Contract 0xf6e62b59dbd8c8395321f886bd06ecf04f57c088 2

 
 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0x6e21da95c91d8fe5ed6809979178b7efd10932ecc9634183d3854d864c0849fdHarvest111215192021-09-22 0:06:1411 hrs 27 mins ago0x46f0469a56bea9487851fa0bd5228ee793ceaebb IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00070109
0xae55765e336a6c6b8028d77e7ddd13b7d4b24f1b00e5c5cd7fe5111fa4fe6453Harvest110836292021-09-20 16:22:071 day 19 hrs ago0x383c88957e2346d23892a6427869c2630b046f48 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00077609
0xefe63f5a745eaeff79de85ceaf2ec60a887dd9d71715f490757f4f0f958a340bHarvest109847242021-09-17 5:34:215 days 5 hrs ago0x6f9ac5b3fa4308620c6763d9aa5a65446e75f5b5 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00077609
0x635451bacc4abc787e8c19a88e7a6f8adf37cf39fc688cd02a1fa3e7d3639270Harvest108968302021-09-14 4:06:158 days 7 hrs ago0x6f9ac5b3fa4308620c6763d9aa5a65446e75f5b5 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00077609
0x6ab4240ae2054e20920487a0e60dcb684e29fd5d0b8b76d6df56b4f364f6c7abHarvest108419262021-09-12 6:16:4810 days 5 hrs ago0x383c88957e2346d23892a6427869c2630b046f48 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00077609
0xe7a89a564a17cfe674670527c2530d9ae3a8da9f746dc7953bb23cc61a5d34edHarvest107673552021-09-09 15:30:5112 days 20 hrs ago0x6f9ac5b3fa4308620c6763d9aa5a65446e75f5b5 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00077609
0x9aa482dea372990f8918690c814d7e8e51b177a00fa0970bd9151ff9ebae93f0Harvest107530662021-09-09 3:27:1513 days 8 hrs ago0x5254921ff79c939a68ac5263e64dc1ae23e48933 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00070109
0x41af82542234e59890759e308b9b47056e43bdb3289b3dd27c46ba2cc862246cHarvest107530502021-09-09 3:26:2613 days 8 hrs ago0x313f39123cc3981f032135de838726b4891c3ac4 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00070109
0xa899bfd0a0c5f162d5d4ddf4f6ed34372326afe02e4888a48478130fad0bf694Harvest106419352021-09-05 5:52:3017 days 5 hrs ago0x383c88957e2346d23892a6427869c2630b046f48 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00077609
0x41d41468233cb1f9d19b1c55a7dd7c62f4f11200e2f65befa694af71f439067cHarvest106284352021-09-04 18:36:2517 days 16 hrs ago0x46f0469a56bea9487851fa0bd5228ee793ceaebb IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00077609
0xe712811cf4ca52e338bf3abee606058eefae12349acb766eaae960075658f6d0Harvest106229302021-09-04 13:55:1217 days 21 hrs ago0x6f9ac5b3fa4308620c6763d9aa5a65446e75f5b5 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00077609
0x9bbc58d1fa5f188b55cfda97b0cf2721515333929d8e330cc7425c6a020f726dHarvest105578832021-09-02 7:13:0320 days 4 hrs ago0x6f9ac5b3fa4308620c6763d9aa5a65446e75f5b5 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00077609
0x49d0137a58c7d1d9c8339de16bf8f38858e9ad7353efc7ecdc171734953f3f3bHarvest104431722021-08-29 6:20:4524 days 5 hrs ago0x383c88957e2346d23892a6427869c2630b046f48 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00077609
0x3ff5eb7563013e52421fedc330e0f2efa9bcb1bf843cfb413bc20cf8bdbf89b8Harvest104353732021-08-28 23:50:1824 days 11 hrs ago0x313f39123cc3981f032135de838726b4891c3ac4 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00070109
0x1a2d002fd1ff693f8ef8987fe657e4f646b41d2adab041a496b968dfdbfec957Harvest104353582021-08-28 23:49:3324 days 11 hrs ago0x5254921ff79c939a68ac5263e64dc1ae23e48933 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00070109
0xc74a29f44072a2b03f0ca474133c7239d73fe5673283f30ec0537384673cd14bHarvest103881662021-08-27 7:16:0326 days 4 hrs ago0x6f9ac5b3fa4308620c6763d9aa5a65446e75f5b5 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00077609
0x45b3198a83f8bc17947e55e7e7fdc4fcf4e6344bc4ddb177ad3c00b0448e5d77Harvest103481652021-08-25 21:50:1027 days 13 hrs ago0x46f0469a56bea9487851fa0bd5228ee793ceaebb IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00070109
0xf0720243dee62024ffb508c63f336e9b89222e673b97ceea2dae69a0f234e330Harvest103047002021-08-24 9:27:2829 days 2 hrs ago0x6f9ac5b3fa4308620c6763d9aa5a65446e75f5b5 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00077609
0x4cb84e3ff775af00fb384b871f88e4f14b1ff5ca648aedf5473ca80b99e48491Harvest102844562021-08-23 16:31:1129 days 19 hrs ago0x313f39123cc3981f032135de838726b4891c3ac4 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00077609
0x57fa06cb2db3fde53eb9d6828ea5a3726bfaf5847191beb23632fbbf710a8727Harvest102844302021-08-23 16:29:5329 days 19 hrs ago0x5254921ff79c939a68ac5263e64dc1ae23e48933 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00077609
0x440dce5292d06a2fffb91fc3a53a5078028ce8f797d44a27a4e7c97acebdf3caHarvest102390222021-08-22 2:29:2831 days 9 hrs ago0x383c88957e2346d23892a6427869c2630b046f48 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00077609
0xcca235a19c1b2df2b2035069c3371eff75283621e263eb4271a2115384c38bc2Harvest101817182021-08-20 2:19:1833 days 9 hrs ago0x46f0469a56bea9487851fa0bd5228ee793ceaebb IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00077609
0x7ea466f278c13656dffb36e094f84f342ca582aaf0e3914578234ec859746172Harvest101545412021-08-19 3:27:2034 days 8 hrs ago0x6f9ac5b3fa4308620c6763d9aa5a65446e75f5b5 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00070109
0x03627c99ed6a92bf8ba6634ffde148d9844408f6f20aa58152a300b81cf0358bHarvest100612762021-08-15 21:32:2937 days 14 hrs ago0x5254921ff79c939a68ac5263e64dc1ae23e48933 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00070109
0xce58befe327e87891bdbad0d78951027fee8c9906c5df2eaf7cafd6a0976366fHarvest100611442021-08-15 21:25:5337 days 14 hrs ago0x313f39123cc3981f032135de838726b4891c3ac4 IN  0xf6e62b59dbd8c8395321f886bd06ecf04f57c0880 BNB0.00070109
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MagneticField

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 10000 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 12 : MagneticField.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./OwnerPausable.sol";
import "./interfaces/IMagnetic.sol";
import "./MagnetToken.sol";

