Address Contract Verified
Address
0x5201ac45Aa019018bdb355D35992cCE4bAe04BcA
Balance
0 ETH
Nonce
2
Code Size
2583 bytes
Creator
0xB1a2a323...fBA6 at tx 0x2afed828...259e40
Indexed Transactions
0
Contract Bytecode
2583 bytes
0x608060405234801561001057600080fd5b50600436106100625760003560e01c80631688f0b9146100675780632500510e1461009757806353e5d935146100aa57806361b69abd146100bf578063addacc0f146100d2578063d18af54d146100da575b600080fd5b61007a61007536600461057d565b6100ed565b6040516001600160a01b0390911681526020015b60405180910390f35b61007a6100a53660046105d6565b610169565b6100b26101fe565b60405161008e91906106bd565b61007a6100cd3660046106d7565b610228565b6100b26102d2565b61007a6100e8366004610727565b6102e4565b60006100fa8484846103ba565b83519091501561011f5760008060008551602087016000865af1141561011f57600080fd5b604080516001600160a01b038084168252861660208201527f4f51faf6c4561ff95f067657e43439f0f856d97c04d9ec9070a6199ad418e235910160405180910390a19392505050565b60006101ad8585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152508792506103ba915050565b6040516bffffffffffffffffffffffff19606083901b16602082015290915060340160408051601f198184030181529082905262461bcd60e51b82526101f5916004016106bd565b60405180910390fd5b606060405180602001610210906104a9565b601f1982820381018352601f90910116604052919050565b600082604051610237906104a9565b6001600160a01b039091168152602001604051809103906000f080158015610263573d6000803e3d6000fd5b508251909150156102895760008060008451602086016000865af1141561028957600080fd5b604080516001600160a01b038084168252851660208201527f4f51faf6c4561ff95f067657e43439f0f856d97c04d9ec9070a6199ad418e235910160405180910390a192915050565b606060405180602001610210906104b6565b600080838360405160200161031592919091825260601b6bffffffffffffffffffffffff1916602082015260340190565b6040516020818303038152906040528051906020012060001c905061033b8686836100ed565b91506001600160a01b038316156103b1576040516303ca56a360e31b81526001600160a01b03841690631e52b5189061037e9085908a908a908a90600401610793565b600060405180830381600087803b15801561039857600080fd5b505af11580156103ac573d6000803e3d6000fd5b505050505b50949350505050565b6000808380519060200120836040516020016103e0929190918252602082015260400190565b60405160208183030381529060405280519060200120905060006040518060200161040a906104a9565b601f1982820381018352601f90910116604081905261043791906001600160a01b038916906020016107d0565b6040516020818303038152906040529050818151826020016000f592506001600160a01b0383166104a05760405162461bcd60e51b815260206004820152601360248201527210dc99585d194c8818d85b1b0819985a5b1959606a1b60448201526064016101f5565b50509392505050565b610173806107f383390190565b607c8061096683390190565b6001600160a01b03811681146104d757600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261050157600080fd5b813567ffffffffffffffff8082111561051c5761051c6104da565b604051601f8301601f19908116603f01168101908282118183101715610544576105446104da565b8160405283815286602085880101111561055d57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60008060006060848603121561059257600080fd5b833561059d816104c2565b9250602084013567ffffffffffffffff8111156105b957600080fd5b6105c5868287016104f0565b925050604084013590509250925092565b600080600080606085870312156105ec57600080fd5b84356105f7816104c2565b9350602085013567ffffffffffffffff8082111561061457600080fd5b818701915087601f83011261062857600080fd5b81358181111561063757600080fd5b88602082850101111561064957600080fd5b95986020929092019750949560400135945092505050565b60005b8381101561067c578181015183820152602001610664565b8381111561068b576000848401525b50505050565b600081518084526106a9816020860160208601610661565b601f01601f19169290920160200192915050565b6020815260006106d06020830184610691565b9392505050565b600080604083850312156106ea57600080fd5b82356106f5816104c2565b9150602083013567ffffffffffffffff81111561071157600080fd5b61071d858286016104f0565b9150509250929050565b6000806000806080858703121561073d57600080fd5b8435610748816104c2565b9350602085013567ffffffffffffffff81111561076457600080fd5b610770878288016104f0565b935050604085013591506060850135610788816104c2565b939692955090935050565b6001600160a01b038581168252841660208201526080604082018190526000906107bf90830185610691565b905082606083015295945050505050565b600083516107e2818460208801610661565b919091019182525060200191905056fe608060405234801561001057600080fd5b5060405161017338038061017383398101604081905261002f916100b9565b6001600160a01b0381166100945760405162461bcd60e51b815260206004820152602260248201527f496e76616c69642073696e676c65746f6e20616464726573732070726f766964604482015261195960f21b606482015260840160405180910390fd5b600080546001600160a01b0319166001600160a01b03929092169190911790556100e9565b6000602082840312156100cb57600080fd5b81516001600160a01b03811681146100e257600080fd5b9392505050565b607c806100f76000396000f3fe6080604052600080546001600160a01b0316813563530ca43760e11b1415602857808252602082f35b3682833781823684845af490503d82833e806041573d82fd5b503d81f3fea2646970667358221220ddcca29f0742fe0a7d685d6e4b92c4f08e5e582f153c4e3bd42e22ced603150064736f6c634300080900336080604052600080546001600160a01b0316813563530ca43760e11b1415602857808252602082f35b3682833781823684845af490503d82833e806041573d82fd5b503d81f3fea2646970667358221220ddcca29f0742fe0a7d685d6e4b92c4f08e5e582f153c4e3bd42e22ced603150064736f6c63430008090033a26469706673582212202d01f191ebfd1a5b8a703f874d68f7a648d2d077b16a81e39b37fe1719b7ba6564736f6c63430008090033
Verified Source Code Full Match
Compiler: v0.8.9+commit.e5eed63a
EVM: london
Optimization: Yes (200 runs)
GnosisSafeProxy.sol 44 lines
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; /// @title IProxy - Helper interface to access masterCopy of the Proxy on-chain /// @author Richard Meissner - <[email protected]> interface IProxy { function masterCopy() external view returns (address); } /// @title GnosisSafeProxy - Generic proxy contract allows to execute all transactions applying the code of a master contract. /// @author Stefan George - <[email protected]> /// @author Richard Meissner - <[email protected]> contract GnosisSafeProxy { // singleton always needs to be first declared variable, to ensure that it is at the same location in the contracts to which calls are delegated. // To reduce deployment costs this variable is internal and needs to be retrieved via `getStorageAt` address internal singleton; /// @dev Constructor function sets address of singleton contract. /// @param _singleton Singleton address. constructor(address _singleton) { require(_singleton != address(0), "Invalid singleton address provided"); singleton = _singleton; } /// @dev Fallback function forwards all transactions and returns all received return data. fallback() external payable { // solhint-disable-next-line no-inline-assembly assembly { let _singleton := and(sload(0), 0xffffffffffffffffffffffffffffffffffffffff) // 0xa619486e == keccak("masterCopy()"). The value is right padded to 32-bytes with 0s if eq(calldataload(0), 0xa619486e00000000000000000000000000000000000000000000000000000000) { mstore(0, _singleton) return(0, 0x20) } calldatacopy(0, 0, calldatasize()) let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0) returndatacopy(0, 0, returndatasize()) if eq(success, 0) { revert(0, returndatasize()) } return(0, returndatasize()) } } }
GnosisSafeProxyFactory.sol 107 lines
// SPDX-License-Identifier: LGPL-3.0-only pragma solidity >=0.7.0 <0.9.0; import "./GnosisSafeProxy.sol"; import "./IProxyCreationCallback.sol"; /// @title Proxy Factory - Allows to create new proxy contact and execute a message call to the new proxy within one transaction. /// @author Stefan George - <[email protected]> contract GnosisSafeProxyFactory { event ProxyCreation(GnosisSafeProxy proxy, address singleton); /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction. /// @param singleton Address of singleton contract. /// @param data Payload for message call sent to new proxy contract. function createProxy(address singleton, bytes memory data) public returns (GnosisSafeProxy proxy) { proxy = new GnosisSafeProxy(singleton); if (data.length > 0) // solhint-disable-next-line no-inline-assembly assembly { if eq(call(gas(), proxy, 0, add(data, 0x20), mload(data), 0, 0), 0) { revert(0, 0) } } emit ProxyCreation(proxy, singleton); } /// @dev Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed. function proxyRuntimeCode() public pure returns (bytes memory) { return type(GnosisSafeProxy).runtimeCode; } /// @dev Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address. function proxyCreationCode() public pure returns (bytes memory) { return type(GnosisSafeProxy).creationCode; } /// @dev Allows to create new proxy contact using CREATE2 but it doesn't run the initializer. /// This method is only meant as an utility to be called from other methods /// @param _singleton Address of singleton contract. /// @param initializer Payload for message call sent to new proxy contract. /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract. function deployProxyWithNonce( address _singleton, bytes memory initializer, uint256 saltNonce ) internal returns (GnosisSafeProxy proxy) { // If the initializer changes the proxy address should change too. Hashing the initializer data is cheaper than just concatinating it bytes32 salt = keccak256(abi.encodePacked(keccak256(initializer), saltNonce)); bytes memory deploymentData = abi.encodePacked(type(GnosisSafeProxy).creationCode, uint256(uint160(_singleton))); // solhint-disable-next-line no-inline-assembly assembly { proxy := create2(0x0, add(0x20, deploymentData), mload(deploymentData), salt) } require(address(proxy) != address(0), "Create2 call failed"); } /// @dev Allows to create new proxy contact and execute a message call to the new proxy within one transaction. /// @param _singleton Address of singleton contract. /// @param initializer Payload for message call sent to new proxy contract. /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract. function createProxyWithNonce( address _singleton, bytes memory initializer, uint256 saltNonce ) public returns (GnosisSafeProxy proxy) { proxy = deployProxyWithNonce(_singleton, initializer, saltNonce); if (initializer.length > 0) // solhint-disable-next-line no-inline-assembly assembly { if eq(call(gas(), proxy, 0, add(initializer, 0x20), mload(initializer), 0, 0), 0) { revert(0, 0) } } emit ProxyCreation(proxy, _singleton); } /// @dev Allows to create new proxy contact, execute a message call to the new proxy and call a specified callback within one transaction /// @param _singleton Address of singleton contract. /// @param initializer Payload for message call sent to new proxy contract. /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract. /// @param callback Callback that will be invoced after the new proxy contract has been successfully deployed and initialized. function createProxyWithCallback( address _singleton, bytes memory initializer, uint256 saltNonce, IProxyCreationCallback callback ) public returns (GnosisSafeProxy proxy) { uint256 saltNonceWithCallback = uint256(keccak256(abi.encodePacked(saltNonce, callback))); proxy = createProxyWithNonce(_singleton, initializer, saltNonceWithCallback); if (address(callback) != address(0)) callback.proxyCreated(proxy, _singleton, initializer, saltNonce); } /// @dev Allows to get the address for a new proxy contact created via `createProxyWithNonce` /// This method is only meant for address calculation purpose when you use an initializer that would revert, /// therefore the response is returned with a revert. When calling this method set `from` to the address of the proxy factory. /// @param _singleton Address of singleton contract. /// @param initializer Payload for message call sent to new proxy contract. /// @param saltNonce Nonce that will be used to generate the salt to calculate the address of the new proxy contract. function calculateCreateProxyWithNonceAddress( address _singleton, bytes calldata initializer, uint256 saltNonce ) external returns (GnosisSafeProxy proxy) { proxy = deployProxyWithNonce(_singleton, initializer, saltNonce); revert(string(abi.encodePacked(proxy))); } }
IProxyCreationCallback.sol 12 lines
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;
import "./GnosisSafeProxy.sol";
interface IProxyCreationCallback {
function proxyCreated(
GnosisSafeProxy proxy,
address _singleton,
bytes calldata initializer,
uint256 saltNonce
) external;
}
Read Contract
proxyCreationCode 0x53e5d935 → bytes
proxyRuntimeCode 0xaddacc0f → bytes
Write Contract 4 functions
These functions modify contract state and require a wallet transaction to execute.
calculateCreateProxyWithNonceAddress 0x2500510e
address _singleton
bytes initializer
uint256 saltNonce
returns: address
createProxy 0x61b69abd
address singleton
bytes data
returns: address
createProxyWithCallback 0xd18af54d
address _singleton
bytes initializer
uint256 saltNonce
address callback
returns: address
createProxyWithNonce 0x1688f0b9
address _singleton
bytes initializer
uint256 saltNonce
returns: address
Recent Transactions
No transactions found for this address