POSTDeployContract

Tron Mainnethttps://tron-mainnet.nodit.io/wallet/deploycontract

Deploys a contract. Returns TransactionExtention, which contains an unsigned transaction.

Request Body
owner_addressstringrequired

Transaction initiator address. (Format: Base58 or Hex)

abistring (json)

Smart contract ABI. Example: "[{"constant":false,"inputs":[{"name":"key","type":"uint256"},{"name":"value","type":"uint256"}],"name":"set","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"key","type":"uint256"}],"name":"get","outputs":[{"name":"value","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]"

bytecodestring

Bytecode of the smart contract. Example: 608060405234801561001057600080fd5b5060de8061001f6000396000f30060806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ab06ee58114604d5780639507d39a146067575b600080fd5b348015605857600080fd5b506065600435602435608e565b005b348015607257600080fd5b50607c60043560a0565b60408051918252519081900360200190f35b60009182526020829052604090912055565b600090815260208190526040902054905600a165627a7a72305820fdfe832221d60dd582b4526afa20518b98c2e1cb0054653053a844cf265b25040029

fee_limitinteger (int32)

Maximum TRX (in sun) the caller agrees to pay for transaction fees. (Unit: sun). Example: 1000000000 (1,000 TRX)

parameterstring

The parameters passed to the contract's constructor function.(ABI-encoded format)

origin_energy_limitinteger (int32)

Maximum Energy the contract deployer is willing to subsidize per call. Must be > 0; typical value: 1,000,000–10,000,000. Example: 100000000

namestring

Contract name

call_valueinteger (int64)

Amount of TRX transferred into the contract at deployment. (Unit: sun)

consume_user_resource_percentinteger (int32)

Percentage of Energy paid by the contract caller (vs. the deployer). Range: 0–100. Default: 0 (deployer pays all). Example: 10 (caller pays 10%, deployer pays 90%).

visibleboolean

Optional. Set to true to format addresses in Base58; set to false for hex format. (Default: false)

Responses
owner_addressstring

Transaction initiator address. (Format: Base58 or Hex)

call_token_valueint64 (int64)

Amount of TRC-10 token transferred into the contract.

token_idinteger (int64)

TRC-10 token id

X-API-KEY
RequestCU40
cURL
curl -X POST "https://tron-mainnet.nodit.io/wallet/deploycontract" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "owner_address": "TUoHaVjx7n5xz8LwPRDckgFrDWhMhuSuJM",
  "name": "SimpleStorage",
  "abi": "[{"inputs":[{"name":"key","type":"uint256"},{"name":"value","type":"uint256"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"key","type":"uint256"}],"name":"get","outputs":[{"name":"value","type":"uint256"}],"stateMutability":"view","type":"function"}]",
  "bytecode": "608060405234801561001057600080fd5b5060de8061001f6000396000f30060806040526004361060485763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631ab06ee58114604d5780639507d39a146067575b600080fd5b348015605857600080fd5b506065600435602435608e565b005b348015607257600080fd5b50607c60043560a0565b60408051918252519081900360200190f35b60009182526020829052604090912055565b600090815260208190526040902054905600a165627a7a72305820fdfe832221d60dd582b4526afa20518b98c2e1cb0054653053a844cf265b25040029",
  "fee_limit": 1000000000,
  "call_value": 0,
  "consume_user_resource_percent": 100,
  "origin_energy_limit": 10000000,
  "visible": true
}'
Response
Example · 200
{
  "owner_address": "string",
  "new_contract": {},
  "token_id": 0
}