write_contract
Interact with smart contracts on BNB Chain by calling state-changing functions. Specify contract address, ABI, function name, arguments, and network to execute write operations securely.
Instructions
Write data to a smart contract by calling a state-changing function
Input Schema
Name | Required | Description | Default |
---|---|---|---|
abi | Yes | The ABI of the smart contract function, as a JSON array | |
args | Yes | The arguments to pass to the function | |
contractAddress | Yes | The address of the smart contract to interact with | |
functionName | Yes | The name of the function to call on the contract | |
network | No | Network name (e.g. 'bsc', 'opbnb', 'ethereum', 'base', etc.) or chain ID. Supports others main popular networks. Defaults to BSC mainnet. | bsc |
privateKey | No | Private key of the sending account. Used only for transaction signing. | 0x5a2b7e4d9c8f1a3e6b0d2c5f4e3d2a1b0c9f8e7d6a5b4c3d2e1f0a9b8c7d6e5f4 |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"abi": {
"description": "The ABI of the smart contract function, as a JSON array",
"type": "array"
},
"args": {
"description": "The arguments to pass to the function",
"type": "array"
},
"contractAddress": {
"description": "The address of the smart contract to interact with",
"type": "string"
},
"functionName": {
"description": "The name of the function to call on the contract",
"type": "string"
},
"network": {
"default": "bsc",
"description": "Network name (e.g. 'bsc', 'opbnb', 'ethereum', 'base', etc.) or chain ID. Supports others main popular networks. Defaults to BSC mainnet.",
"type": "string"
},
"privateKey": {
"default": "0x5a2b7e4d9c8f1a3e6b0d2c5f4e3d2a1b0c9f8e7d6a5b4c3d2e1f0a9b8c7d6e5f4",
"description": "Private key of the sending account. Used only for transaction signing.",
"type": "string"
}
},
"required": [
"contractAddress",
"abi",
"functionName",
"args"
],
"type": "object"
}