TRON Developer Guide — Converting Ethereum Contracts

TRON Foundation

For users wishing to deploy existing Ethereum solidity contracts onto the TRON network, there are some key differences to look for:

Units of Currency

Units of currency in TRON smart contracts are TRX and sun. To successfully migrate your Ethereum smart contracts to TRON, please change Ether denominations into TRX denominations, while being mindful of the Ether/TRX market exchange rates. Remember that 1 TRX = 1,000,000 sun. The Ether denomination table is listed here for your reference.

For example, in the below figure, the ether term is changed to trx. At the same time, the average exchange rate of TRX to Ether on this day is 8400 TRX to 1 Ether. Thus, after the units are converted, the quantity is also adjusted to ensure a minimal change in value.

User Pay Ratio

User pay ratio is defined as the ratio of the cost the smart contract user should pay. This parameter accepts any integer between 0 and 100, inclusive. However, it is strongly recommended to set the value between 1 and 99. The reason is to protect yourself, the contract developer, from malicious infinite loop time-out attacks.

TRON Foundation

Written by

The official medium of Tron Foundation

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade