ETH Price: $2,615.96 (+0.82%)

Contract

0x2f927257dc6783f5ae0644Ee729242533699B2C1
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim176702102023-07-11 11:56:11408 days ago1689076571IN
0x2f927257...33699B2C1
0 ETH0.0019000815.96091201
Claim171231832023-04-25 12:10:23485 days ago1682424623IN
0x2f927257...33699B2C1
0 ETH0.0047486435.39906049
Claim170477952023-04-14 20:39:23495 days ago1681504763IN
0x2f927257...33699B2C1
0 ETH0.0027303829.98942189
Claim170477132023-04-14 20:22:11495 days ago1681503731IN
0x2f927257...33699B2C1
0 ETH0.0028509323.94817081
Claim170132462023-04-09 21:01:23500 days ago1681074083IN
0x2f927257...33699B2C1
0 ETH0.0026349919.35418544
Claim168757722023-03-21 11:39:35520 days ago1679398775IN
0x2f927257...33699B2C1
0 ETH0.0013845112.80240836
Claim168757642023-03-21 11:37:59520 days ago1679398679IN
0x2f927257...33699B2C1
0 ETH0.0014279313.20389226
Claim168757542023-03-21 11:35:59520 days ago1679398559IN
0x2f927257...33699B2C1
0 ETH0.0014680712.33198546
Claim168527252023-03-18 6:01:11523 days ago1679119271IN
0x2f927257...33699B2C1
0 ETH0.0013445114.76754
Claim168527172023-03-18 5:59:35523 days ago1679119175IN
0x2f927257...33699B2C1
0 ETH0.0018840715.82648718
Claim168258792023-03-14 11:25:59527 days ago1678793159IN
0x2f927257...33699B2C1
0 ETH0.0029954522.00174943
Claim167798932023-03-08 0:10:35533 days ago1678234235IN
0x2f927257...33699B2C1
0 ETH0.0047001134.52257923
Claim167679462023-03-06 7:51:47535 days ago1678089107IN
0x2f927257...33699B2C1
0 ETH0.0021583719.77714817
Claim167679112023-03-06 7:44:47535 days ago1678088687IN
0x2f927257...33699B2C1
0 ETH0.0022216820.35725154
Claim167467172023-03-03 8:12:47538 days ago1677831167IN
0x2f927257...33699B2C1
0 ETH0.0022403420.71614822
Claim167466972023-03-03 8:08:47538 days ago1677830927IN
0x2f927257...33699B2C1
0 ETH0.0030698924.5111372
Claim167466802023-03-03 8:05:23538 days ago1677830723IN
0x2f927257...33699B2C1
0 ETH0.0018070319.84775407
Claim167466422023-03-03 7:57:35538 days ago1677830255IN
0x2f927257...33699B2C1
0 ETH0.0017714719.45712864
Claim167466272023-03-03 7:54:35538 days ago1677830075IN
0x2f927257...33699B2C1
0 ETH0.002114419.55159967
Claim167466002023-03-03 7:49:11538 days ago1677829751IN
0x2f927257...33699B2C1
0 ETH0.0022682219.05337527
Claim167180362023-02-27 7:25:59542 days ago1677482759IN
0x2f927257...33699B2C1
0 ETH0.0014713214.72117361
Claim164134682023-01-15 16:43:23584 days ago1673801003IN
0x2f927257...33699B2C1
0 ETH0.0025333918.88534459
Claim163921322023-01-12 17:12:47587 days ago1673543567IN
0x2f927257...33699B2C1
0 ETH0.0019953419.57259135
Claim163830772023-01-11 10:48:59589 days ago1673434139IN
0x2f927257...33699B2C1
0 ETH0.0015220212.78515598
Claim163827852023-01-11 9:50:23589 days ago1673430623IN
0x2f927257...33699B2C1
0 ETH0.0015140414.00012598
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
sbBTCPool

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 9999 runs

Other Settings:
default evmVersion
File 1 of 10 : sbBTCPool.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./interfaces/IBarn.sol";
import "./interfaces/INodeRewards.sol";
import "./interfaces/ISwapContract.sol";

contract sbBTCPool is Ownable {
    using SafeMath for uint256;

    uint256 constant divisor = 10 ** 27;

    uint256 public balanceBefore;
    uint256 public currentMultiplier;

    mapping(address => uint256) public userMultiplier;
    mapping(address => uint256) public owed;

    IBarn public barn;
    IERC20 public rewardToken;
    INodeRewards public nodeRewards;
    ISwapContract public swapContract;

    event Claim(address indexed user, uint256 amount);

    // setup sets the contracts
    function setup(address _swap, address _barn, address _nodeRewards) public {
        require(_swap != address(0), "swapContract address must not be 0x0");
        require(_barn != address(0), "barn address must not be 0x0");
        require(msg.sender == owner(), "!owner");
        require(address(rewardToken) == address(0), "rewardToken must be 0x0");

        swapContract = ISwapContract(_swap);
        rewardToken = IERC20(swapContract.lpToken());
        nodeRewards = INodeRewards(_nodeRewards);
        barn = IBarn(_barn);
    }

    // claim calculates the currently owed reward and transfers the funds to the user
    function claim() public returns (uint256){
        require(swapContract.isNodeStake(msg.sender), "msg.sender is not staker");

        _calculateOwed(msg.sender);

        uint256 amount = owed[msg.sender];
        require(amount > 0, "nothing to claim");

        owed[msg.sender] = 0;

        rewardToken.transfer(msg.sender, amount);

        // acknowledge the amount that was transferred to the user
        ackFunds();

        emit Claim(msg.sender, amount);

        return amount;
    }

    // ackFunds checks the difference between the last known balance of `token` and the current one
    // if it goes up, the multiplier is re-calculated
    // if it goes down, it only updates the known balance
    function ackFunds() public {
        uint256 balanceNow = rewardToken.balanceOf(address(this));

        if (balanceNow == 0 || balanceNow <= balanceBefore) {
            balanceBefore = balanceNow;
            return;
        }

        uint256 totalStaked = nodeRewards.totalNodeStaked();
        // if there's no bond staked, it doesn't make sense to ackFunds because there's nobody to distribute them to
        // and the calculation would fail anyways due to division by 0
        if (totalStaked == 0) {
            return;
        }

        uint256 diff = balanceNow.sub(balanceBefore);
        uint256 multiplier = currentMultiplier.add(diff.mul(divisor).div(totalStaked));

        balanceBefore = balanceNow;
        currentMultiplier = multiplier;
    }

    // _calculateOwed calculates and updates the total amount that is owed to an user and updates the user's multiplier
    // to the current value
    // it automatically attempts to pull the token from the source and acknowledge the funds
    function _calculateOwed(address user) internal {
        ackFunds();

        uint256 reward = _userPendingReward(user);

        owed[user] = owed[user].add(reward);
        userMultiplier[user] = currentMultiplier;
    }

    // _userPendingReward calculates the reward that should be based on the current multiplier / anything that's not included in the `owed[user]` value
    // it does not represent the entire reward that's due to the user unless added on top of `owed[user]`
    function _userPendingReward(address user) internal view returns (uint256) {

        uint256 multiplier = currentMultiplier.sub(userMultiplier[user]);

        return barn.balanceOf(user).mul(multiplier).div(divisor);
    }
}

File 2 of 10 : 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 3 of 10 : 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 4 of 10 : 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 5 of 10 : IBarn.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;

import "../libraries/LibBarnStorage.sol";

interface IBarn {
    // deposit allows a user to add more bond to his staked balance
    function deposit(uint256 amount) external;

    // withdraw allows a user to withdraw funds if the balance is not locked
    function withdraw(uint256 amount) external;

    // lock a user's currently staked balance until timestamp & add the bonus to his voting power
    function lock(uint256 timestamp) external;

    // delegate allows a user to delegate his voting power to another user
    function delegate(address to) external;

    // stopDelegate allows a user to take back the delegated voting power
    function stopDelegate() external;

    // lock the balance of a proposal creator until the voting ends; only callable by DAO
    function lockCreatorBalance(address user, uint256 timestamp) external;

