Skip to content

Commit

Permalink
Merge pull request #57 from AutarkLabs/staging-store
Browse files Browse the repository at this point in the history
refactor(contract): clean unused role and change permission
  • Loading branch information
ottodevs authored Jan 24, 2020
2 parents 5f18f33 + 7f7384a commit ff9d868
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
5 changes: 0 additions & 5 deletions arapp.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@
"id": "REMOVE_ROLE",
"params": []
},
{
"name": "Reorder widgets",
"id": "REORDER_ROLE",
"params": []
},
{
"name": "Update a widget",
"id": "UPDATE_ROLE",
Expand Down
4 changes: 1 addition & 3 deletions contracts/About.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,10 @@ contract About is AragonApp {
/* Hard-coded constants to save gas
bytes32 constant public ADD_ROLE = keccak256("ADD_ROLE");
bytes32 constant public REMOVE_ROLE = keccak256("REMOVE_ROLE");
bytes32 constant public REORDER_ROLE = keccak256("REORDER_ROLE");
bytes32 constant public UPDATE_ROLE = keccak256("UPDATE_ROLE");
*/
bytes32 constant public ADD_ROLE = 0x9fdb66370b2703c58b55fbb88662023f986df503f838f6ca75ff9f9bdabd694a;
bytes32 constant public REMOVE_ROLE = 0x0a55cd9c498e2688378e5cd183217e75c0fa1cdbaa909387f565177cd47670f5;
bytes32 constant public REORDER_ROLE = 0x0210352125167815ae2d54bb8e405f542b6cd4763cd039d14f046edad97dc03d;
bytes32 constant public UPDATE_ROLE = 0x3ee192ac25847473237ced4bba57f848e1fd794930ff85b42823290580967205;

/**
Expand Down Expand Up @@ -59,7 +57,7 @@ contract About is AragonApp {
}

/**
* @notice Update `@fromHex(_priority, "utf8")` content to `_addr`
* @notice Create widget `_priority` with content `_addr`
* @param _priority Index of the widget
* @param _addr IPFS hash of the widget's data
*/
Expand Down
7 changes: 5 additions & 2 deletions contracts/dev/Template.sol
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ contract Template is BaseTemplate, TokenCache {
internal
{
About app = _installAboutApp(_dao);
_createAboutAppPermissions(_acl, app, _voting, _voting);
// Warning here, set ANY_ENTITY for development,
// use another grantee or manager in prod like for example _voting
_createAboutAppPermissions(_acl, app, ANY_ENTITY, ANY_ENTITY);
}

function _installAboutApp(
Expand All @@ -143,8 +145,9 @@ contract Template is BaseTemplate, TokenCache {
)
internal
{
_acl.createPermission(_grantee, _app, _app.ADD_ROLE(), _manager);
_acl.createPermission(_grantee, _app, _app.REMOVE_ROLE(), _manager);
_acl.createPermission(_grantee, _app, _app.UPDATE_ROLE(), _manager);
_acl.createPermission(ANY_ENTITY, _app, _app.REMOVE_ROLE(), _manager);
}

function _ensureTemplateSettings(
Expand Down

0 comments on commit ff9d868

Please sign in to comment.