Hi guys, please help) in Eth Contracts 1 eth = 1 000 000 000 000 000 000 Wei but what in Trx?
Dec 2, 2020, 3:12 PM
uint256 value = 5 000 000;
uint256 trxPrice = 30 000;
uint256 price = 5 000 000;
function calculate(uint256 _value) view public returns(uint256){
uint256 amount = _value.mul(contractTOP.trxPrice()).div(1 trx).div(price);
return amount;
}
5 000 000*30 000/ ? /5 000 000 =
uint256 trxPrice = 30 000;
uint256 price = 5 000 000;
function calculate(uint256 _value) view public returns(uint256){
uint256 amount = _value.mul(contractTOP.trxPrice()).div(1 trx).div(price);
return amount;
}
5 000 000*30 000/ ? /5 000 000 =
Dec 2, 2020, 3:13 PM
Haven't found any official definition for that
Dec 2, 2020, 3:15 PM
i cant deploy in tron 😟
Dec 2, 2020, 3:19 PM
You have to follow their official documentation
https://developers.tron.network/
Dec 2, 2020, 3:20 PM
Tron has 6 decimals
Dec 2, 2020, 3:26 PM
Thanks
Dec 2, 2020, 3:26 PM
I think Tron documentation examples used 18 decimals - so it would depend on the token, like in Ethereum
Dec 2, 2020, 3:27 PM
You can use tron directly on contract
Dec 2, 2020, 3:27 PM
Ah the native asset,sorry
Dec 2, 2020, 3:27 PM
Like uint256 a = 100 trx;
Dec 2, 2020, 3:27 PM
TRC20 can have 18 decimals
Dec 2, 2020, 3:28 PM