Contract 0x32e5594f14de658b0d577d6560fa0d9c6f1aa724 1

 
Txn Hash
Block
From
To
Value [Txn Fee]
0x5b74688982a54c2dea4cfa109355abea483fa49e3f2f705323299e74bd70378523258002021-10-18 6:59:002 mins ago0x32ebb7adfb4c0a6f9cb930037eeabc5a23f3c51f IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000539390208 ETH
0x2f9184036bf84979c3300a616eafcb47ebe699df26a4664c66cd3ac137f06b2623257942021-10-18 6:58:213 mins ago0x32ebb7adfb4c0a6f9cb930037eeabc5a23f3c51f IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000516469885 ETH
0x8eedbf34bf4f7111cc0c68d2819bef2b8b4c8834f4a08f2497fbd97bd10e3bce23257612021-10-18 6:56:525 mins ago0xa163a8db7d940286b2ebc32475db6318d085ed75 IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000541199936 ETH
0x4a2183e40133d0c15fc8ed95a29af5c2414114c8d903e431e944939827347b0723257412021-10-18 6:55:106 mins ago0xa163a8db7d940286b2ebc32475db6318d085ed75 IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000518281991 ETH
0xab6d4b767e0fd73ec9d86f1a511c6a82c1322276e948de5644b9ff33beb7a4ff23255802021-10-18 6:48:2513 mins ago0x14752abc79c53e37bbb1a034298577a4aca758d0 IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000541210237 ETH
0xc5aedfe27198a1f3725103fe11d43284e73a317ce45f68dd27ea5630bf1fc8ae23255762021-10-18 6:48:2513 mins ago0x14752abc79c53e37bbb1a034298577a4aca758d0 IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000519396828 ETH
0x05a43e64c5c572a20cf1d104800fce1792091825d29e342fdbe14341fc82eb2a23253622021-10-18 6:33:5627 mins ago0x551545c6aa92cd6ed0e2fe9487008ac2bd91056a IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000699009211 ETH
0x14320b8f29b7be7f8b77271786af87a9a995e3dca2032f89bd07d61bc64315c423253082021-10-18 6:29:3532 mins ago0xf8805249b5d2a28ce0de8683e0ab4938d7a23043 IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000538289633 ETH
0x63004151770217c3a2c1f6b904ce052cecd1549dff57bebfb0c7ba1919eaefbb23251552021-10-18 6:20:5141 mins ago0x45ae1f83ab9ba3c9fd034c9422d6321cbd3beeca IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000541208652 ETH
0xd1d4d62e5de6843545263921ceef9da117154c3c1dc125a725216107225c59e423251442021-10-18 6:18:4543 mins ago0xc90c87b4072c6b57fd568956632139a812dbe749 IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000538300726 ETH
0xa59415d08193a7e066234b17164ffe8532eb18a01f23e2b6628f4a1033193e5123251382021-10-18 6:18:4543 mins ago0xc90c87b4072c6b57fd568956632139a812dbe749 IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000516483355 ETH
0xe6ca545bea812fc5eee0fcae760b71ae51cfa72623b9b46d8ed0d15e4ecfe2d423251232021-10-18 6:18:3143 mins ago0x45ae1f83ab9ba3c9fd034c9422d6321cbd3beeca IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000519403959 ETH
0xe6c7d8eebd6aa7a07e825980863a11e6a9b85a83664d4e706cb1a3bbe66c5ff723251012021-10-18 6:17:0544 mins ago0x415015cd9ee1f1bd273facc7da9f3ac00c4f610d IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000541215783 ETH
0x4bd31df6e86392253f7c9e4aad185b813d38fb4c238f808b5a350093732750ef23250972021-10-18 6:17:0544 mins ago0x415015cd9ee1f1bd273facc7da9f3ac00c4f610d IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000519406336 ETH
0xbd498c5310706cb43de15025c4abb3caff10a19cf093ecf146d03b433920177123250892021-10-18 6:16:3745 mins ago0xf8805249b5d2a28ce0de8683e0ab4938d7a23043 IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000516469885 ETH
0x770b3f5f8d3b8f49fc5e8d9ba16a7933539e9bb4575a25696ca4f848d5d7330023245012021-10-18 5:41:401 hr 20 mins ago0x9b6131eae892de5c96ddd3af52c74359cb99596e IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000862690521 ETH
0x91d05f78123a9d087980b1b2a3d44397db5bb60d6d8fc02c0c39372b414fdcdc23243432021-10-18 5:28:511 hr 33 mins ago0x43da6d2db9651b7042e31ffb2607a7cfa4d5d03b IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000544003084 ETH
0x689e8ea5a69dce5da18b36daf1508cd90ffb1ee3b77c85f195ff8bdfcde5580d23243362021-10-18 5:28:511 hr 33 mins ago0x43da6d2db9651b7042e31ffb2607a7cfa4d5d03b IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000520903479 ETH
0x9adcbda1769d6d43d16fd00dae34a21d76eba0f5de15df0ef85440e83c5995d723242322021-10-18 5:22:451 hr 39 mins ago0xfadede05176cec9d799e35999fdfafb86b418811 IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.0005418094 ETH
0x58c8ab2c45ef1b9dfe3929e632b58cdc19eef0a1e128f5f400ad6ca018262bce23242252021-10-18 5:22:211 hr 39 mins ago0xfadede05176cec9d799e35999fdfafb86b418811 IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000520913069 ETH
0xca46f3c6ec28189995f7097d7f6e7e4056c6834e24e61b6f0604fddbf1465f7423240882021-10-18 5:11:031 hr 50 mins ago0x5b0c1dedff02315b5153c5330ef862bc891c6fd9 IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000542900248 ETH
0x502238fee92c11b848c542d687a059143d10a075a5e791bae2677c13223d6e5623240862021-10-18 5:10:251 hr 51 mins ago0x5b0c1dedff02315b5153c5330ef862bc891c6fd9 IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.00052200072 ETH
0xbaecccf2ccd6dfe90ca01aab974e33c62fa64ff9c54bca7315879659d915838f23240172021-10-18 5:05:371 hr 56 mins ago0xc8049a248252c2f76dd0edb11b3ba79b48a9d501 IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000544389076 ETH
0x74d19e0baea49bc0f1a03e9660cc22029f2f29b42ae793c0a497a20cf816be5323240102021-10-18 5:04:471 hr 57 mins ago0xc8049a248252c2f76dd0edb11b3ba79b48a9d501 IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.00052127189 ETH
0x77542a4b41cbab213c96db3df81db91ec13f1128ec7fc127dea25add07eeaee423239942021-10-18 5:04:011 hr 57 mins ago0x15eacb3e2d48759be17292fec83be676f9051577 IN  0x32e5594f14de658b0d577d6560fa0d9c6f1aa7240 ETH0.000544023063 ETH
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Minimal Proxy Contract for 0x32e5594f14de658b0d577d6560fa0d9c6f1aa724

