Contract
0xF65Ee62a5a4B65133c192D2454C3C1779dfED892
2
Contract Overview
My Name Tag:
Not Available, login to update
[ Download CSV Export ]
Contract Name:
UpgradableProxy
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity)
/** *Submitted for verification at moonriver.moonscan.io on 2021-10-28 */ /** *Submitted for verification at polygonscan.com on 2021-06-09 */ // SPDX-License-Identifier: MIT pragma solidity 0.6.12; interface IERCProxy { function proxyType() external pure returns (uint256 proxyTypeId); function implementation() external view returns (address codeAddr); } abstract contract Proxy is IERCProxy { function delegatedFwd(address _dst, bytes memory _calldata) internal { // solium-disable-next-line security/no-inline-assembly assembly { let result := delegatecall(sub(gas(), 10000), _dst, add(_calldata, 0x20), mload(_calldata), 0, 0) let size := returndatasize() let ptr := mload(0x40) returndatacopy(ptr, 0, size) // revert instead of invalid() bc if the underlying call failed with invalid() it already wasted gas. // if the call returned error data, forward it switch result case 0 { revert(ptr, size) } default { return(ptr, size) } } } function proxyType() external pure virtual override returns (uint256 proxyTypeId) { // Upgradeable proxy proxyTypeId = 2; } function implementation() external view virtual override returns (address); } contract UpgradableProxy is Proxy { event ProxyUpdated(address indexed _new, address indexed _old); event ProxyOwnerUpdate(address _new, address _old); bytes32 constant IMPLEMENTATION_SLOT = keccak256("matic.network.proxy.implementation"); bytes32 constant OWNER_SLOT = keccak256("matic.network.proxy.owner"); constructor(address _proxyTo) public { setProxyOwner(msg.sender); setImplementation(_proxyTo); } fallback() external payable { delegatedFwd(loadImplementation(), msg.data); } receive() external payable { delegatedFwd(loadImplementation(), msg.data); } modifier onlyProxyOwner() { require(loadProxyOwner() == msg.sender, "NOT_OWNER"); _; } function proxyOwner() external view returns (address) { return loadProxyOwner(); } function loadProxyOwner() internal view returns (address) { address _owner; bytes32 position = OWNER_SLOT; assembly { _owner := sload(position) } return _owner; } function implementation() external view override returns (address) { return loadImplementation(); } function loadImplementation() internal view returns (address) { address _impl; bytes32 position = IMPLEMENTATION_SLOT; assembly { _impl := sload(position) } return _impl; } function transferProxyOwnership(address newOwner) public onlyProxyOwner { require(newOwner != address(0), "ZERO_ADDRESS"); emit ProxyOwnerUpdate(newOwner, loadProxyOwner()); setProxyOwner(newOwner); } function setProxyOwner(address newOwner) private { bytes32 position = OWNER_SLOT; assembly { sstore(position, newOwner) } } function updateImplementation(address _newProxyTo) public onlyProxyOwner { require(_newProxyTo != address(0x0), "INVALID_PROXY_ADDRESS"); require(isContract(_newProxyTo), "DESTINATION_ADDRESS_IS_NOT_A_CONTRACT"); emit ProxyUpdated(_newProxyTo, loadImplementation()); setImplementation(_newProxyTo); } function updateAndCall(address _newProxyTo, bytes memory data) public payable onlyProxyOwner { updateImplementation(_newProxyTo); (bool success, bytes memory returnData) = address(this).call{value: msg.value}(data); require(success, string(returnData)); } function setImplementation(address _newProxyTo) private { bytes32 position = IMPLEMENTATION_SLOT; assembly { sstore(position, _newProxyTo) } } function isContract(address _target) internal view returns (bool) { if (_target == address(0)) { return false; } uint256 size; assembly { size := extcodesize(_target) } return size > 0; } } contract UChildERC20Proxy is UpgradableProxy { constructor(address _proxyTo) public UpgradableProxy(_proxyTo) {} }
[{"inputs":[{"internalType":"address","name":"_proxyTo","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_new","type":"address"},{"indexed":false,"internalType":"address","name":"_old","type":"address"}],"name":"ProxyOwnerUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_new","type":"address"},{"indexed":true,"internalType":"address","name":"_old","type":"address"}],"name":"ProxyUpdated","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxyOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxyType","outputs":[{"internalType":"uint256","name":"proxyTypeId","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferProxyOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newProxyTo","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"updateAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_newProxyTo","type":"address"}],"name":"updateImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801561001057600080fd5b506040516109fd3803806109fd8339818101604052602081101561003357600080fd5b505161003e3361004d565b61004781610071565b50610095565b7f44f6e2e8884cba1236b7f22f351fa5d88b17292b7e0225ca47e5ecdf6055cdd655565b7fbaab7dbf64751104133af04abc7d9979f0fda3b059a322a8333f533d3f32bf7f55565b610959806100a46000396000f3fe6080604052600436106100695760003560e01c80635c60da1b116100435780635c60da1b14610168578063d88ca2c81461017d578063f1739cae14610240576100b8565b8063025313a2146100c3578063025b22bc146101015780634555d5c914610141576100b8565b366100b8576100b6610079610280565b6000368080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506102a592505050565b005b6100b6610079610280565b3480156100cf57600080fd5b506100d86102cd565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561010d57600080fd5b506100b66004803603602081101561012457600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166102dc565b34801561014d57600080fd5b506101566104b4565b60408051918252519081900360200190f35b34801561017457600080fd5b506100d86104b9565b6100b66004803603604081101561019357600080fd5b73ffffffffffffffffffffffffffffffffffffffff82351691908101906040810160208201356401000000008111156101cb57600080fd5b8201836020820111156101dd57600080fd5b803590602001918460018302840111640100000000831117156101ff57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506104c3945050505050565b34801561024c57600080fd5b506100b66004803603602081101561026357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166106d9565b7fbaab7dbf64751104133af04abc7d9979f0fda3b059a322a8333f533d3f32bf7f5490565b600080825160208401856127105a03f43d604051816000823e8280156102c9578282f35b8282fd5b60006102d7610861565b905090565b336102e5610861565b73ffffffffffffffffffffffffffffffffffffffff161461036757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e45520000000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81166103e957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f494e56414c49445f50524f58595f414444524553530000000000000000000000604482015290519081900360640190fd5b6103f281610886565b610447576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806108ff6025913960400191505060405180910390fd5b61044f610280565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fd32d24edea94f55e932d9a008afc425a8561462d1b1f57bc6e508e9a6b9509e160405160405180910390a36104b1816108b6565b50565b600290565b60006102d7610280565b336104cc610861565b73ffffffffffffffffffffffffffffffffffffffff161461054e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e45520000000000000000000000000000000000000000000000604482015290519081900360640190fd5b610557826102dc565b600060603073ffffffffffffffffffffffffffffffffffffffff1634846040518082805190602001908083835b602083106105c157805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101610584565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610623576040519150601f19603f3d011682016040523d82523d6000602084013e610628565b606091505b50915091508181906106d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561069757818101518382015260200161067f565b50505050905090810190601f1680156106c45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5050505050565b336106e2610861565b73ffffffffffffffffffffffffffffffffffffffff161461076457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e45520000000000000000000000000000000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81166107e657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f5a45524f5f414444524553530000000000000000000000000000000000000000604482015290519081900360640190fd5b7fdbe5fd65bcdbae152f24ab660ea68e72b4d4705b57b16e0caae994e214680ee281610810610861565b604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a16104b1816108da565b7f44f6e2e8884cba1236b7f22f351fa5d88b17292b7e0225ca47e5ecdf6055cdd65490565b600073ffffffffffffffffffffffffffffffffffffffff82166108ab575060006108b1565b50803b15155b919050565b7fbaab7dbf64751104133af04abc7d9979f0fda3b059a322a8333f533d3f32bf7f55565b7f44f6e2e8884cba1236b7f22f351fa5d88b17292b7e0225ca47e5ecdf6055cdd65556fe44455354494e4154494f4e5f414444524553535f49535f4e4f545f415f434f4e5452414354a2646970667358221220fc8f568d752bb332c7ff6628f2a5e69ea7b4cbc446e5b588577fb9462553d0a364736f6c634300060c0033000000000000000000000000748581c161f36b4824e1eb379504637101cd1c37
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000748581c161f36b4824e1eb379504637101cd1c37
-----Decoded View---------------
Arg [0] : _proxyTo (address): 0x748581c161f36b4824e1eb379504637101cd1c37
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000748581c161f36b4824e1eb379504637101cd1c37
Deployed ByteCode Sourcemap
1377:3019:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1980:44;1993:20;:18;:20::i;:::-;2015:8;;1980:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1980:12:0;;-1:-1:-1;;;1980:44:0:i;:::-;1377:3019;;1882:44;1895:20;:18;:20::i;2157:96::-;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;3274:345;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3274:345:0;;;;:::i;1141:146::-;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;2494:113;;;;;;;;;;;;;:::i;3627:289::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3627:289:0;;-1:-1:-1;3627:289:0;;-1:-1:-1;;;;;3627:289:0:i;2858:232::-;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2858:232:0;;;;:::i;2615:235::-;1585:47;2794:15;2615:235;:::o;354:779::-;618:1;615;603:9;597:16;590:4;579:9;575:20;569:4;561:5;554;550:17;537:83;646:16;695:4;689:11;737:4;734:1;729:3;714:28;940:6;964:66;;;;1091:4;1086:3;1079:17;964:66;1006:4;1001:3;994:17;2157:96;2202:7;2229:16;:14;:16::i;:::-;2222:23;;2157:96;:::o;3274:345::-;2105:10;2085:16;:14;:16::i;:::-;:30;;;2077:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3366:27:::1;::::0;::::1;3358:61;;;::::0;;::::1;::::0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;3438:23;3449:11;3438:10;:23::i;:::-;3430:73;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3547:20;:18;:20::i;:::-;3521:47;;3534:11;3521:47;;;;;;;;;;;;3581:30;3599:11;3581:17;:30::i;:::-;3274:345:::0;:::o;1141:146::-;1278:1;;1141:146::o;2494:113::-;2552:7;2579:20;:18;:20::i;3627:289::-;2105:10;2085:16;:14;:16::i;:::-;:30;;;2077:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3731:33:::1;3752:11;3731:20;:33::i;:::-;3778:12;3792:23;3827:4;3819:18;;3845:9;3856:4;3819:42;;;;;;;;;;;;;;;;;;;::::0;;;;;;;;;::::1;::::0;;::::1;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3777:84;;;;3880:7;3896:10;3872:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;;::::1;::::0;;;::::1;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2140:1;;3627:289:::0;;:::o;2858:232::-;2105:10;2085:16;:14;:16::i;:::-;:30;;;2077:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2949:22:::1;::::0;::::1;2941:47;;;::::0;;::::1;::::0;;::::1;;::::0;::::1;::::0;::::1;::::0;;;;::::1;::::0;;;;;;;;;;;;;::::1;;3004:44;3021:8;3031:16;:14;:16::i;:::-;3004:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;3059:23;3073:8;3059:13;:23::i;2261:225::-:0;1669:38;2429:15;2261:225;:::o;4119:274::-;4179:4;4200:21;;;4196:66;;-1:-1:-1;4245:5:0;4238:12;;4196:66;-1:-1:-1;4329:20:0;;4377:8;;4119:274;;;;:::o;3924:187::-;1585:47;4064:29;4049:55::o;3098:168::-;1669:38;3222:26;3207:52::o
Swarm Source
ipfs://fc8f568d752bb332c7ff6628f2a5e69ea7b4cbc446e5b588577fb9462553d0a3
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.