-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Move contracts to subdirectories #1253
Merged
frangio
merged 5 commits into
OpenZeppelin:master
from
come-maiz:refactor/1177/out-of-root
Sep 3, 2018
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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 was deleted.
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
8 changes: 4 additions & 4 deletions
8
contracts/Bounty.sol β contracts/bounties/BreakInvariantBounty.sol
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
File renamed without changes.
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
6 changes: 3 additions & 3 deletions
6
contracts/mocks/ECRecoveryMock.sol β contracts/mocks/ECDSAMock.sol
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
// When this line is split, truffle parsing fails. | ||
// See: https://github.com/ethereum/solidity/issues/4871 | ||
// solium-disable-next-line max-len | ||
import {BreakInvariantBounty, Target} from "../../contracts/bounties/BreakInvariantBounty.sol"; | ||
|
||
|
||
contract InsecureInvariantTargetMock is Target { | ||
function checkInvariant() public returns(bool) { | ||
return false; | ||
} | ||
} | ||
|
||
|
||
contract InsecureInvariantTargetBounty is BreakInvariantBounty { | ||
function deployContract() internal returns (address) { | ||
return new InsecureInvariantTargetMock(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
pragma solidity ^0.4.24; | ||
|
||
// When this line is split, truffle parsing fails. | ||
// See: https://github.com/ethereum/solidity/issues/4871 | ||
// solium-disable-next-line max-len | ||
import {BreakInvariantBounty, Target} from "../../contracts/bounties/BreakInvariantBounty.sol"; | ||
|
||
|
||
contract SecureInvariantTargetMock is Target { | ||
function checkInvariant() public returns(bool) { | ||
return true; | ||
} | ||
} | ||
|
||
|
||
contract SecureInvariantTargetBounty is BreakInvariantBounty { | ||
function deployContract() internal returns (address) { | ||
return new SecureInvariantTargetMock(); | ||
} | ||
} |
This file was deleted.
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
File renamed without changes.
File renamed without changes.
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 was deleted.
Oops, something went wrong.
6 changes: 3 additions & 3 deletions
6
test/library/ECRecovery.test.js β test/library/ECDSA.test.js
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
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.
Can you explain the reasoning behind this rename? I'm not sure I prefer the new name.
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.
Because now the directory is called bounties and it has room for other types of bounties, we need a less generic name. I used the docstring to come up with this name:
"This bounty will pay out to a researcher if they break invariant logic of the contract."
The alternative we had documented on the issue #1177 was to move it to examples, but we didn't document any other option for the name. Do you have a better name in mind, or would you like a different solution for taking it out of the root dir?
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.
Ah I remember that conversation now. The problem is that I can't imagine other types of bounties possible. Do you have any in mind?
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.
More or less. I might be stretching this a little, but there could be an oracle that checks who closed a github bug, and then let that person claim the bounty. Following the same idea, a bounty on ZeppelinOS might be totally on chain, but not just for breaking a contract but for publishing a new version or something. I think we will see more things related to bounties in the future, and they can all fit in this directory. But these are just predictions, I don't have a strong opinion about this directory. This was jsut the best option I could come up with, but I'm happy moving the contract somewhere else, giving it a different name, or dropping 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.
That's a super cool idea, but if it's ever developed I don't see it being a part of OpenZeppelin because it would be a complex system.
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.
An
OracleBounty
sounds like a nice and straightforward usage example of anOracle
interface, once that's finalized (#971), I'd like to see such a contract. However, I don't think we'd also want to have an in-houseOracle
implementation, so I'm not sure if this kind of thing would incentive that.I'd keep the
bounties
directory, if only to see if any interesting bounty-related contributions come our way.