Skip to content
Verified contractPartialLGPL-3.0-only

SafeProxy

Address0x5bfceadee9b9b12d83369ee04a12950cb47f481d
Balance

0 ETH

 

Transactions

1

 

Compiler

solc 0.7.6

 

Same code

11,899 more contracts

 

Details

Compiler
solc 0.7.6+commit.7338295f
Language
solidity
Optimization
No
EVM version
istanbul
License
LGPL-3.0-only
Match
Partialcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
25,489,391
Creation transaction
0xd61c8572f7…16f44601f1
Main copy (most transactions)
0x4d2fb5f8…70c7e0e4

SafeProxy.sol

// SPDX-License-Identifier: LGPL-3.0-only
/* solhint-disable one-contract-per-file */
pragma solidity >=0.7.0 <0.9.0;

interface IProxy {
    function masterCopy() external view returns (address);
}

contract SafeProxy {
    address internal singleton;

    constructor(address _singleton) {
        require(_singleton != address(0), "Invalid singleton address provided");
        singleton = _singleton;
    }

    fallback() external payable {
        assembly {
            let _singleton := sload(0)
            if eq(shr(224, calldataload(0)), 0xa619486e) {
                mstore(0x6c, shl(96, _singleton))
                return(0x60, 0x20)
            }
            calldatacopy(0, 0, calldatasize())
            let success := delegatecall(gas(), _singleton, 0, calldatasize(), 0, 0)
            returndatacopy(0, 0, returndatasize())
            if iszero(success) {
                revert(0, returndatasize())
            }
            return(0, returndatasize())
        }
    }
}
Compiler settingsShow
{
  "optimizer": {
    "runs": 200,
    "enabled": false
  },
  "evmVersion": "istanbul"
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.