Skip to content

Fix incorrect assumption about erc7201 constant function call#16672

Open
matheusaaguiar wants to merge 3 commits into
developfrom
fix_erc7201_invalid_param_number_ice
Open

Fix incorrect assumption about erc7201 constant function call#16672
matheusaaguiar wants to merge 3 commits into
developfrom
fix_erc7201_invalid_param_number_ice

Conversation

@matheusaaguiar

Copy link
Copy Markdown
Contributor

Fix #16633.

@matheusaaguiar matheusaaguiar self-assigned this May 5, 2026
@matheusaaguiar matheusaaguiar changed the title Fix erc7201 invalid param number ice Fix incorrect assumption about erc7201 constant function call May 5, 2026

@nikola-matic nikola-matic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say this warrants a changelog - it's a user visible change after all.

case FunctionType::Kind::ERC7201:
{
solAssert(_functionCall.arguments().size() == 1);
if (_functionCall.arguments().size() != 1)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you not move this to TypeChecker?

@matheusaaguiar matheusaaguiar May 5, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here is that for certain cases, like array lengths, the constant folding happens before, during DeclarationTypeChecker visits... I could add that there, but feels a bit out of place too.
At first, I wanted to rely on TypeChecker and missed that this could be triggered before it was verified (see this comment)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough

@matheusaaguiar matheusaaguiar force-pushed the fix_erc7201_invalid_param_number_ice branch 3 times, most recently from 7284376 to c877f69 Compare May 7, 2026 18:52
@github-actions

Copy link
Copy Markdown

This pull request is stale because it has been open for 14 days with no activity.
It will be closed in 7 days unless the stale label is removed.

@github-actions github-actions Bot added the stale The issue/PR was marked as stale because it has been open for too long. label May 22, 2026
@cameel cameel removed the stale The issue/PR was marked as stale because it has been open for too long. label May 23, 2026
@github-actions

github-actions Bot commented Jun 7, 2026

Copy link
Copy Markdown

This pull request is stale because it has been open for 14 days with no activity.
It will be closed in 7 days unless the stale label is removed.

@github-actions github-actions Bot added the stale The issue/PR was marked as stale because it has been open for too long. label Jun 7, 2026
@cameel cameel removed the stale The issue/PR was marked as stale because it has been open for too long. label Jun 8, 2026
@matheusaaguiar matheusaaguiar force-pushed the fix_erc7201_invalid_param_number_ice branch from c877f69 to 79eff37 Compare June 15, 2026 15:03
@github-actions

Copy link
Copy Markdown

This pull request is stale because it has been open for 14 days with no activity.
It will be closed in 7 days unless the stale label is removed.

@github-actions github-actions Bot added the stale The issue/PR was marked as stale because it has been open for too long. label Jun 30, 2026
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

This pull request was closed due to a lack of activity for 7 days after it was stale.

@github-actions github-actions Bot closed this Jul 7, 2026
@nikola-matic nikola-matic reopened this Jul 7, 2026
@nikola-matic nikola-matic removed stale The issue/PR was marked as stale because it has been open for too long. closed-due-inactivity labels Jul 7, 2026
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

Successfully merging this pull request may close these issues.

ICE in ConstantEvaluator::endVisit(FunctionCall) when erc7201() is called with no arguments as a constant

3 participants