Contract Overview
Balance:
0 HT
Token:
My Name Tag:
Not Available
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
OwnedUpgradeabilityProxy
Compiler Version
v0.4.25+commit.59dbf8f1
Contract Source Code (Solidity Multiple files format)
pragma solidity ^0.4.25; import './UpgradeabilityProxy.sol'; /** * @title OwnedUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with basic authorization control functionalities */ contract OwnedUpgradeabilityProxy is UpgradeabilityProxy { /** * @dev Event to show ownership has been transferred * @param previousOwner representing the address of the previous owner * @param newOwner representing the address of the new owner */ event ProxyOwnershipTransferred(address previousOwner, address newOwner); // Storage position of the owner of the contract bytes32 private constant proxyOwnerPosition = keccak256("org.zeppelinos.proxy.owner"); /** * @dev the constructor sets the original owner of the contract to the sender account. */ constructor() public { setUpgradeabilityOwner(msg.sender); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyProxyOwner() { require(msg.sender == proxyOwner()); _; } /** * @dev Tells the address of the owner * @return the address of the owner */ function proxyOwner() public view returns (address owner) { bytes32 position = proxyOwnerPosition; assembly { owner := sload(position) } } /** * @dev Sets the address of the owner */ function setUpgradeabilityOwner(address newProxyOwner) internal { bytes32 position = proxyOwnerPosition; assembly { sstore(position, newProxyOwner) } } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferProxyOwnership(address newOwner) public onlyProxyOwner { require(newOwner != address(0)); emit ProxyOwnershipTransferred(proxyOwner(), newOwner); setUpgradeabilityOwner(newOwner); } /** * @dev Allows the proxy owner to upgrade the current version of the proxy. * @param implementation representing the address of the new implementation to be set. */ function upgradeTo(address implementation) public onlyProxyOwner { _upgradeTo(implementation); } /** * @dev Allows the proxy owner to upgrade the current version of the proxy and call the new implementation * to initialize whatever is needed through a low level call. * @param implementation representing the address of the new implementation to be set. * @param data represents the msg.data to bet sent in the low level call. This parameter may include the function * signature of the implementation to be called with the needed payload */ function upgradeToAndCall(address implementation, bytes data) payable public onlyProxyOwner { upgradeTo(implementation); require(implementation.delegatecall(data)); } }
pragma solidity ^0.4.25; library Address { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } }
pragma solidity ^0.4.25; /** * @title Proxy * @dev Gives the possibility to delegate any call to a foreign implementation. */ contract Proxy { /** * @dev Tells the address of the implementation where every call will be delegated. * @return address of the implementation to which it will be delegated */ function implementation() public view returns (address); /** * @dev Fallback function allowing to perform a delegatecall to the given implementation. * This function will return whatever the implementation call returns */ function () payable public { address _impl = implementation(); require(_impl != address(0)); assembly { let ptr := mload(0x40) calldatacopy(ptr, 0, calldatasize) let result := delegatecall(gas, _impl, ptr, calldatasize, 0, 0) let size := returndatasize returndatacopy(ptr, 0, size) switch result case 0 { revert(ptr, size) } default { return(ptr, size) } } } }
pragma solidity ^0.4.25; import './Proxy.sol'; import './Address.sol'; /** * @title UpgradeabilityProxy * @dev This contract represents a proxy where the implementation address to which it will delegate can be upgraded */ contract UpgradeabilityProxy is Proxy { /** * @dev This event will be emitted every time the implementation gets upgraded * @param implementation representing the address of the upgraded implementation */ event Upgraded(address indexed implementation); // Storage position of the address of the current implementation bytes32 private constant implementationPosition = keccak256("org.zeppelinos.proxy.implementation"); /** * @dev Constructor function */ constructor() public {} /** * @dev Tells the address of the current implementation * @return address of the current implementation */ function implementation() public view returns (address impl) { bytes32 position = implementationPosition; assembly { impl := sload(position) } } /** * @dev Sets the address of the current implementation * @param newImplementation address representing the new implementation to be set */ function setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation),"newImplementation is not a contractAddress"); bytes32 position = implementationPosition; assembly { sstore(position, newImplementation) } } /** * @dev Upgrades the implementation address * @param newImplementation representing the address of the new implementation to be set */ function _upgradeTo(address newImplementation) internal { address currentImplementation = implementation(); require(currentImplementation != newImplementation); setImplementation(newImplementation); emit Upgraded(newImplementation); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[],"name":"proxyOwner","outputs":[{"name":"owner","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"implementation","type":"address"}],"name":"upgradeTo","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"implementation","type":"address"},{"name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"implementation","outputs":[{"name":"impl","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferProxyOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"previousOwner","type":"address"},{"indexed":false,"name":"newOwner","type":"address"}],"name":"ProxyOwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"implementation","type":"address"}],"name":"Upgraded","type":"event"}]
Contract Creation Code
608060405234801561001057600080fd5b5061002333640100000000610028810204565b61005d565b604080517f6f72672e7a657070656c696e6f732e70726f78792e6f776e65720000000000008152905190819003601a01902055565b6105478061006c6000396000f30060806040526004361061006c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025313a281146100b25780633659cfe6146100e35780634f1ef286146101065780635c60da1b14610160578063f1739cae14610175575b6000610076610196565b9050600160a060020a038116151561008d57600080fd5b60405136600082376000803683855af43d806000843e8180156100ae578184f35b8184fd5b3480156100be57600080fd5b506100c76101f2565b60408051600160a060020a039092168252519081900360200190f35b3480156100ef57600080fd5b50610104600160a060020a0360043516610228565b005b60408051602060046024803582810135601f8101859004850286018501909652858552610104958335600160a060020a03169536956044949193909101919081908401838280828437509497506102509650505050505050565b34801561016c57600080fd5b506100c7610196565b34801561018157600080fd5b50610104600160a060020a03600435166102f9565b604080517f6f72672e7a657070656c696e6f732e70726f78792e696d706c656d656e74617481527f696f6e0000000000000000000000000000000000000000000000000000000000602082015290519081900360230190205490565b604080517f6f72672e7a657070656c696e6f732e70726f78792e6f776e65720000000000008152905190819003601a0190205490565b6102306101f2565b600160a060020a0316331461024457600080fd5b61024d8161037e565b50565b6102586101f2565b600160a060020a0316331461026c57600080fd5b61027582610228565b81600160a060020a03168160405180828051906020019080838360005b838110156102aa578181015183820152602001610292565b50505050905090810190601f1680156102d75780820380516001836020036101000a031916815260200191505b50915050600060405180830381855af491505015156102f557600080fd5b5050565b6103016101f2565b600160a060020a0316331461031557600080fd5b600160a060020a038116151561032a57600080fd5b7f5a3e66efaa1e445ebd894728a69d6959842ea1e97bd79b892797106e270efcd96103536101f2565b60408051600160a060020a03928316815291841660208301528051918290030190a161024d816103e4565b6000610388610196565b9050600160a060020a0380821690831614156103a357600080fd5b6103ac82610419565b604051600160a060020a038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a25050565b604080517f6f72672e7a657070656c696e6f732e70726f78792e6f776e65720000000000008152905190819003601a01902055565b600061042482610513565b15156104b757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f6e6577496d706c656d656e746174696f6e206973206e6f74206120636f6e747260448201527f6163744164647265737300000000000000000000000000000000000000000000606482015290519081900360840190fd5b50604080517f6f72672e7a657070656c696e6f732e70726f78792e696d706c656d656e74617481527f696f6e00000000000000000000000000000000000000000000000000000000006020820152905190819003602301902055565b6000903b11905600a165627a7a72305820b49b00462e173216d7a6030b7a8d6de13dc008758307ef4f1a89e61a069fbd030029
Deployed ByteCode Sourcemap
211:2582:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;583:13:2;599:16;:14;:16::i;:::-;583:32;-1:-1:-1;;;;;;629:19:2;;;;621:28;;;;;;690:4;684:11;723:12;720:1;715:3;702:34;804:1;801;787:12;782:3;775:5;770:3;757:49;825:14;869:4;866:1;861:3;846:28;889:6;902:28;;;;959:4;954:3;947:17;902:28;923:4;918:3;911:17;1106:158:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1106:158:1;;;;;;;;-1:-1:-1;;;;;1106:158:1;;;;;;;;;;;;;;2047:102;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;2047:102:1;-1:-1:-1;;;;;2047:102:1;;;;;;;2617:174;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;2617:174:1;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2617:174:1;;-1:-1:-1;2617:174:1;;-1:-1:-1;;;;;;;2617:174:1;858:164:3;;8:9:-1;5:2;;;30:1;27;20:12;5:2;858:164:3;;;;1652:212:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1652:212:1;-1:-1:-1;;;;;1652:212:1;;;;;858:164:3;614:48;;;;;;;;;;;;;;;;;;;;;997:15;;981:37::o;1106:158:1:-;645:39;;;;;;;;;;;;;;;;1239:15;;1222:38::o;2047:102::-;986:12;:10;:12::i;:::-;-1:-1:-1;;;;;972:26:1;:10;:26;964:35;;;;;;2118:26;2129:14;2118:10;:26::i;:::-;2047:102;:::o;2617:174::-;986:12;:10;:12::i;:::-;-1:-1:-1;;;;;972:26:1;:10;:26;964:35;;;;;;2715:25;2725:14;2715:9;:25::i;:::-;2754:14;-1:-1:-1;;;;;2754:27:1;2782:4;2754:33;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;90:11;;;84:18;71:11;;;64:39;52:2;45:10;8:100;;;12:14;2754:33:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2746:42;;;;;;;;2617:174;;:::o;1652:212::-;986:12;:10;:12::i;:::-;-1:-1:-1;;;;;972:26:1;:10;:26;964:35;;;;;;-1:-1:-1;;;;;1738:22:1;;;;1730:31;;;;;;1772:49;1798:12;:10;:12::i;:::-;1772:49;;;-1:-1:-1;;;;;1772:49:1;;;;;;;;;;;;;;;;;;;;;1827:32;1850:8;1827:22;:32::i;1607:252:3:-;1669:29;1701:16;:14;:16::i;:::-;1669:48;-1:-1:-1;;;;;;1731:42:3;;;;;;;;1723:51;;;;;;1780:36;1798:17;1780;:36::i;:::-;1827:27;;-1:-1:-1;;;;;1827:27:3;;;;;;;;1607:252;;:::o;1320:171:1:-;645:39;;;;;;;;;;;;;;;;1450:31;1442:45::o;1179:275:3:-;1345:16;1256:37;1275:17;1256:18;:37::i;:::-;1248:91;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;614:48:3;;;;;;;;;;;;;;;;;;;;;1409:35;1401:49::o;404:616:0:-;464:4;967:20;;1005:8;;404:616::o
Swarm Source
bzzr://b49b00462e173216d7a6030b7a8d6de13dc008758307ef4f1a89e61a069fbd03
Age | Block | Fee Address | Jailed | Incoming |
---|