Skip to content
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

Parse error while parsing OpenZeppelin ERC20 contract #38

Open
dhilst opened this issue Jan 31, 2023 · 1 comment
Open

Parse error while parsing OpenZeppelin ERC20 contract #38

dhilst opened this issue Jan 31, 2023 · 1 comment

Comments

@dhilst
Copy link

dhilst commented Jan 31, 2023

I tried to parse the contract : https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol

But I got this error

Fatal error: exception Solidity_exceptions.SyntaxError("Parse error", _)

I'm not sure if I'm doing something wrong, I'm using the 0.5.3 version of ocaml-solidity

@hra687261
Copy link
Contributor

This is probably due to the fact that ocaml-solidity supports only the versions 0.6.x (cf. https://ocamlpro.com/blog/2020_05_19_ocaml_solidity_parser_with_menhir/) of solidity while that contract is written in 0.8.0.
After testing I got the following error message:

./openzeppelin-contracts/contracts/token/ERC20/ERC20.sol:202.21-202.22:
Syntax error: Parse error
 199           uint256 currentAllowance = allowance(owner, spender);
 200           require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
 201           unchecked {
 202 >             _approve(owner, spender, currentAllowance - subtractedValue);
 203           }
 204

The unchecked keyword for example is currently not supported in ocaml-solidity.
We are currently not focused on this project, so we can't promise to do it very soon, but feel free to open a PR or you can contact us to tell us more about your use of the project and your specific needs on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants