Contract 0x9F7968de728aC7A6769141F63dCA03FD8b03A76F

 

Contract Overview

Balance:
321.423943771418438199 ETH

ETH Value:
$1,237,077.19 (@ $3,848.74/ETH)

Token:
Txn Hash
Block
From
To
Value [Txn Fee]
0xf9cc0ade940401132bdef98bfb7c6ba98d0cd9e444e49dd10b15dfdb03c047c323268342021-10-18 7:51:105 mins ago0xfadbf2a11623b9fb76789df05d2dec38d088a692 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000670285105 ETH
0x33075c889081ce4234c388d0d8368b328650ade3f004d3216928bc55cf321eac23189502021-10-17 23:56:198 hrs ago0x327a001fc673fa8a384c2ec024cdb395671927ea IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000498634028 ETH
0x2e32a3af763f4880d80b729f42f63da07aa1711453687104445b53d1a06189ce23110782021-10-17 19:02:2412 hrs 54 mins ago0x1789f114c913b147998a3f7f641c88acaa43e678 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000683248227 ETH
0x267b55a7312402e1931ce78c21f603ee509a443c0f8ef4d621b4b2cf2233d65b23078982021-10-17 16:09:5915 hrs 47 mins ago0xe34abd7d7d134f932a42fe1d2f4a11ab95b72be6 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.00068263647 ETH
0x37b7250fbdf7fbdff3cf346c23fda019a8268af010006279fa3f2ff4985563d323039922021-10-17 13:37:5818 hrs 19 mins ago0x26069b735a2bf169a5ed524df1b6db4abe0f516c IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000522149402 ETH
0x7ec8aa1499edb9278972ee034f8892c15d7a79bd63ded055ecc77da691d6941e23027162021-10-17 12:43:2919 hrs 13 mins ago0xdc6a5b3da5c6c4ca0204bac74654be877eebec04 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000523275577 ETH
0x8dc5e12921bd151f2f44d7fddb7d0cc890fdeede8dbd4c364c0d65c52c3929d722955452021-10-17 7:51:041 day 6 mins ago0x606b9b8c1cbcfa7117c7dc35cc7b054ce616492c IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.00054794642 ETH
0xf3ccb4e384f44aeef07dbbbc59e5518a07e8fa8b2be654b10a24b731bcb5512622821892021-10-16 19:43:281 day 12 hrs ago0xdcb6f4b629c6aaf9e0410a085ece045a35a831e4 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000626060557 ETH
0xe0493278f7125162acba919d32c7f4a1aa1f13b4a67c30518998b406975127fe22794762021-10-16 16:52:031 day 15 hrs ago0x33ab17c44929ab7b05d473f6d72d9fa7cda3d8e7 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000631782711 ETH
0x6bbab43ed0dde49ef49d8b9d03fdd06aab570c0dbefee1810ca00eb8a5c1a15022794562021-10-16 16:52:031 day 15 hrs ago0x1f527198f8460132246e08589fa207c2000c81cd IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000633071506 ETH
0xa333a7f38bf60a1766189aa1a0afa199645a5904b0d53cb79dae55581150530022793562021-10-16 16:47:531 day 15 hrs ago0x11414661e194b8b0d7248e789c1d41332904f2ba IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000633048319 ETH
0x9219c4553eba001c8a70fba82946cce1c310d5c787e6228ffeafb10f6aad0b0a22730352021-10-16 11:29:091 day 20 hrs ago0xa0a2aedf7b6f6aa41a56ee2c301cc87bf0927091 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000642300149 ETH
0xae8e79aea81e15560adfe385edd3824b853335c62cc714ebba251f20eb18482222730332021-10-16 11:29:091 day 20 hrs ago0x7df8b463786a1a44fce6b8137cbfae99c8612d19 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000838854428 ETH
0x2338072d53282ef8b326de1c9cf67c7240a654c428b0b430a1add44a9229014022730062021-10-16 11:27:191 day 20 hrs ago0x6bdddcf0a6b91d39d39df9bab7c1d54b11e7140f IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.00083864521 ETH
0x2497a0d6399878e62a8feff86de7babffaf761845b625ae7a969bb63ed8fd8b422635872021-10-16 3:05:002 days 4 hrs ago0x4789f8ed86858dd6879104781293a98569b46b16 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000933521952 ETH
0x7b2d311837a79b729ed5cd6ceb7fbc6bf4b9469ff2598bfa6617adeb74c2a83622554402021-10-15 17:51:312 days 14 hrs ago0x9a8e8fe802802965b7b149502bce085b46e75111 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000712840825 ETH
0x4093d333e83df958801e198d10c3538c4be1cd620a93c3049d8590260e98857122525582021-10-15 15:40:112 days 16 hrs ago0x459dabca5ada6670cbc4da49593f8abb1bd849ba IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000921858875 ETH
0xea191191c5402d8d12a3a645a7069f7c6c012a144b4ffa0fa1107e2586ada9c722442042021-10-15 10:52:562 days 21 hrs ago0x4c2f62d6f34388a8d134907fea723e7ed902fe22 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000688364297 ETH
0xba648497fa80d8138dcba72e42163834d2ebfcc91495f7c967a3f98aa8d084ed22416292021-10-15 9:12:522 days 22 hrs ago0xed831c5e0d450807a16dbc4b76125697676d05bd IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000696638066 ETH
0x6a0e0400f2710ae279037a712dfa62207fc07349f46d3655554a9ef1634f44ae22378782021-10-15 6:59:573 days 57 mins ago0x3b182f8265f7f051954b4c7a8fa0ed3a29301dc2 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.0009049829 ETH
0xa60a533da9a1e4a97a89a819ffdfa56ce897fbedd57b02fde9cc4fe6b813aa6522330262021-10-15 3:39:433 days 4 hrs ago0xd281e5ba9ddab1070063a101f877d43df1e453b5 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000673729398 ETH
0x8b2df43ba64e42b68233f4001c9266aff44f977d3cfae5895c3a76cda9c0d1f122300682021-10-15 1:11:503 days 6 hrs ago0xefac013e88f7f976a4788f05a7b2eda5d70fc405 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000886079455 ETH
0xf31d8d16362526a91d8625abdff368225c2e27f606bd36b6e9ce6047f553530622300422021-10-15 1:10:303 days 6 hrs ago0xf599a045543348517a4296dedb7bb64076ad6a94 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000881622748 ETH
0x3290a1b9f51286974d9157d7d2408fc973fa63ad1b0a43073dfffe9dc117759222273992021-10-14 21:57:563 days 9 hrs ago0x492ab4524c1a63bf7fd22d0f09705e5ef3e3626a IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000658705429 ETH
0x7ee6b4e5905f32bb96d775502fce21fbf797a634ae46524b5f8f28cf2571ca7e22247492021-10-14 19:38:463 days 12 hrs ago0x5e9b7676b36f5de6ce31eef1fa4a23598af8eddc IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.00085541272 ETH
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Minimal Proxy Contract for 0x9F7968de728aC7A6769141F63dCA03FD8b03A76F

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.