Skip to content

Instantly share code, notes, and snippets.

View himanshuchawla009's full-sized avatar
🎯
Focusing

himanshuchawla009

🎯
Focusing
  • web3auth
  • internet
View GitHub Profile
pragma solidity ^0.4.18;
import "./KeyValueStorage.sol";
contract StorageState {
KeyValueStorage _storage;
}
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"));
pragma solidity ^0.4.18;
import "./SafeMath.sol";
import "./StorageState.sol";
contract DelegateV1 is StorageState {
using SafeMath for uint256;
function setNumberOfOwners(uint256 num) public {
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);
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];