    // balanceOf returns the current BOND balance of a user (bonus not included)
    function balanceOf(address user) external view returns (uint256);

    // balanceAtTs returns the amount of BOND that the user currently staked (bonus NOT included)
    function balanceAtTs(address user, uint256 timestamp) external view returns (uint256);

    // stakeAtTs returns the Stake object of the user that was valid at `timestamp`
    function stakeAtTs(address user, uint256 timestamp) external view returns (LibBarnStorage.Stake memory);

    // votingPower returns the voting power (bonus included) + delegated voting power for a user at the current block
    function votingPower(address user) external view returns (uint256);

    // votingPowerAtTs returns the voting power (bonus included) + delegated voting power for a user at a point in time
    function votingPowerAtTs(address user, uint256 timestamp) external view returns (uint256);

    // bondStaked returns the total raw amount of BOND staked at the current block
    function bondStaked() external view returns (uint256);

    // bondStakedAtTs returns the total raw amount of BOND users have deposited into the contract
    // it does not include any bonus
    function bondStakedAtTs(uint256 timestamp) external view returns (uint256);

    // delegatedPower returns the total voting power that a user received from other users
    function delegatedPower(address user) external view returns (uint256);

    // delegatedPowerAtTs returns the total voting power that a user received from other users at a point in time
    function delegatedPowerAtTs(address user, uint256 timestamp) external view returns (uint256);

    // multiplierAtTs calculates the multiplier at a given timestamp based on the user's stake a the given timestamp
    // it includes the decay mechanism
    function multiplierAtTs(address user, uint256 timestamp) external view returns (uint256);

    // userLockedUntil returns the timestamp until the user's balance is locked
    function userLockedUntil(address user) external view returns (uint256);

    // userDidDelegate returns the address to which a user delegated their voting power; address(0) if not delegated
    function userDelegatedTo(address user) external view returns (address);

    // bondCirculatingSupply returns the current circulating supply of BOND
    function bondCirculatingSupply() external view returns (uint256);
}

File 6 of 10 : INodeRewards.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;

interface INodeRewards {
    function totalNodeStaked() external view returns (uint256);
}

File 7 of 10 : ISwapContract.sol
pragma solidity 0.7.6;

interface ISwapContract {
    function getActiveNodes() external returns (address[] memory);

    function isNodeStake(address _user) external returns (bool);

    function lpToken() external returns (address);
}

File 8 of 10 : 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 9 of 10 : LibBarnStorage.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "../interfaces/IRewards.sol";

library LibBarnStorage {
    bytes32 constant STORAGE_POSITION = keccak256("com.barnbridge.barn.storage");

    struct Checkpoint {
        uint256 timestamp;
        uint256 amount;
    }

    struct Stake {
        uint256 timestamp;
        uint256 amount;
        uint256 expiryTimestamp;
        address delegatedTo;
    }

    struct NodeInfo {
        bytes32 p2pkey;
        uint8   dataType;
    }

    struct Storage {
        bool initialized;

        // mapping of user address to history of Stake objects
        // every user action creates a new object in the history
        mapping(address => Stake[]) userStakeHistory;

        // array of bond staked Checkpoint
        // deposits/withdrawals create a new object in the history (max one per block)
        Checkpoint[] bondStakedHistory;

        // mapping of user address to history of delegated power
        // every delegate/stopDelegate call create a new checkpoint (max one per block)
        mapping(address => Checkpoint[]) delegatedPowerHistory;

        // mapping of user address to <p2pkey,dataType> for swingby node. (no history)
        mapping(address => NodeInfo) nodeInfo;

        IERC20 bond;
        IRewards rewards;
    }

    function barnStorage() internal pure returns (Storage storage ds) {
        bytes32 position = STORAGE_POSITION;
        assembly {
            ds.slot := position
        }
    }
}

File 10 of 10 : IRewards.sol
// SPDX-License-Identifier: Apache-2.0
pragma solidity 0.7.6;

interface IRewards {
    function registerUserAction(address user) external;

    function setNewAPR(uint256 _apr) external;
}

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

