Verified contractPartialLGPL-3.0-only
SafeProxy
Address0xba9791f15f4d3d786caaa6d5d823e60ecb5dedfb
- Balance
0 ETH
- Transactions
2
- Compiler
solc 0.8.26
- Same code
1 more contract
Details
- Compiler
- solc 0.8.26+commit.8a97fa7a
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- paris
- License
- LGPL-3.0-only
- Match
- Partialcreation code: no, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,298,857
- Creation transaction
- 0x0598e49063…b6abfedb4c
node_modules/@safe-global/safe-contracts/contracts/proxies/SafeProxy.sol
// SPDX-License-Identifier: LGPL-3.0-only
pragma solidity >=0.7.0 <0.9.0;
/**
* @title IProxy - Helper interface to access the singleton address of the Proxy on-chain.
* @author Richard Meissner - @rmeissner
*/
interface IProxy {
function masterCopy() external view returns (address);
}
/**
* @title SafeProxy - 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 SafeProxy {
// 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;
/**
* @notice 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())
}
}
}
Compiler settingsShow
{
"viaIR": false,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"libraries": {},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "paris",
"remappings": [
"@rhinestone/=node_modules/@rhinestone/",
"sentinellist/=node_modules/@rhinestone/sentinellist/src/",
"erc4337-validation/=node_modules/@rhinestone/erc4337-validation/src/",
"safe7579/=node_modules/@rhinestone/safe7579/src/",
"modulekit/=node_modules/@rhinestone/modulekit/src/",
"module-bases/=node_modules/@rhinestone/module-bases/src/",
"@ERC4337/=node_modules/@ERC4337/",
"account-abstraction/=node_modules/@ERC4337/account-abstraction/contracts/",
"account-abstraction-v0.6/=node_modules/@ERC4337/account-abstraction-v0.6/contracts/",
"@openzeppelin/=node_modules/@openzeppelin/",
"@safe-global/=node_modules/@safe-global/",
"ds-test/=node_modules/ds-test/src/",
"erc7579/=node_modules/erc7579/src/",
"forge-std/=node_modules/forge-std/src/",
"solady/=node_modules/solady/src/",
"solarray/=node_modules/solarray/src/",
"@prb/math/=node_modules/@prb/math/src/",
"ether-email-auth/=node_modules/ether-email-auth/",
"@zk-email/contracts/=node_modules/@zk-email/contracts/",
"solidity-stringutils/=node_modules/solidity-stringutils/",
"@matterlabs/zksync-contracts/l2/contracts/=src/libraries/",
"erc7579-implementation/=node_modules/erc7579-implementation/",
"kernel/=node_modules/@zerodev/kernel/src/",
"ExcessivelySafeCall/=node_modules/excessively-safe-call/src/",
"@safe-global/safe-contracts/=node_modules/@safe-global/safe-contracts/",
"@email-wallet/=node_modules/@email-wallet/",
"@gnosis.pm/=node_modules/@gnosis.pm/",
"@uniswap/=node_modules/@uniswap/",
"@zerodev/=node_modules/@zerodev/",
"accountabstraction/=node_modules/accountabstraction/",
"base64-sol/=node_modules/base64-sol/",
"email-wallet-sdk/=node_modules/email-wallet-sdk/",
"excessively-safe-call/=node_modules/excessively-safe-call/",
"hardhat-deploy/=node_modules/hardhat-deploy/",
"hardhat/=node_modules/hardhat/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.