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

Does not recognize payable #32

Closed
kopy-kat opened this issue Feb 8, 2024 · 4 comments
Closed

Does not recognize payable #32

kopy-kat opened this issue Feb 8, 2024 · 4 comments
Milestone

Comments

@kopy-kat
Copy link

kopy-kat commented Feb 8, 2024

Example:

address payable constant SWAPROUTER_ADDRESS = payable(0xE592427A0AEce92De3Edee1F18E0157C05861564);

Error message:

CompileInferenceError: Failed parsing imports at [PATH/CONTRACT]:66:1 - Expected " ", "/*", "//", "[", "\t", "\x0B", "\x0C", "constant", " ", "", [ , , , - , , , ], or [\n,\r,
,
] but "p" found.
    at findAllFiles (/.../node_modules/.pnpm/solc-typed-ast@17.0.3_typescript@5.3.3/node_modules/solc-typed-ast/dist/compile/inference/imports.js:128:23)
    at compileSol (/.../node_modules/.pnpm/solc-typed-ast@17.0.3_typescript@5.3.3/node_modules/solc-typed-ast/dist/compile/utils.js:160:44)
    at async getProjectCompiledSources (/.../node_modules/.pnpm/@defi-wonderland+natspec-smells@1.0.3_typescript@5.3.3/node_modules/@defi-wonderland/natspec-smells/lib/utils.js:29:27)
    at async /.../node_modules/.pnpm/@defi-wonderland+natspec-smells@1.0.3_typescript@5.3.3/node_modules/@defi-wonderland/natspec-smells/lib/main.js:16:25
@gas1cent
Copy link
Member

gas1cent commented Feb 8, 2024

@kopy-kat hey, thanks for the report! What solidity version are you using? Any chance I can see the full contract?

@kopy-kat
Copy link
Author

kopy-kat commented Feb 8, 2024

Using 0.8.24 and this is actually the full file (its in a lib):

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.21;

address payable constant SWAPROUTER_ADDRESS = payable(0xE592427A0AEce92De3Edee1F18E0157C05861564);
uint24 constant SWAPROUTER_DEFAULTFEE = 3000;

@gas1cent
Copy link
Member

gas1cent commented Feb 8, 2024

Perfect, thanks. It seems to be a parser issue, I've reported it here: Consensys/solc-typed-ast#255
Will update you once we find a solution.

@gas1cent
Copy link
Member

Hey @kopy-kat! Just fyi, the bug has been addressed by the Consensys team and we've included the fix in v1.1.1. Give it a try :)

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