Contract Security Audit

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"ackFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"balanceBefore","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"barn","outputs":[{"internalType":"contract IBarn","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claim","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nodeRewards","outputs":[{"internalType":"contract INodeRewards","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"owed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_swap","type":"address"},{"internalType":"address","name":"_barn","type":"address"},{"internalType":"address","name":"_nodeRewards","type":"address"}],"name":"setup","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapContract","outputs":[{"internalType":"contract ISwapContract","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50600061001b61006a565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a35061006e565b3390565b6110028061007d6000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806394b5798a1161008c578063df18e04711610066578063df18e047146101e4578063e38f80b714610217578063f2fde38b1461021f578063f7c618c114610252576100ea565b806394b5798a146101a1578063acfd9325146101a9578063b1a03b6b146101b1576100ea565b8063715018a6116100c8578063715018a61461014257806377b8b1c71461014c5780638da5cb5b146101915780638ea8303114610199576100ea565b8063194f480e146100ef5780634e71d92d146101205780636fbaaa1e1461013a575b600080fd5b6100f761025a565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b610128610276565b60408051918252519081900360200190f35b6101286104c7565b61014a6104cd565b005b61014a6004803603606081101561016257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135821691604090910135166105ca565b6100f76108a4565b6100f76108c0565b6101286108dc565b61014a6108e2565b610128600480360360208110156101c757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610a98565b610128600480360360208110156101fa57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610aaa565b6100f7610abc565b61014a6004803603602081101561023557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610ad8565b6100f7610c45565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b600854604080517fa742329d000000000000000000000000000000000000000000000000000000008152336004820152905160009273ffffffffffffffffffffffffffffffffffffffff169163a742329d91602480830192602092919082900301818787803b1580156102e857600080fd5b505af11580156102fc573d6000803e3d6000fd5b505050506040513d602081101561031257600080fd5b5051610365576040805162461bcd60e51b815260206004820152601860248201527f6d73672e73656e646572206973206e6f74207374616b65720000000000000000604482015290519081900360640190fd5b61036e33610c61565b33600090815260046020526040902054806103d0576040805162461bcd60e51b815260206004820152601060248201527f6e6f7468696e6720746f20636c61696d00000000000000000000000000000000604482015290519081900360640190fd5b33600081815260046020818152604080842084905560065481517fa9059cbb00000000000000000000000000000000000000000000000000000000815293840195909552602483018690525173ffffffffffffffffffffffffffffffffffffffff9094169363a9059cbb936044808501948390030190829087803b15801561045757600080fd5b505af115801561046b573d6000803e3d6000fd5b505050506040513d602081101561048157600080fd5b5061048c90506108e2565b60408051828152905133917f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4919081900360200190a2905090565b60025481565b6104d5610ce6565b73ffffffffffffffffffffffffffffffffffffffff166104f36108a4565b73ffffffffffffffffffffffffffffffffffffffff161461055b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b73ffffffffffffffffffffffffffffffffffffffff831661061c5760405162461bcd60e51b8152600401808060200182810382526024815260200180610f886024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216610684576040805162461bcd60e51b815260206004820152601c60248201527f6261726e2061646472657373206d757374206e6f742062652030783000000000604482015290519081900360640190fd5b61068c6108a4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461070b576040805162461bcd60e51b815260206004820152600660248201527f216f776e65720000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60065473ffffffffffffffffffffffffffffffffffffffff1615610776576040805162461bcd60e51b815260206004820152601760248201527f726577617264546f6b656e206d75737420626520307830000000000000000000604482015290519081900360640190fd5b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8581169190911791829055604080517f5fcbd28500000000000000000000000000000000000000000000000000000000815290519290911691635fcbd285916004808201926020929091908290030181600087803b15801561081257600080fd5b505af1158015610826573d6000803e3d6000fd5b505050506040513d602081101561083c57600080fd5b5051600680547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff938416179091556007805482169383169390931790925560058054909216921691909117905550565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b60085473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b15801561095357600080fd5b505afa158015610967573d6000803e3d6000fd5b505050506040513d602081101561097d57600080fd5b5051905080158061099057506001548111155b1561099d57600155610a96565b600754604080517f8ca0a7e5000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff1691638ca0a7e5916004808301926020929190829003018186803b158015610a0857600080fd5b505afa158015610a1c573d6000803e3d6000fd5b505050506040513d6020811015610a3257600080fd5b5051905080610a42575050610a96565b6000610a5960015484610cea90919063ffffffff16565b90506000610a89610a8084610a7a856b033b2e3c9fd0803ce8000000610d4c565b90610dac565b60025490610e13565b6001949094555050506002555b565b60036020526000908152604090205481565b60046020526000908152604090205481565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b610ae0610ce6565b73ffffffffffffffffffffffffffffffffffffffff16610afe6108a4565b73ffffffffffffffffffffffffffffffffffffffff1614610b66576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116610bb85760405162461bcd60e51b8152600401808060200182810382526026815260200180610f626026913960400191505060405180910390fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b610c696108e2565b6000610c7482610e6d565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260046020526040902054909150610ca79082610e13565b73ffffffffffffffffffffffffffffffffffffffff90921660009081526004602090815260408083209490945560025460039091529290209190915550565b3390565b600082821115610d41576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b508082035b92915050565b600082610d5b57506000610d46565b82820282848281610d6857fe5b0414610da55760405162461bcd60e51b8152600401808060200182810382526021815260200180610fac6021913960400191505060405180910390fd5b9392505050565b6000808211610e02576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610e0b57fe5b049392505050565b600082820183811015610da5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81166000908152600360205260408120546002548291610ea29190610cea565b600554604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811660048301529151939450610da5936b033b2e3c9fd0803ce800000093610a7a9387939116916370a0823191602480820192602092909190829003018186803b158015610f2f57600080fd5b505afa158015610f43573d6000803e3d6000fd5b505050506040513d6020811015610f5957600080fd5b505190610d4c56fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737373776170436f6e74726163742061646472657373206d757374206e6f7420626520307830536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220f215b8309a858e8c42412ada79a19442bee8e8852b8918e6174469a5062ab83b64736f6c63430007060033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c806394b5798a1161008c578063df18e04711610066578063df18e047146101e4578063e38f80b714610217578063f2fde38b1461021f578063f7c618c114610252576100ea565b806394b5798a146101a1578063acfd9325146101a9578063b1a03b6b146101b1576100ea565b8063715018a6116100c8578063715018a61461014257806377b8b1c71461014c5780638da5cb5b146101915780638ea8303114610199576100ea565b8063194f480e146100ef5780634e71d92d146101205780636fbaaa1e1461013a575b600080fd5b6100f761025a565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b610128610276565b60408051918252519081900360200190f35b6101286104c7565b61014a6104cd565b005b61014a6004803603606081101561016257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020810135821691604090910135166105ca565b6100f76108a4565b6100f76108c0565b6101286108dc565b61014a6108e2565b610128600480360360208110156101c757600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610a98565b610128600480360360208110156101fa57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610aaa565b6100f7610abc565b61014a6004803603602081101561023557600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610ad8565b6100f7610c45565b60055473ffffffffffffffffffffffffffffffffffffffff1681565b600854604080517fa742329d000000000000000000000000000000000000000000000000000000008152336004820152905160009273ffffffffffffffffffffffffffffffffffffffff169163a742329d91602480830192602092919082900301818787803b1580156102e857600080fd5b505af11580156102fc573d6000803e3d6000fd5b505050506040513d602081101561031257600080fd5b5051610365576040805162461bcd60e51b815260206004820152601860248201527f6d73672e73656e646572206973206e6f74207374616b65720000000000000000604482015290519081900360640190fd5b61036e33610c61565b33600090815260046020526040902054806103d0576040805162461bcd60e51b815260206004820152601060248201527f6e6f7468696e6720746f20636c61696d00000000000000000000000000000000604482015290519081900360640190fd5b33600081815260046020818152604080842084905560065481517fa9059cbb00000000000000000000000000000000000000000000000000000000815293840195909552602483018690525173ffffffffffffffffffffffffffffffffffffffff9094169363a9059cbb936044808501948390030190829087803b15801561045757600080fd5b505af115801561046b573d6000803e3d6000fd5b505050506040513d602081101561048157600080fd5b5061048c90506108e2565b60408051828152905133917f47cee97cb7acd717b3c0aa1435d004cd5b3c8c57d70dbceb4e4458bbd60e39d4919081900360200190a2905090565b60025481565b6104d5610ce6565b73ffffffffffffffffffffffffffffffffffffffff166104f36108a4565b73ffffffffffffffffffffffffffffffffffffffff161461055b576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b73ffffffffffffffffffffffffffffffffffffffff831661061c5760405162461bcd60e51b8152600401808060200182810382526024815260200180610f886024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216610684576040805162461bcd60e51b815260206004820152601c60248201527f6261726e2061646472657373206d757374206e6f742062652030783000000000604482015290519081900360640190fd5b61068c6108a4565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461070b576040805162461bcd60e51b815260206004820152600660248201527f216f776e65720000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60065473ffffffffffffffffffffffffffffffffffffffff1615610776576040805162461bcd60e51b815260206004820152601760248201527f726577617264546f6b656e206d75737420626520307830000000000000000000604482015290519081900360640190fd5b600880547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8581169190911791829055604080517f5fcbd28500000000000000000000000000000000000000000000000000000000815290519290911691635fcbd285916004808201926020929091908290030181600087803b15801561081257600080fd5b505af1158015610826573d6000803e3d6000fd5b505050506040513d602081101561083c57600080fd5b5051600680547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff938416179091556007805482169383169390931790925560058054909216921691909117905550565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b60085473ffffffffffffffffffffffffffffffffffffffff1681565b60015481565b600654604080517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152905160009273ffffffffffffffffffffffffffffffffffffffff16916370a08231916024808301926020929190829003018186803b15801561095357600080fd5b505afa158015610967573d6000803e3d6000fd5b505050506040513d602081101561097d57600080fd5b5051905080158061099057506001548111155b1561099d57600155610a96565b600754604080517f8ca0a7e5000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff1691638ca0a7e5916004808301926020929190829003018186803b158015610a0857600080fd5b505afa158015610a1c573d6000803e3d6000fd5b505050506040513d6020811015610a3257600080fd5b5051905080610a42575050610a96565b6000610a5960015484610cea90919063ffffffff16565b90506000610a89610a8084610a7a856b033b2e3c9fd0803ce8000000610d4c565b90610dac565b60025490610e13565b6001949094555050506002555b565b60036020526000908152604090205481565b60046020526000908152604090205481565b60075473ffffffffffffffffffffffffffffffffffffffff1681565b610ae0610ce6565b73ffffffffffffffffffffffffffffffffffffffff16610afe6108a4565b73ffffffffffffffffffffffffffffffffffffffff1614610b66576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff8116610bb85760405162461bcd60e51b8152600401808060200182810382526026815260200180610f626026913960400191505060405180910390fd5b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60065473ffffffffffffffffffffffffffffffffffffffff1681565b610c696108e2565b6000610c7482610e6d565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260046020526040902054909150610ca79082610e13565b73ffffffffffffffffffffffffffffffffffffffff90921660009081526004602090815260408083209490945560025460039091529290209190915550565b3390565b600082821115610d41576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b508082035b92915050565b600082610d5b57506000610d46565b82820282848281610d6857fe5b0414610da55760405162461bcd60e51b8152600401808060200182810382526021815260200180610fac6021913960400191505060405180910390fd5b9392505050565b6000808211610e02576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381610e0b57fe5b049392505050565b600082820183811015610da5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff81166000908152600360205260408120546002548291610ea29190610cea565b600554604080517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff87811660048301529151939450610da5936b033b2e3c9fd0803ce800000093610a7a9387939116916370a0823191602480820192602092909190829003018186803b158015610f2f57600080fd5b505afa158015610f43573d6000803e3d6000fd5b505050506040513d6020811015610f5957600080fd5b505190610d4c56fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737373776170436f6e74726163742061646472657373206d757374206e6f7420626520307830536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220f215b8309a858e8c42412ada79a19442bee8e8852b8918e6174469a5062ab83b64736f6c63430007060033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.