Contract 0x9F7968de728aC7A6769141F63dCA03FD8b03A76F

 

Contract Overview

Balance:
10,889.810583811316257709 ETH

ETH Value:
$37,132,185.03 (@ $3,409.81/ETH)

Token:
Txn Hash
Block
From
To
Value [Txn Fee]
0x91051077bb3f6a9d375bab815b40618186baf0d14cdd916b0813592d2464a13d11635282021-09-17 19:53:002 mins ago0x9f93530a539dbeae77d7ffb0c2c98112dc39c4da IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000490589376 ETH
0xfa5bd23e2a9804d7084cd72f72b8233bd21c97e2eabeda6a89c3a6cd997a372b11632002021-09-17 19:46:248 mins ago0x3b8b736e35723a239028fb5e33efccffd4beafdb IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000489405642 ETH
0xe527d309cf029293ee110693d82312446f81dd4b0c0b5d01aa0f4861f4ce5b9f11630602021-09-17 19:43:5011 mins ago0x7e517ba2109a5b32519d50b9231444cbf45442bf IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000488462325 ETH
0x03532d57d001b0b137d85399b5e49aa97025ab6ac377fbb2a5e28e57759470e511630262021-09-17 19:42:2912 mins ago0x635f953692bb98c1fae44edcadb4a67ef417f207 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.0004872724 ETH
0x1781c84b19922175ed5fc6fa95c88a7758165c85e2787804f67580ee37faa77a11625462021-09-17 19:27:5327 mins ago0x4b1499656a9c96ff3497d4899c25efd3bc29ff0e IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000487290283 ETH
0x3c9f408ee3a847ef9b31f6d718a8d622dc4a4e44f142a5b3e86830fd8e873e1611625272021-09-17 19:27:5327 mins ago0x45c2217cc3e7242e9c7ca2ebf882e58766c829e9 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000488326717 ETH
0x085348c4134ecb27be40cf6a6513c317a5a9d59fa29ec40617bffe06a05b54c311625162021-09-17 19:27:5327 mins ago0x30442f337f5b7b3e3550180e0d3c56b8026fdfda IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000488318521 ETH
0x02f8bb6099966015b7ba4a1ac2e6f729c3e05e566198cbefb0b71e4528803c2311625072021-09-17 19:27:5327 mins ago0xe9920a36e9e042b3796ac94a73e36a0b425b0750 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000486262044 ETH
0x7911b28e7f47f4c65b18f29a02db8f82060ea63f972a8cb249d69fa2179f1ac811625002021-09-17 19:26:2528 mins ago0xc915e1d0f176ca787078e47e6f34c20c90394bd4 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000487276126 ETH
0x52a0e0430b5ac5dc6712be8fbaad7e803a7fccec7f83e887fcda3852d1f3edd811624942021-09-17 19:26:2528 mins ago0x7f83ab77c6c3b7a322e3cb678aad08e3c2b3e50d IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000486255338 ETH
0xe4d3ffd5bd09b9f1c8af769bbd4b56f3c4b1a008448048f14d36fe9703b5c66d11624922021-09-17 19:26:2528 mins ago0xc48d6fa3e3189f52c84f40f84c9f8896a144f49f IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000487273145 ETH
0xcc4500fd9beb7793533d9b5e7c646b90dbfbaf51bc1736c0e441f4732cee5cc411624882021-09-17 19:26:2528 mins ago0x9ea9428b49004a218c28aca5b05b13ccb09b28bd IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000487281341 ETH
0x8cbba0a29c3016fce20eecb3a13d731cda1c7057bc46168b65ac59b5aaf4937211624862021-09-17 19:26:2528 mins ago0x6887df8e7b15ffae0369a718dc1c7c7f8588a358 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000488311815 ETH
0x4eb5addb3a1684ec89223f9f94dd8b77359cf473ca6c8fe11ffa7ec11a4d253f11624812021-09-17 19:26:2528 mins ago0x12ab076894e15b0d6b9c2d27195f965d6cf2e814 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000487300714 ETH
0x9ac14da682a49e45a68fff1a8b0dec5dc3a1affaac3b9c290539a8adda3af6e311624742021-09-17 19:26:2528 mins ago0x57069aafb3767c38b17a0357ecd106036dad64fd IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000488301383 ETH
0xc5f09bb8c853ef62399361d328430deda6c78aee7d7a54a0edfcf0b0af7663e511624672021-09-17 19:26:2528 mins ago0x2d66c4024ed413dd0a5fb4c7ba0806d0ad054621 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.00048830958 ETH
0x9db17b4eec4be699ad9b43c21577d9eeaf7bd6512263a3241c8de724a57ec37a11624662021-09-17 19:26:2528 mins ago0x6f5eea1e20e69c5db953db53267d0ab99b98bb03 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000487142753 ETH
0x82681f826d45b9698192155d037bc097e15a012ac3c325eafb2bb2bd3cfbd07711624602021-09-17 19:25:5829 mins ago0x1a0bde914f51175ba73397e8b4b1c7c771333a1d IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000487283577 ETH
0x2e8cebb61a7cc08ad499b6ea642667d047948e1c14a9c43fe596da535314c7d911624522021-09-17 19:25:5829 mins ago0xa0f3c69654a3f2f1f87238cfcb2af12ddf2419c7 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000488292442 ETH
0xb5f416397cbe6ba96e2eb3bae38adaad810d45cbde096228fc93ff1ad2765c2211624512021-09-17 19:22:5832 mins ago0x0708ff21acf0b329efa61c1370fd5bc92f4c48bf IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000487295498 ETH
0x299608cac517479c708a9b1644668a6c060427bc941369266cd8db642ff9568611624362021-09-17 19:22:5832 mins ago0x3bdad62bbd3639b063412dc830ca51f53ab708bf IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000486262044 ETH
0x3d956af482e1e54aecbec8dda898d171fca4bf5c35046d0d2fca20e4451cb3fb11624242021-09-17 19:22:5832 mins ago0xce8ea16c74cee538f6a3025cbfc7f8c20d80c291 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000486260554 ETH
0xaa174cfda8921d28d32dc9370e46eb72b493cdc0a8e32cec86301883e6ec323711624172021-09-17 19:22:5832 mins ago0x0d55ffd7ee6066f441d2e3c83a8b07dbb0871448 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000486279927 ETH
0x93d11b6a97d446e851a216ca7413a131912e8fccb6f6d47e4db2ac6947a2457b11624122021-09-17 19:22:5832 mins ago0x9db478cc3cd7d639940cc39c69205d6735878e4b IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000488326717 ETH
0x1f2fb36235b033886063d3eb1b3e272a78602fecb2a1f1064a2fa94e6a52559011624082021-09-17 19:22:5832 mins ago0x50706ec0a1b359223b0263a752a9ad9abc5ffc14 IN  0x9f7968de728ac7a6769141f63dca03fd8b03a76f0 ETH0.000487273145 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.