Contract Overview
Balance:
0 CLV
CLV Value:
$0.00
My Name Tag:
Not Available, login to update
Txn Hash | Method |
Block
|
From
|
To
|
Value | [Txn Fee] | |||
---|---|---|---|---|---|---|---|---|---|
0xbc951037b32e87c3ab62108063d09ea7d813b026f317168a5791681fb9790a50 | 0x6102f561 | 2711669 | 12 days 14 hrs ago | 0xd134a7d9485c1aac0cbf82718cf6d6e3fd130945 | IN | Create: PoolInfo | 0 CLV | 0.00216953 |
[ Download CSV Export ]
Contract Name:
PoolInfo
Compiler Version
v0.8.4+commit.c7e474f2
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
/* PoolInfo https://github.com/FanbaseEU/Staking_Ethereum_SmartContracts SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; import "../interfaces/IPool.sol"; import "../interfaces/IStakingModule.sol"; import "../interfaces/IRewardModule.sol"; /** * @title Pool info library * * @notice this implements the Pool info library, which provides read-only * convenience functions to query additional information and metadata * about the core Pool contract. */ library PoolInfo { /** * @notice get information about the underlying staking and reward modules * @param pool address of Pool contract * @return staking module address * @return reward module address * @return staking module type * @return reward module type */ function modules(address pool) public view returns ( address, address, address, address ) { IPool p = IPool(pool); IStakingModule s = IStakingModule(p.stakingModule()); IRewardModule r = IRewardModule(p.rewardModule()); return (address(s), address(r), s.factory(), r.factory()); } }
/* IEvents https://github.com/FanbaseEU/Staking_Ethereum_SmartContracts SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; /** * @title GYSR event system * * @notice common interface to define GYSR event system */ interface IEvents { // staking event Staked( address indexed user, address indexed token, uint256 amount, uint256 shares ); event Unstaked( address indexed user, address indexed token, uint256 amount, uint256 shares ); event Claimed( address indexed user, address indexed token, uint256 amount, uint256 shares ); // rewards event RewardsDistributed( address indexed user, address indexed token, uint256 amount, uint256 shares ); event RewardsFunded( address indexed token, uint256 amount, uint256 shares, uint256 timestamp ); event RewardsUnlocked(address indexed token, uint256 shares); event RewardsExpired( address indexed token, uint256 amount, uint256 shares, uint256 timestamp ); // gysr event GysrSpent(address indexed user, uint256 amount); event GysrVested(address indexed user, uint256 amount); event GysrWithdrawn(uint256 amount); }
/* IPool https://github.com/FanbaseEU/Staking_Ethereum_SmartContracts SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; /** * @title Pool interface * * @notice this defines the core Pool contract interface */ interface IPool { /** * @return staking tokens for Pool */ function stakingTokens() external view returns (address[] memory); /** * @return reward tokens for Pool */ function rewardTokens() external view returns (address[] memory); /** * @return staking balances for user */ function stakingBalances(address user) external view returns (uint256[] memory); /** * @return total staking balances for Pool */ function stakingTotals() external view returns (uint256[] memory); /** * @return reward balances for Pool */ function rewardBalances() external view returns (uint256[] memory); /** * @return GYSR usage ratio for Pool */ function usage() external view returns (uint256); /** * @return address of staking module */ function stakingModule() external view returns (address); /** * @return address of reward module */ function rewardModule() external view returns (address); /** * @notice stake asset and begin earning rewards * @param amount number of tokens to stake * @param stakingdata data passed to staking module * @param rewarddata data passed to reward module */ function stake( uint256 amount, bytes calldata stakingdata, bytes calldata rewarddata ) external; /** * @notice unstake asset and claim rewards * @param amount number of tokens to unstake * @param stakingdata data passed to staking module * @param rewarddata data passed to reward module */ function unstake( uint256 amount, bytes calldata stakingdata, bytes calldata rewarddata ) external; /** * @notice claim rewards without unstaking * @param amount number of tokens to claim against * @param stakingdata data passed to staking module * @param rewarddata data passed to reward module */ function claim( uint256 amount, bytes calldata stakingdata, bytes calldata rewarddata ) external; /** * @notice method called ad hoc to update user accounting */ function update() external; /** * @notice method called ad hoc to clean up and perform additional accounting */ function clean() external; /** * @return gysr balance available for withdrawal */ function gysrBalance() external view returns (uint256); /** * @notice withdraw GYSR tokens applied during unstaking * @param amount number of GYSR to withdraw */ function withdraw(uint256 amount) external; }
/* IRewardModule https://github.com/FanbaseEU/Staking_Ethereum_SmartContracts SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./IEvents.sol"; import "../OwnerController.sol"; /** * @title Reward module interface * * @notice this contract defines the common interface that any reward module * must implement to be compatible with the modular Pool architecture. */ abstract contract IRewardModule is OwnerController, IEvents { // constants uint256 public constant DECIMALS = 18; /** * @return array of reward tokens */ function tokens() external view virtual returns (address[] memory); /** * @return array of reward token balances */ function balances() external view virtual returns (uint256[] memory); /** * @return GYSR usage ratio for reward module */ function usage() external view virtual returns (uint256); /** * @return address of module factory */ function factory() external view virtual returns (address); /** * @notice perform any necessary accounting for new stake * @param account address of staking account * @param user address of user * @param shares number of new shares minted * @param data addtional data * @return amount of gysr spent * @return amount of gysr vested */ function stake( address account, address user, uint256 shares, bytes calldata data ) external virtual returns (uint256, uint256); /** * @notice reward user and perform any necessary accounting for unstake * @param account address of staking account * @param user address of user * @param shares number of shares burned * @param data additional data * @return amount of gysr spent * @return amount of gysr vested */ function unstake( address account, address user, uint256 shares, bytes calldata data ) external virtual returns (uint256, uint256); /** * @notice reward user and perform and necessary accounting for existing stake * @param account address of staking account * @param user address of user * @param shares number of shares being claimed against * @param data addtional data * @return amount of gysr spent * @return amount of gysr vested */ function claim( address account, address user, uint256 shares, bytes calldata data ) external virtual returns (uint256, uint256); /** * @notice method called by anyone to update accounting * @param user address of user for update * @dev will only be called ad hoc and should not contain essential logic */ function update(address user) external virtual; /** * @notice method called by owner to clean up and perform additional accounting * @dev will only be called ad hoc and should not contain any essential logic */ function clean() external virtual; }
/* IStakingModule https://github.com/FanbaseEU/Staking_Ethereum_SmartContracts SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./IEvents.sol"; import "../OwnerController.sol"; /** * @title Staking module interface * * @notice this contract defines the common interface that any staking module * must implement to be compatible with the modular Pool architecture. */ abstract contract IStakingModule is OwnerController, IEvents { // constants uint256 public constant DECIMALS = 18; /** * @return array of staking tokens */ function tokens() external view virtual returns (address[] memory); /** * @notice get balance of user * @param user address of user * @return balances of each staking token */ function balances(address user) external view virtual returns (uint256[] memory); /** * @return address of module factory */ function factory() external view virtual returns (address); /** * @notice get total staked amount * @return totals for each staking token */ function totals() external view virtual returns (uint256[] memory); /** * @notice stake an amount of tokens for user * @param user address of user * @param amount number of tokens to stake * @param data additional data * @return address of staking account * @return number of shares minted for stake */ function stake( address user, uint256 amount, bytes calldata data ) external virtual returns (address, uint256); /** * @notice unstake an amount of tokens for user * @param user address of user * @param amount number of tokens to unstake * @param data additional data * @return address of staking account * @return number of shares burned for unstake */ function unstake( address user, uint256 amount, bytes calldata data ) external virtual returns (address, uint256); /** * @notice quote the share value for an amount of tokens without unstaking * @param user address of user * @param amount number of tokens to claim with * @param data additional data * @return address of staking account * @return number of shares that the claim amount is worth */ function claim( address user, uint256 amount, bytes calldata data ) external virtual returns (address, uint256); /** * @notice method called by anyone to update accounting * @param user address of user for update * @dev will only be called ad hoc and should not contain essential logic */ function update(address user) external virtual; /** * @notice method called by owner to clean up and perform additional accounting * @dev will only be called ad hoc and should not contain any essential logic */ function clean() external virtual; }
/* OwnerController https://github.com/FanbaseEU/Staking_Ethereum_SmartContracts SPDX-License-Identifier: MIT */ pragma solidity 0.8.4; /** * @title Owner controller * * @notice this base contract implements an owner-controller access model. * * @dev the contract is an adapted version of the OpenZeppelin Ownable contract. * It allows the owner to designate an additional account as the controller to * perform restricted operations. * * Other changes include supporting role verification with a require method * in addition to the modifier option, and removing some unneeded functionality. * * Original contract here: * https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol */ contract OwnerController { address private _owner; address private _controller; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); event ControlTransferred( address indexed previousController, address indexed newController ); constructor() { _owner = msg.sender; _controller = msg.sender; emit OwnershipTransferred(address(0), _owner); emit ControlTransferred(address(0), _owner); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Returns the address of the current controller. */ function controller() public view returns (address) { return _controller; } /** * @dev Modifier that throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == msg.sender, "Only owner can perform this action"); _; } /** * @dev Modifier that throws if called by any account other than the controller. */ modifier onlyController() { require(_controller == msg.sender, "Only controller can perform this action"); _; } /** * @dev Throws if called by any account other than the owner. */ function requireOwner() internal view { require(_owner == msg.sender, "Only owner can perform this action"); } /** * @dev Throws if called by any account other than the controller. */ function requireController() internal view { require(_controller == msg.sender, "Only controller can perform this action"); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). This can * include renouncing ownership by transferring to the zero address. * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual { requireOwner(); require(newOwner != address(0), "New owner address can't be zero"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } /** * @dev Transfers control of the contract to a new account (`newController`). * Can only be called by the owner. */ function transferControl(address newController) public virtual { requireOwner(); require(newController != address(0), "New controller address can't be zero"); emit ControlTransferred(_controller, newController); _controller = newController; } }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
[{"inputs":[{"internalType":"address","name":"pool","type":"address"}],"name":"modules","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6102f561003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c8063a8ee49fe1461003a575b600080fd5b61004d61004836600461026c565b610081565b604080516001600160a01b039586168152938516602085015291841683830152909216606082015290519081900360800190f35b60008060008060008590506000816001600160a01b031663504b82bf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156100c757600080fd5b505afa1580156100db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ff919061028f565b90506000826001600160a01b031663e70c20d96040518163ffffffff1660e01b815260040160206040518083038186803b15801561013c57600080fd5b505afa158015610150573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610174919061028f565b90508181836001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156101b157600080fd5b505afa1580156101c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101e9919061028f565b836001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561022257600080fd5b505afa158015610236573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061025a919061028f565b96509650965096505050509193509193565b60006020828403121561027d578081fd5b8135610288816102a7565b9392505050565b6000602082840312156102a0578081fd5b8151610288815b6001600160a01b03811681146102bc57600080fd5b5056fea264697066735822122081e7446a5795455ac94e5ad9535f84fec5230a346080b28e31968621c29d404264736f6c63430008040033
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.