Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0x462340b61e2ae2C13f01F66B727d1bFDc907E53e
Balance 0 ETH
Nonce 1
Code Size 430 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

430 bytes
0x6080604052600436106100225760003560e01c806359659e901461003957610031565b366100315761002f610089565b005b61002f610089565b34801561004557600080fd5b5061006d7f000000000000000000000000cafeac0ff5da0a2777d915531bfa6b29d282ee6281565b6040516001600160a01b03909116815260200160405180910390f35b61009961009461009b565b610124565b565b60007f000000000000000000000000cafeac0ff5da0a2777d915531bfa6b29d282ee626001600160a01b0316632aa8195e6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061011f9190610148565b905090565b3660008037600080366000845af43d6000803e808015610143573d6000f35b3d6000fd5b60006020828403121561015a57600080fd5b81516001600160a01b038116811461017157600080fd5b939250505056fea2646970667358221220debdeb5af99b4613a4491f8e8ab7124e948738d7ebb94f66bb5e193d53de655c64736f6c63430008120033

Verified Source Code Full Match

Compiler: v0.8.18+commit.87f61d96 EVM: paris Optimization: Yes (200 runs)
Proxy.sol 86 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)

pragma solidity ^0.8.0;

/**
 * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM
 * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to
 * be specified by overriding the virtual {_implementation} function.
 *
 * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a
 * different contract through the {_delegate} function.
 *
 * The success and return data of the delegated call will be returned back to the caller of the proxy.
 */
abstract contract Proxy {
    /**
     * @dev Delegates the current call to `implementation`.
     *
     * This function does not return to its internal call site, it will return directly to the external caller.
     */
    function _delegate(address implementation) internal virtual {
        assembly {
            // 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.
            let result := delegatecall(gas(), implementation, 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())
            }
        }
    }

    /**
     * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function
     * and {_fallback} should delegate.
     */
    function _implementation() internal view virtual returns (address);

    /**
     * @dev Delegates the current call to the address returned by `_implementation()`.
     *
     * This function does not return to its internal call site, it will return directly to the external caller.
     */
    function _fallback() internal virtual {
        _beforeFallback();
        _delegate(_implementation());
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other
     * function in the contract matches the call data.
     */
    fallback() external payable virtual {
        _fallback();
    }

    /**
     * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data
     * is empty.
     */
    receive() external payable virtual {
        _fallback();
    }

    /**
     * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`
     * call, or as part of the Solidity `fallback` or `receive` functions.
     *
     * If overridden should call `super._beforeFallback()`.
     */
    function _beforeFallback() internal virtual {}
}
IStakingPoolBeacon.sol 15 lines
// SPDX-License-Identifier: MIT

pragma solidity >=0.5.0;

/**
 * @dev This is the interface that {BeaconProxy} expects of its beacon.
 */
interface IStakingPoolBeacon {
  /**
   * @dev Must return an address that can be used as a delegate call target.
   *
   * {BeaconProxy} will check that this address is a contract.
   */
  function stakingPoolImplementation() external view returns (address);
}
IStakingPoolFactory.sol 14 lines
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity >=0.5.0;

interface IStakingPoolFactory {

  function stakingPoolCount() external view returns (uint);

  function beacon() external view returns (address);

  function create(address beacon) external returns (uint poolId, address stakingPoolAddress);

  event StakingPoolCreated(uint indexed poolId, address indexed stakingPoolAddress);
}
MinimalBeaconProxy.sol 43 lines
// SPDX-License-Identifier: GPL-3.0-only

pragma solidity ^0.8.18;

import "@openzeppelin/contracts-v4/proxy/Proxy.sol";
import "../../interfaces/IStakingPoolBeacon.sol";
import "../../interfaces/IStakingPoolFactory.sol";

/**
 * @dev This contract implements a proxy that gets the implementation address for each call from a {UpgradeableBeacon}.
 *
 * The beacon address is stored as an immutable field.
 *
 */
contract MinimalBeaconProxy is Proxy {

  /**
   * @dev The beacon address.
   */
  address immutable public beacon;

  /**
   * @dev Initializes the proxy with `beacon`.
   *
   */
  constructor() {
    beacon = IStakingPoolFactory(msg.sender).beacon();
  }

  /**
   * @dev Returns the current beacon address.
   */
  function _beacon() internal view virtual returns (address) {
    return beacon;
  }

  /**
   * @dev Returns the current implementation address of the associated beacon.
   */
  function _implementation() internal view virtual override returns (address) {
    return IStakingPoolBeacon(beacon).stakingPoolImplementation();
  }
}

Read Contract

beacon 0x59659e90 → address

Recent Transactions

No transactions found for this address