Contract Name:
NyanRewards

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 400 runs

Other Settings:
default evmVersion, MIT license
Decompile ByteCode
/**
 *Submitted for verification at arbiscan.io on 2021-09-08
*/

//SPDX-License-Identifier: MIT

// File: @openzeppelin/contracts/ownership/Ownable.sol

pragma solidity ^0.8.7;

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
 
contract Ownable {
    address public owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    constructor() {
        owner = msg.sender;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(msg.sender == owner, "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public onlyOwner {
        emit OwnershipTransferred(owner, address(0));
        owner = address(0);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     */
    function _transferOwnership(address newOwner) internal {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }
}

interface IERC20 {
    function totalSupply() external view returns (uint256);
    function balanceOf(address account) external view returns (uint256);
    function transfer(address recipient, uint256 amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint256);
    function approve(address spender, uint256 amount) external returns (bool);
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
    
    event Transfer(address indexed from, address indexed to, uint256 value);
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

contract StakedTokenWrapper {
    uint256 public totalSupply;

    mapping(address => uint256) private _balances;
    IERC20 public stakedToken;
    
    event Staked(address indexed user, uint256 amount);
    event Withdrawn(address indexed user, uint256 amount);

    function balanceOf(address account) public view returns (uint256) {
        return _balances[account];
    }

    string constant _transferErrorMessage = "staked token transfer failed";
    
    function stakeFor(address forWhom, uint128 amount) public payable virtual {
        IERC20 st = stakedToken;
        if(st == IERC20(address(0))) { //eth
            unchecked {
                totalSupply += msg.value;
                _balances[forWhom] += msg.value;
            }
        }
        else {
            require(msg.value == 0, "non-zero eth");
            require(amount > 0, "Cannot stake 0");
            require(st.transferFrom(msg.sender, address(this), amount), _transferErrorMessage);
            unchecked { 
                totalSupply += amount;
                _balances[forWhom] += amount;
            }
        }
        emit Staked(forWhom, amount);
    }

    function withdraw(uint128 amount) public virtual {
        require(amount <= _balances[msg.sender], "withdraw: balance is lower");
        unchecked {
            _balances[msg.sender] -= amount;
            totalSupply = totalSupply-amount;
        }
        IERC20 st = stakedToken;
        if(st == IERC20(address(0))) { //eth
            (bool success, ) = msg.sender.call{value: amount}("");
            require(success, "eth transfer failure");
        }
        else {
            require(stakedToken.transfer(msg.sender, amount), _transferErrorMessage);
        }
        emit Withdrawn(msg.sender, amount);
    }
}

contract NyanRewards is StakedTokenWrapper, Ownable {
    IERC20 public rewardToken;
    uint256 public rewardRate;
    uint64 public periodFinish;
    uint64 public lastUpdateTime;
    uint128 public rewardPerTokenStored;
    struct UserRewards {
        uint128 userRewardPerTokenPaid;
        uint128 rewards;
    }
    mapping(address => UserRewards) public userRewards;

    event RewardAdded(uint256 reward);
    event RewardPaid(address indexed user, uint256 reward);

    constructor(IERC20 _rewardToken, IERC20 _stakedToken) {
        rewardToken = _rewardToken;
        stakedToken = _stakedToken;
    }

    modifier updateReward(address account) {
        uint128 _rewardPerTokenStored = rewardPerToken();
        lastUpdateTime = lastTimeRewardApplicable();
        rewardPerTokenStored = _rewardPerTokenStored;
        userRewards[account].rewards = earned(account);
        userRewards[account].userRewardPerTokenPaid = _rewardPerTokenStored;
        _;
    }

    function lastTimeRewardApplicable() public view returns (uint64) {
        uint64 blockTimestamp = uint64(block.timestamp);
        return blockTimestamp < periodFinish ? blockTimestamp : periodFinish;
    }

    function rewardPerToken() public view returns (uint128) {
        uint256 totalStakedSupply = totalSupply;
        if (totalStakedSupply == 0) {
            return rewardPerTokenStored;
        }
        unchecked {
            uint256 rewardDuration = lastTimeRewardApplicable()-lastUpdateTime;
            return uint128(rewardPerTokenStored + rewardDuration*rewardRate*1e18/totalStakedSupply);
        }
    }

    function earned(address account) public view returns (uint128) {
        unchecked { 
            return uint128(balanceOf(account)*(rewardPerToken()-userRewards[account].userRewardPerTokenPaid)/1e18 + userRewards[account].rewards);
        }
    }

    function stake(uint128 amount) external payable {
        stakeFor(msg.sender, amount);
    }

    function stakeFor(address forWhom, uint128 amount) public payable override updateReward(forWhom) {
        super.stakeFor(forWhom, amount);
    }

    function withdraw(uint128 amount) public override updateReward(msg.sender) {
        super.withdraw(amount);
    }

    function exit() external {
        getReward();
        withdraw(uint128(balanceOf(msg.sender)));
    }

    function getReward() public updateReward(msg.sender) {
        uint256 reward = earned(msg.sender);
        if (reward > 0) {
            userRewards[msg.sender].rewards = 0;
            require(rewardToken.transfer(msg.sender, reward), "reward transfer failed");
            emit RewardPaid(msg.sender, reward);
        }
    }

    function setRewardParams(uint128 reward, uint64 duration) external onlyOwner {
        unchecked {
            require(reward > 0);
            rewardPerTokenStored = rewardPerToken();
            uint64 blockTimestamp = uint64(block.timestamp);
            uint256 maxRewardSupply = rewardToken.balanceOf(address(this));
            if(rewardToken == stakedToken)
                maxRewardSupply -= totalSupply;
            uint256 leftover = 0;
            if (blockTimestamp >= periodFinish) {
                rewardRate = reward/duration;
            } else {
                uint256 remaining = periodFinish-blockTimestamp;
                leftover = remaining*rewardRate;
                rewardRate = (reward+leftover)/duration;
            }
            require(reward+leftover <= maxRewardSupply, "not enough tokens");
            lastUpdateTime = blockTimestamp;
            periodFinish = blockTimestamp+duration;
            emit RewardAdded(reward);
        }
    }

    function withdrawReward() external onlyOwner {
        uint256 rewardSupply = rewardToken.balanceOf(address(this));
        //ensure funds staked by users can't be transferred out
        if(rewardToken == stakedToken)
                rewardSupply -= totalSupply;
        require(rewardToken.transfer(msg.sender, rewardSupply));
        rewardRate = 0;
        periodFinish = uint64(block.timestamp);
    }
}

/*
   ____            __   __        __   _
  / __/__ __ ___  / /_ / /  ___  / /_ (_)__ __
 _\ \ / // // _ \/ __// _ \/ -_)/ __// / \ \ /
/___/ \_, //_//_/\__//_//_/\__/ \__//_/ /_\_\
     /___/

* Synthetix: YFIRewards.sol
*
* Docs: https://docs.synthetix.io/
*
*
* MIT License
* ===========
*
* Copyright (c) 2020 Synthetix
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
*/

Contract ABI

[{"inputs":[{"internalType":"contract IERC20","name":"_rewardToken","type":"address"},{"internalType":"contract IERC20","name":"_stakedToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"reward","type":"uint256"}],"name":"RewardPaid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Staked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastTimeRewardApplicable","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastUpdateTime","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"periodFinish","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerToken","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardPerTokenStored","outputs":[{"internalType":"uint128","name":"","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint128","name":"reward","type":"uint128"},{"internalType":"uint64","name":"duration","type":"uint64"}],"name":"setRewardParams","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint128","name":"amount","type":"uint128"}],"name":"stake","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"forWhom","type":"address"},{"internalType":"uint128","name":"amount","type":"uint128"}],"name":"stakeFor","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"stakedToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userRewards","outputs":[{"internalType":"uint128","name":"userRewardPerTokenPaid","type":"uint128"},{"internalType":"uint128","name":"rewards","type":"uint128"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint128","name":"amount","type":"uint128"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawReward","outputs":[],"stateMutability":"nonpayable","type":"function"}]

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.