More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 27 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Unstake | 21284195 | 25 days ago | IN | 0 ETH | 0.00299612 | ||||
Unstake | 21258288 | 28 days ago | IN | 0 ETH | 0.00271012 | ||||
Unstake | 21193581 | 37 days ago | IN | 0 ETH | 0.02197468 | ||||
Stake | 21083226 | 53 days ago | IN | 0 ETH | 0.00224729 | ||||
Unstake | 21080002 | 53 days ago | IN | 0 ETH | 0.0015967 | ||||
Unstake | 21079300 | 53 days ago | IN | 0 ETH | 0.00292379 | ||||
Unstake | 21079297 | 53 days ago | IN | 0 ETH | 0.0014794 | ||||
Unstake | 21078645 | 53 days ago | IN | 0 ETH | 0.00520214 | ||||
Stake | 21078045 | 53 days ago | IN | 0 ETH | 0.00078348 | ||||
Stake | 21077482 | 54 days ago | IN | 0 ETH | 0.00426897 | ||||
Stake | 21076982 | 54 days ago | IN | 0 ETH | 0.00108317 | ||||
Stake | 21076487 | 54 days ago | IN | 0 ETH | 0.00092039 | ||||
Stake | 21075744 | 54 days ago | IN | 0 ETH | 0.00156816 | ||||
Stake | 21075418 | 54 days ago | IN | 0 ETH | 0.00159265 | ||||
Stake | 21075356 | 54 days ago | IN | 0 ETH | 0.0009074 | ||||
Stake | 21075113 | 54 days ago | IN | 0 ETH | 0.00077012 | ||||
Stake | 21074869 | 54 days ago | IN | 0 ETH | 0.00060917 | ||||
Stake | 21074840 | 54 days ago | IN | 0 ETH | 0.0007008 | ||||
Stake | 21074807 | 54 days ago | IN | 0 ETH | 0.00096606 | ||||
Stake | 21074417 | 54 days ago | IN | 0 ETH | 0.00070825 | ||||
Stake | 21074412 | 54 days ago | IN | 0 ETH | 0.00038117 | ||||
Stake | 21073745 | 54 days ago | IN | 0 ETH | 0.0007262 | ||||
Stake | 21073679 | 54 days ago | IN | 0 ETH | 0.00153931 | ||||
Stake | 21073575 | 54 days ago | IN | 0 ETH | 0.00153197 | ||||
Stake | 21073476 | 54 days ago | IN | 0 ETH | 0.00156534 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|
21073299 | 54 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xE41a29b2...C0809139A The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
PERStaking
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.19; import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "./interface/IsPER.sol"; interface IPER { function uniswapV2Pair() external view returns (address); function burnFrom(address account, uint256 amount) external; } interface ITreasury { function mint() external; } /// @title PERStaking /// @notice PER Staking contract PERStaking { /// DATA STRUCTURES /// struct Epoch { uint256 length; // in seconds uint256 number; // since inception uint256 end; // timestamp uint256 distribute; // amount } /// STATE VARIABLES /// /// @notice PER address IERC20 public immutable PER; /// @notice sPER address IsPER public immutable sPER; /// @notice Current epoch details Epoch public epoch; /// @notice treasury address ITreasury public immutable treasury; /// CONSTRUCTOR /// /// @param _PER Address of PER /// @param _sPER Address of sPER constructor(address _PER, address _sPER, address _treasury) { PER = IERC20(_PER); sPER = IsPER(_sPER); treasury = ITreasury(_treasury); epoch = Epoch({length: 8 hours, number: 0, end: block.timestamp + 8 hours, distribute: 0}); } /// MUTATIVE FUNCTIONS /// /// @notice stake PER /// @param _to address /// @param _amount uint function stake(address _to, uint256 _amount) external { rebase(); PER.transferFrom(msg.sender, address(this), _amount); sPER.transfer(_to, _amount); } /// @notice redeem sPER for PER /// @param _to address /// @param _amount uint function unstake(address _to, uint256 _amount, bool _rebase) external { if (_rebase) rebase(); sPER.transferFrom(msg.sender, address(this), _amount); require(_amount <= PER.balanceOf(address(this)), "Insufficient PER balance in contract"); PER.transfer(_to, _amount); } ///@notice Trigger rebase if epoch over function rebase() public { if (epoch.end <= block.timestamp) { sPER.rebase(epoch.distribute, epoch.number); epoch.end = epoch.end + epoch.length; epoch.number++; if (address(treasury) != address(0)) { treasury.mint(); } uint256 balance = PER.balanceOf(address(this)); uint256 staked = sPER.circulatingSupply(); if (balance <= staked) { epoch.distribute = 0; } else { epoch.distribute = balance - staked; } } } /// INTERNAL FUNCTIONS /// /// @notice Send sPER upon staking /// @param _to Address of where sending sPER /// @param _amount Amount of sPER to send /// @return _sent Amount of sPER sent function _send(address _to, uint256 _amount) internal returns (uint256 _sent) { sPER.transfer(_to, _amount); // send as sPER (equal unit as PER) return _amount; } /// VIEW FUNCTIONS /// /// @notice Returns econds until the next epoch begins /// @return seconds_ Till next epoch function secondsToNextEpoch() external view returns (uint256 seconds_) { if (epoch.end < block.timestamp) return 0; return epoch.end - block.timestamp; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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); }
// SPDX-License-Identifier: AGPL-3.0 pragma solidity 0.8.19; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IsPER is IERC20 { function rebase(uint256 amount_, uint epoch_) external returns (uint256); function circulatingSupply() external view returns (uint256); function gonsForBalance(uint amount) external view returns (uint); function balanceForGons(uint gons) external view returns (uint); function index() external view returns (uint); }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_PER","type":"address"},{"internalType":"address","name":"_sPER","type":"address"},{"internalType":"address","name":"_treasury","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"PER","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"epoch","outputs":[{"internalType":"uint256","name":"length","type":"uint256"},{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"uint256","name":"distribute","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rebase","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sPER","outputs":[{"internalType":"contract IsPER","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"secondsToNextEpoch","outputs":[{"internalType":"uint256","name":"seconds_","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"stake","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"contract ITreasury","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"bool","name":"_rebase","type":"bool"}],"name":"unstake","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100885760003560e01c80639483c1d71161005b5780639483c1d714610143578063adc9772e14610159578063af14052c1461016c578063b608f0d21461017457600080fd5b806321d0af341461008d57806361d027b3146100a25780638257099f146100e6578063900cf0cf1461010d575b600080fd5b6100a061009b366004610842565b61019b565b005b6100c97f000000000000000000000000dc60e24e5479a76ac49c18934ba937e3557b9ff381565b6040516001600160a01b0390911681526020015b60405180910390f35b6100c97f000000000000000000000000a92abf543d7a45a857d48bd47f8d019eba35dcfe81565b6000546001546002546003546101239392919084565b6040805194855260208501939093529183015260608201526080016100dd565b61014b6103f4565b6040519081526020016100dd565b6100a0610167366004610882565b61041c565b6100a0610554565b6100c97f00000000000000000000000028e259349c8cee1eb97a1ea277ac12eb04fdecff81565b80156101a9576101a9610554565b6040516323b872dd60e01b8152336004820152306024820152604481018390527f000000000000000000000000a92abf543d7a45a857d48bd47f8d019eba35dcfe6001600160a01b0316906323b872dd906064016020604051808303816000875af115801561021c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061024091906108ac565b506040516370a0823160e01b81523060048201527f00000000000000000000000028e259349c8cee1eb97a1ea277ac12eb04fdecff6001600160a01b0316906370a0823190602401602060405180830381865afa1580156102a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102c991906108d0565b82111561035b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f496e73756666696369656e74205045522062616c616e636520696e20636f6e7460448201527f7261637400000000000000000000000000000000000000000000000000000000606482015260840160405180910390fd5b60405163a9059cbb60e01b81526001600160a01b038481166004830152602482018490527f00000000000000000000000028e259349c8cee1eb97a1ea277ac12eb04fdecff169063a9059cbb906044016020604051808303816000875af11580156103ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103ee91906108ac565b50505050565b60004260006002015410156104095750600090565b600254610417904290610918565b905090565b610424610554565b6040516323b872dd60e01b8152336004820152306024820152604481018290527f00000000000000000000000028e259349c8cee1eb97a1ea277ac12eb04fdecff6001600160a01b0316906323b872dd906064016020604051808303816000875af1158015610497573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104bb91906108ac565b5060405163a9059cbb60e01b81526001600160a01b038381166004830152602482018390527f000000000000000000000000a92abf543d7a45a857d48bd47f8d019eba35dcfe169063a9059cbb906044016020604051808303816000875af115801561052b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061054f91906108ac565b505050565b6002544210610813576003546001546040517f058ecdb40000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000a92abf543d7a45a857d48bd47f8d019eba35dcfe169263058ecdb4926105cf92600401918252602082015260400190565b6020604051808303816000875af11580156105ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061061291906108d0565b506000546002546106239190610931565b6002556001805490600061063683610944565b90915550507f000000000000000000000000dc60e24e5479a76ac49c18934ba937e3557b9ff36001600160a01b0316156106de577f000000000000000000000000dc60e24e5479a76ac49c18934ba937e3557b9ff36001600160a01b0316631249c58b6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156106c557600080fd5b505af11580156106d9573d6000803e3d6000fd5b505050505b6040516370a0823160e01b81523060048201526000907f00000000000000000000000028e259349c8cee1eb97a1ea277ac12eb04fdecff6001600160a01b0316906370a0823190602401602060405180830381865afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076991906108d0565b905060007f000000000000000000000000a92abf543d7a45a857d48bd47f8d019eba35dcfe6001600160a01b0316639358928b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ef91906108d0565b9050808211610802576000600355610810565b61080c8183610918565b6003555b50505b565b80356001600160a01b038116811461082c57600080fd5b919050565b801515811461083f57600080fd5b50565b60008060006060848603121561085757600080fd5b61086084610815565b925060208401359150604084013561087781610831565b809150509250925092565b6000806040838503121561089557600080fd5b61089e83610815565b946020939093013593505050565b6000602082840312156108be57600080fd5b81516108c981610831565b9392505050565b6000602082840312156108e257600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b8181038181111561092b5761092b6108e9565b92915050565b8082018082111561092b5761092b6108e9565b600060018201610956576109566108e9565b506001019056fea26469706673582212208a75c88335ea39b03f2098a0fe5214557053380c1ed5d82fadcd19bb94ddbd9e64736f6c63430008130033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
[ 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.