hdries
hdries

Reputation: 121

Duplicate SafeMath in Solidity libraries

I'm working on a Solidity smart contract, and I'm importing both the openzeppelin-solidity library, as well as the chainlink library.

Both have the SafeMath library; I'm loading all the .sol files in Python. When I try to compile (Python), I get the following error:

TypeError: Member "div" not unique after argument-dependent lookup in uint256

I got this error the moment I added the chainlink library, so I guess the problem is the duplicate SafeMath definition? Obviously I don't want to go change imports in either library.

How best to solve this?

Upvotes: 4

Views: 932

Answers (1)

Patrick Collins
Patrick Collins

Reputation: 6131

Chainlink repo now uses safeMathChainlink to avoid naming conflicts, so if you import that you’ll not have those issues.

Also, in v0.8 of solidity, safeMath as a whole is no longer needed

Upvotes: 1

Related Questions