0

I got error importing and using 1INCH. The problem is in the versions. In IOneSplit.sol version is 0.5.0 (pragma solidity ^0.5.0). And IOneSplit imports IERC20 which is in 0.8.0 (pragma solidity ^0.8.0). I'm using RemixIDE. Is the error from my side? How can I fix it?

IERC20: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol

IOneSplit: https://github.com/1inch/1inchProtocol/blob/master/contracts/IOneSplit.sol


Any help appreciated.

1

It is possible to use OpenZeppelin contracts' version 2.5, it was the latest to support solc 0.5.x: IERC20.sol.

2
  • Thank you @Ismael. Are you sure I won't get errors from SafeMath etc.? – RafayelKh May 10 at 16:00
  • @RafayelKh You have two options either downgrade OpenZeppelin to v2.5 use solc v0.5 or migrate to IOneSplit to use solc v0.8. – Ismael May 10 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.