Contracts

Get Started

Read, write, and deploy smart contracts on any EVM compatible blockchain.


Read a Contract

You can read contract data efficiently using the contract read API.

GET /v1/contract/read
Content-Type: application/json
x-secret-key: <your-project-secret-key>
{
"readOptions": {
"chainId": "1" // your chain id
"from": "0x...", // optional, if you want to read from a specific address
},
"params": [{
"contractAddress": "0x...",
"method": "function allowance(address owner, address spender)",
"params": ["0x...", "0x..."],
}],
}

You can batch multiple contract reads in a single request, and the response will be an array of results or errors.

Write to a Contract

You can write to a contract using the contract write API.

POST /v1/contract/write
Content-Type: application/json
x-secret-key: <your-project-secret-key>
{
"executionOptions": {
"from": "0x...", // your server wallet address
"chainId": "1" // your chain id
},
"params": [{
"contractAddress": "0x...",
"method": "function transfer(address to, uint256 amount)",
"params": ["0x...", "1000000000000000000"],
}]
}

You can batch multiple contract writes in a single request, and the transactions will be batched atomically onchain.

Deploy a Contract

You can deploy a contract using the contract deploy API.

Going further

Explore Full API References

For comprehensive guides on implementing the full thirdweb SDK, explore our language-specific documentation: