ETH Price: $3,334.13 (-1.37%)

Contract

0x1E7B12fabc33D771c128f3A76AAb939E5F701ecA
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Unstake212841952024-11-28 5:41:1125 days ago1732772471IN
0x1E7B12fa...E5F701ecA
0 ETH0.002996129.62593407
Unstake212582882024-11-24 14:45:5928 days ago1732459559IN
0x1E7B12fa...E5F701ecA
0 ETH0.002710128.70738936
Unstake211935812024-11-15 14:06:4737 days ago1731679607IN
0x1E7B12fa...E5F701ecA
0 ETH0.0219746832.0625081
Stake210832262024-10-31 4:27:1153 days ago1730348831IN
0x1E7B12fa...E5F701ecA
0 ETH0.002247297.48429088
Unstake210800022024-10-30 17:40:3553 days ago1730310035IN
0x1E7B12fa...E5F701ecA
0 ETH0.001596716.4864052
Unstake210793002024-10-30 15:19:3553 days ago1730301575IN
0x1E7B12fa...E5F701ecA
0 ETH0.0029237928.76677611
Unstake210792972024-10-30 15:18:5953 days ago1730301539IN
0x1E7B12fa...E5F701ecA
0 ETH0.001479428.22269364
Unstake210786452024-10-30 13:05:5953 days ago1730293559IN
0x1E7B12fa...E5F701ecA
0 ETH0.0052021415.84358215
Stake210780452024-10-30 11:05:4753 days ago1730286347IN
0x1E7B12fa...E5F701ecA
0 ETH0.000783488.64178737
Stake210774822024-10-30 9:11:4754 days ago1730279507IN
0x1E7B12fa...E5F701ecA
0 ETH0.0042689710.89964497
Stake210769822024-10-30 7:30:5954 days ago1730273459IN
0x1E7B12fa...E5F701ecA
0 ETH0.0010831711.94742087
Stake210764872024-10-30 5:51:3554 days ago1730267495IN
0x1E7B12fa...E5F701ecA
0 ETH0.0009203910.12553212
Stake210757442024-10-30 3:21:4754 days ago1730258507IN
0x1E7B12fa...E5F701ecA
0 ETH0.001568169.42104476
Stake210754182024-10-30 2:15:5954 days ago1730254559IN
0x1E7B12fa...E5F701ecA
0 ETH0.0015926521.65054337
Stake210753562024-10-30 2:03:3554 days ago1730253815IN
0x1E7B12fa...E5F701ecA
0 ETH0.000907410.00861309
Stake210751132024-10-30 1:14:5954 days ago1730250899IN
0x1E7B12fa...E5F701ecA
0 ETH0.000770128.49441748
Stake210748692024-10-30 0:26:1154 days ago1730247971IN
0x1E7B12fa...E5F701ecA
0 ETH0.000609176.71921285
Stake210748402024-10-30 0:20:2354 days ago1730247623IN
0x1E7B12fa...E5F701ecA
0 ETH0.00070087.32403374
Stake210748072024-10-30 0:13:4754 days ago1730247227IN
0x1E7B12fa...E5F701ecA
0 ETH0.0009660610.65569799
Stake210744172024-10-29 22:55:3554 days ago1730242535IN
0x1E7B12fa...E5F701ecA
0 ETH0.000708257.81198996
Stake210744122024-10-29 22:54:3554 days ago1730242475IN
0x1E7B12fa...E5F701ecA
0 ETH0.000381177.77233097
Stake210737452024-10-29 20:40:3554 days ago1730234435IN
0x1E7B12fa...E5F701ecA
0 ETH0.000726214.80757071
Stake210736792024-10-29 20:27:2354 days ago1730233643IN
0x1E7B12fa...E5F701ecA
0 ETH0.0015393116.9763185
Stake210735752024-10-29 20:06:3554 days ago1730232395IN
0x1E7B12fa...E5F701ecA
0 ETH0.0015319716.01041114
Stake210734762024-10-29 19:46:4754 days ago1730231207IN
0x1E7B12fa...E5F701ecA
0 ETH0.0015653417.26569124
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block
From
To
210732992024-10-29 19:11:1154 days ago1730229071  Contract Creation0 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
File 1 of 4 : Staking.sol
// 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;
    }
}

File 2 of 4 : IERC20Metadata.sol
// 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);
}

File 3 of 4 : IERC20.sol
// 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);
}

File 4 of 4 : IsPER.sol
// 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);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 1000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"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

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
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.