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

False compiler DeclarationError: Modifier already used for this function #2621

Closed
elenadimitrova opened this issue Jul 22, 2017 · 5 comments · Fixed by #2652 or JoinColony/colonySale#24
Assignees
Labels

Comments

@elenadimitrova
Copy link
Collaborator

Solidity compiler throws an error

DeclarationError: Modifier already used for this function.

when a function uses modifier twice with different parameters, e.g.

modifier nonZeroAddress(address x) {
    require(x != 0);
    _;
  }

function X(address a, address b) 
nonZeroAddress(a)
nonZeroAddress(b)
{ ... }

@axic
Copy link
Member

axic commented Jul 22, 2017

This was introduced in #2460.

@onbjerg
Copy link

onbjerg commented Jul 25, 2017

Why was the version not bumped to reflect #2460, which is a breaking change?

There are legitimate use cases to use the same modifier twice on the same function.

@chriseth
Copy link
Contributor

Ah, I see. To be honest, I did not consider multiple uses of the same modifier, but seeing your example, that was obviously a stupid assumption :-)

@chriseth
Copy link
Contributor

Will work on this.

@onbjerg
Copy link

onbjerg commented Jul 29, 2017

No worries, thanks for the swift response 😄 Happy hacking!

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