1

The Tron Network uses Solidity and has a lot of similarities to Ethereum.

I'm trying to use the OpenZeppelin contracts designed for Ethereum to run on the Tron Network.

I've chosen Solidity version 0.6.x which is supported by the tronbox compiler.

Is it possible to run OpenZeppelin contracts on the Tron Network?

webish
  • 701
  • 2
  • 9
  • 17

1 Answers1

2

Is it possible to run OpenZeppelin contracts on the Tron Network?

Yes. For example this token uses an OpenZeppelin implementation of ERC20.

Petr Hejda
  • 40,554
  • 8
  • 72
  • 100
  • What are the requirements for compatibility? Purely the Solidity version for TRC20? – webish Jun 07 '21 at 14:04
  • Per the [Tron docs](https://developers.tron.network/docs/tron-box-contract-deployment), the latest supported Solidity version (by Tron) is 0.5.10. Btw the latest version of Solidity is now 0.8.4 (but it doesn't seem to be supported by Tron)... Then you need to take into account the compatibility of the OpenZeppelin implementation with the Solidity version, it's stated on the first line `pragma solidity ...`. The OpenZeppelin code linked in my answer is compatible with Solidity 0.5.10. – Petr Hejda Jun 07 '21 at 14:09
  • 1
    I think Tron's docs are stale... Tronbox now supports 0.7.0 and I've run 0.6.13 contracts on the quickstart docker contaimer; however, I've seen some issues using earlier versions of OpenZeppelin that are supposed to be compatible with with 0.6.x... Appreciate the link and details! – webish Jun 07 '21 at 14:16