Contract 0x60c0a5d66CbC9FC795a95Bb2E0960c8adAc74f9f

 

Contract Overview

Balance:
0 ETH

ETH Value:
$0.00

Token:
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x859893d09a19c5e1beaeed4910770cd6ed798531af89539b48ed085faaf7a94eClaim All276030192022-09-30 13:04:583 hrs 6 mins ago0x161d9b5d6e3ed8d9c1d36a7caf971901c60b9222 IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00002526
0x410cd7d3b29fe86c92046f72e2a2f3bbf54c66930b24d539733f1ad6fed50e34Claim All272954612022-09-28 22:32:511 day 17 hrs ago0xf6746f1472ea920eee7b793a4d48be0fea647bfe IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00002259
0xdc2622952225d73de603401bde84e5bd44628258afebdc75dbcfb10449b9c290Claim All272931852022-09-28 22:00:501 day 18 hrs ago0x5345462544ed763639519376c298e939228dd1f4 IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00002888
0x2df9a859ffe0ead0abdcaba8fee9eaadf340235b475a63296031211002165f55Claim All272021432022-09-28 11:48:182 days 4 hrs ago0xd4bf1af91763afea5a7f7dece13594d2523388a7 IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.0000218
0xe64e6e3549beef63dd7dec73ab3dd32f68660b0081b37dc2666710e00c3641bdClaim All271939032022-09-28 11:02:002 days 5 hrs ago0x9401df71b22eb8fee6d89e25905308c06afb5b81 IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.0000342
0x5044f92b7ef93f93ff859f9c02b990b41f197327133e397c99681f682dd99a23Claim All271582352022-09-28 7:55:482 days 8 hrs ago0x66eaddf4486ff607b9d67856db2ca7cf862160e1 IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00002155
0x553b44449c38ca4a22a68fb51870d3db25a6438b6850b728fa8c1731603c6139Claim All270804212022-09-28 0:42:492 days 15 hrs ago0xbe1e5a07c3af9b648b2dec7f193bc0835646725e IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00001805
0xc29bb859c3ae5ddfa85149de38e3af83505c6cea4ec24d435ee04eb3e536275bClaim All270801822022-09-28 0:40:392 days 15 hrs ago0xbe1e5a07c3af9b648b2dec7f193bc0835646725e IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00002143
0xd1a68315249f8053c0bd62ac7fd01ff2dd6e2688a2496bfbe7e278d0a156ea18Claim All270347652022-09-27 17:06:392 days 23 hrs ago0xc8c0342dbe53cf8b12d46edca7b77cd71d6884d8 IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00004794
0x167367144e27f731283f35b8188dc363523d99dce1ad77d8610cbf3fa1bb29caClaim All269881752022-09-27 12:39:263 days 3 hrs ago0x66f38834895920589f66a8eabc2b6a543b0eca24 IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00001926
0x2de0fa966ecbdc4e42a82a5ce92d2015f2b5a91dc4d0dc8d1f8865225421dd30Claim All268354162022-09-26 14:56:334 days 1 hr ago0xc8c0342dbe53cf8b12d46edca7b77cd71d6884d8 IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00002787
0x2bdbbde41ce6a4622b81b0c29697ce3cd4873d2126ce54a96c55c71a43b5586dClaim All266933482022-09-26 2:02:584 days 14 hrs ago0xf6746f1472ea920eee7b793a4d48be0fea647bfe IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00001255
0x581297ad0fbe6a032eb31acda1504c035d884340ec906e3bbd5802f6278c84e5Claim All266348062022-09-25 17:21:294 days 22 hrs ago0x5c21e2ca71209821b95a8182663a64569aa8f822 IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.0000252
0x37e880a21fde73650afed030fb335a70d2bb46d435bd47e00b1b7d4e4290098aClaim All266066152022-09-25 14:40:195 days 1 hr ago0x133d93566f9699b3af46fe150daa8a67a9563ed6 IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00001985
0x3a9fca53bed417ecb03cf795e916e662e213492b8db9442cd0d5762f36c574d3Claim All265231062022-09-25 6:53:225 days 9 hrs ago0x86aa575618ba2c34a3190f5f2b4358b216b04c75 IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00003396
0x7c9767090ba0512551722091011617a2b16e3018e482bf08cf958389aa65fce3Claim All264854312022-09-25 2:08:305 days 14 hrs ago0xba1baea54261a0b6e1f8fcfd0aad3dff68da6ae0 IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00001984
0x049d86dd3a6d1ac6ea4eba3cb7870720a2cd2270e0ce246c59cd465ae797077fClaim All263892972022-09-24 12:50:466 days 3 hrs ago0xa446c62fd242de22d2ee067b7d14ea27bde308b1 IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00003241
0xb0e7fb0b310147c1c29990b1754bb3919ca682c13f9c514b64e835270edb06e0Claim All262833782022-09-24 0:21:256 days 15 hrs ago0x0851dae86b9504adb9aca6bb7031e178d0236faf IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.0000201
0xc75abeedb1688981b2b9849b6b3918af6cd68c8b0c601c586fdde156f2320132Claim All262637852022-09-23 20:53:416 days 19 hrs ago0xf6746f1472ea920eee7b793a4d48be0fea647bfe IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00002214
0x422c01c2c3b4880ee6b4daaeb20fe229475301f2efdc3d40be05f197a7700953Claim All261922962022-09-23 13:39:557 days 2 hrs ago0xbc9dbaa7bceedaf6675a99adc3617fbfb42dbd9c IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00003293
0xe1ac9ad065e7f0e63157119911c6c7f777b858768887bfd44efee7f47ad1ae4aClaim All261128062022-09-23 6:17:117 days 9 hrs ago0x0ad59c344359fdf8472e7ffbf4eb6af4751138da IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00002906
0xdbd49b3f6f3592a558ce45c9156694892246e391b442c15096d8b0eec514fa8aClaim All261076642022-09-23 5:39:277 days 10 hrs ago0xe4709a6bc622d60ee15a29880561c85c7fdac46d IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00001701
0x92672f0bd3018c61ba91baf36fd3fa0da1d7490f65027c6f71951303ea4472ddClaim All259935322022-09-22 15:22:008 days 49 mins ago0x8886dca35291f05ed5d8e21f083998ea8dceb50f IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00002447
0x6ae87d7f3a91497b14928b96888c2a5bcc2ab492223c6ae1439d6d1d76276069Claim All258804252022-09-22 5:28:158 days 10 hrs ago0xb19be18a7d279432f607676acd34c62ff932daba IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00002571
0x317b108db4010d4c991a8068d2c8b2702fe378f4095a632461694ca529fb9871Claim All258546962022-09-22 2:57:528 days 13 hrs ago0x27b4ccb700a16d3929ec26852f73a735bb152d61 IN  0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f0 ETH0.00002917
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x859893d09a19c5e1beaeed4910770cd6ed798531af89539b48ed085faaf7a94e276030192022-09-30 13:04:583 hrs 6 mins ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: plsJONES Token0 ETH
0x859893d09a19c5e1beaeed4910770cd6ed798531af89539b48ed085faaf7a94e276030192022-09-30 13:04:583 hrs 6 mins ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: plsDPX Token0 ETH
0x859893d09a19c5e1beaeed4910770cd6ed798531af89539b48ed085faaf7a94e276030192022-09-30 13:04:583 hrs 6 mins ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: Plutus Epoch Staking (6 Month)0 ETH
0x859893d09a19c5e1beaeed4910770cd6ed798531af89539b48ed085faaf7a94e276030192022-09-30 13:04:583 hrs 6 mins ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: Plutus Epoch Staking (6 Month)0 ETH
0x859893d09a19c5e1beaeed4910770cd6ed798531af89539b48ed085faaf7a94e276030192022-09-30 13:04:583 hrs 6 mins ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: Plutus Epoch Staking (6 Month)0 ETH
0x859893d09a19c5e1beaeed4910770cd6ed798531af89539b48ed085faaf7a94e276030192022-09-30 13:04:583 hrs 6 mins ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: Plutus Epoch Staking (6 Month)0 ETH
0x410cd7d3b29fe86c92046f72e2a2f3bbf54c66930b24d539733f1ad6fed50e34272954612022-09-28 22:32:511 day 17 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: plsJONES Token0 ETH
0x410cd7d3b29fe86c92046f72e2a2f3bbf54c66930b24d539733f1ad6fed50e34272954612022-09-28 22:32:511 day 17 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: plsDPX Token0 ETH
0x410cd7d3b29fe86c92046f72e2a2f3bbf54c66930b24d539733f1ad6fed50e34272954612022-09-28 22:32:511 day 17 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: Plutus Epoch Staking (6 Month)0 ETH
0x410cd7d3b29fe86c92046f72e2a2f3bbf54c66930b24d539733f1ad6fed50e34272954612022-09-28 22:32:511 day 17 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: Plutus Epoch Staking (6 Month)0 ETH
0x410cd7d3b29fe86c92046f72e2a2f3bbf54c66930b24d539733f1ad6fed50e34272954612022-09-28 22:32:511 day 17 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: Plutus Epoch Staking (6 Month)0 ETH
0x410cd7d3b29fe86c92046f72e2a2f3bbf54c66930b24d539733f1ad6fed50e34272954612022-09-28 22:32:511 day 17 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: Plutus Epoch Staking (6 Month)0 ETH
0xdc2622952225d73de603401bde84e5bd44628258afebdc75dbcfb10449b9c290272931852022-09-28 22:00:501 day 18 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: plsJONES Token0 ETH
0xdc2622952225d73de603401bde84e5bd44628258afebdc75dbcfb10449b9c290272931852022-09-28 22:00:501 day 18 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: plsDPX Token0 ETH
0xdc2622952225d73de603401bde84e5bd44628258afebdc75dbcfb10449b9c290272931852022-09-28 22:00:501 day 18 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: Plutus Epoch Staking (6 Month)0 ETH
0xdc2622952225d73de603401bde84e5bd44628258afebdc75dbcfb10449b9c290272931852022-09-28 22:00:501 day 18 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: Plutus Epoch Staking (6 Month)0 ETH
0xdc2622952225d73de603401bde84e5bd44628258afebdc75dbcfb10449b9c290272931852022-09-28 22:00:501 day 18 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: Plutus Epoch Staking (6 Month)0 ETH
0xdc2622952225d73de603401bde84e5bd44628258afebdc75dbcfb10449b9c290272931852022-09-28 22:00:501 day 18 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: Plutus Epoch Staking (6 Month)0 ETH
0xdc2622952225d73de603401bde84e5bd44628258afebdc75dbcfb10449b9c290272931852022-09-28 22:00:501 day 18 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: plsJONES Token0 ETH
0xdc2622952225d73de603401bde84e5bd44628258afebdc75dbcfb10449b9c290272931852022-09-28 22:00:501 day 18 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: plsDPX Token0 ETH
0xdc2622952225d73de603401bde84e5bd44628258afebdc75dbcfb10449b9c290272931852022-09-28 22:00:501 day 18 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: Plutus Epoch Staking (6 Month)0 ETH
0xdc2622952225d73de603401bde84e5bd44628258afebdc75dbcfb10449b9c290272931852022-09-28 22:00:501 day 18 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: Plutus Epoch Staking (6 Month)0 ETH
0xdc2622952225d73de603401bde84e5bd44628258afebdc75dbcfb10449b9c290272931852022-09-28 22:00:501 day 18 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: Plutus Epoch Staking (6 Month)0 ETH
0xdc2622952225d73de603401bde84e5bd44628258afebdc75dbcfb10449b9c290272931852022-09-28 22:00:501 day 18 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: Plutus Epoch Staking (6 Month)0 ETH
0x2df9a859ffe0ead0abdcaba8fee9eaadf340235b475a63296031211002165f55272021432022-09-28 11:48:182 days 4 hrs ago 0x60c0a5d66cbc9fc795a95bb2e0960c8adac74f9f Plutus DAO: plsJONES Token0 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
EpochStakingRewardsV2

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 4 : EpochStakingRewardsV2.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import '@openzeppelin/contracts/token/ERC20/IERC20.sol';
import '@openzeppelin/contracts/access/Ownable.sol';

