Source Code
Overview
S Balance
More Info
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 8 internal transactions
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
25986357 | 17 hrs ago | 0 S | ||||
25986357 | 17 hrs ago | Contract Creation | 0 S | |||
25986357 | 17 hrs ago | 0 S | ||||
25986355 | 17 hrs ago | 0 S | ||||
25986355 | 17 hrs ago | Contract Creation | 0 S | |||
25986355 | 17 hrs ago | 0 S | ||||
25984750 | 17 hrs ago | 0 S | ||||
25948025 | 22 hrs ago | 0 S |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x28556B2C...905a8D28D The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
StakingPoolFactory
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity ^0.8.18; import "../../interfaces/IStakingPoolFactory.sol"; import "./MinimalBeaconProxy.sol"; contract StakingPoolFactory is IStakingPoolFactory { address public operator; uint96 internal _stakingPoolCount; // temporary beacon address storage to avoid constructor arguments in the proxy address public beacon; constructor(address _operator) { operator = _operator; } function changeOperator(address newOperator) public { require(msg.sender == operator, "StakingPoolFactory: Not operator"); require(newOperator != address(0), "StakingPoolFactory: Invalid operator"); operator = newOperator; } function stakingPoolCount() external view returns (uint) { return _stakingPoolCount; } function create(address _beacon) external returns (uint poolId, address stakingPoolAddress) { require(msg.sender == operator, "StakingPoolFactory: Not operator"); beacon = _beacon; poolId = ++_stakingPoolCount; stakingPoolAddress = address( new MinimalBeaconProxy{salt : bytes32(poolId)}() ); require( stakingPoolAddress != address(0), "StakingPoolFactory: Failed to create staking pool" ); emit StakingPoolCreated(poolId, stakingPoolAddress); } }
// 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 {} }
// 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); }
// 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); }
// 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(); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"poolId","type":"uint256"},{"indexed":true,"internalType":"address","name":"stakingPoolAddress","type":"address"}],"name":"StakingPoolCreated","type":"event"},{"inputs":[],"name":"beacon","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOperator","type":"address"}],"name":"changeOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_beacon","type":"address"}],"name":"create","outputs":[{"internalType":"uint256","name":"poolId","type":"uint256"},{"internalType":"address","name":"stakingPoolAddress","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakingPoolCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100575760003560e01c806306394c9b1461005c5780632dd96be914610071578063570ca7351461009757806359659e90146100c25780639ed93318146100d5575b600080fd5b61006f61006a366004610399565b610105565b005b600054600160a01b90046001600160601b03166040519081526020015b60405180910390f35b6000546100aa906001600160a01b031681565b6040516001600160a01b03909116815260200161008e565b6001546100aa906001600160a01b031681565b6100e86100e3366004610399565b6101e8565b604080519283526001600160a01b0390911660208301520161008e565b6000546001600160a01b031633146101645760405162461bcd60e51b815260206004820181905260248201527f5374616b696e67506f6f6c466163746f72793a204e6f74206f70657261746f7260448201526064015b60405180910390fd5b6001600160a01b0381166101c65760405162461bcd60e51b8152602060048201526024808201527f5374616b696e67506f6f6c466163746f72793a20496e76616c6964206f70657260448201526330ba37b960e11b606482015260840161015b565b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000805481906001600160a01b031633146102455760405162461bcd60e51b815260206004820181905260248201527f5374616b696e67506f6f6c466163746f72793a204e6f74206f70657261746f72604482015260640161015b565b600180546001600160a01b0319166001600160a01b0385161790556000805460149061028090600160a01b90046001600160601b03166103c9565b91906101000a8154816001600160601b0302191690836001600160601b0316021790556001600160601b031691508160001b6040516102be9061038c565b8190604051809103906000f59050801580156102de573d6000803e3d6000fd5b5090506001600160a01b0381166103515760405162461bcd60e51b815260206004820152603160248201527f5374616b696e67506f6f6c466163746f72793a204661696c656420746f20637260448201527019585d19481cdd185ada5b99c81c1bdbdb607a1b606482015260840161015b565b6040516001600160a01b0382169083907f4a13c6e39e7b1a55efde5a451a2e84f4b11d5ba538be0e26224ccaa8d90b78e990600090a3915091565b610282806103fe83390190565b6000602082840312156103ab57600080fd5b81356001600160a01b03811681146103c257600080fd5b9392505050565b60006001600160601b038083168181036103f357634e487b7160e01b600052601160045260246000fd5b600101939250505056fe60a060405234801561001057600080fd5b50336001600160a01b03166359659e906040518163ffffffff1660e01b8152600401602060405180830381865afa15801561004f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100739190610084565b6001600160a01b03166080526100b4565b60006020828403121561009657600080fd5b81516001600160a01b03811681146100ad57600080fd5b9392505050565b6080516101ae6100d460003960008181604b0152609f01526101ae6000f3fe6080604052600436106100225760003560e01c806359659e901461003957610031565b366100315761002f610089565b005b61002f610089565b34801561004557600080fd5b5061006d7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200160405180910390f35b61009961009461009b565b610124565b565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316632aa8195e6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156100fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061011f9190610148565b905090565b3660008037600080366000845af43d6000803e808015610143573d6000f35b3d6000fd5b60006020828403121561015a57600080fd5b81516001600160a01b038116811461017157600080fd5b939250505056fea2646970667358221220debdeb5af99b4613a4491f8e8ab7124e948738d7ebb94f66bb5e193d53de655c64736f6c63430008120033a264697066735822122061eeffdde1f5eb8ce468c9acf30bc8934c365729b3f9ff5411773d7da5cd3c0564736f6c63430008120033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.