TRON - blockchain platform.
Questions tagged [tron]
182 questions
1
vote
1 answer
Is there an alternate block.timestamp (Ethereum) for Tron? (Timers)
I am wanting to use block.timestamp as a way to generate a certain amount of currency per second by subtracting a current saved block.timestamp (let's say second 9999) by an older saved block.timestamp (let's say second 9990) which produces a…

CryptoGrounds
- 21
- 4
1
vote
0 answers
Error: The transaction has been reverted to the initial state
I have below code in solidity.
pragma solidity ^0.5.2;
contract Image{
struct User {
uint32 pixelsPainted;
uint32 pixelsOwned;
uint balance;
uint earning;
uint referrerAward;
uint bonusCollected;
uint bonusMask;
…

Varsh
- 413
- 9
- 26
1
vote
1 answer
TypeError: contract.test is not a function tronweb nodejs
I am trying to access Tron smart contract which is deployed on the Shasta test network using Tron-Web. I am using node-casiko server Following is my code:
const TronWeb = require('tronweb')
// This provider is optional, you can just use a url for…

Varsh
- 413
- 9
- 26
0
votes
0 answers
How to sign transaction in Tron network with trongrid API 4.7.2 and Python?
I have call this post API in Python:
url = "https://api.trongrid.io/wallet/createtransaction"
headers = {
"accept": "application/json",
"content-type": "application/json"
}
body = {
"owner_address": "Txxxxxxx",
"to_address":…

reza_khalafi
- 6,230
- 7
- 56
- 82
0
votes
1 answer
Sending USDT in testnet -- always "out of energy"
On my account in Shasta I have 5k TRX and the same amount of USDT. I'm trying to send USDT. So far it's failed with a result Failed -Out of Energy. For instance:
async function transferTronTRC20Token(amount, privateKey, contractAddress) {
let url…

Marco C. Stewart
- 133
- 7
0
votes
0 answers
TronWeb: mnemonics or private key?
I have a few beginner's questions to you:
Why do we need mnemonics if all accounts are restored on instantination of tron web instance through passing the private key?
What is 0th account which is returned after the tronWeb.createRandom() is…

Kirill
- 55
- 1
- 5
0
votes
0 answers
signtypedata TRON network
did somone here know how to create an offchain signature that can be validate like this onchain:
address signatory = ecrecover(keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)), v,r,s);
const signMessage = await…
0
votes
0 answers
how to broadcast trc20 transfer tx in golang?
I had search github for an official SDK, sadly there is no usable one for me. I want to use TronGrid HTTP-API to do this. Can anyone give me a clue? Example codes is better.

Andrew Cui
- 1,269
- 2
- 11
- 10
0
votes
1 answer
Tron API get the number of burned TRX before making a transaction
Need to receive a network commission for the transaction, as this is done in the trust wallet.
Specify the wallet address
Enter the amount of TRX to send
Click Continue.
And output, example "Network Fee: ~0.265 TRX".
I use PHP language
I've been…

The Edward
- 1
- 1
0
votes
0 answers
How to implement TronLink wallet connect in a React project?
I'm trying to implement TronLink wallet connect in my React project using the TronWeb library.
I tried TronWeb documentation, but not able to find good resource to start for React.
I tried to create TronWeb instance using the samples in the…

Akachi1325
- 1
- 4
0
votes
1 answer
How to swap trc20 to trx with Python in one wallet address?
I need to swap(change) part of my trc20 asset to trx in my Tron wallet. Consider i have some data like this:
public_key="AAA"
private_key="PPP"
trc20_address="TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"
current_trc20_amount=100 usdt
So for example swap 2…

reza_khalafi
- 6,230
- 7
- 56
- 82
0
votes
0 answers
Trying to fetch all transactions containing specific type for a certain TRON address using trongrid
I am using api.trongrid.io to fetch transactions for a TRON address and this works 100%, however, is it possible to fetch all transactions for this TRON address that contains a specific type?
Has anyone perhaps managed to find a way to do this?
I…
0
votes
0 answers
Transfer confirm on mobile wallet using walletconnect shows ethereum address
I am trying to connect DAPP with trustwallet mobile app using walletconnect. I am used the demo app provided by tronwallet-adapter here https://github.com/tronprotocol/tronwallet-adapter/tree/main/demos/react-ui/create-react-app.
I tested connecting…

Abhilash Reddy
- 35
- 5
0
votes
0 answers
AILED TRANSACTION REVERT
I am associated with a smart contract which is a decentralized project I am facing problems in getting withdrawal
I request you please tell us what is the problem we are facing in this
I want to know the solution to this and how this solution can be…

Jiya Rajput
- 1
- 1
0
votes
0 answers
Trying to create a Vault smart-contract in Tron Mainnet that interacts with USDT
I'm trying to create a vault smart-contract that allows deposits and withdraws of Tron USDT. Deposits - work.
But when I try to withdraw, I get ERC20 transfer amount exceedes balance error..... but I gave allowance! like this:
spender = msg.sender;…