PreçosGitHubPainel

TRON

wallet/deploycontract15 créditos

Builds an unsigned smart contract deployment transaction.

Rede: tron

Parâmetros

NomeTipoDescrição
owner_addressstringTransaction initiator address (base58 or hex).
abistringContract ABI as a JSON string. (opcional)
bytecodestringContract bytecode as a hex string. (opcional)
parameterstringABI-encoded constructor arguments (hex). (opcional)
namestringContract name (at most 32 bytes). (opcional)
fee_limitnumberMaximum TRX (in sun) the deployer is willing to burn for Energy. (opcional)
origin_energy_limitnumberMaximum Energy the deployer pays per call; must be > 0. (opcional)
consume_user_resource_percentnumberPercentage (0 to 100) of the Energy paid by the caller; default 0 (deployer pays all). (opcional)
call_valuenumberTRX transferred to the contract at deployment, in sun. (opcional)
Permission_idnumberPermission ID for multi-signature accounts; defaults to the owner permission (0). (opcional)
visiblebooleantrue = base58 addresses (in the request and the response); false (default) = hex addresses. (opcional)

Retorno

Tipo

Object

Unsigned transaction object (txID, raw_data, raw_data_hex, visible) plus contract_address, the computed address of the new contract. It is only built, not signed or broadcast. On failure an Error string.

Exemplos de código

curl 'https://holy-burned-sky-tron-mainnet.rpcnode.dev/7c9e6679-7425-40de-944b-e07fc1f90ae7/wallet/deploycontract' \
  -X POST \
  -H 'content-type: application/json' \
  -d '{
  "owner_address": "TLsV52sRDL79HXGGm9yzwKibb6BeruhUzy",
  "name": "MyContract",
  "abi": "[]",
  "bytecode": "<contract bytecode>",
  "fee_limit": 1000000000,
  "origin_energy_limit": 10000000,
  "consume_user_resource_percent": 100,
  "visible": true
}'