-
Notifications
You must be signed in to change notification settings - Fork 931
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
Fixes for 1.0.0 #90
Merged
Merged
Fixes for 1.0.0 #90
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ea6a3a6
Fix reentrency attack with contract signatures
rmeissner d178264
Fix contract signature gas refund abuse
rmeissner eab2cf3
Add note about bounds check on signatureSplit
rmeissner 59bdc69
Added signature well-formedness checks
rmeissner ff86200
Adjust eip1271 interface to revert
rmeissner 9a1abe7
Added comments; Increase version
rmeissner 9d2416a
Log gas costs for master copy deployment
rmeissner 0a0383a
Remove )
rmeissner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,21 @@ | ||
pragma solidity ^0.5.0; | ||
|
||
contract ISignatureValidator { | ||
// bytes4(keccak256("isValidSignature(bytes,bytes)") | ||
bytes4 constant internal EIP1271_MAGIC_VALUE = 0x20c13b0b; | ||
|
||
/** | ||
* @dev Should return whether the signature provided is valid for the provided data | ||
* @param _data Arbitrary length data signed on the behalf of address(this) | ||
* @param _signature Signature byte array associated with _data | ||
* | ||
* MUST return a bool upon valid or invalid signature with corresponding _data | ||
* MUST take (bytes, bytes) as arguments | ||
* MUST return the bytes4 magic value 0x20c13b0b when function passes. | ||
* MUST NOT modify state (using STATICCALL for solc < 0.5, view modifier for solc > 0.5) | ||
* MUST allow external calls | ||
*/ | ||
function isValidSignature( | ||
bytes calldata _data, | ||
bytes calldata _signature) | ||
external | ||
returns (bool isValid); | ||
external | ||
returns (bytes4); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Uxio0 this will require changes in the clients, so we need to add a way that the clients know which version to use for signing (maybe return the contract version with the estimates)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively we could stick to dataGas (but imo this is a really bad name ... on the other side the user will not see it)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer that clients query the GET
/safes/{address}/
endpoint, I don't like how the estimate endpoint is growing. CurrentlymasterCopy
,nonce
,threshold
andowners
are returned, I will addversion
to that endpoint too. Would be ok for you @rmeissner?