Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Reads and writes Tron contract state via troncast, covering view calls, transfers, approvals, admin calls, and address conversion.
18% 86%+68 ptsof test cases passed
Passed 19 of 22 test cases with the skill, and 4 of 22 without it.
We need to check if a contract is deployed at address TLPh66vQ2QMb64rG3WEBV5qnAhefh2kcdw on Tron mainnet by fetching its runtime bytecode via CLI. cast code fails on Tron RPCs. What command should we run?
Uses troncast code command to retrieve contract bytecode.
3 of 3 safety checks passed
Tron has its own address format, RPC surface, and resource model, so cast does not work against it (eth_getTransactionCount and debug_traceTransaction aren't supported on TronGrid public endpoints). All read/write contract interaction on Tron goes through troncast (script/troncast/), a Cast-like TronWeb wrapper — never hand-roll a TronWeb script for something troncast already covers.
Repo: stay in contracts. Unlike /deploy-contract-tron, this skill needs no contracts-tron fork checkout — troncast and the deployed contract's on-chain state are both reachable from the normal contracts session. See docs/TronFork.md for why the fork exists at all and when it does matter (deploys and any change to LibAsset/WithdrawablePeriphery).
| Situation | Skill |
|---|---|
| Deploying a new contract to Tron | /deploy-contract-tron |
| Read a Tron contract's state, or send a simple write (transfer, approve, single admin call) | this skill |
| Move gas (TRX) from our own deployer wallet | this skill (troncast send ... --value) |
| Production governance change (whitelist sync, ownership transfer, anything needing the Timelock) | route to propose-to-safe-tron.ts conventions — this needs Safe-quorum + scheduleBatch/executeBatch sequencing, not a one-off troncast send. Flag it and get explicit direction rather than improvising. |
| Analyzing a past Tron transaction/trace | /analyze-tx (already has a Tron-specific section) |
202-tron-scripts.md)Tron addresses are base58 (T...) at the RPC/display layer, 21-byte hex (0x41 prefix + 20-byte EVM address) internally. Convert explicitly at the point of use — never assume a hex address the user pastes is already in the right form for a given call:
bun troncast address to-hex TLPh66vQ2QMb64rG3WEBV5qnAhefh2kcdw # -> 0x7252af...
bun troncast address to-base58 0x7252afce04856eaac8f8a8beb5ae29621a1ca49b # -> TLPh66...
troncast itself accepts either format for call/send/code target addresses, so conversion is only needed when the user needs the other format back, or when composing calldata by hand.
RPC env var required even for offline conversions. troncast address to-hex/to-base58 always requires ETH_NODE_URI_TRON in .env — the codec hardcodes the mainnet TronWeb instance, so ETH_NODE_URI_TRONSHASTA does not satisfy it and address takes no --env flag — even though the conversion itself is a pure offline codec operation; the CLI aborts without it. If it's not set, prefix a dummy value for that one invocation rather than editing .env.
troncast callbun troncast call <address> "<functionSignature> returns (<type>)" [params...] --env <mainnet|testnet>
# examples
bun troncast call <DIAMOND> "owner() returns (address)" --env mainnet
bun troncast call <TOKEN> "balanceOf(address) returns (uint256)" <WALLET> --env mainnet
bun troncast call <TOKEN> "decimals() returns (uint8)" --env mainnet --json
Next to this one in the catalogue, plus more from the same author.