Skip to content

Commit

Permalink
Audit review 6.4: All finance roles to board (#144)
Browse files Browse the repository at this point in the history
* Removed finance roles from shareholders and assign to board

* Removed redundant function from board template
  • Loading branch information
theethernaut authored and facuspagnuolo committed Sep 3, 2019
1 parent 7241270 commit 66dafa3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
5 changes: 2 additions & 3 deletions templates/company-board/README.md
Expand Up @@ -62,9 +62,8 @@ The network details will be automatically selected by the `arapp.json`'s environ
| Share Voting | MODIFY_SUPPORT | Share Voting | Share Voting |
| Agent or Vault | TRANSFER | Finance | Share Voting |
| Finance | CREATE_PAYMENTS | Board Voting | Share Voting |
| Finance | CREATE_PAYMENTS | Share Voting | Share Voting |
| Finance | EXECUTE_PAYMENTS | Share Voting | Share Voting |
| Finance | MANAGE_PAYMENTS | Share Voting | Share Voting |
| Finance | EXECUTE_PAYMENTS | Board Voting | Share Voting |
| Finance | MANAGE_PAYMENTS | Board Voting | Share Voting |
| Board Token Manager | MINT | Share Voting | Share Voting |
| Board Token Manager | BURN | Share Voting | Share Voting |
| Share Token Manager | MINT | Share Voting | Share Voting |
Expand Down
12 changes: 1 addition & 11 deletions templates/company-board/contracts/CompanyBoardTemplate.sol
Expand Up @@ -188,7 +188,7 @@ contract CompanyBoardTemplate is BaseTemplate {
_createCustomAgentPermissions(acl, Agent(agentOrVault), _shareVoting, _boardVoting);
}
_createVaultPermissions(acl, agentOrVault, finance, _shareVoting);
_createCustomFinancePermissions(acl, finance, _shareVoting, _boardVoting);
_createFinancePermissions(acl, finance, _boardVoting, _shareVoting);

return finance;
}
Expand All @@ -207,16 +207,6 @@ contract CompanyBoardTemplate is BaseTemplate {
_acl.createPermission(_boardVoting, _agent, _agent.RUN_SCRIPT_ROLE(), _shareVoting);
}

function _createCustomFinancePermissions(ACL _acl, Finance _finance, Voting _shareVoting, Voting _boardVoting) internal {
address[] memory grantees = new address[](2);
grantees[0] = address(_shareVoting);
grantees[1] = address(_boardVoting);

_createPermissions(_acl, grantees, _finance, _finance.CREATE_PAYMENTS_ROLE(), _shareVoting);
_acl.createPermission(_shareVoting, _finance, _finance.EXECUTE_PAYMENTS_ROLE(), _shareVoting);
_acl.createPermission(_shareVoting, _finance, _finance.MANAGE_PAYMENTS_ROLE(), _shareVoting);
}

function _cachePreparedDao(
Kernel _dao,
MiniMeToken _shareToken,
Expand Down
5 changes: 2 additions & 3 deletions templates/company-board/test/company-board.js
Expand Up @@ -236,9 +236,8 @@ contract('Company with board', ([_, owner, boardMember1, boardMember2, shareHold
assert.equal((await finance.getPeriodDuration()).toString(), expectedPeriod, 'finance period should be 30 days')

await assertRole(acl, finance, shareVoting, 'CREATE_PAYMENTS_ROLE', boardVoting)
await assertRole(acl, finance, shareVoting, 'CREATE_PAYMENTS_ROLE')
await assertRole(acl, finance, shareVoting, 'EXECUTE_PAYMENTS_ROLE')
await assertRole(acl, finance, shareVoting, 'MANAGE_PAYMENTS_ROLE')
await assertRole(acl, finance, shareVoting, 'EXECUTE_PAYMENTS_ROLE', boardVoting)
await assertRole(acl, finance, shareVoting, 'MANAGE_PAYMENTS_ROLE', boardVoting)

await assertMissingRole(acl, finance, 'CHANGE_PERIOD_ROLE')
await assertMissingRole(acl, finance, 'CHANGE_BUDGETS_ROLE')
Expand Down

0 comments on commit 66dafa3

Please sign in to comment.