Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
openzeppelin-contracts-upgradeable
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
openzeppelin-contracts-upgradeable
Commits
fc07f7a0
Commit
fc07f7a0
authored
May 19, 2018
by
Nicolás Venturo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RBACWithAdmin now has an initialize function instead of a constructor.
parent
dd6054ef
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
RBACMock.sol
contracts/mocks/RBACMock.sol
+2
-0
RBACWithAdmin.sol
contracts/ownership/rbac/RBACWithAdmin.sol
+6
-5
No files found.
contracts/mocks/RBACMock.sol
View file @
fc07f7a0
...
...
@@ -19,6 +19,8 @@ contract RBACMock is RBACWithAdmin {
function RBACMock(address[] _advisors)
public
{
RBACWithAdmin.initialize(msg.sender);
addRole(msg.sender, ROLE_ADVISOR);
for (uint256 i = 0; i < _advisors.length; i++) {
...
...
contracts/ownership/rbac/RBACWithAdmin.sol
View file @
fc07f7a0
pragma solidity ^0.4.21;
import "./RBAC.sol";
import 'zos-lib/contracts/migrations/Migratable.sol';
/**
* @title RBACWithAdmin
...
...
@@ -9,7 +9,7 @@ import "./RBAC.sol";
* @dev It's recommended that you define constants in the contract,
* @dev like ROLE_ADMIN below, to avoid typos.
*/
contract RBACWithAdmin is RBAC {
contract RBACWithAdmin is RBAC
, Migratable
{
/**
* A constant role name for indicating admins.
*/
...
...
@@ -26,12 +26,13 @@ contract RBACWithAdmin is RBAC {
}
/**
* @dev constructor. Sets
msg.sender as admin by default
* @dev constructor. Sets
initialAdmin as admin.
*/
function RBACWithAdmin()
function initialize(address initialAdmin)
isInitializer("RBACWithAdmin", "1.9.0-beta")
public
{
addRole(
msg.sender
, ROLE_ADMIN);
addRole(
initialAdmin
, ROLE_ADMIN);
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment