Skip to content
Verified contractExactMIT

NonReceivableInitializedProxy

Address0x56d550c59971b7eb08ff6ff10c8f13c3ecdce09a
Balance

0.0023 ETH

 

Transactions

23

 

Compiler

solc 0.8.5

 

Same code

4,423 more contracts

 

Details

Compiler
solc 0.8.5+commit.a4f2e591
Language
solidity
Optimization
Yes, 999,999 runs
EVM version
berlin
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
15,109,234
Creation transaction
0xb364acce8f…bff815086b
Main copy (most transactions)
0x85ae9267…7b83bf20

contracts/NonReceivableInitializedProxy.sol

// SPDX-License-Identifier: MIT
pragma solidity 0.8.5;

/**
 * @title NonReceivableInitializedProxy
 * @author Anna Carroll
 */
contract NonReceivableInitializedProxy {
    // address of logic contract
    address public immutable logic;

    // ======== Constructor =========

    constructor(
        address _logic,
        bytes memory _initializationCalldata
    ) {
        logic = _logic;
        // Delegatecall into the logic contract, supplying initialization calldata
        (bool _ok, bytes memory returnData) =
            _logic.delegatecall(_initializationCalldata);
        // Revert if delegatecall to implementation reverts
        require(_ok, string(returnData));
    }

    // ======== Fallback =========

    fallback() external payable {
        address _impl = logic;
        assembly {
            let ptr := mload(0x40)
            calldatacopy(ptr, 0, calldatasize())
            let result := delegatecall(gas(), _impl, ptr, calldatasize(), 0, 0)
            let size := returndatasize()
            returndatacopy(ptr, 0, size)

            switch result
                case 0 {
                    revert(ptr, size)
                }
                default {
                    return(ptr, size)
                }
        }
    }
}
Compiler settingsShow
{
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "libraries": {},
  "optimizer": {
    "runs": 999999,
    "enabled": true
  },
  "evmVersion": "berlin",
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.