interface IPlutusEpochStaking {
  function stakedDetails(address _user) external view returns (uint112 amount, uint32 lastCheckpoint);

  function epochCheckpoints(uint32 _epoch)
    external
    view
    returns (
      uint32 startedAt,
      uint32 endedAt,
      uint112 totalStaked
    );

  function currentTotalStaked() external view returns (uint112);

  function stakedCheckpoints(address _addr, uint32 _epoch) external view returns (uint112 _amount);
}

interface IEpochStakingRewards {
  function claimDetails(address _addr, uint32 _epoch)
    external
    view
    returns (
      bool _fullyClaimed,
      uint32 _lastClaimedTimestamp,
      uint96 _plsDpxClaimedAmt,
      uint96 _plsJonesClaimedAmt
    );

  function epochRewards(uint32 _epoch)
    external
    view
    returns (
      uint32 _addedAtTimestamp,
      uint96 _plsDpx,
      uint96 _plsJones
    );

  function epoch() external view returns (uint32);

  function totalPlsDpxRewards() external view returns (uint96);

  function totalPlsJonesRewards() external view returns (uint96);
}

contract EpochStakingRewardsV2 is Ownable {
  uint256 private constant EPOCH_DURATION = 2_628_000 seconds;

  IERC20 public immutable plsDPX;
  IERC20 public immutable plsJONES;
  IPlutusEpochStaking public immutable staking;
  IEpochStakingRewards private immutable oldRewards;

  struct Reward {
    uint32 addedAtTimestamp;
    uint96 plsDpx;
    uint96 plsJones;
  }

  struct ClaimDetails {
    bool fullyClaimed;
    uint32 lastClaimedTimestamp;
    uint96 plsDpxClaimedAmt;
    uint96 plsJonesClaimedAmt;
  }

  uint32 public epoch;
  uint96 public totalPlsDpxRewards;
  uint96 public totalPlsJonesRewards;

  // Address => Epoch => Claim Details
  mapping(address => mapping(uint32 => ClaimDetails)) public claimDetails;

  // Epoch => Reward
  mapping(uint32 => Reward) public epochRewards;

  mapping(address => bool) public migrated;

  constructor(
    address _plsDpx,
    address _plsJones,
    address _staking,
    address _oldRewards
  ) {
    plsDPX = IERC20(_plsDpx);
    plsJONES = IERC20(_plsJones);
    staking = IPlutusEpochStaking(_staking);
    oldRewards = IEpochStakingRewards(_oldRewards);
    _migrateStorage();
  }

  function claimAll() external {
    _migrateClaimDetails(msg.sender);
    uint32 _epoch = epoch;

    unchecked {
      for (uint32 i = 0; i <= _epoch; i++) {
        if (!claimDetails[msg.sender][i].fullyClaimed) {
          _claimRewards(i);
        }
      }
    }
  }

  function _claimRewards(uint32 _epoch) internal {
    ClaimDetails memory _claimDetails = claimDetails[msg.sender][_epoch];
    Reward memory rewardsForEpoch = epochRewards[_epoch];

    // User rewards for epoch
    uint256 userPlsDpxShare = calculateShare(msg.sender, _epoch, rewardsForEpoch.plsDpx);
    uint256 userPlsJonesShare = calculateShare(msg.sender, _epoch, rewardsForEpoch.plsJones);

    require(userPlsDpxShare > 0 || userPlsJonesShare > 0, 'No rewards');

    uint256 claimablePlsDpx; // user portion claimable
    uint256 claimablePlsJones; // user portion claimable

    // Claim prorated amount for current epoch
    uint256 vestedDuration;

    unchecked {
      if (_claimDetails.lastClaimedTimestamp > rewardsForEpoch.addedAtTimestamp) {
        vestedDuration = block.timestamp - _claimDetails.lastClaimedTimestamp;
      } else {
        vestedDuration = block.timestamp - rewardsForEpoch.addedAtTimestamp;
      }

      claimablePlsDpx += (userPlsDpxShare * vestedDuration) / EPOCH_DURATION;
      claimablePlsJones += (userPlsJonesShare * vestedDuration) / EPOCH_DURATION;
    }

    bool _fullyClaimed;

    if (claimablePlsDpx > userPlsDpxShare - _claimDetails.plsDpxClaimedAmt) {
      // if claimable asset calculated is > claimable amt
      claimablePlsDpx = uint96(userPlsDpxShare - _claimDetails.plsDpxClaimedAmt);
      _fullyClaimed = true;
    } else {
      claimablePlsDpx = uint96(claimablePlsDpx);
    }

    if (claimablePlsJones > userPlsJonesShare - _claimDetails.plsJonesClaimedAmt) {
      // if claimable asset calculated is > claimable amt
      claimablePlsJones = uint96(userPlsJonesShare - _claimDetails.plsJonesClaimedAmt);
    } else {
      claimablePlsJones = uint96(claimablePlsJones);
    }

    // Update user claim details
    unchecked {
      claimDetails[msg.sender][_epoch] = ClaimDetails({
        fullyClaimed: _fullyClaimed,
        plsDpxClaimedAmt: _claimDetails.plsDpxClaimedAmt + uint96(claimablePlsDpx),
        plsJonesClaimedAmt: _claimDetails.plsJonesClaimedAmt + uint96(claimablePlsJones),
        lastClaimedTimestamp: uint32(block.timestamp)
      });
    }

    plsDPX.transfer(msg.sender, claimablePlsDpx);
    plsJONES.transfer(msg.sender, claimablePlsJones);

    emit ClaimRewards(msg.sender);
  }

  function _migrateStorage() internal {
    uint32 _epoch = oldRewards.epoch();
    epoch = _epoch;
    totalPlsDpxRewards = oldRewards.totalPlsDpxRewards();
    totalPlsJonesRewards = oldRewards.totalPlsJonesRewards();

    unchecked {
      for (uint32 i = 0; i <= _epoch; i++) {
        (uint32 _addedAtTs, uint96 _plsDpx, uint96 _plsJones) = oldRewards.epochRewards(i);
        epochRewards[i] = Reward({ addedAtTimestamp: _addedAtTs, plsDpx: _plsDpx, plsJones: _plsJones });
      }
    }
  }

  function _migrateClaimDetails(address _user) internal {
    if (migrated[_user]) {
      return;
    }

    unchecked {
      for (uint32 i = 0; i <= epoch; i++) {
        (bool _fullyClaimed, uint32 _lastClaimedTs, uint96 _plsDpxClaimed, uint96 _plsJonesClaimed) = oldRewards
          .claimDetails(_user, i);

        claimDetails[_user][i] = ClaimDetails({
          fullyClaimed: _fullyClaimed,
          lastClaimedTimestamp: _lastClaimedTs,
          plsDpxClaimedAmt: _plsDpxClaimed,
          plsJonesClaimedAmt: _plsJonesClaimed
        });
      }
    }

    migrated[_user] = true;
  }

  /** VIEWS */
  function getAmount(address _addr) public view returns (bool hasWithdrawn, uint112 amount) {
    uint32 lastCheckpoint;
    (amount, lastCheckpoint) = staking.stakedDetails(_addr);
    if (lastCheckpoint > 0) {
      hasWithdrawn = true;
      amount = staking.stakedCheckpoints(_addr, 1);
    }
  }

  /// @dev Calculate share of rewards for epoch
  function calculateShare(
    address _addr,
    uint32 _epoch,
    uint256 _rewardAmt
  ) public view returns (uint256) {
    (, uint112 amount) = getAmount(_addr);
    (, , uint112 totalStaked) = staking.epochCheckpoints(_epoch);
    return (amount * _rewardAmt) / totalStaked;
  }

  function pendingRewardsFor(uint32 _epoch) public view returns (uint256 _plsDpx, uint256 _plsJones) {
    ClaimDetails memory _claimDetails = claimDetails[msg.sender][_epoch];

    if (_claimDetails.lastClaimedTimestamp == 0) {
      (
        bool __fullyClaimed,
        uint32 _lastClaimedTimestamp,
        uint96 _plsDpxClaimedAmt,
        uint96 _plsJonesClaimedAmt
      ) = oldRewards.claimDetails(msg.sender, _epoch);

      if (_lastClaimedTimestamp != 0) {
        _claimDetails = ClaimDetails({
          fullyClaimed: __fullyClaimed,
          lastClaimedTimestamp: _lastClaimedTimestamp,
          plsDpxClaimedAmt: _plsDpxClaimedAmt,
          plsJonesClaimedAmt: _plsJonesClaimedAmt
        });
      }
    }
    Reward memory rewardsForEpoch = epochRewards[_epoch];

    // User rewards for epoch
    uint256 userPlsDpxShare = calculateShare(msg.sender, _epoch, rewardsForEpoch.plsDpx);
    uint256 userPlsJonesShare = calculateShare(msg.sender, _epoch, rewardsForEpoch.plsJones);

    require(userPlsDpxShare > 0 || userPlsJonesShare > 0, 'No rewards');

    uint256 claimablePlsDpx; // user portion claimable
    uint256 claimablePlsJones; // user portion claimable

    // Claim prorated amount for current epoch
    uint256 vestedDuration;

    unchecked {
      if (_claimDetails.lastClaimedTimestamp > rewardsForEpoch.addedAtTimestamp) {
        vestedDuration = block.timestamp - _claimDetails.lastClaimedTimestamp;
      } else {
        vestedDuration = block.timestamp - rewardsForEpoch.addedAtTimestamp;
      }

      claimablePlsDpx += (userPlsDpxShare * vestedDuration) / EPOCH_DURATION;
      claimablePlsJones += (userPlsJonesShare * vestedDuration) / EPOCH_DURATION;
    }

    bool _fullyClaimed;

    if (claimablePlsDpx > userPlsDpxShare - _claimDetails.plsDpxClaimedAmt) {
      // if claimable asset calculated is > claimable amt
      claimablePlsDpx = uint96(userPlsDpxShare - _claimDetails.plsDpxClaimedAmt);
      _fullyClaimed = true;
    } else {
      claimablePlsDpx = uint96(claimablePlsDpx);
    }

    if (claimablePlsJones > userPlsJonesShare - _claimDetails.plsJonesClaimedAmt) {
      // if claimable asset calculated is > claimable amt
      claimablePlsJones = uint96(userPlsJonesShare - _claimDetails.plsJonesClaimedAmt);
    } else {
      claimablePlsJones = uint96(claimablePlsJones);
    }

    _plsDpx = claimablePlsDpx;
    _plsJones = claimablePlsJones;
  }

  function pendingRewards() external view returns (uint256 _pendingDpx, uint256 _pendingJones) {
    uint32 _epoch = epoch;

    for (uint32 i = 0; i <= _epoch; i++) {
      if (!claimDetails[msg.sender][i].fullyClaimed) {
        (uint256 d, uint256 j) = pendingRewardsFor(i);
        _pendingDpx += d;
        _pendingJones += j;
      }
    }
  }

  /** OWNER */
  /// @dev deposit to rewards contract
  function depositRewards(uint96 _plsDpx, uint96 _plsJones) external onlyOwner {
    if (totalPlsDpxRewards == 0 && totalPlsJonesRewards == 0) {
      // No op - Don't increment it for very first deposit
    } else {
      epoch += 1;
    }

    epochRewards[epoch] = Reward({ addedAtTimestamp: uint32(block.timestamp), plsDpx: _plsDpx, plsJones: _plsJones });
    totalPlsJonesRewards += _plsJones;
    totalPlsDpxRewards += _plsDpx;

    plsDPX.transferFrom(msg.sender, address(this), _plsDpx);
    plsJONES.transferFrom(msg.sender, address(this), _plsJones);

    emit DepositRewards(epoch);
  }

  /**
    Retrieve stuck funds or new reward tokens
   */
  function retrieve(IERC20 token) external onlyOwner {
    if ((address(this).balance) != 0) {
      payable(owner()).transfer(address(this).balance);
    }

    token.transfer(owner(), token.balanceOf(address(this)));
  }

  event DepositRewards(uint32 epoch);
  event ClaimRewards(address indexed _recipient);
}

File 2 of 4 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.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 3 of 4 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @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.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * 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.
 */
abstract contract Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "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 virtual onlyOwner {
        _transferOwnership(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 virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 4 of 4 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_plsDpx","type":"address"},{"internalType":"address","name":"_plsJones","type":"address"},{"internalType":"address","name":"_staking","type":"address"},{"internalType":"address","name":"_oldRewards","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_recipient","type":"address"}],"name":"ClaimRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"epoch","type":"uint32"}],"name":"DepositRewards","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"},{"internalType":"uint32","name":"_epoch","type":"uint32"},{"internalType":"uint256","name":"_rewardAmt","type":"uint256"}],"name":"calculateShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint32","name":"","type":"uint32"}],"name":"claimDetails","outputs":[{"internalType":"bool","name":"fullyClaimed","type":"bool"},{"internalType":"uint32","name":"lastClaimedTimestamp","type":"uint32"},{"internalType":"uint96","name":"plsDpxClaimedAmt","type":"uint96"},{"internalType":"uint96","name":"plsJonesClaimedAmt","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint96","name":"_plsDpx","type":"uint96"},{"internalType":"uint96","name":"_plsJones","type":"uint96"}],"name":"depositRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"epoch","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"","type":"uint32"}],"name":"epochRewards","outputs":[{"internalType":"uint32","name":"addedAtTimestamp","type":"uint32"},{"internalType":"uint96","name":"plsDpx","type":"uint96"},{"internalType":"uint96","name":"plsJones","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"getAmount","outputs":[{"internalType":"bool","name":"hasWithdrawn","type":"bool"},{"internalType":"uint112","name":"amount","type":"uint112"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"migrated","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingRewards","outputs":[{"internalType":"uint256","name":"_pendingDpx","type":"uint256"},{"internalType":"uint256","name":"_pendingJones","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint32","name":"_epoch","type":"uint32"}],"name":"pendingRewardsFor","outputs":[{"internalType":"uint256","name":"_plsDpx","type":"uint256"},{"internalType":"uint256","name":"_plsJones","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"plsDPX","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"plsJONES","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"retrieve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"staking","outputs":[{"internalType":"contract IPlutusEpochStaking","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPlsDpxRewards","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalPlsJonesRewards","outputs":[{"internalType":"uint96","name":"","type":"uint96"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6101006040523480156200001257600080fd5b506040516200220d3803806200220d8339810160408190526200003591620003ec565b620000403362000073565b6001600160a01b0380851660805283811660a05282811660c052811660e05262000069620000c3565b5050505062000503565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060e0516001600160a01b031663900cf0cf6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200010157600080fd5b505afa15801562000116573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200013c91906200045e565b905080600060146101000a81548163ffffffff021916908363ffffffff16021790555060e0516001600160a01b0316639409927a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156200019b57600080fd5b505afa158015620001b0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001d691906200049b565b600160006101000a8154816001600160601b0302191690836001600160601b0316021790555060e0516001600160a01b031663590c2be96040518163ffffffff1660e01b815260040160206040518083038186803b1580156200023857600080fd5b505afa1580156200024d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200027391906200049b565b6001600c6101000a8154816001600160601b0302191690836001600160601b0316021790555060005b8163ffffffff168163ffffffff1611620003cb5760e051604051632d15671d60e21b815263ffffffff83166004820152600091829182916001600160a01b03169063b4559c749060240160606040518083038186803b158015620002ff57600080fd5b505afa15801562000314573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200033a9190620004b9565b6040805160608101825263ffffffff94851681526001600160601b0393841660208083019182529385168284019081528a8716600090815260039095529290932090518154935192518516600160801b02600160801b600160e01b031993909516640100000000026001600160801b031990941695169490941791909117161790555050600190910190506200029c565b5050565b80516001600160a01b0381168114620003e757600080fd5b919050565b600080600080608085870312156200040357600080fd5b6200040e85620003cf565b93506200041e60208601620003cf565b92506200042e60408601620003cf565b91506200043e60608601620003cf565b905092959194509250565b805163ffffffff81168114620003e757600080fd5b6000602082840312156200047157600080fd5b6200047c8262000449565b9392505050565b80516001600160601b0381168114620003e757600080fd5b600060208284031215620004ae57600080fd5b6200047c8262000483565b600080600060608486031215620004cf57600080fd5b620004da8462000449565b9250620004ea6020850162000483565b9150620004fa6040850162000483565b90509250925092565b60805160a05160c05160e051611c986200057560003960008181610c330152611249015260008181610288015281816109d401528181610fc0015261108f0152600081816102f2015281816108a50152611826015260008181610170015281816107f5015261173e0152611c986000f3fe608060405234801561001057600080fd5b50600436106101515760003560e01c806386012bfd116100cd578063d1058e5911610081578063ef99e12b11610066578063ef99e12b14610419578063f2fde38b1461042c578063f5a797671461043f57600080fd5b8063d1058e59146103f4578063eded3fda146103fc57600080fd5b8063900cf0cf116100b2578063900cf0cf146103465780639409927a14610372578063b4559c741461038557600080fd5b806386012bfd146103145780638da5cb5b1461033557600080fd5b80634ba0a5ee11610124578063590c2be911610109578063590c2be9146102aa578063715018a6146102e557806375aff88f146102ed57600080fd5b80634ba0a5ee146102505780634cf088d91461028357600080fd5b80630a79309b146101565780630c913b341461016b5780631e6ad350146101af5780631fb18797146101c2575b600080fd5b6101696101643660046118f6565b610478565b005b6101927f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6101696101bd36600461192f565b61060d565b61021a6101d036600461197a565b600260209081526000928352604080842090915290825290205460ff81169063ffffffff610100820416906001600160601b03650100000000008204811691600160881b90041684565b60408051941515855263ffffffff90931660208501526001600160601b03918216928401929092521660608201526080016101a6565b61027361025e3660046118f6565b60046020526000908152604090205460ff1681565b60405190151581526020016101a6565b6101927f000000000000000000000000000000000000000000000000000000000000000081565b6001546102cd906c0100000000000000000000000090046001600160601b031681565b6040516001600160601b0390911681526020016101a6565b610169610971565b6101927f000000000000000000000000000000000000000000000000000000000000000081565b6103276103223660046119a8565b610985565b6040519081526020016101a6565b6000546001600160a01b0316610192565b60005461035d90600160a01b900463ffffffff1681565b60405163ffffffff90911681526020016101a6565b6001546102cd906001600160601b031681565b6103c86103933660046119e9565b60036020526000908152604090205463ffffffff8116906001600160601b036401000000008204811691600160801b90041683565b6040805163ffffffff90941684526001600160601b0392831660208501529116908201526060016101a6565b610169610a93565b610404610afb565b604080519283526020830191909152016101a6565b6104046104273660046119e9565b610b8f565b61016961043a3660046118f6565b610ef1565b61045261044d3660046118f6565b610f81565b6040805192151583526dffffffffffffffffffffffffffff9091166020830152016101a6565b610480611112565b47156104c257600080546040516001600160a01b03909116914780156108fc02929091818181858888f193505050501580156104c0573d6000803e3d6000fd5b505b806001600160a01b031663a9059cbb6104e36000546001600160a01b031690565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526001600160a01b038516906370a082319060240160206040518083038186803b15801561053b57600080fd5b505afa15801561054f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105739190611a06565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b1580156105d157600080fd5b505af11580156105e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106099190611a34565b5050565b610615611112565b6001546001600160601b031615801561064757506001546c0100000000000000000000000090046001600160601b0316155b1561065157610692565b6001600060148282829054906101000a900463ffffffff166106739190611a65565b92506101000a81548163ffffffff021916908363ffffffff1602179055505b6040805160608101825263ffffffff42811682526001600160601b03808616602080850191825286831685870190815260008054600160a01b900486168152600390925295902093518454915195518316600160801b027fffffffff000000000000000000000000ffffffffffffffffffffffffffffffff968416640100000000027fffffffffffffffffffffffffffffffff0000000000000000000000000000000090931691909416171793909316179055600180548392600c9161076a9185916c01000000000000000000000000900416611a8d565b92506101000a8154816001600160601b0302191690836001600160601b0316021790555081600160008282829054906101000a90046001600160601b03166107b29190611a8d565b82546101009290920a6001600160601b038181021990931691831602179091556040516323b872dd60e01b815233600482015230602482015290841660448201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031691506323b872dd90606401602060405180830381600087803b15801561084257600080fd5b505af1158015610856573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087a9190611a34565b506040516323b872dd60e01b81523360048201523060248201526001600160601b03821660448201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906323b872dd90606401602060405180830381600087803b1580156108f157600080fd5b505af1158015610905573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109299190611a34565b50600054604051600160a01b90910463ffffffff1681527fabccf803841244f7fef97d8d38bdf09763ebee3f13639f30d1a1b1cf79c937989060200160405180910390a15050565b610979611112565b610983600061116c565b565b60008061099185610f81565b6040517f446b0d3400000000000000000000000000000000000000000000000000000000815263ffffffff87166004820152909250600091506001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063446b0d349060240160606040518083038186803b158015610a1657600080fd5b505afa158015610a2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a4e9190611acd565b92505050806dffffffffffffffffffffffffffff1684836dffffffffffffffffffffffffffff16610a7f9190611b15565b610a899190611b4a565b9695505050505050565b610a9c336111d4565b60008054600160a01b900463ffffffff16905b8163ffffffff168163ffffffff16116106095733600090815260026020908152604080832063ffffffff8516845290915290205460ff16610af357610af3816113e1565b600101610aaf565b600080548190600160a01b900463ffffffff16815b8163ffffffff168163ffffffff1611610b895733600090815260026020908152604080832063ffffffff8516845290915290205460ff16610b7757600080610b5783610b8f565b9092509050610b668287611b6c565b9550610b728186611b6c565b945050505b80610b8181611b84565b915050610b10565b50509091565b33600090815260026020908152604080832063ffffffff80861685529083528184208251608081018452905460ff81161515825261010081049092169381018490526001600160601b03650100000000008304811693820193909352600160881b90910490911660608201528291610d0657604051631fb1879760e01b815233600482015263ffffffff851660248201526000908190819081906001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001690631fb187979060440160806040518083038186803b158015610c7557600080fd5b505afa158015610c89573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cad9190611ba8565b93509350935093508263ffffffff16600014610d0157604051806080016040528085151581526020018463ffffffff168152602001836001600160601b03168152602001826001600160601b031681525094505b505050505b63ffffffff80851660009081526003602090815260408083208151606081018352905494851681526001600160601b0364010000000086048116938201849052600160801b90950490941690840152610d629033908890610985565b90506000610d7e338885604001516001600160601b0316610985565b90506000821180610d8f5750600081115b610dcd5760405162461bcd60e51b815260206004820152600a6024820152694e6f207265776172647360b01b60448201526064015b60405180910390fd5b6000806000856000015163ffffffff16876020015163ffffffff161115610e015750602086015163ffffffff164203610e0d565b50845163ffffffff1642035b622819a08582020483019250622819a081850281610e2d57610e2d611b34565b0482019150600087604001516001600160601b031686610e4d9190611c04565b841115610e80576040880151610e6c906001600160601b031687611c04565b6001600160601b0316935060019050610e8d565b836001600160601b031693505b6060880151610ea5906001600160601b031686611c04565b831115610ed4576060880151610ec4906001600160601b031686611c04565b6001600160601b03169250610ee1565b826001600160601b031692505b5091999098509650505050505050565b610ef9611112565b6001600160a01b038116610f755760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610dc4565b610f7e8161116c565b50565b6040517f7b7ce6510000000000000000000000000000000000000000000000000000000081526001600160a01b038281166004830152600091829182917f000000000000000000000000000000000000000000000000000000000000000090911690637b7ce65190602401604080518083038186803b15801561100357600080fd5b505afa158015611017573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103b9190611c1b565b909250905063ffffffff81161561110c576040517f38c621510000000000000000000000000000000000000000000000000000000081526001600160a01b03858116600483015260016024830181905294507f000000000000000000000000000000000000000000000000000000000000000016906338c621519060440160206040518083038186803b1580156110d157600080fd5b505afa1580156110e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111099190611c47565b91505b50915091565b6000546001600160a01b031633146109835760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610dc4565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811660009081526004602052604090205460ff16156111f85750565b60005b60005463ffffffff600160a01b9091048116908216116113bc57604051631fb1879760e01b81526001600160a01b03838116600483015263ffffffff831660248301526000918291829182917f00000000000000000000000000000000000000000000000000000000000000001690631fb187979060440160806040518083038186803b15801561128b57600080fd5b505afa15801561129f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112c39190611ba8565b60408051608081018252941515855263ffffffff93841660208087019182526001600160601b03948516878401908152938516606088019081526001600160a01b038e166000908152600283528481208e89168252909252929020955186549151935192518516600160881b027fffffff000000000000000000000000ffffffffffffffffffffffffffffffffff939095166501000000000002929092167fffffff000000000000000000000000000000000000000000000000ffffffffff939095166101000264ffffffff00199215159290921664ffffffffff19909116171716919091171790555050600190920191506111fb9050565b506001600160a01b03166000908152600460205260409020805460ff19166001179055565b33600081815260026020908152604080832063ffffffff8087168086529184528285208351608081018552905460ff81161515825261010081048316828701526001600160601b03650100000000008204811683870152600160881b9091048116606080840191909152938752600386528487208551948501865254928316845264010000000083048116958401869052600160801b90920490911692820192909252909390929161149591908690610985565b905060006114b1338685604001516001600160601b0316610985565b905060008211806114c25750600081115b6114fb5760405162461bcd60e51b815260206004820152600a6024820152694e6f207265776172647360b01b6044820152606401610dc4565b6000806000856000015163ffffffff16876020015163ffffffff16111561152f5750602086015163ffffffff16420361153b565b50845163ffffffff1642035b622819a08582020483019250622819a08185028161155b5761155b611b34565b0482019150600087604001516001600160601b03168661157b9190611c04565b8411156115ae57604088015161159a906001600160601b031687611c04565b6001600160601b03169350600190506115bb565b836001600160601b031693505b60608801516115d3906001600160601b031686611c04565b8311156116025760608801516115f2906001600160601b031686611c04565b6001600160601b0316925061160f565b826001600160601b031692505b604051806080016040528082151581526020014263ffffffff168152602001858a60400151016001600160601b03168152602001848a60600151016001600160601b031681525060026000336001600160a01b03166001600160a01b0316815260200190815260200160002060008b63ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548163ffffffff021916908363ffffffff16021790555060408201518160000160056101000a8154816001600160601b0302191690836001600160601b0316021790555060608201518160000160116101000a8154816001600160601b0302191690836001600160601b031602179055509050507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb33866040518363ffffffff1660e01b815260040161179e9291906001600160a01b03929092168252602082015260400190565b602060405180830381600087803b1580156117b857600080fd5b505af11580156117cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f09190611a34565b506040517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018490527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063a9059cbb90604401602060405180830381600087803b15801561187257600080fd5b505af1158015611886573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118aa9190611a34565b5060405133907f0178be5ff07ff0255343266c94130c9a7c518cf8ba70cbf6198cfb3572ab9d3f90600090a2505050505050505050565b6001600160a01b0381168114610f7e57600080fd5b60006020828403121561190857600080fd5b8135611913816118e1565b9392505050565b6001600160601b0381168114610f7e57600080fd5b6000806040838503121561194257600080fd5b823561194d8161191a565b9150602083013561195d8161191a565b809150509250929050565b63ffffffff81168114610f7e57600080fd5b6000806040838503121561198d57600080fd5b8235611998816118e1565b9150602083013561195d81611968565b6000806000606084860312156119bd57600080fd5b83356119c8816118e1565b925060208401356119d881611968565b929592945050506040919091013590565b6000602082840312156119fb57600080fd5b813561191381611968565b600060208284031215611a1857600080fd5b5051919050565b80518015158114611a2f57600080fd5b919050565b600060208284031215611a4657600080fd5b61191382611a1f565b634e487b7160e01b600052601160045260246000fd5b600063ffffffff808316818516808303821115611a8457611a84611a4f565b01949350505050565b60006001600160601b03808316818516808303821115611a8457611a84611a4f565b80516dffffffffffffffffffffffffffff81168114611a2f57600080fd5b600080600060608486031215611ae257600080fd5b8351611aed81611968565b6020850151909350611afe81611968565b9150611b0c60408501611aaf565b90509250925092565b6000816000190483118215151615611b2f57611b2f611a4f565b500290565b634e487b7160e01b600052601260045260246000fd5b600082611b6757634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611b7f57611b7f611a4f565b500190565b600063ffffffff80831681811415611b9e57611b9e611a4f565b6001019392505050565b60008060008060808587031215611bbe57600080fd5b611bc785611a1f565b93506020850151611bd781611968565b6040860151909350611be88161191a565b6060860151909250611bf98161191a565b939692955090935050565b600082821015611c1657611c16611a4f565b500390565b60008060408385031215611c2e57600080fd5b611c3783611aaf565b9150602083015161195d81611968565b600060208284031215611c5957600080fd5b61191382611aaf56fea2646970667358221220dc2917cd95d0d9a27cec9411420ed4d54d413e405a7ce03a288b302af5cbbfe064736f6c63430008090033000000000000000000000000f236ea74b515ef96a9898f5a4ed4aa591f253ce1000000000000000000000000e7f6c3c1f0018e4c08acc52965e5cbff99e34a44000000000000000000000000beb981021ed9c85aa51d96c0c2eda10ee4404a2e0000000000000000000000006e1954da37fad279114035a45da49ca30ea5a988

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000f236ea74b515ef96a9898f5a4ed4aa591f253ce1000000000000000000000000e7f6c3c1f0018e4c08acc52965e5cbff99e34a44000000000000000000000000beb981021ed9c85aa51d96c0c2eda10ee4404a2e0000000000000000000000006e1954da37fad279114035a45da49ca30ea5a988

-----Decoded View---------------
Arg [0] : _plsDpx (address): 0xf236ea74b515ef96a9898f5a4ed4aa591f253ce1
Arg [1] : _plsJones (address): 0xe7f6c3c1f0018e4c08acc52965e5cbff99e34a44
Arg [2] : _staking (address): 0xbeb981021ed9c85aa51d96c0c2eda10ee4404a2e
Arg [3] : _oldRewards (address): 0x6e1954da37fad279114035a45da49ca30ea5a988

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000f236ea74b515ef96a9898f5a4ed4aa591f253ce1
Arg [1] : 000000000000000000000000e7f6c3c1f0018e4c08acc52965e5cbff99e34a44
Arg [2] : 000000000000000000000000beb981021ed9c85aa51d96c0c2eda10ee4404a2e
Arg [3] : 0000000000000000000000006e1954da37fad279114035a45da49ca30ea5a988


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