deploycontract - Tron
deploycontract. Creates an unsigned transaction to deploy a smart contract to the Tron network.
deploycontract - tron [Value: 20CU]
Creates an unsigned transaction to deploy a smart contract to the Tron network.
Use cases
- Deploy a compiled Solidity contract's bytecode to the Tron network
- Set the deployer-vs-caller energy split (consume_user_resource_percent) at deploy time
Constraints
- fee_limit is required and capped at the protocol maximum (1,500,000 TRX)
- The returned transaction is unsigned and must be broadcast separately
Unlock Access to 100+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Language
Request
Examples
curl --request POST \
--url https://lb.drpc.live/tron/{API-KEY}/wallet/deploycontract \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{"owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g", "bytecode": "example", "abi": "example", "name": "example", "fee_limit": 1, "consume_user_resource_percent": 1, "origin_energy_limit": 1, "call_value": 1, "visible": true}'Response
200
{
"visible": true,
"txID": "6db783c4142b3749a4b598db4644155455c9206e2eca4b31efbd48e46773d9d5",
"raw_data": {
"contract": [{
"parameter": {
"value": {
"owner_address": "TZ4UXDV5ZhNW7fb2AMSbgfAEZ7hWsnYS2g",
"new_contract": { "bytecode": "608060405234801561001057600080fd5b50...", "consume_user_resource_percent": 100 }
},
"type_url": "type.googleapis.com/protocol.CreateSmartContract"
},
"type": "CreateSmartContract"
}],
"ref_block_bytes": "f69b",
"ref_block_hash": "7d4a3b02495f2320",
"expiration": 1762502739000,
"fee_limit": 1000000000,
"timestamp": 1762502681856
},
"raw_data_hex": "0a02f69b22087d4a3b02495f232040b888e6eaa5335a67080112630a2d..."
}Request params
idinteger
jsonrpcstring
methodstring
object
owner_addressstring
[Required] The deploying account's address
bytecodestring
[Required] The compiled contract bytecode, hex-encoded
abistring
The contract's ABI, JSON-encoded as a string
namestring
The contract's name
parameterstring
Constructor parameters (hex, appended to bytecode)
fee_limitinteger
[Required] Maximum TRX, in sun, the caller will burn for energy on this deployment
consume_user_resource_percentinteger
Percentage of invocation energy cost passed on to callers (0-100)
origin_energy_limitinteger
Maximum energy a single call can consume from the deployer's account
call_valueinteger
Amount of TRX, in sun, sent to the contract's constructor
token_idint64
TRC-10 token id sent with the deployment
call_token_valueint64
TRC-10 amount sent with the deployment
Permission_idinteger
Multi-sig permission ID
visibleboolean
When true, addresses are base58check strings; when false (default), hex strings
Response
200
Creates an unsigned transaction to deploy a smart contract to the Tron network.Response params
object
visibleboolean
Indicates whether addresses in this transaction are represented in base58 format (true) or hex format (false).
txIDstring
The unique transaction hash (transaction ID), computed as the SHA256 of raw_data.
contract_addressstring
The deterministic address assigned to the new smart contract, computed from the deployer's address and transaction nonce.
raw_dataobject
The unsigned transaction body containing the contract instruction and blockchain reference data.
object
contractarray_of_objects
The list of contract instructions to be executed by this transaction.
object
parameterobject
The typed payload describing the specific contract call being made.
object
valueobject
The decoded fields of the contract — here, a smart contract deployment request.
object
owner_addressstring
The address deploying the smart contract, in hex format.
new_contractobject
The definition of the smart contract being deployed.
object
origin_addressstring
The address recorded as the contract's creator/owner, in hex format.
consume_user_resource_percentinteger
The percentage of Energy cost that callers of this contract must pay themselves, with the remainder charged to the contract owner.
namestring
The human-readable name given to the smart contract.
bytecodestring
The hex-encoded compiled EVM bytecode to be deployed on-chain.
abiobject
The contract's Application Binary Interface, describing its callable functions and events; empty here.
origin_energy_limitinteger
The maximum amount of Energy the contract owner is willing to cover per call, capping the owner-paid share.
type_urlstring
The fully qualified protobuf type identifier describing which contract schema `value` should be decoded with.
typestring
The human-readable name of the contract type being executed (here, CreateSmartContract).
ref_block_bytesstring
The last two bytes of the reference block number, used for transaction expiration and replay protection.
ref_block_hashstring
The last eight bytes of the reference block's hash, paired with ref_block_bytes for replay protection.
fee_limitinteger
The maximum amount of TRX, in sun, the deployer is willing to spend on Energy fees for this deployment.
expirationinteger
Unix timestamp, in ms, after which this transaction is no longer valid and will be rejected by the network.
timestampinteger
Unix timestamp, in ms, marking when the transaction was created/signed by the client.
raw_data_hexstring
The hex-encoded serialized bytes of raw_data, used as the actual payload to sign and broadcast.