Verified contractExactMIT
InitializedProxy
Address0x2604e9f68259e609e8744fb67cc410d50fc9aa0f
- Balance
6.039414 ETH
- Transactions
7,727
- Compiler
solc 0.8.5
- Same code
7,106 more contracts
Details
- Compiler
- solc 0.8.5+commit.a4f2e591
- Language
- solidity
- Optimization
- Yes, 1,000 runs
- EVM version
- berlin
- License
- MIT
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 13,395,540
- Creation transaction
- 0xd6798d7329…b3f619876d
- Main copy (most transactions)
- 0xdfdb7f72…b0635346
contracts/InitializedProxy.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @title InitializedProxy
* @author Anna Carroll
*/
contract InitializedProxy {
// 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)
}
}
}
// ======== Receive =========
receive() external payable {} // solhint-disable-line no-empty-blocks
}Compiler settingsShow
{
"metadata": {
"bytecodeHash": "ipfs"
},
"libraries": {},
"optimizer": {
"runs": 1000,
"enabled": true
},
"evmVersion": "berlin",
"remappings": []
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.