-
Notifications
You must be signed in to change notification settings - Fork 54
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
Projects v2 contracts #1002
Projects v2 contracts #1002
Conversation
- remove default token from initialize call (defaults to address(0)) - remove references to github
- add metaTX fulfillment call - remove unsupported getters - remove support for adding multiple Issuers
2019-06-21: initial submission, corrected linter issues, corrected testing issues
- convert _removeBounty to work with Standard Bounties V2 - add drainBounty and changeDeadline interfaces
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.
Just some questions to value if any of these should be needed to address into the audit cleanup
@@ -8,6 +8,7 @@ import "@tps/test-helpers/contracts/factory/EVMScriptRegistryFactory.sol"; | |||
import "@tps/test-helpers/contracts/lib/misc/Migrations.sol"; | |||
import "@aragon/apps-shared-minime/contracts/MiniMeToken.sol"; | |||
import "@tps/test-helpers/contracts/lib/bounties/StandardBounties.sol"; | |||
import "@tps/test-helpers/contracts/lib/bounties/BountiesEvents.sol"; |
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 think we should not actually need to import this if we don't intend to use BountiesEvents in AddressBook tests, do you have an special reason for 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.
Good catch. I've reorganized Spoof.sol and TestImports.sol imports to better reflect their purposes in the address book app
@@ -5,6 +5,7 @@ import "@tps/test-helpers/contracts/factory/DAOFactory.sol"; | |||
import "@tps/test-helpers/contracts/acl/ACL.sol"; | |||
import "@aragon/apps-shared-minime/contracts/MiniMeToken.sol"; | |||
import "@tps/test-helpers/contracts/lib/bounties/StandardBounties.sol"; | |||
import "@tps/test-helpers/contracts/lib/bounties/BountiesEvents.sol"; |
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 think we should not actually need to import this if we don't intend to use BountiesEvents in Allocations tests, do you have an special reason for 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.
We need to import it here or Truffle throws this error (as outlined by Jorge's comments in Spoof.sol): Error: Could not find artifacts for ./lib/bounties/BountiesEvents from any sources
@@ -1,6 +1,7 @@ | |||
pragma solidity ^0.4.24; | |||
|
|||
import "@tps/test-helpers/contracts/lib/bounties/StandardBounties.sol"; | |||
import "@tps/test-helpers/contracts/lib/bounties/BountiesEvents.sol"; |
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.
same here
apps/projects/contracts/Projects.sol
Outdated
@@ -293,7 +344,7 @@ contract Projects is IsContract, AragonApp { | |||
/////////////////////// | |||
/** | |||
* @notice Add repository to the Projects app | |||
* @param _repoId Github id of the repo to add | |||
* @param _repoId id of the repo to be aadded |
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.
Really small miss click typo 😇
apps/projects/contracts/Projects.sol
Outdated
@@ -370,7 +426,8 @@ contract Projects is IsContract, AragonApp { | |||
bool _approved | |||
) external auth(REVIEW_APPLICATION_ROLE) | |||
{ | |||
GithubIssue storage issue = repos[_repoId].issues[_issueNumber]; | |||
Issue storage issue = repos[_repoId].issues[_issueNumber]; | |||
require(issue.assignee != 0xffffffffffffffffffffffffffffffffffffffff, "ISSUE_OPEN"); |
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.
Very opinionated comment, but the address seems ugly to me, maybe address(-1)
could work?
apps/projects/contracts/Projects.sol
Outdated
emit SubmissionAccepted(_submissionNumber, _repoId, _issueNumber); | ||
} else { | ||
submission.status = SubmissionStatus.Rejected; | ||
bounties.performAction( |
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 will probably try to clean this duped block, it seems that it could be outside of the condition, I will check carefully anyway
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 moved the bounties.performAction
call outside of the if/else construct and just put it at the end
@@ -136,7 +168,7 @@ contract('Projects App', accounts => { | |||
) | |||
|
|||
// Deploy test Bounties contract | |||
bounties = await StandardBounties.new(web3.toBigNumber(owner1)) | |||
bounties = { address: '0x72D1Ae1D6C8f3dd444b3D95bAd554Be483082e40'.toLowerCase() } |
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.
Just curious, what is the motivation of toLowerCase here?
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.
the test for changing bounty settings fails:
1) Contract: Projects App
post-initialization
settings management
can change Bounty Settings:
StandardBounties Contract address incorrect
+ expected - actual
-0x72d1ae1d6c8f3dd444b3d95bad554be483082e40
+0x72D1Ae1D6C8f3dd444b3D95bAd554Be483082e40
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.
Ok I think I understand, to prevent different hashes for the same address with different casing, yeah, thinking about it I agree is a good decision, it seems less cumbersome than dealing with checksummed addresses 👍
@@ -7,5 +7,6 @@ module.exports = { | |||
Kernel: artifacts.require('./kernel/Kernel'), | |||
MiniMeToken: artifacts.require('./lib/minime/MiniMeToken'), | |||
StandardBounties: artifacts.require('./lib/bounties/StandardBounties'), | |||
BountiesEvents: artifacts.require('./lib/bounties/BountiesEvents'), |
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.
Here is the small change that enforces to import BountiesEvents on each Spoof.sol for every app 🎉
I am sorry you experienced errors locally, it seems this one is so confusing
I blame myself because I created this "artifact-requirer" helper, but it seems is not useful anymore, my recommendation would be to move StandardBounties related code to a projects subfolder or to the integrations one, as I think it is convenient for us to get rid of test-helpers folder, I tried to follow this approach with Rewards when moving the mining functions there
Is not a big deal, but seems it is related to #588 and it actually clears lot of intermediate dead code, I think the change worths be done
I already did the changes so I will commit those, if you don't mind @topocount I just tried to clarify about the previous related comments so we can save some time in the future with these pesky things
03a7e84
to
b490ac8
Compare
faa15c8
to
e44aba7
Compare
…untyContractValid
21cbb80
to
c79afa7
Compare
- convert repoIndex to a mapping - add requires to token approval calls
- add isInitialized to all functions without auth - convert all functions with small enough parameter sizes to "external" from "public" - reorder functions to be match visibility order style - add "_description" to updateBounty to make it more forwarder-friendly
Remaining Support Actions
The initial contract work is done, but supporting files still need some work and the contract likely needs some polish in order to conform to conventions we've set forth in Rewards and Address Book contracts:
require
functions fail are missing coverage