Smart Contracts
Cubewire supports deploying new smart contracts and interacting with existing contracts on supported blockchains. All contract operations follow the same security model as transactions, including policy evaluation and approval workflows.
What are Smart Contract Operations?
This section covers dedicated contract endpoints:
- Contract Deployment — Deploy new smart contracts to the blockchain
- Contract Read — Query contract state (view/pure functions, no gas required)
Note: For state-changing contract calls, use the Transactions API with type: CONTRACT_WRITE.
Contract Deployment
Deploy compiled smart contracts with constructor parameters to any supported blockchain network.
How to Use:
- Compile your smart contract and obtain the bytecode
- Prepare constructor parameters with proper types and values
- Submit deployment request with vault ID, chain ID, bytecode, and gas limit
- The deployment follows the standard workflow with policy evaluation and approval (if required)
- Poll transaction status to get the deployed contract address and transaction hash
The deployment process is asynchronous - you receive an immediate response with a workflow ID and transaction ID for tracking. See the Deploy a smart contract endpoint for complete request and response details.
Deployment Flow
Contract Read Operations
Query smart contract state without modifying the blockchain or consuming gas.
How to Use:
- Identify the contract address and function you want to call
- Provide the function name and any required parameters
- Submit the read request with a vault ID for context
- Receive immediate synchronous response with decoded results
Read operations are perfect for checking token balances, querying configuration values, or verifying contract state. The function must be a view or pure function that doesn't modify state. See the Read contract state endpoint for complete request and response details.
Common Use Cases
Token Deployment
Deploy ERC-20 or ERC-721 tokens:
- Custom organizational tokens
- NFT collections
- Governance tokens
Multisig Wallets
Deploy Gnosis Safe or similar multisig contracts:
- Treasury management
- Shared custody arrangements
Custom Business Logic
Deploy custom contracts for:
- Payment splitting
- Vesting schedules
- Escrow arrangements
Contract Queries
Read contract state for:
- Token balances
- Contract configuration
- Ownership verification
Best Practices
Deployment
| Practice | Description |
|---|---|
| Test on testnets first | Deploy to Sepolia/Mumbai before mainnet |
| Verify bytecode | Ensure bytecode matches audited source |
| Document deployments | Track contract addresses and purposes |
Security
| Practice | Description |
|---|---|
| Audit contracts | Professional audit before deployment |
| Use established patterns | OpenZeppelin, etc. |
| Verify on block explorer | Verify source code after deployment |
Contract Interaction
| Practice | Description |
|---|---|
| Provide ABI | Include ABI for proper result decoding |
| Validate addresses | Verify contract exists before calling |
| Handle errors | Contract calls may revert |
Related Topics
- Transactions — Contract write operations via transactions
- Networks — Supported blockchain networks
API Reference
For complete API documentation including endpoints, request/response examples, and code samples:
- Deploy a smart contract — `POST /
- Read contract state
Smart Contracts
Cubewire supports deploying new smart contracts and interacting with existing contracts on supported blockchains. All contract operations follow the same security model as transactions, including policy evaluation and approval workflows.
What are Smart Contract Operations?
This section covers dedicated contract endpoints:
- Contract Deployment — Deploy new smart contracts to the blockchain
- Contract Read — Query contract state (view/pure functions, no gas required)
Note: For state-changing contract calls, use the Transactions API with type: CONTRACT_WRITE.
Contract Deployment
Deploy compiled smart contracts with constructor parameters to any supported blockchain network.
How to Use:
- Compile your smart contract and obtain the bytecode
- Prepare constructor parameters with proper types and values
- Submit deployment request with vault ID, chain ID, bytecode, and gas limit
- The deployment follows the standard workflow with policy evaluation and approval (if required)
- Poll transaction status to get the deployed contract address and transaction hash
The deployment process is asynchronous - you receive an immediate response with a workflow ID and transaction ID for tracking. See the Deploy a smart contract endpoint for complete request and response details.
Deployment Flow
Contract Read Operations
Query smart contract state without modifying the blockchain or consuming gas.
How to Use:
- Identify the contract address and function you want to call
- Provide the function name and any required parameters
- Submit the read request with a vault ID for context
- Receive immediate synchronous response with decoded results
Read operations are perfect for checking token balances, querying configuration values, or verifying contract state. The function must be a view or pure function that doesn't modify state. See the Read contract state endpoint for complete request and response details.
Common Use Cases
Token Deployment
Deploy ERC-20 or ERC-721 tokens:
- Custom organizational tokens
- NFT collections
- Governance tokens
Multisig Wallets
Deploy Gnosis Safe or similar multisig contracts:
- Treasury management
- Shared custody arrangements
Custom Business Logic
Deploy custom contracts for:
- Payment splitting
- Vesting schedules
- Escrow arrangements
Contract Queries
Read contract state for:
- Token balances
- Contract configuration
- Ownership verification
Best Practices
Deployment
| Practice | Description |
|---|---|
| Test on testnets first | Deploy to Sepolia/Mumbai before mainnet |
| Verify bytecode | Ensure bytecode matches audited source |
| Document deployments | Track contract addresses and purposes |
Security
| Practice | Description |
|---|---|
| Audit contracts | Professional audit before deployment |
| Use established patterns | OpenZeppelin, etc. |
| Verify on block explorer | Verify source code after deployment |
Contract Interaction
| Practice | Description |
|---|---|
| Provide ABI | Include ABI for proper result decoding |
| Validate addresses | Verify contract exists before calling |
| Handle errors | Contract calls may revert |
Related Topics
- Transactions — Contract write operations via transactions
- Networks — Supported blockchain networks
API Reference
For complete API documentation including endpoints, request/response examples, and code samples:
- Deploy a smart contract — `POST /
- Read contract state