// MagneticField is a smart contract for distributing Magnet by asking user to stake the ERC20-based token.
contract MagneticField is IMagnetic, Ownable {
  using SafeMath for uint256;
  using SafeERC20 for IERC20;

  // Info of each user.
  struct UserInfo {
    uint256 amount; // How many Staking tokens the user has provided.
    uint256 rewardDebt; // Reward debt. See explanation below.
    uint256 bonusDebt; // Last block that user exec something to the pool.
    address fundedBy; // Funded by who?
    //
    // We do some fancy math here. Basically, any point in time, the amount of Magnets
    // entitled to a user but is pending to be distributed is:
    //
    //   pending reward = (user.amount * pool.accMagnetPerShare) - user.rewardDebt
    //
    // Whenever a user deposits or withdraws Staking tokens to a pool. Here's what happens:
    //   1. The pool's `accMagnetPerShare` (and `lastRewardBlock`) gets updated.
    //   2. User receives the pending reward sent to his/her address.
    //   3. User's `amount` gets updated.
    //   4. User's `rewardDebt` gets updated.
  }

  // Info of each pool.
  struct PoolInfo {
    address stakeToken; // Address of Staking token contract.
    uint256 allocPoint; // How many allocation points assigned to this pool. MAGNETs to distribute per block.
    uint256 lastRewardBlock; // Last block number that MAGNETs distribution occurs.
    uint256 accMagnetPerShare; // Accumulated MAGNETs per share, times 1e12. See below.
    uint256 accMagnetPerShareTilBonusEnd; // Accumated MAGNETs per share until Bonus End.
  }

  // The Magnet TOKEN!
  MagnetToken public magnet;
  // Dev address.
  address public devaddr;
  // MAGNET tokens created per block.
  uint256 public magnetPerBlock;
  // Bonus muliplier for early magnet makers.
  uint256 public bonusMultiplier;
  // Block number when bonus MAGNET period ends.
  uint256 public bonusEndBlock;
  // Bonus lock-up in BPS
  uint256 public bonusLockUpBps;

  // Info of existing stake token
  mapping(address => bool) existTokens;

  // Info of each pool.
  PoolInfo[] public poolInfo;
  // Info of each user that stakes Staking tokens.
  mapping(uint256 => mapping(address => UserInfo)) public userInfo;
  // Total allocation poitns. Must be the sum of all allocation points in all pools.
  uint256 public totalAllocPoint;
  // The block number when MAGNET mining starts.
  uint256 public startBlock;

  event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
  event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
  event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount);

  constructor(
    MagnetToken _magnet,
    address _devaddr,
    uint256 _magnetPerBlock,
    uint256 _startBlock,
    uint256 _bonusLockupBps,
    uint256 _bonusMultiplier,
    uint256 _bonusEndBlock
  ) public {
    totalAllocPoint = 0;
    magnet = _magnet;
    devaddr = _devaddr;
    bonusMultiplier = _bonusMultiplier;
    magnetPerBlock = _magnetPerBlock;
    bonusLockUpBps = _bonusLockupBps;
    bonusEndBlock = _bonusEndBlock;
    startBlock = _startBlock;
  }

  /*
  ██████╗░░█████╗░██████╗░░█████╗░███╗░░░███╗  ░██████╗███████╗████████╗████████╗███████╗██████╗░
  ██╔══██╗██╔══██╗██╔══██╗██╔══██╗████╗░████║  ██╔════╝██╔════╝╚══██╔══╝╚══██╔══╝██╔════╝██╔══██╗
  ██████╔╝███████║██████╔╝███████║██╔████╔██║  ╚█████╗░█████╗░░░░░██║░░░░░░██║░░░█████╗░░██████╔╝
  ██╔═══╝░██╔══██║██╔══██╗██╔══██║██║╚██╔╝██║  ░╚═══██╗██╔══╝░░░░░██║░░░░░░██║░░░██╔══╝░░██╔══██╗
  ██║░░░░░██║░░██║██║░░██║██║░░██║██║░╚═╝░██║  ██████╔╝███████╗░░░██║░░░░░░██║░░░███████╗██║░░██║
  ╚═╝░░░░░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░░░░╚═╝  ╚═════╝░╚══════╝░░░╚═╝░░░░░░╚═╝░░░╚══════╝╚═╝░░╚═╝
  */

  // Update dev address by the previous dev.
  function setDev(address _devaddr) public {
    require(msg.sender == devaddr, "dev: wut?");
    devaddr = _devaddr;
  }

  function setMagnetPerBlock(uint256 _magnetPerBlock) public onlyOwner {
    magnetPerBlock = _magnetPerBlock;
  }

  // Set Bonus params. bonus will start to accu on the next block that this function executed
  // See the calculation and counting in test file.
  function setBonus(
    uint256 _bonusMultiplier,
    uint256 _bonusEndBlock,
    uint256 _bonusLockUpBps
  ) public onlyOwner {
    require(_bonusEndBlock > block.number, "setBonus: bad bonusEndBlock");
    require(_bonusMultiplier > 1, "setBonus: bad bonusMultiplier");
    bonusMultiplier = _bonusMultiplier;
    bonusEndBlock = _bonusEndBlock;
    bonusLockUpBps = _bonusLockUpBps;
  }

  // Add a new lp to the pool. Can only be called by the owner.
  function addPool(
    uint256 _allocPoint,
    address _stakeToken,
    bool _withUpdate
  ) public override onlyOwner {
    if (_withUpdate) {
      massUpdatePools();
    }
    require(_stakeToken != address(0), "add: not stakeToken addr");
    require(!isDuplicatedPool(_stakeToken), "add: stakeToken dup");
    uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock;
    totalAllocPoint = totalAllocPoint.add(_allocPoint);
    existTokens[_stakeToken] = true;
    poolInfo.push(
      PoolInfo({
        stakeToken: _stakeToken,
        allocPoint: _allocPoint,
        lastRewardBlock: lastRewardBlock,
        accMagnetPerShare: 0,
        accMagnetPerShareTilBonusEnd: 0
      })
    );
  }

  // Update the given pool's MAGNET allocation point. Can only be called by the owner.
  function setPool(
    uint256 _pid,
    uint256 _allocPoint,
    bool _withUpdate
  ) public override onlyOwner {
    if (_withUpdate) {
      massUpdatePools();
    }
    totalAllocPoint = totalAllocPoint.sub(poolInfo[_pid].allocPoint).add(_allocPoint);
    poolInfo[_pid].allocPoint = _allocPoint;
  }

  /*
  ░██╗░░░░░░░██╗░█████╗░██████╗░██╗░░██╗
  ░██║░░██╗░░██║██╔══██╗██╔══██╗██║░██╔╝
  ░╚██╗████╗██╔╝██║░░██║██████╔╝█████═╝░
  ░░████╔═████║░██║░░██║██╔══██╗██╔═██╗░
  ░░╚██╔╝░╚██╔╝░╚█████╔╝██║░░██║██║░╚██╗
  ░░░╚═╝░░░╚═╝░░░╚════╝░╚═╝░░╚═╝╚═╝░░╚═╝
  */

  function isDuplicatedPool(address _stakeToken) public view returns (bool) {
    return existTokens[_stakeToken];
  }

  function poolLength() external override view returns (uint256) {
    return poolInfo.length;
  }

  // Return reward multiplier over the given _from to _to block.
  function getMultiplier(uint256 _lastRewardBlock, uint256 _currentBlock) public view returns (uint256) {
    if (_currentBlock <= bonusEndBlock) {
      return _currentBlock.sub(_lastRewardBlock).mul(bonusMultiplier);
    }
    if (_lastRewardBlock >= bonusEndBlock) {
      return _currentBlock.sub(_lastRewardBlock);
    }
    // This is the case where bonusEndBlock is in the middle of _lastRewardBlock and _currentBlock block.
    return bonusEndBlock.sub(_lastRewardBlock).mul(bonusMultiplier).add(_currentBlock.sub(bonusEndBlock));
  }

  // View function to see pending MAGNETs on frontend.
  function pendingMagnet(uint256 _pid, address _user) external override view returns (uint256) {
    PoolInfo storage pool = poolInfo[_pid];
    UserInfo storage user = userInfo[_pid][_user];
    uint256 accMagnetPerShare = pool.accMagnetPerShare;
    uint256 lpSupply = IERC20(pool.stakeToken).balanceOf(address(this));
    if (block.number > pool.lastRewardBlock && lpSupply != 0) {
      uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
      uint256 magnetReward = multiplier.mul(magnetPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
      accMagnetPerShare = accMagnetPerShare.add(magnetReward.mul(1e12).div(lpSupply));
    }
    return user.amount.mul(accMagnetPerShare).div(1e12).sub(user.rewardDebt);
  }

  // Update reward vairables for all pools. Be careful of gas spending!
  function massUpdatePools() public {
    uint256 length = poolInfo.length;
    for (uint256 pid = 0; pid < length; ++pid) {
      updatePool(pid);
    }
  }

  // Update reward variables of the given pool to be up-to-date.
  function updatePool(uint256 _pid) public override {
    PoolInfo storage pool = poolInfo[_pid];
    if (block.number <= pool.lastRewardBlock) {
      return;
    }
    uint256 lpSupply = IERC20(pool.stakeToken).balanceOf(address(this));
    if (lpSupply == 0) {
      pool.lastRewardBlock = block.number;
      return;
    }
    uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
    uint256 magnetReward = multiplier.mul(magnetPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
    magnet.mint(devaddr, magnetReward.div(10));
    magnet.mint(address(this), magnetReward);
    pool.accMagnetPerShare = pool.accMagnetPerShare.add(magnetReward.mul(1e12).div(lpSupply));
    // update accMagnetPerShareTilBonusEnd
    if (block.number <= bonusEndBlock) {
      magnet.lock(devaddr, magnetReward.div(10).mul(bonusLockUpBps).div(10000));
      pool.accMagnetPerShareTilBonusEnd = pool.accMagnetPerShare;
    }
    if(block.number > bonusEndBlock && pool.lastRewardBlock < bonusEndBlock) {
      uint256 magnetBonusPortion = bonusEndBlock.sub(pool.lastRewardBlock).mul(bonusMultiplier).mul(magnetPerBlock).mul(pool.allocPoint).div(totalAllocPoint);
      magnet.lock(devaddr, magnetBonusPortion.div(10).mul(bonusLockUpBps).div(10000));
      pool.accMagnetPerShareTilBonusEnd = pool.accMagnetPerShareTilBonusEnd.add(magnetBonusPortion.mul(1e12).div(lpSupply));
    }
    pool.lastRewardBlock = block.number;
  }

  // Deposit Staking tokens to FieldToken for MAGNET allocation.
  function deposit(address _for, uint256 _pid, uint256 _amount) public override {
    PoolInfo storage pool = poolInfo[_pid];
    UserInfo storage user = userInfo[_pid][_for];
    if (user.fundedBy != address(0)) require(user.fundedBy == msg.sender, "bad sof");
    require(pool.stakeToken != address(0), "deposit: not accept deposit");
    updatePool(_pid);
    if (user.amount > 0) _harvest(_for, _pid);
    if (user.fundedBy == address(0)) user.fundedBy = msg.sender;
    IERC20(pool.stakeToken).safeTransferFrom(address(msg.sender), address(this), _amount);
    user.amount = user.amount.add(_amount);
    user.rewardDebt = user.amount.mul(pool.accMagnetPerShare).div(1e12);
    user.bonusDebt = user.amount.mul(pool.accMagnetPerShareTilBonusEnd).div(1e12);
    emit Deposit(msg.sender, _pid, _amount);
  }

  // Withdraw Staking tokens from FieldToken.
  function withdraw(address _for, uint256 _pid, uint256 _amount) public override {
    _withdraw(_for, _pid, _amount);
  }

  function withdrawAll(address _for, uint256 _pid) public override {
    _withdraw(_for, _pid, userInfo[_pid][_for].amount);
  }

  function _withdraw(address _for, uint256 _pid, uint256 _amount) internal {
    PoolInfo storage pool = poolInfo[_pid];
    UserInfo storage user = userInfo[_pid][_for];
    require(user.fundedBy == msg.sender, "only funder");
    require(user.amount >= _amount, "withdraw: not good");
    updatePool(_pid);
    _harvest(_for, _pid);
    user.amount = user.amount.sub(_amount);
    user.rewardDebt = user.amount.mul(pool.accMagnetPerShare).div(1e12);
    user.bonusDebt = user.amount.mul(pool.accMagnetPerShareTilBonusEnd).div(1e12);
    if (pool.stakeToken != address(0)) {
      IERC20(pool.stakeToken).safeTransfer(address(msg.sender), _amount);
    }
    emit Withdraw(msg.sender, _pid, user.amount);
  }

  // Harvest MAGNETs earn from the pool.
  function harvest(uint256 _pid) public override {
    PoolInfo storage pool = poolInfo[_pid];
    UserInfo storage user = userInfo[_pid][msg.sender];
    updatePool(_pid);
    _harvest(msg.sender, _pid);
    user.rewardDebt = user.amount.mul(pool.accMagnetPerShare).div(1e12);
    user.bonusDebt = user.amount.mul(pool.accMagnetPerShareTilBonusEnd).div(1e12);
  }

  function _harvest(address _to, uint256 _pid) internal {
    PoolInfo storage pool = poolInfo[_pid];
    UserInfo storage user = userInfo[_pid][_to];
    require(user.amount > 0, "nothing to harvest");
    uint256 pending = user.amount.mul(pool.accMagnetPerShare).div(1e12).sub(user.rewardDebt);
    require(pending <= magnet.balanceOf(address(this)), "wtf not enough magnet");
    uint256 bonus = user.amount.mul(pool.accMagnetPerShareTilBonusEnd).div(1e12).sub(user.bonusDebt);
    safeMagnetTransfer(_to, pending);
    magnet.lock(_to, bonus.mul(bonusLockUpBps).div(10000));
  }

  // Withdraw without caring about rewards. EMERGENCY ONLY.
  function emergencyWithdraw(uint256 _pid) public {
    PoolInfo storage pool = poolInfo[_pid];
    UserInfo storage user = userInfo[_pid][msg.sender];
    IERC20(pool.stakeToken).safeTransfer(address(msg.sender), user.amount);
    emit EmergencyWithdraw(msg.sender, _pid, user.amount);
    user.amount = 0;
    user.rewardDebt = 0;
  }

    // Safe magnet transfer function, just in case if rounding error causes pool to not have enough MAGNETs.
  function safeMagnetTransfer(address _to, uint256 _amount) internal {
    uint256 magnetBal = magnet.balanceOf(address(this));
    if (_amount > magnetBal) {
      magnet.transfer(_to, magnetBal);
    } else {
      magnet.transfer(_to, _amount);
    }
  }

}

File 2 of 12 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 3 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @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 `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @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);
}

File 4 of 12 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 5 of 12 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () internal {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), msgSender);
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        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 {
        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 virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 6 of 12 : OwnerPausable.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.6.12;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Pausable.sol";

/**
 * @title OwnerPausable
 * @notice An ownable contract allows the owner to pause and unpause the
 * contract without a delay.
 * @dev Only methods using the provided modifiers will be paused.
 */
abstract contract OwnerPausable is
    Ownable,
    Pausable
{
    /**
     * @notice Pause the contract. Revert if already paused.
     */
    function pause() external onlyOwner {
        _pause();
    }

    /**
     * @notice Unpause the contract. Revert if already unpaused.
     */
    function unpause() external onlyOwner {
        _unpause();
    }
}

File 7 of 12 : IMagnetic.sol
interface IMagnetic {
  function poolLength() external view returns (uint256);

  function addPool(
    uint256 _allocPoint,
    address _stakeToken,
    bool _withUpdate
  ) external;

  function setPool(
    uint256 _pid,
    uint256 _allocPoint,
    bool _withUpdate
  ) external;

  function pendingMagnet(uint256 _pid, address _user) external view returns (uint256);

  function updatePool(uint256 _pid) external;

  function deposit(address _for, uint256 _pid, uint256 _amount) external;

  function withdraw(address _for, uint256 _pid, uint256 _amount) external;

  function withdrawAll(address _for, uint256 _pid) external;

  function harvest(uint256 _pid) external;
}

File 8 of 12 : MagnetToken.sol
// SPDX-License-Identifier: MIT

// SPDX-License-Identifier: MIT

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

// Magnet Token with Governance.
contract MagnetToken is ERC20("Stable Magnet Token", "SMAG"), Ownable {
  uint256 private _cap = 100000000e18; //100M
  uint256 private _totalLock;

  uint256 public startReleaseBlock;
  uint256 public endReleaseBlock;

  mapping(address => uint256) private _locks;
  mapping(address => uint256) private _lastUnlockBlock;

  event Lock(address indexed to, uint256 value);

  constructor(uint256 _startReleaseBlock, uint256 _endReleaseBlock) public {
    require(_endReleaseBlock > _startReleaseBlock, "endReleaseBlock < startReleaseBlock");
    _setupDecimals(18);
    startReleaseBlock = _startReleaseBlock;
    endReleaseBlock = _endReleaseBlock;

    // maunalMint 10k for seeding liquidity
    mint(msg.sender, 10000e18);
  }

  function setReleaseBlock(uint256 _startReleaseBlock, uint256 _endReleaseBlock) public onlyOwner {
    require(_endReleaseBlock > _startReleaseBlock, "endReleaseBlock < startReleaseBlock");
    startReleaseBlock = _startReleaseBlock;
    endReleaseBlock = _endReleaseBlock;
  }

  function cap() public view returns (uint256) {
    return _cap;
  }

  function unlockedSupply() public view returns (uint256) {
    return totalSupply().sub(totalLock());
  }

  function totalLock() public view returns (uint256) {
    return _totalLock;
  }

  function mint(address _to, uint256 _amount) public onlyOwner {
    require(totalSupply().add(_amount) <= cap(), "cap exceeded");
    _mint(_to, _amount);
    _moveDelegates(address(0), _delegates[_to], _amount);
  }

  function burn(address _account, uint256 _amount) public onlyOwner {
    _burn(_account, _amount);
  }

  function totalBalanceOf(address _account) public view returns (uint256) {
    return _locks[_account].add(balanceOf(_account));
  }

  function lockOf(address _account) public view returns (uint256) {
    return _locks[_account];
  }

  function lastUnlockBlock(address _account) public view returns (uint256) {
    return _lastUnlockBlock[_account];
  }

  function lock(address _account, uint256 _amount) public onlyOwner {
    require(_account != address(0), "no lock to address(0)");
    require(_amount <= balanceOf(_account), "no lock over balance");

    _transfer(_account, address(this), _amount);

    _locks[_account] = _locks[_account].add(_amount);
    _totalLock = _totalLock.add(_amount);

    if (_lastUnlockBlock[_account] < startReleaseBlock) {
      _lastUnlockBlock[_account] = startReleaseBlock;
    }

    emit Lock(_account, _amount);
  }

  function canUnlockAmount(address _account) public view returns (uint256) {
    // When block number less than startReleaseBlock, no Tokens can be unlocked
    if (block.number < startReleaseBlock) {
      return 0;
    }
    // When block number more than endReleaseBlock, all locked Tokens can be unlocked
    else if (block.number >= endReleaseBlock) {
      return _locks[_account];
    }
    // When block number is more than startReleaseBlock but less than endReleaseBlock,
    // some Tokens can be released
    else
    {
      uint256 releasedBlock = block.number.sub(_lastUnlockBlock[_account]);
      uint256 blockLeft = endReleaseBlock.sub(_lastUnlockBlock[_account]);
      return _locks[_account].mul(releasedBlock).div(blockLeft);
    }
  }

  function unlock() public {
    require(_locks[msg.sender] > 0, "no locked Tokens");

    uint256 amount = canUnlockAmount(msg.sender);
    require(amount > 0, "unlock zero amount");

    _transfer(address(this), msg.sender, amount);
    _locks[msg.sender] = _locks[msg.sender].sub(amount);
    _lastUnlockBlock[msg.sender] = block.number;
    _totalLock = _totalLock.sub(amount);
  }

  // @dev move Tokens with its locked funds to another account
  function transferAll(address _to) public {
    _locks[_to] = _locks[_to].add(_locks[msg.sender]);

    if (_lastUnlockBlock[_to] < startReleaseBlock) {
      _lastUnlockBlock[_to] = startReleaseBlock;
    }

    if (_lastUnlockBlock[_to] < _lastUnlockBlock[msg.sender]) {
      _lastUnlockBlock[_to] = _lastUnlockBlock[msg.sender];
    }

    _locks[msg.sender] = 0;
    _lastUnlockBlock[msg.sender] = 0;

    _transfer(msg.sender, _to, balanceOf(msg.sender));
  }

  // Copied and modified from YAM code:
  // https://github.com/yam-finance/yam-protocol/blob/master/contracts/token/YAMGovernanceStorage.sol
  // https://github.com/yam-finance/yam-protocol/blob/master/contracts/token/YAMGovernance.sol
  // Which is copied and modified from COMPOUND:
  // https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/Comp.sol

  /// @dev A record of each accounts delegate
  mapping(address => address) internal _delegates;

  /// @dev A checkpoint for marking number of votes from a given block
  struct Checkpoint {
    uint32 fromBlock;
    uint256 votes;
  }

  /// @dev A record of votes checkpoints for each account, by index
  mapping(address => mapping(uint32 => Checkpoint)) public checkpoints;

  /// @dev The number of checkpoints for each account
  mapping(address => uint32) public numCheckpoints;

  /// @dev The EIP-712 typehash for the contract's domain
  bytes32 public constant DOMAIN_TYPEHASH = keccak256(
    "EIP712Domain(string name,uint256 chainId,address verifyingContract)"
  );

  /// @dev The EIP-712 typehash for the delegation struct used by the contract
  bytes32 public constant DELEGATION_TYPEHASH = keccak256(
    "Delegation(address delegatee,uint256 nonce,uint256 expiry)"
  );

  /// @dev A record of states for signing / validating signatures
  mapping(address => uint256) public nonces;

  /// @dev An event thats emitted when an account changes its delegate
  event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);

  /// @dev An event thats emitted when a delegate account's vote balance changes
  event DelegateVotesChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance);

  /**
    * @dev Delegate votes from `msg.sender` to `delegatee`
    * @param delegator The address to get delegatee for
    */
  function delegates(address delegator) external view returns (address) {
    return _delegates[delegator];
  }

  /**
    * @dev Delegate votes from `msg.sender` to `delegatee`
    * @param delegatee The address to delegate votes to
    */
  function delegate(address delegatee) external {
    return _delegate(msg.sender, delegatee);
  }

  /**
    * @dev Delegates votes from signatory to `delegatee`
    * @param delegatee The address to delegate votes to
    * @param nonce The contract state required to match the signature
    * @param expiry The time at which to expire the signature
    * @param v The recovery byte of the signature
    * @param r Half of the ECDSA signature pair
    * @param s Half of the ECDSA signature pair
    */
  function delegateBySig(
    address delegatee,
    uint256 nonce,
    uint256 expiry,
    uint8 v,
    bytes32 r,
    bytes32 s
  ) external {
    bytes32 domainSeparator = keccak256(
      abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name())), getChainId(), address(this))
    );

    bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));

    bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));

    address signatory = ecrecover(digest, v, r, s);
    require(signatory != address(0), "TOKEN::delegateBySig: invalid signature");
    require(nonce == nonces[signatory]++, "TOKEN::delegateBySig: invalid nonce");
    require(now <= expiry, "TOKEN::delegateBySig: signature expired");
    return _delegate(signatory, delegatee);
  }

  /**
    * @dev Gets the current votes balance for `account`
    * @param account The address to get votes balance
    * @return The number of current votes for `account`
    */
  function getCurrentVotes(address account) external view returns (uint256) {
    uint32 nCheckpoints = numCheckpoints[account];
    return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
  }

  /**
    * @dev Determine the prior number of votes for an account as of a block number
    * @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
    * @param account The address of the account to check
    * @param blockNumber The block number to get the vote balance at
    * @return The number of votes the account had as of the given block
    */
  function getPriorVotes(address account, uint256 blockNumber) external view returns (uint256) {
    require(blockNumber < block.number, "TOKEN::getPriorVotes: not yet determined");

    uint32 nCheckpoints = numCheckpoints[account];
    if (nCheckpoints == 0) {
      return 0;
    }

    // First check most recent balance
    if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
      return checkpoints[account][nCheckpoints - 1].votes;
    }

    // Next check implicit zero balance
    if (checkpoints[account][0].fromBlock > blockNumber) {
      return 0;
    }

    uint32 lower = 0;
    uint32 upper = nCheckpoints - 1;
    while (upper > lower) {
      uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
      Checkpoint memory cp = checkpoints[account][center];
      if (cp.fromBlock == blockNumber) {
        return cp.votes;
      } else if (cp.fromBlock < blockNumber) {
        lower = center;
      } else {
        upper = center - 1;
      }
    }
    return checkpoints[account][lower].votes;
  }

  function _delegate(address delegator, address delegatee) internal {
    address currentDelegate = _delegates[delegator];
    uint256 delegatorBalance = balanceOf(delegator); // balance of underlying TOKENs (not scaled);
    _delegates[delegator] = delegatee;

    emit DelegateChanged(delegator, currentDelegate, delegatee);

    _moveDelegates(currentDelegate, delegatee, delegatorBalance);
  }

  function _moveDelegates(
    address srcRep,
    address dstRep,
    uint256 amount
  ) internal {
    if (srcRep != dstRep && amount > 0) {
      if (srcRep != address(0)) {
        // decrease old representative
        uint32 srcRepNum = numCheckpoints[srcRep];
        uint256 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
        uint256 srcRepNew = srcRepOld.sub(amount);
        _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
      }

      if (dstRep != address(0)) {
        // increase new representative
        uint32 dstRepNum = numCheckpoints[dstRep];
        uint256 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
        uint256 dstRepNew = dstRepOld.add(amount);
        _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
      }
    }
  }

  function _writeCheckpoint(
    address delegatee,
    uint32 nCheckpoints,
    uint256 oldVotes,
    uint256 newVotes
  ) internal {
    uint32 blockNumber = safe32(block.number, "TOKEN::_writeCheckpoint: block number exceeds 32 bits");

    if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
      checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
    } else {
      checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
      numCheckpoints[delegatee] = nCheckpoints + 1;
    }

    emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
  }

  function safe32(uint256 n, string memory errorMessage) internal pure returns (uint32) {
    require(n < 2**32, errorMessage);
    return uint32(n);
  }

  function getChainId() internal pure returns (uint256) {
    uint256 chainId;
    assembly {
      chainId := chainid()
    }
    return chainId;
  }
}

File 9 of 12 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 10 of 12 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

File 11 of 12 : Pausable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./Context.sol";

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor () internal {
        _paused = false;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        require(!paused(), "Pausable: paused");
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        require(paused(), "Pausable: not paused");
        _;
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

File 12 of 12 : ERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "../../utils/Context.sol";
import "./IERC20.sol";
import "../../math/SafeMath.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 * For a generic mechanism see {ERC20PresetMinterPauser}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * We have followed general OpenZeppelin guidelines: functions revert instead
 * of returning `false` on failure. This behavior is nonetheless conventional
 * and does not conflict with the expectations of ERC20 applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 *
 * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
 * functions have been added to mitigate the well-known issues around setting
 * allowances. See {IERC20-approve}.
 */
contract ERC20 is Context, IERC20 {
    using SafeMath for uint256;

    mapping (address => uint256) private _balances;

    mapping (address => mapping (address => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;
    uint8 private _decimals;

    /**
     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with
     * a default value of 18.
     *
     * To select a different value for {decimals}, use {_setupDecimals}.
     *
     * All three of these values are immutable: they can only be set once during
     * construction.
     */
    constructor (string memory name_, string memory symbol_) public {
        _name = name_;
        _symbol = symbol_;
        _decimals = 18;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5,05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is
     * called.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return _decimals;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual override returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual override returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `recipient` cannot be the zero address.
     * - the caller must have a balance of at least `amount`.
     */
    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(_msgSender(), recipient, amount);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual override returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 amount) public virtual override returns (bool) {
        _approve(_msgSender(), spender, amount);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * Requirements:
     *
     * - `sender` and `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     * - the caller must have allowance for ``sender``'s tokens of at least
     * `amount`.
     */
    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
        _transfer(sender, recipient, amount);
        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
        return true;
    }

    /**
     * @dev Atomically increases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
        return true;
    }

    /**
     * @dev Atomically decreases the allowance granted to `spender` by the caller.
     *
     * This is an alternative to {approve} that can be used as a mitigation for
     * problems described in {IERC20-approve}.
     *
     * Emits an {Approval} event indicating the updated allowance.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `spender` must have allowance for the caller of at least
     * `subtractedValue`.
     */
    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
        return true;
    }

    /**
     * @dev Moves tokens `amount` from `sender` to `recipient`.
     *
     * This is internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * Requirements:
     *
     * - `sender` cannot be the zero address.
     * - `recipient` cannot be the zero address.
     * - `sender` must have a balance of at least `amount`.
     */
    function _transfer(address sender, address recipient, uint256 amount) internal virtual {
        require(sender != address(0), "ERC20: transfer from the zero address");
        require(recipient != address(0), "ERC20: transfer to the zero address");

        _beforeTokenTransfer(sender, recipient, amount);

        _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
        _balances[recipient] = _balances[recipient].add(amount);
        emit Transfer(sender, recipient, amount);
    }

    /** @dev Creates `amount` tokens and assigns them to `account`, increasing
     * the total supply.
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     */
    function _mint(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: mint to the zero address");

        _beforeTokenTransfer(address(0), account, amount);

        _totalSupply = _totalSupply.add(amount);
        _balances[account] = _balances[account].add(amount);
        emit Transfer(address(0), account, amount);
    }

    /**
     * @dev Destroys `amount` tokens from `account`, reducing the
     * total supply.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     * - `account` must have at least `amount` tokens.
     */
    function _burn(address account, uint256 amount) internal virtual {
        require(account != address(0), "ERC20: burn from the zero address");

        _beforeTokenTransfer(account, address(0), amount);

        _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
        _totalSupply = _totalSupply.sub(amount);
        emit Transfer(account, address(0), amount);
    }

    /**
     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     */
    function _approve(address owner, address spender, uint256 amount) internal virtual {
        require(owner != address(0), "ERC20: approve from the zero address");
        require(spender != address(0), "ERC20: approve to the zero address");

        _allowances[owner][spender] = amount;
        emit Approval(owner, spender, amount);
    }

    /**
     * @dev Sets {decimals} to a value other than the default one of 18.
     *
     * WARNING: This function should only be called from the constructor. Most
     * applications that interact with token contracts will not expect
     * {decimals} to ever change, and may work incorrectly if it does.
     */
    function _setupDecimals(uint8 decimals_) internal virtual {
        _decimals = decimals_;
    }

    /**
     * @dev Hook that is called before any transfer of tokens. This includes
     * minting and burning.
     *
     * Calling conditions:
     *
     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
     * will be to transferred to `to`.
     * - when `from` is zero, `amount` tokens will be minted for `to`.
     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.
     * - `from` and `to` are never both zero.
     *
     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
     */
    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract MagnetToken","name":"_magnet","type":"address"},{"internalType":"address","name":"_devaddr","type":"address"},{"internalType":"uint256","name":"_magnetPerBlock","type":"uint256"},{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_bonusLockupBps","type":"uint256"},{"internalType":"uint256","name":"_bonusMultiplier","type":"uint256"},{"internalType":"uint256","name":"_bonusEndBlock","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"address","name":"_stakeToken","type":"address"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"bonusEndBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bonusLockUpBps","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bonusMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_for","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"devaddr","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"_currentBlock","type":"uint256"}],"name":"getMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakeToken","type":"address"}],"name":"isDuplicatedPool","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"magnet","outputs":[{"internalType":"contract MagnetToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"magnetPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingMagnet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"address","name":"stakeToken","type":"address"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accMagnetPerShare","type":"uint256"},{"internalType":"uint256","name":"accMagnetPerShareTilBonusEnd","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_bonusMultiplier","type":"uint256"},{"internalType":"uint256","name":"_bonusEndBlock","type":"uint256"},{"internalType":"uint256","name":"_bonusLockUpBps","type":"uint256"}],"name":"setBonus","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_devaddr","type":"address"}],"name":"setDev","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_magnetPerBlock","type":"uint256"}],"name":"setMagnetPerBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"setPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","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":"uint256","name":"_pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"},{"internalType":"uint256","name":"bonusDebt","type":"uint256"},{"internalType":"address","name":"fundedBy","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_for","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_for","type":"address"},{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"withdrawAll","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b50604051612557380380612557833981810160405260e081101561003357600080fd5b508051602082015160408301516060840151608085015160a086015160c0909601519495939492939192909190600061006a610106565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506000600a55600180546001600160a01b039889166001600160a01b0319918216179091556002805497909816961695909517909555600494909455600391909155600692909255600555600b5561010a565b3390565b61243e806101196000396000f3fe608060405234801561001057600080fd5b50600436106101cf5760003560e01c806393f1a40b11610104578063cbdec1fc116100a2578063ddc6326211610071578063ddc63262146104e9578063f2fde38b14610506578063fa0c38831461052c578063fa5be8f814610549576101cf565b8063cbdec1fc14610487578063cc6dbc271461048f578063d477f05f146104bb578063d49e77cd146104e1576101cf565b8063b03df69d116100de578063b03df69d146103e7578063b5485f2e14610421578063b5c5f6721461044d578063b789a73b1461047f576101cf565b806393f1a40b1461037c578063a0029341146103d7578063a8b973a1146103df576101cf565b806351eb05a611610171578063715018a61161014b578063715018a6146102f95780637abceffd146103015780638da5cb5b146103355780638dbb1e3a14610359576101cf565b806351eb05a6146102b75780635312ea8e146102d4578063630b5ba1146102f1576101cf565b806317caf6f1116101ad57806317caf6f1146102745780631aed65531461027c57806346ca6bea1461028457806348cd4cb1146102af576101cf565b8063081e3eda146101d45780630efe6a8b146101ee5780631526fe2714610222575b600080fd5b6101dc610572565b60408051918252519081900360200190f35b6102206004803603606081101561020457600080fd5b506001600160a01b038135169060208101359060400135610578565b005b61023f6004803603602081101561023857600080fd5b5035610783565b604080516001600160a01b03909616865260208601949094528484019290925260608401526080830152519081900360a00190f35b6101dc6107cb565b6101dc6107d1565b6102206004803603606081101561029a57600080fd5b508035906020810135906040013515156107d7565b6101dc6108c4565b610220600480360360208110156102cd57600080fd5b50356108ca565b610220600480360360208110156102ea57600080fd5b5035610ce1565b610220610d7c565b610220610d9f565b6102206004803603606081101561031757600080fd5b508035906001600160a01b0360208201351690604001351515610e75565b61033d611140565b604080516001600160a01b039092168252519081900360200190f35b6101dc6004803603604081101561036f57600080fd5b508035906020013561114f565b6103a86004803603604081101561039257600080fd5b50803590602001356001600160a01b03166111c1565b604080519485526020850193909352838301919091526001600160a01b03166060830152519081900360800190f35b6101dc6111fc565b6101dc611202565b61040d600480360360208110156103fd57600080fd5b50356001600160a01b0316611208565b604080519115158252519081900360200190f35b6101dc6004803603604081101561043757600080fd5b50803590602001356001600160a01b0316611226565b6102206004803603606081101561046357600080fd5b506001600160a01b0381351690602081013590604001356113a3565b61033d6113b3565b6101dc6113c2565b610220600480360360408110156104a557600080fd5b506001600160a01b0381351690602001356113c8565b610220600480360360208110156104d157600080fd5b50356001600160a01b03166113f8565b61033d611491565b610220600480360360208110156104ff57600080fd5b50356114a0565b6102206004803603602081101561051c57600080fd5b50356001600160a01b031661152f565b6102206004803603602081101561054257600080fd5b503561165b565b6102206004803603606081101561055f57600080fd5b50803590602081013590604001356116d4565b60085490565b60006008838154811061058757fe5b600091825260208083208684526009825260408085206001600160a01b03808b168752935290932060038101546005909302909301935016156106255760038101546001600160a01b03163314610625576040805162461bcd60e51b815260206004820152600760248201527f62616420736f6600000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b81546001600160a01b0316610681576040805162461bcd60e51b815260206004820152601b60248201527f6465706f7369743a206e6f7420616363657074206465706f7369740000000000604482015290519081900360640190fd5b61068a846108ca565b80541561069b5761069b85856117ff565b60038101546001600160a01b03166106da576003810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016331790555b81546106f1906001600160a01b0316333086611a74565b80546106fd9084611b02565b80825560038301546107209164e8d4a510009161071a9190611b5c565b90611bb5565b6001820155600482015481546107409164e8d4a510009161071a91611b5c565b6002820155604080518481529051859133917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a35050505050565b6008818154811061079057fe5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0390931694509092909185565b600a5481565b60055481565b6107df611c1c565b6001600160a01b03166107f0611140565b6001600160a01b03161461084b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b801561085957610859610d7c565b610896826108906008868154811061086d57fe5b906000526020600020906005020160010154600a54611c2090919063ffffffff16565b90611b02565b600a8190555081600884815481106108aa57fe5b906000526020600020906005020160010181905550505050565b600b5481565b6000600882815481106108d957fe5b90600052602060002090600502019050806002015443116108fa5750610cde565b8054604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561095d57600080fd5b505afa158015610971573d6000803e3d6000fd5b505050506040513d602081101561098757600080fd5b505190508061099d575043600290910155610cde565b60006109ad83600201544361114f565b905060006109da600a5461071a86600101546109d460035487611b5c90919063ffffffff16565b90611b5c565b6001546002549192506001600160a01b03908116916340c10f199116610a0184600a611bb5565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015610a4757600080fd5b505af1158015610a5b573d6000803e3d6000fd5b5050600154604080517f40c10f190000000000000000000000000000000000000000000000000000000081523060048201526024810186905290516001600160a01b0390921693506340c10f19925060448082019260009290919082900301818387803b158015610acb57600080fd5b505af1158015610adf573d6000803e3d6000fd5b50505050610b0d610b028461071a64e8d4a5100085611b5c90919063ffffffff16565b600386015490611b02565b60038501556005544311610bb8576001546002546006546001600160a01b039283169263282d3fdf921690610b4f906127109061071a906109d488600a611bb5565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015610b9557600080fd5b505af1158015610ba9573d6000803e3d6000fd5b50505060038501546004860155505b60055443118015610bce57506005548460020154105b15610cd0576000610c08600a5461071a87600101546109d46003546109d46004546109d48d60020154600554611c2090919063ffffffff16565b6001546002546006549293506001600160a01b039182169263282d3fdf9290911690610c41906127109061071a906109d488600a611bb5565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015610c8757600080fd5b505af1158015610c9b573d6000803e3d6000fd5b50505050610cc9610cbe8561071a64e8d4a5100085611b5c90919063ffffffff16565b600487015490611b02565b6004860155505b438460020181905550505050505b50565b600060088281548110610cf057fe5b60009182526020808320858452600982526040808520338087529352909320805460059093029093018054909450610d35926001600160a01b03919091169190611c7d565b80546040805191825251849133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae05959181900360200190a360008082556001909101555050565b60085460005b81811015610d9b57610d93816108ca565b600101610d82565b5050565b610da7611c1c565b6001600160a01b0316610db8611140565b6001600160a01b031614610e13576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b610e7d611c1c565b6001600160a01b0316610e8e611140565b6001600160a01b031614610ee9576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b8015610ef757610ef7610d7c565b6001600160a01b038216610f52576040805162461bcd60e51b815260206004820152601860248201527f6164643a206e6f74207374616b65546f6b656e20616464720000000000000000604482015290519081900360640190fd5b610f5b82611208565b15610fad576040805162461bcd60e51b815260206004820152601360248201527f6164643a207374616b65546f6b656e2064757000000000000000000000000000604482015290519081900360640190fd5b6000600b544311610fc057600b54610fc2565b435b600a54909150610fd29085611b02565b600a556001600160a01b039283166000818152600760209081526040808320805460017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009091168117909155815160a0810183529485529184019788528301938452606083018281526080840183815260088054938401815590935292517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee3600590920291820180547fffffffffffffffffffffffff000000000000000000000000000000000000000016919097161790955594517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee485015590517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee5840155517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee68301555090517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee790910155565b6000546001600160a01b031690565b600060055482116111725760045461116b906109d48486611c20565b90506111bb565b60055483106111855761116b8284611c20565b6111b861119d60055484611c2090919063ffffffff16565b6108906004546109d487600554611c2090919063ffffffff16565b90505b92915050565b60096020908152600092835260408084209091529082529020805460018201546002830154600390930154919290916001600160a01b031684565b60035481565b60045481565b6001600160a01b031660009081526007602052604090205460ff1690565b6000806008848154811061123657fe5b600091825260208083208784526009825260408085206001600160a01b0389811687529084528186206005959095029092016003810154815483517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015293519298509596909590949316926370a082319260248082019391829003018186803b1580156112c957600080fd5b505afa1580156112dd573d6000803e3d6000fd5b505050506040513d60208110156112f357600080fd5b505160028501549091504311801561130a57508015155b1561136a57600061131f85600201544361114f565b90506000611346600a5461071a88600101546109d460035487611b5c90919063ffffffff16565b905061136561135e8461071a8464e8d4a51000611b5c565b8590611b02565b935050505b611398836001015461139264e8d4a5100061071a868860000154611b5c90919063ffffffff16565b90611c20565b979650505050505050565b6113ae838383611cfd565b505050565b6001546001600160a01b031681565b60065481565b60008181526009602090815260408083206001600160a01b0386168452909152902054610d9b9083908390611cfd565b6002546001600160a01b03163314611457576040805162461bcd60e51b815260206004820152600960248201527f6465763a207775743f0000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6002546001600160a01b031681565b6000600882815481106114af57fe5b600091825260208083208584526009825260408085203386529092529220600590910290910191506114e0836108ca565b6114ea33846117ff565b600382015481546115059164e8d4a510009161071a91611b5c565b6001820155600482015481546115259164e8d4a510009161071a91611b5c565b6002909101555050565b611537611c1c565b6001600160a01b0316611548611140565b6001600160a01b0316146115a3576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166115e85760405162461bcd60e51b81526004018080602001828103825260268152602001806123726026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b611663611c1c565b6001600160a01b0316611674611140565b6001600160a01b0316146116cf576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600355565b6116dc611c1c565b6001600160a01b03166116ed611140565b6001600160a01b031614611748576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b43821161179c576040805162461bcd60e51b815260206004820152601b60248201527f736574426f6e75733a2062616420626f6e7573456e64426c6f636b0000000000604482015290519081900360640190fd5b600183116117f1576040805162461bcd60e51b815260206004820152601d60248201527f736574426f6e75733a2062616420626f6e75734d756c7469706c696572000000604482015290519081900360640190fd5b600492909255600555600655565b60006008828154811061180e57fe5b600091825260208083208584526009825260408085206001600160a01b03891686529092529220805460059092029092019250611892576040805162461bcd60e51b815260206004820152601260248201527f6e6f7468696e6720746f20686172766573740000000000000000000000000000604482015290519081900360640190fd5b60006118c0826001015461139264e8d4a5100061071a87600301548760000154611b5c90919063ffffffff16565b600154604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290519293506001600160a01b03909116916370a0823191602480820192602092909190829003018186803b15801561192757600080fd5b505afa15801561193b573d6000803e3d6000fd5b505050506040513d602081101561195157600080fd5b50518111156119a7576040805162461bcd60e51b815260206004820152601560248201527f777466206e6f7420656e6f756768206d61676e65740000000000000000000000604482015290519081900360640190fd5b60006119d5836002015461139264e8d4a5100061071a88600401548860000154611b5c90919063ffffffff16565b90506119e18683611eb3565b6001546006546001600160a01b039091169063282d3fdf908890611a0e906127109061071a908790611b5c565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015611a5457600080fd5b505af1158015611a68573d6000803e3d6000fd5b50505050505050505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd00000000000000000000000000000000000000000000000000000000179052611afc90859061208e565b50505050565b6000828201838110156111b8576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082611b6b575060006111bb565b82820282848281611b7857fe5b04146111b85760405162461bcd60e51b81526004018080602001828103825260218152602001806123be6021913960400191505060405180910390fd5b6000808211611c0b576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381611c1457fe5b049392505050565b3390565b600082821115611c77576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb000000000000000000000000000000000000000000000000000000001790526113ae90849061208e565b600060088381548110611d0c57fe5b600091825260208083208684526009825260408085206001600160a01b03808b1687529352909320600381015460059093029093019350163314611d97576040805162461bcd60e51b815260206004820152600b60248201527f6f6e6c792066756e646572000000000000000000000000000000000000000000604482015290519081900360640190fd5b8054831115611ded576040805162461bcd60e51b815260206004820152601260248201527f77697468647261773a206e6f7420676f6f640000000000000000000000000000604482015290519081900360640190fd5b611df6846108ca565b611e0085856117ff565b8054611e0c9084611c20565b8082556003830154611e299164e8d4a510009161071a9190611b5c565b600182015560048201548154611e499164e8d4a510009161071a91611b5c565b600282015581546001600160a01b031615611e74578154611e74906001600160a01b03163385611c7d565b80546040805191825251859133917ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5689181900360200190a35050505050565b600154604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b158015611f1757600080fd5b505afa158015611f2b573d6000803e3d6000fd5b505050506040513d6020811015611f4157600080fd5b5051905080821115611fee57600154604080517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038681166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015611fbc57600080fd5b505af1158015611fd0573d6000803e3d6000fd5b505050506040513d6020811015611fe657600080fd5b506113ae9050565b600154604080517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b038681166004830152602482018690529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b505050506040513d602081101561208757600080fd5b5050505050565b60606120e3826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661213f9092919063ffffffff16565b8051909150156113ae5780806020019051602081101561210257600080fd5b50516113ae5760405162461bcd60e51b815260040180806020018281038252602a8152602001806123df602a913960400191505060405180910390fd5b606061214e8484600085612158565b90505b9392505050565b6060824710156121995760405162461bcd60e51b81526004018080602001828103825260268152602001806123986026913960400191505060405180910390fd5b6121a2856122c7565b6121f3576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b6020831061225057805182527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe09092019160209182019101612213565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146122b2576040519150601f19603f3d011682016040523d82523d6000602084013e6122b7565b606091505b50915091506113988282866122cd565b3b151590565b606083156122dc575081612151565b8251156122ec5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561233657818101518382015260200161231e565b50505050905090810190601f1680156123635780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a264697066735822122054365030cf2689d045f42031c34aa6708a770f981653391b9b556861844e0eee64736f6c634300060c0033000000000000000000000000cd734b1f9b0b976ddc46e507d0aa51a4216a1e98000000000000000000000000bd62765fa20a05e8ca80faddf3f85437d556d5e10000000000000000000000000000000000000000000000001bc16d674ec80000000000000000000000000000000000000000000000000000000000000080a9e40000000000000000000000000000000000000000000000000000000000001b580000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000083bd64

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

000000000000000000000000cd734b1f9b0b976ddc46e507d0aa51a4216a1e98000000000000000000000000bd62765fa20a05e8ca80faddf3f85437d556d5e10000000000000000000000000000000000000000000000001bc16d674ec80000000000000000000000000000000000000000000000000000000000000080a9e40000000000000000000000000000000000000000000000000000000000001b580000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000083bd64

-----Decoded View---------------
Arg [0] : _magnet (address): 0xcd734b1f9b0b976ddc46e507d0aa51a4216a1e98
Arg [1] : _devaddr (address): 0xbd62765fa20a05e8ca80faddf3f85437d556d5e1
Arg [2] : _magnetPerBlock (uint256): 2000000000000000000
Arg [3] : _startBlock (uint256): 8432100
Arg [4] : _bonusLockupBps (uint256): 7000
Arg [5] : _bonusMultiplier (uint256): 7
Arg [6] : _bonusEndBlock (uint256): 8633700

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000cd734b1f9b0b976ddc46e507d0aa51a4216a1e98
Arg [1] : 000000000000000000000000bd62765fa20a05e8ca80faddf3f85437d556d5e1
Arg [2] : 0000000000000000000000000000000000000000000000001bc16d674ec80000
Arg [3] : 000000000000000000000000000000000000000000000000000000000080a9e4
Arg [4] : 0000000000000000000000000000000000000000000000000000000000001b58
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [6] : 000000000000000000000000000000000000000000000000000000000083bd64


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.