Discover more of Etherscan's tools and services in one place.
Sponsored
Contract Source Code:
File 1 of 1 : BeaconProxy
// File contracts/beacon/IBeacon.sol pragma solidity ^0.8.0; interface IBeacon { function latestCopy() external view returns(address); } // File contracts/beacon/BeaconProxy.sol pragma solidity ^0.8.0; contract BeaconProxy { bytes32 private constant BEACON_SLOT = keccak256(abi.encodePacked("fairmint.beaconproxy.beacon")); constructor() public { _setBeacon(msg.sender); } function _setBeacon(address _beacon) private { bytes32 slot = BEACON_SLOT; assembly { sstore(slot, _beacon) } } function _getBeacon() internal view returns(address beacon) { bytes32 slot = BEACON_SLOT; assembly { beacon := sload(slot) } } function _getMasterCopy() internal view returns(address) { IBeacon beacon = IBeacon(_getBeacon()); return beacon.latestCopy(); } fallback() external payable { address copy = _getMasterCopy(); assembly { calldatacopy(0, 0, calldatasize()) let result := delegatecall(gas(), copy, 0, calldatasize(), 0, 0) let size := returndatasize() returndatacopy(0, 0, size) switch result case 0 { revert(0, size) } default { return(0, size) } } } }
Please enter a contract address above to load the contract details and source code.
Please DO NOT store any passwords or private keys here. A private note (up to 100 characters) can be saved and is useful for transaction tracking.
My Name Tag:
Private Note:
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.