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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add isValidSignatureAndData to Bouncer to verify method calls. #891

Closed
1 task done
shrugs opened this issue Apr 12, 2018 · 3 comments 路 Fixed by #973
Closed
1 task done

Add isValidSignatureAndData to Bouncer to verify method calls. #891

shrugs opened this issue Apr 12, 2018 · 3 comments 路 Fixed by #973
Labels
feature New contracts, functions, or helpers.

Comments

@shrugs
Copy link
Contributor

shrugs commented Apr 12, 2018

馃帀 Description

Add the ability for Bouncer.sol to check the method signature and/or arguments to a method, to allow a bouncer to sign a message for a very specific function call.

The naive approach of

return isValidDataHash(
      keccak256(address(this), _address, msg.data),
      _sig
    );

won't work because the signature is part of the data and you need the data to sign and you need the signature to get the data and you need the data to sign you get the point.

One option is to enforce that the signature is always at the end of the msg.data and then ignore the last 32 bytes.

  • 馃搱 This is a feature request.
@shrugs shrugs added feature New contracts, functions, or helpers. discussion labels Apr 12, 2018
@aflesher
Copy link
Contributor

I can grab this issue if no one else is working on it.

For the method signature should we just add a bool to determine if it should validate the arguments and methodId or just the methodId ?
function isValidSignatureAndData(address _address, bytes _sig, bool _validateArgs)

Also I can't think of any alternative to:

One option is to enforce that the signature is always at the end of the msg.data and then ignore the last 32 bytes.

so I'll just implement that

@shrugs
Copy link
Contributor Author

shrugs commented Jun 1, 2018

@aflesher do you think it's worth two different methods/modifiers instead of the boolean switch?

@aflesher
Copy link
Contributor

aflesher commented Jun 1, 2018

Good point. I think it does make sense to separate them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New contracts, functions, or helpers.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants