Skip to main content

Ethereum & EVM Chains

This page covers operations specific to Ethereum and EVM-compatible chains: Polygon, BSC, Arbitrum, Optimism, Avalanche, and all other networks supported via @eth-like.

Universal EVM Addresses

Generate one address that works across all EVM chains:

curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"accountId": "eFjwUQXB8CMnrTHSgYzaL6",
"network": "@eth-like",
"name": "Universal EVM"
}' \
https://api.carabaas.com/api/v1/addresses

The same address receives deposits on Ethereum, Polygon, BSC, Arbitrum, and every other EVM chain. Balances and transactions are tracked per-network automatically.

ERC-20 Token Transfers

Transfer ERC-20 tokens using the standard transaction endpoint — specify the token contract address as the asset:

curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"orderId": "f6a7b8c9-d0e1-4f2a-3b4c-5d6e7f8a9b0c",
"vaultId": "kR7mNpX2wQvL9sYhBjD4eT",
"destination": "0xRecipient...",
"network": "ethereum-mainnet",
"asset": "c60_t0xdac17f958d2ee523a2206206994597c13d831ec7",
"amount": "1000.00",
"feePriority": "medium"
}' \
https://api.carabaas.com/api/v1/transactions

ERC-20 Allowances (approve)

Before a smart contract can spend tokens on your behalf (DeFi swaps, lending, etc.), you need to approve an allowance.

Set Up Allowance

curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"vaultId": "kR7mNpX2wQvL9sYhBjD4eT",
"addressId": "gMP71sR5sNUnGdKFTsNzp6",
"network": "ethereum-mainnet",
"asset": "c60_t0xdac17f958d2ee523a2206206994597c13d831ec7",
"spender": "0xDeFiProtocolAddress...",
"amount": "1000000000"
}' \
https://api.carabaas.com/api/v1/transactions/flows/setup-allowance

This creates an approve transaction on-chain. The flow goes through the same approval pipeline as regular transactions.

Check Current Allowance

curl -H "Authorization: Bearer $TOKEN" \
https://api.carabaas.com/api/v1/addresses/{addressId}/allowance

Transfer From

After allowance is set, execute a transferFrom to pull tokens from an approved address:

curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"orderId": "a7b8c9d0-e1f2-4a3b-4c5d-6e7f8a9b0c1d",
"vaultId": "kR7mNpX2wQvL9sYhBjD4eT",
"addressId": "gMP71sR5sNUnGdKFTsNzp6",
"network": "ethereum-mainnet",
"asset": "c60_t0xTokenAddress...",
"from": "0xApprovedAddress...",
"destination": "0xRecipient...",
"amount": "500.00"
}' \
https://api.carabaas.com/api/v1/transactions/transfer-from

Manage Flows

Track the status of allowance flows:

curl -H "Authorization: Bearer $TOKEN" \
https://api.carabaas.com/api/v1/transactions/flows/{flowId}

Decline a pending flow:

curl -X PATCH -H "Authorization: Bearer $TOKEN" \
https://api.carabaas.com/api/v1/transactions/flows/{flowId}/decline

Gas Management

Fee Priority

The feePriority parameter maps to EVM gas pricing:

PriorityBehavior
lowLower gas price, slower confirmation
mediumBalanced gas price and speed
highHigher gas price, faster confirmation

Custom Gas Limit

Override the default gas limit for contract interactions:

{
"options": {
"gasLimit": 150000
}
}

Transaction Replacement (RBF / Speed Up)

If a transaction is stuck due to low gas, replace it with a higher fee:

curl -X PATCH \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{ "feePriority": "high" }' \
https://api.carabaas.com/api/v1/transactions/{txId}/replace

Smart Contract Calls

Execute arbitrary smart contract functions by providing encoded call data:

curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"orderId": "b8c9d0e1-f2a3-4b4c-5d6e-7f8a9b0c1d2e",
"vaultId": "kR7mNpX2wQvL9sYhBjD4eT",
"addressId": "gMP71sR5sNUnGdKFTsNzp6",
"destination": "0xContractAddress...",
"network": "ethereum-mainnet",
"asset": "c1",
"amount": "0",
"options": {
"gasLimit": 200000,
"data": "0xa9059cbb..."
}
}' \
https://api.carabaas.com/api/v1/transactions

Simulate Before Executing

Always simulate contract calls first:

curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"vaultId": "kR7mNpX2wQvL9sYhBjD4eT",
"destination": "0xContractAddress...",
"network": "ethereum-mainnet",
"asset": "c1",
"amount": "0",
"options": { "gasLimit": 200000, "data": "0xa9059cbb..." }
}' \
https://api.carabaas.com/api/v1/transactions/simulate

Decoded Transaction

Retrieve human-readable contract call details:

curl -H "Authorization: Bearer $TOKEN" \
https://api.carabaas.com/api/v1/transactions/{txId}/decoded

Applicable Networks

All operations on this page apply to:

Ethereum, Polygon, BSC, Arbitrum, Optimism, Avalanche, Fantom, Cronos, Sonic, HyperEVM, Ethereum Classic, Flare, Songbird, IoTeX, Kava, VeChain, XDC Network, Zilliqa 2.0

See Also