curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/deploycontract \
--header 'Content-Type: application/json' \
--data '{
"owner_address": "41b487cdb2d8dc7b2a8e5e7e7b4e3e8b8b8b8b8b",
"abi": "[{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"type\":\"function\"}]",
"bytecode": "608060405234801561001057600080fd5b5061012a806100206000396000f3fe6080604052",
"parameter": "",
"call_value": 0,
"consume_user_resource_percent": 100,
"fee_limit": 1000000000,
"origin_energy_limit": 10000000,
"name": "MyContract"
}'
{
"visible": true,
"txID": "<string>",
"raw_data": {},
"raw_data_hex": "<string>"
}
curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/deploycontract \
--header 'Content-Type: application/json' \
--data '{
"owner_address": "41b487cdb2d8dc7b2a8e5e7e7b4e3e8b8b8b8b8b",
"abi": "[{\"inputs\":[],\"name\":\"name\",\"outputs\":[{\"name\":\"\",\"type\":\"string\"}],\"type\":\"function\"}]",
"bytecode": "608060405234801561001057600080fd5b5061012a806100206000396000f3fe6080604052",
"parameter": "",
"call_value": 0,
"consume_user_resource_percent": 100,
"fee_limit": 1000000000,
"origin_energy_limit": 10000000,
"name": "MyContract"
}'
{
"visible": true,
"txID": "<string>",
"raw_data": {},
"raw_data_hex": "<string>"
}
owner_address
— address of the account deploying the contract in hexadecimal formatabi
— contract ABI (Application Binary Interface) as a JSON string defining contract methods and eventsbytecode
— compiled contract bytecode in hexadecimal formatparameter
— (optional) constructor parameters encoded in hexadecimal formatcall_value
— (optional) amount of TRX to transfer to the contract during deployment (in SUN, 1 TRX = 1,000,000 SUN)consume_user_resource_percent
— (optional) percentage of caller’s resources used for contract calls (0-100, default 100)fee_limit
— (optional) maximum energy fee willing to pay for deployment (in SUN)origin_energy_limit
— (optional) energy limit provided by the contract creator for future callsname
— (optional) human-readable name for the contractvisible
— boolean indicating whether addresses are in visible formattxID
— unique transaction ID for the deployment transactionraw_data
— raw transaction data containing all deployment parametersraw_data_hex
— raw transaction data encoded in hexadecimal formatwallet/deploycontract
method is used for:
wallet/broadcasttransaction
to actually deploy the contract to the network.Contract deployment transaction
The response is of type object
.
Was this page helpful?