Commit fc07f7a0 by Nicolás Venturo

RBACWithAdmin now has an initialize function instead of a constructor.

parent dd6054ef
...@@ -19,6 +19,8 @@ contract RBACMock is RBACWithAdmin { ...@@ -19,6 +19,8 @@ contract RBACMock is RBACWithAdmin {
function RBACMock(address[] _advisors) function RBACMock(address[] _advisors)
public public
{ {
RBACWithAdmin.initialize(msg.sender);
addRole(msg.sender, ROLE_ADVISOR); addRole(msg.sender, ROLE_ADVISOR);
for (uint256 i = 0; i < _advisors.length; i++) { for (uint256 i = 0; i < _advisors.length; i++) {
......
pragma solidity ^0.4.21; pragma solidity ^0.4.21;
import "./RBAC.sol"; import "./RBAC.sol";
import 'zos-lib/contracts/migrations/Migratable.sol';
/** /**
* @title RBACWithAdmin * @title RBACWithAdmin
...@@ -9,7 +9,7 @@ import "./RBAC.sol"; ...@@ -9,7 +9,7 @@ import "./RBAC.sol";
* @dev It's recommended that you define constants in the contract, * @dev It's recommended that you define constants in the contract,
* @dev like ROLE_ADMIN below, to avoid typos. * @dev like ROLE_ADMIN below, to avoid typos.
*/ */
contract RBACWithAdmin is RBAC { contract RBACWithAdmin is RBAC, Migratable {
/** /**
* A constant role name for indicating admins. * A constant role name for indicating admins.
*/ */
...@@ -26,12 +26,13 @@ contract RBACWithAdmin is RBAC { ...@@ -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 public
{ {
addRole(msg.sender, ROLE_ADMIN); addRole(initialAdmin, ROLE_ADMIN);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment