Commit 6ac45333 by Francisco Giordano

convert Secondary to initializers

parent 0962b9e5
pragma solidity ^0.4.24; pragma solidity ^0.4.24;
import "../Initializable.sol";
import "../ownership/Secondary.sol"; import "../ownership/Secondary.sol";
contract SecondaryMock is Secondary { contract SecondaryMock is Initializable, Secondary {
constructor() public {
Secondary.initialize();
}
function onlyPrimaryMock() public view onlyPrimary { function onlyPrimaryMock() public view onlyPrimary {
} }
} }
pragma solidity ^0.4.24; pragma solidity ^0.4.24;
import "../Initializable.sol";
/** /**
* @title Secondary * @title Secondary
* @dev A Secondary contract can only be used by its primary account (the one that created it) * @dev A Secondary contract can only be used by its primary account (the one that created it)
*/ */
contract Secondary { contract Secondary is Initializable {
address private _primary; address private _primary;
/** /**
* @dev Sets the primary account to the one that is creating the Secondary contract. * @dev Sets the primary account to the one that is creating the Secondary contract.
*/ */
constructor() public { function initialize() public initializer {
_primary = msg.sender; _primary = msg.sender;
} }
......
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