Discover more of Etherscan's tools and services in one place.
Sponsored
Contract Source Code:
File 1 of 1 : MinimalBeaconProxy.sol
// SPDX-License-Identifier: MIT pragma solidity >=0.8.0; contract MinimalBeaconProxy { bytes32 internal constant BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; constructor() { assembly { sstore(BEACON_SLOT, 0x7A764C5Dff7E8296924fF47Da2C89383494DE1A5) // store beacon address } } fallback() external payable virtual { assembly { let p := mload(0x40) // Call GammaPoolFactory -> getProtocol(uint16) mstore(p, 0xd2c7c2a400000000000000000000000000000000000000000000000000000000) mstore(add(p, 4), 0x0003) let result := staticcall(gas(), 0xFD513630F697A9C1731F196185fb9ebA6eAAc20B, p, 0x24, 0x80, 0x20) if iszero(result) { revert(0, returndatasize()) } let impl := mload(0x80) // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. result := delegatecall(gas(), impl, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } }
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.
This website uses cookies to improve your experience. By continuing to use this website, you agree to its Terms and Privacy Policy.