TRON
wallet/deploycontract15 créditos
Builds an unsigned smart contract deployment transaction.
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
| owner_address | string | Transaction initiator address (base58 or hex). |
| abi | string | Contract ABI as a JSON string. (opcional) |
| bytecode | string | Contract bytecode as a hex string. (opcional) |
| parameter | string | ABI-encoded constructor arguments (hex). (opcional) |
| name | string | Contract name (at most 32 bytes). (opcional) |
| fee_limit | number | Maximum TRX (in sun) the deployer is willing to burn for Energy. (opcional) |
| origin_energy_limit | number | Maximum Energy the deployer pays per call; must be > 0. (opcional) |
| consume_user_resource_percent | number | Percentage (0 to 100) of the Energy paid by the caller; default 0 (deployer pays all). (opcional) |
| call_value | number | TRX transferred to the contract at deployment, in sun. (opcional) |
| Permission_id | number | Permission ID for multi-signature accounts; defaults to the owner permission (0). (opcional) |
| visible | boolean | true = 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
}'