How It Works
The build flow:- Accepts function signatures - ABI-formatted function definitions
- Processes arguments - Supports static values and runtime balance injection
- Generates instructions - Creates executable MEE instructions
- Enables composition - Combines with other flow types seamlessly
Parameters
When using/instructions/build in your composeFlows array:
| Parameter | Type | Required | Description |
|---|---|---|---|
functionSignature | string | Yes | ABI function signature (e.g., function transfer(address to, uint256 amount)) |
args | array | Yes | Function arguments array |
to | string | Yes | Target contract address (checksummed) |
chainId | number | Yes | Chain ID for execution |
value | string | No | Native token value in wei (default: “0”) |
gasLimit | string | No | Gas limit override |
Runtime Balance Injection
Thebuild flow type supports runtimeErc20Balance for dynamic amount calculations:
Runtime balance is currently only supported for
/instructions/build flow type. Support for other types coming in future updates.Complete Workflow Examples
- Token Transfer
- With Runtime Balance
- DeFi Operations
- Native ETH Withdrawal
Simple ERC20 transfer
Argument Types
Theargs array supports various data types:
Static Values
Runtime Balance (Dynamic)
Complex Types
Best Practices
Use Runtime Balance for Withdrawals
Use Runtime Balance for Withdrawals
Always use runtime balance when withdrawing after swaps (for EOA mode):
Set Appropriate Gas Limits
Set Appropriate Gas Limits
Override gas limits for complex operations:
Batch Same-Chain Operations
Batch Same-Chain Operations
Same-chain
build instructions are automatically batched:Validate Function Signatures
Validate Function Signatures
Ensure function signatures match the ABI exactly:
Use ETH Forwarder for Native Tokens
Use ETH Forwarder for Native Tokens
When withdrawing or transferring native tokens (ETH, MATIC, BNB, etc.), always use the ETH Forwarder contract:
Common Use Cases
Withdraw from DeFi Protocol
NFT Transfer
Custom DEX Swap
Troubleshooting
Invalid function signature
Invalid function signature
Ensure your signature exactly matches the contract ABI:
- Include the
functionkeyword - Use correct parameter types (e.g.,
uint256, notuint) - Match parameter names (though names don’t affect encoding)
Transaction reverted
Transaction reverted
Common causes:
- Insufficient balance for operation
- Missing token approvals (add approve instruction first)
- Gas limit too low (increase
gasLimit) - Contract-specific requirements not met
Runtime balance not working
Runtime balance not working
Runtime balance is only supported for
/instructions/build:- Cannot use in
/instructions/intent-simple - Cannot use in
/instructions/intent - Must be in the
argsarray, not other parameters