This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.18; | |
import "./KeyValueStorage.sol"; | |
contract StorageState { | |
KeyValueStorage _storage; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.18; | |
import "./DelegateV1.sol"; | |
import "./StorageState.sol"; | |
import "./Ownable.sol"; | |
contract DelegateV2 is StorageState { | |
modifier onlyOwner() { | |
require(msg.sender == _storage.getAddress("owner")); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.18; | |
import "./SafeMath.sol"; | |
import "./StorageState.sol"; | |
contract DelegateV1 is StorageState { | |
using SafeMath for uint256; | |
function setNumberOfOwners(uint256 num) public { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.18; | |
import "./Ownable.sol"; | |
import "./StorageState.sol"; | |
contract Proxy is StorageState , Ownable { | |
function Proxy(KeyValueStorage storage_ , address _owner) public { | |
_storage = storage_; | |
_storage.setAddress("owner",_owner); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contract KeyValueStorage { | |
mapping(address => mapping(bytes32 => uint256)) _uintStorage; | |
mapping(address => mapping(bytes32 => address)) _addressStorage; | |
mapping(address => mapping(bytes32 => bool)) _boolStorage; | |
/**** Get Methods ***********/ | |
function getAddress(bytes32 key) public view returns (address) { | |
return _addressStorage[msg.sender][key]; |
NewerOlder