-
Notifications
You must be signed in to change notification settings - Fork 11.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace inline assembly with Solidity in ERC165Checker #1761
Comments
Would it be something like this?
Don't have a good grasp on the assembly code yet.. |
@RCYP Looks like it, yeah! Go for it. |
Oh, actually, you're missing the gas limit. It should be |
After putting the gas limit it fails to compile if the function is declared as So should I remove the |
Hm, that seems like a bug? I can't see how a static call would modify state. I'll ask the solc developers. |
Reported in ethereum/solidity#6901. |
The Solidity bug above has been fixed in 0.5.10. However, bumping the minimum solc required for this contract to 0.5.10 is technically a breaking change, because we currently support 0.5.0. @nventuro What do you think? I think it would be okay to bump the pragma for this specific contract. Removing the hand written assembly is definitely desirable. |
Technically our API guarantees explicitly exclude the Solidity version. I think bumping the pragma on this one is fine. We should also update the |
Should i make theses changes to this file and |
@yopereir that'd be great! 😁 |
ok, i'll do it over this weekend. |
One of the few
assembly
blocks we have is inERC165Checker
.https://github.com/OpenZeppelin/openzeppelin-solidity/blob/2ccc12b328e6d5d1d3faa5b99bec8d1de8b92fea/contracts/introspection/ERC165Checker.sol#L103-L120
I think we used assembly back then because Solidity didn't have
.staticcall
yet. It should be possible to replace it with.staticcall
andabi.decode
now.The text was updated successfully, but these errors were encountered: