Contract
0x4200000000000000000000000000000000000007
13
Contract Overview
Balance:
0 ETH
Token:
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Latest 25 Deposits
[ Download CSV Export ]
Contract Name:
Proxy
Compiler Version
v0.8.15+commit.e14f2714
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.15; /** * @title Proxy * @notice Proxy is a transparent proxy that passes through the call if the caller is the owner or * if the caller is address(0), meaning that the call originated from an off-chain * simulation. */ contract Proxy { /** * @notice The storage slot that holds the address of the implementation. * bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1) */ bytes32 internal constant IMPLEMENTATION_KEY = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @notice The storage slot that holds the address of the owner. * bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1) */ bytes32 internal constant OWNER_KEY = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @notice An event that is emitted each time the implementation is changed. This event is part * of the EIP-1967 specification. * * @param implementation The address of the implementation contract */ event Upgraded(address indexed implementation); /** * @notice An event that is emitted each time the owner is upgraded. This event is part of the * EIP-1967 specification. * * @param previousAdmin The previous owner of the contract * @param newAdmin The new owner of the contract */ event AdminChanged(address previousAdmin, address newAdmin); /** * @notice A modifier that reverts if not called by the owner or by address(0) to allow * eth_call to interact with this proxy without needing to use low-level storage * inspection. We assume that nobody is able to trigger calls from address(0) during * normal EVM execution. */ modifier proxyCallIfNotAdmin() { if (msg.sender == _getAdmin() || msg.sender == address(0)) { _; } else { // This WILL halt the call frame on completion. _doProxyCall(); } } /** * @notice Sets the initial admin during contract deployment. Admin address is stored at the * EIP-1967 admin storage slot so that accidental storage collision with the * implementation is not possible. * * @param _admin Address of the initial contract admin. Admin as the ability to access the * transparent proxy interface. */ constructor(address _admin) { _changeAdmin(_admin); } // slither-disable-next-line locked-ether receive() external payable { // Proxy call by default. _doProxyCall(); } // slither-disable-next-line locked-ether fallback() external payable { // Proxy call by default. _doProxyCall(); } /** * @notice Set the implementation contract address. The code at the given address will execute * when this contract is called. * * @param _implementation Address of the implementation contract. */ function upgradeTo(address _implementation) external proxyCallIfNotAdmin { _setImplementation(_implementation); } /** * @notice Set the implementation and call a function in a single transaction. Useful to ensure * atomic execution of initialization-based upgrades. * * @param _implementation Address of the implementation contract. * @param _data Calldata to delegatecall the new implementation with. */ function upgradeToAndCall(address _implementation, bytes calldata _data) external payable proxyCallIfNotAdmin returns (bytes memory) { _setImplementation(_implementation); (bool success, bytes memory returndata) = _implementation.delegatecall(_data); require(success, "Proxy: delegatecall to new implementation contract failed"); return returndata; } /** * @notice Changes the owner of the proxy contract. Only callable by the owner. * * @param _admin New owner of the proxy contract. */ function changeAdmin(address _admin) external proxyCallIfNotAdmin { _changeAdmin(_admin); } /** * @notice Gets the owner of the proxy contract. * * @return Owner address. */ function admin() external proxyCallIfNotAdmin returns (address) { return _getAdmin(); } /** * @notice Queries the implementation address. * * @return Implementation address. */ function implementation() external proxyCallIfNotAdmin returns (address) { return _getImplementation(); } /** * @notice Sets the implementation address. * * @param _implementation New implementation address. */ function _setImplementation(address _implementation) internal { assembly { sstore(IMPLEMENTATION_KEY, _implementation) } emit Upgraded(_implementation); } /** * @notice Changes the owner of the proxy contract. * * @param _admin New owner of the proxy contract. */ function _changeAdmin(address _admin) internal { address previous = _getAdmin(); assembly { sstore(OWNER_KEY, _admin) } emit AdminChanged(previous, _admin); } /** * @notice Performs the proxy call via a delegatecall. */ function _doProxyCall() internal { address impl = _getImplementation(); require(impl != address(0), "Proxy: implementation not initialized"); assembly { // Copy calldata into memory at 0x0....calldatasize. calldatacopy(0x0, 0x0, calldatasize()) // Perform the delegatecall, make sure to pass all available gas. let success := delegatecall(gas(), impl, 0x0, calldatasize(), 0x0, 0x0) // Copy returndata into memory at 0x0....returndatasize. Note that this *will* // overwrite the calldata that we just copied into memory but that doesn't really // matter because we'll be returning in a second anyway. returndatacopy(0x0, 0x0, returndatasize()) // Success == 0 means a revert. We'll revert too and pass the data up. if iszero(success) { revert(0x0, returndatasize()) } // Otherwise we'll just return and pass the data up. return(0x0, returndatasize()) } } /** * @notice Queries the implementation address. * * @return Implementation address. */ function _getImplementation() internal view returns (address) { address impl; assembly { impl := sload(IMPLEMENTATION_KEY) } return impl; } /** * @notice Queries the owner of the proxy contract. * * @return Owner address. */ function _getAdmin() internal view returns (address) { address owner; assembly { owner := sload(OWNER_KEY) } return owner; } }
{ "remappings": [ "@eth-optimism-bedrock/=lib/optimism.git/packages/contracts-bedrock/", "@gnosissafe/contracts/=lib/safe-contracts/contracts/", "@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/", "@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/", "@rari-capital/solmate/=lib/solmate.git/", "ds-test/=lib/solmate.git/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "optimism.git/=lib/optimism.git/", "optimism/=lib/optimism/", "safe-contracts/=lib/safe-contracts/contracts/", "solmate.git/=lib/solmate.git/src/" ], "optimizer": { "enabled": true, "runs": 10000 }, "metadata": { "bytecodeHash": "none" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "evmVersion": "london", "libraries": {} }
[{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_admin","type":"address"}],"name":"changeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_implementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_implementation","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60806040526004361061005e5760003560e01c80635c60da1b116100435780635c60da1b146100be5780638f283970146100f8578063f851a440146101185761006d565b80633659cfe6146100755780634f1ef286146100955761006d565b3661006d5761006b61012d565b005b61006b61012d565b34801561008157600080fd5b5061006b6100903660046106d9565b610224565b6100a86100a33660046106f4565b610296565b6040516100b59190610777565b60405180910390f35b3480156100ca57600080fd5b506100d3610419565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100b5565b34801561010457600080fd5b5061006b6101133660046106d9565b6104b0565b34801561012457600080fd5b506100d3610517565b60006101577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b905073ffffffffffffffffffffffffffffffffffffffff8116610201576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f50726f78793a20696d706c656d656e746174696f6e206e6f7420696e6974696160448201527f6c697a656400000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b3660008037600080366000845af43d6000803e8061021e573d6000fd5b503d6000f35b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061027d575033155b1561028e5761028b816105a3565b50565b61028b61012d565b60606102c07fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806102f7575033155b1561040a57610305846105a3565b6000808573ffffffffffffffffffffffffffffffffffffffff16858560405161032f9291906107ea565b600060405180830381855af49150503d806000811461036a576040519150601f19603f3d011682016040523d82523d6000602084013e61036f565b606091505b509150915081610401576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603960248201527f50726f78793a2064656c656761746563616c6c20746f206e657720696d706c6560448201527f6d656e746174696f6e20636f6e7472616374206661696c65640000000000000060648201526084016101f8565b91506104129050565b61041261012d565b9392505050565b60006104437fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061047a575033155b156104a557507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6104ad61012d565b90565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610509575033155b1561028e5761028b8161060b565b60006105417fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610578575033155b156104a557507fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc81905560405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60006106357fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61038390556040805173ffffffffffffffffffffffffffffffffffffffff8084168252851660208201529192507f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f910160405180910390a15050565b803573ffffffffffffffffffffffffffffffffffffffff811681146106d457600080fd5b919050565b6000602082840312156106eb57600080fd5b610412826106b0565b60008060006040848603121561070957600080fd5b610712846106b0565b9250602084013567ffffffffffffffff8082111561072f57600080fd5b818601915086601f83011261074357600080fd5b81358181111561075257600080fd5b87602082850101111561076457600080fd5b6020830194508093505050509250925092565b600060208083528351808285015260005b818110156107a457858101830151858201604001528201610788565b818111156107b6576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b818382376000910190815291905056fea164736f6c634300080f000a
Deployed ByteCode Sourcemap
294:6844:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2699:14;:12;:14::i;:::-;294:6844;;2844:14;:12;:14::i;3108:125::-;;;;;;;;;;-1:-1:-1;3108:125:0;;;;;:::i;:::-;;:::i;3582:422::-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;4604:117;;;;;;;;;;;;;:::i;:::-;;;1911:42:1;1899:55;;;1881:74;;1869:2;1854:18;4604:117:0;1735:226:1;4171:103:0;;;;;;;;;;-1:-1:-1;4171:103:0;;;;;:::i;:::-;;:::i;4386:99::-;;;;;;;;;;;;;:::i;5476:1067::-;5519:12;5534:20;6793:18;6787:25;;6662:187;5534:20;5519:35;-1:-1:-1;5572:18:0;;;5564:68;;;;;;;2168:2:1;5564:68:0;;;2150:21:1;2207:2;2187:18;;;2180:30;2246:34;2226:18;;;2219:62;2317:7;2297:18;;;2290:35;2342:19;;5564:68:0;;;;;;;;;5754:14;5749:3;5744;5731:38;5928:3;5923;5907:14;5902:3;5896:4;5889:5;5876:56;6225:16;6220:3;6215;6200:42;6349:7;6339:80;;6388:16;6383:3;6376:29;6339:80;;6510:16;6505:3;6498:29;3108:125;7088:9;7082:16;1912:25;;:10;:25;;;:53;;;-1:-1:-1;1941:10:0;:24;1912:53;1908:190;;;3191:35:::1;3210:15;3191:18;:35::i;:::-;3108:125:::0;:::o;1908:190::-;2073:14;:12;:14::i;3582:422::-;3733:12;1926:11;7088:9;7082:16;;6964:172;1926:11;1912:25;;:10;:25;;;:53;;;-1:-1:-1;1941:10:0;:24;1912:53;1908:190;;;3761:35:::1;3780:15;3761:18;:35::i;:::-;3807:12;3821:23:::0;3848:15:::1;:28;;3877:5;;3848:35;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3806:77;;;;3901:7;3893:77;;;::::0;::::1;::::0;;2850:2:1;3893:77:0::1;::::0;::::1;2832:21:1::0;2889:2;2869:18;;;2862:30;2928:34;2908:18;;;2901:62;2999:27;2979:18;;;2972:55;3044:19;;3893:77:0::1;2648:421:1::0;3893:77:0::1;3987:10:::0;-1:-1:-1;1908:190:0;;-1:-1:-1;1908:190:0;;2073:14;:12;:14::i;:::-;3582:422;;;;;:::o;4604:117::-;4668:7;1926:11;7088:9;7082:16;;6964:172;1926:11;1912:25;;:10;:25;;;:53;;;-1:-1:-1;1941:10:0;:24;1912:53;1908:190;;;-1:-1:-1;6793:18:0;6787:25;;4604:117::o;1908:190::-;2073:14;:12;:14::i;:::-;4604:117;:::o;4171:103::-;7088:9;7082:16;1912:25;;:10;:25;;;:53;;;-1:-1:-1;1941:10:0;:24;1912:53;1908:190;;;4247:20:::1;4260:6;4247:12;:20::i;4386:99::-:0;4441:7;1926:11;7088:9;7082:16;;6964:172;1926:11;1912:25;;:10;:25;;;:53;;;-1:-1:-1;1941:10:0;:24;1912:53;1908:190;;;-1:-1:-1;7088:9:0;7082:16;;4604:117::o;4856:194::-;4958:18;4951:43;;;5018:25;;;;;;;;;;;4856:194;:::o;5189:206::-;5246:16;5265:11;7088:9;7082:16;;6964:172;5265:11;5316:9;5309:25;;;5358:30;;;3258:42:1;3327:15;;;3309:34;;3379:15;;3374:2;3359:18;;3352:43;5246:30:0;;-1:-1:-1;5358:30:0;;3221:18:1;5358:30:0;;;;;;;5236:159;5189:206;:::o;14:196:1:-;82:20;;142:42;131:54;;121:65;;111:93;;200:1;197;190:12;111:93;14:196;;;:::o;215:186::-;274:6;327:2;315:9;306:7;302:23;298:32;295:52;;;343:1;340;333:12;295:52;366:29;385:9;366:29;:::i;406:665::-;485:6;493;501;554:2;542:9;533:7;529:23;525:32;522:52;;;570:1;567;560:12;522:52;593:29;612:9;593:29;:::i;:::-;583:39;;673:2;662:9;658:18;645:32;696:18;737:2;729:6;726:14;723:34;;;753:1;750;743:12;723:34;791:6;780:9;776:22;766:32;;836:7;829:4;825:2;821:13;817:27;807:55;;858:1;855;848:12;807:55;898:2;885:16;924:2;916:6;913:14;910:34;;;940:1;937;930:12;910:34;985:7;980:2;971:6;967:2;963:15;959:24;956:37;953:57;;;1006:1;1003;996:12;953:57;1037:2;1033;1029:11;1019:21;;1059:6;1049:16;;;;;406:665;;;;;:::o;1076:654::-;1186:4;1215:2;1244;1233:9;1226:21;1276:6;1270:13;1319:6;1314:2;1303:9;1299:18;1292:34;1344:1;1354:140;1368:6;1365:1;1362:13;1354:140;;;1463:14;;;1459:23;;1453:30;1429:17;;;1448:2;1425:26;1418:66;1383:10;;1354:140;;;1512:6;1509:1;1506:13;1503:91;;;1582:1;1577:2;1568:6;1557:9;1553:22;1549:31;1542:42;1503:91;-1:-1:-1;1646:2:1;1634:15;1651:66;1630:88;1615:104;;;;1721:2;1611:113;;1076:654;-1:-1:-1;;;1076:654:1:o;2372:271::-;2555:6;2547;2542:3;2529:33;2511:3;2581:16;;2606:13;;;2581:16;2372:271;-1:-1:-1;2372:271:1:o
Swarm Source
none