ETH Price: $2,428.07 (+5.33%)

Contract

0x5387AeD486B9Ee6AC7833640F8ddFD6BBcD01d96
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim Fee127460982021-07-02 4:34:251175 days ago1625200465IN
0x5387AeD4...BBcD01d96
0 ETH0.0014823313
Claim Fee127348342021-06-30 10:39:351177 days ago1625049575IN
0x5387AeD4...BBcD01d96
0 ETH0.0011485711.85
Claim Fee127302682021-06-29 17:27:181177 days ago1624987638IN
0x5387AeD4...BBcD01d96
0 ETH0.0016305714.3
Claim Fee127133382021-06-27 2:08:251180 days ago1624759705IN
0x5387AeD4...BBcD01d96
0 ETH0.0011402610
Claim Fee126909282021-06-23 14:33:271183 days ago1624458807IN
0x5387AeD4...BBcD01d96
0 ETH0.0012550618.00000145
Claim Fee126869762021-06-22 23:30:141184 days ago1624404614IN
0x5387AeD4...BBcD01d96
0 ETH0.0025318428.6
Claim Fee124587362021-05-18 13:46:371219 days ago1621345597IN
0x5387AeD4...BBcD01d96
0 ETH0.0085519575
Claim Fee123644982021-05-04 0:27:311234 days ago1620088051IN
0x5387AeD4...BBcD01d96
0 ETH0.0054375456.1
Claim Fee123425782021-04-30 15:14:041237 days ago1619795644IN
0x5387AeD4...BBcD01d96
0 ETH0.0040490260.5
Claim Fee123395772021-04-30 3:59:591238 days ago1619755199IN
0x5387AeD4...BBcD01d96
0 ETH0.0030830533.00000145
0x60806040123003702021-04-24 2:58:421244 days ago1619233122IN
 Create: FeePool
0 ETH0.079827975

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
FeePool

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
File 1 of 7 : FeePool.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/utils/ReentrancyGuard.sol";
import "./lib/SafeDecimalMath.sol";
import "./interface/IAddressResolver.sol";
import "./interface/IFeePool.sol";


contract FeePool is ReentrancyGuard, IFeePool{
    using SafeMath for uint;
    using SafeDecimalMath for uint;

    bytes32 public constant BOR = "BOR";
    bytes32 public constant OTOKEN = "oToken";
    bytes32 public constant PPTOKEN = "ppToken";

    bytes32 public tunnelKey;
    IAddressResolver public addrReso;

    uint public borFeePerTokenStored;
    uint public oTokenFeePerTokenStored;

    mapping(address => uint) public userBORFee;
    mapping(address => uint) public userBORFeePaid;
    mapping(address => uint) public userOTokenFee;
    mapping(address => uint) public userOTokenFeePaid;



    mapping(address => uint) private _balances;

    constructor(IAddressResolver _addrReso, bytes32 _tunnelKey) public {
        addrReso = _addrReso;
        tunnelKey = _tunnelKey;
    }

    function bor() internal view returns (IERC20) {
        return IERC20(addrReso.requireAndKey2Address(BOR, "BOR contract is address(0) in FeePool"));
    }

    function otoken() internal view returns(IERC20) {
        return IERC20(addrReso.requireKKAddrs(tunnelKey, OTOKEN, "oToken contract is address(0) in FeePool"));
    }

    function ptoken() internal view returns(IERC20) {
        return IERC20(addrReso.requireKKAddrs(tunnelKey, PPTOKEN, "oToken contract is address(0) in FeePool"));
    }

    function totalSupply() external view returns (uint256) {
        return ptoken().totalSupply();
    }

    function balanceOf(address account) external view returns (uint256) {
        return _balances[account];
    }

    function borFeePerToken() public view returns(uint) {
        return borFeePerTokenStored;
    }

    function oTokenFeePerToken() public view returns(uint) {
        return oTokenFeePerTokenStored;
    }

    function earned(address account) public view override returns(uint, uint) {
        uint borFee = _balances[account].multiplyDecimal(borFeePerTokenStored.sub(userBORFeePaid[account])).add(userBORFee[account]);
        uint btokenFee = _balances[account].multiplyDecimal(oTokenFeePerTokenStored.sub(userOTokenFeePaid[account])).add(userOTokenFee[account]);
        return (borFee, btokenFee);
    }

    function getTotalFee() public view returns(uint, uint) {
        return (bor().balanceOf(address(this)), otoken().balanceOf(address(this)));
    }

    function notifyBORFeeAmount(uint amount) external override onlyTunnel {
        borFeePerTokenStored = borFeePerTokenStored.add(amount.divideDecimal(ptoken().totalSupply()));
    }

    function notifyBTokenFeeAmount(uint amount) external override onlyTunnel {

        oTokenFeePerTokenStored = oTokenFeePerTokenStored.add(amount.divideDecimal(ptoken().totalSupply()));
    }

    function notifyPTokenAmount(address account, uint amount) external override onlyTunnel {
        // first update account rewards
        (uint earnedBOR, uint earnedOToken) = earned(account);
        userBORFee[account] = earnedBOR; 
        userOTokenFee[account] = earnedOToken; 

        userBORFeePaid[account] = borFeePerTokenStored;
        userOTokenFeePaid[account] = oTokenFeePerTokenStored;

        _balances[account] = _balances[account].add(amount);
    }

    function withdraw(address account, uint amount) external override onlyTunnel{
        _claimFee(account);
        _balances[account] = _balances[account].sub(amount);
    }

    function claimFee() external {
        _claimFee(msg.sender);
    }

    function _claimFee(address account) internal {
        (uint earnedBOR, uint earnedOToken) = earned(account);
        userBORFee[account] = 0;
        userBORFeePaid[account] = borFeePerTokenStored;

        userOTokenFee[account] = 0;
        userOTokenFeePaid[account] = oTokenFeePerTokenStored;
        
        bor().transfer(account, earnedBOR);
        otoken().transfer(account, earnedOToken);

    }

    // modifier
    modifier onlyTunnel {
        require(
            msg.sender == addrReso.key2address(tunnelKey),
            "caller is not tunnel"
        );
        _;
    }


}

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

pragma solidity ^0.6.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, 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) {
        return sub(a, b, "SafeMath: subtraction overflow");
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * 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);
        uint256 c = a - b;

        return c;
    }

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

        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");

        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts 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) {
        return div(a, b, "SafeMath: division by zero");
    }

    /**
     * @dev Returns the integer division of two unsigned integers. Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        uint256 c = a / b;
        // assert(a == b * c + a % b); // There is no case in which this doesn't hold

        return c;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts 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) {
        return mod(a, b, "SafeMath: modulo by zero");
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
        require(b != 0, errorMessage);
        return a % b;
    }
}

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

pragma solidity ^0.6.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 7 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor () internal {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;

        _;

        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

File 5 of 7 : IAddressResolver.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.12;

interface IAddressResolver {
    
    function key2address(bytes32 key) external view returns(address);
    function address2key(address addr) external view returns(bytes32);
    function requireAndKey2Address(bytes32 name, string calldata reason) external view returns(address);

    function setAddress(bytes32 key, address addr) external;
    function setMultiAddress(bytes32[] memory keys, address[] memory addrs) external;
    
    function setKkAddr(bytes32 k1, bytes32 k2, address addr) external;
    function setMultiKKAddr(bytes32[] memory k1s, bytes32[] memory k2s, address[] memory addrs) external;

    function kk2addr(bytes32 k1, bytes32 k2) external view returns(address);
    function requireKKAddrs(bytes32 k1, bytes32 k2, string calldata reason) external view returns(address);
}

File 6 of 7 : IFeePool.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.12;

interface IFeePool {

    function earned(address account) external view returns(uint, uint);

    function notifyBORFeeAmount(uint amount) external;
    function notifyBTokenFeeAmount(uint amount) external;
    function notifyPTokenAmount(address account, uint amount) external;
    
    function withdraw(address account, uint amount) external;

}

File 7 of 7 : SafeDecimalMath.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.8;

// Libraries
import "@openzeppelin/contracts/math/SafeMath.sol";

// https://docs.synthetix.io/contracts/SafeDecimalMath
library SafeDecimalMath {
    using SafeMath for uint;

    /* Number of decimal places in the representations. */
    uint8 public constant decimals = 18;
    uint8 public constant highPrecisionDecimals = 27;

    /* The number representing 1.0. */
    uint public constant UNIT = 10**uint(decimals);

    /* The number representing 1.0 for higher fidelity numbers. */
    uint public constant PRECISE_UNIT = 10**uint(highPrecisionDecimals);
    uint private constant UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR = 10**uint(highPrecisionDecimals - decimals);

    /**
     * @return Provides an interface to UNIT.
     */
    function unit() external pure returns (uint) {
        return UNIT;
    }

    /**
     * @return Provides an interface to PRECISE_UNIT.
     */
    function preciseUnit() external pure returns (uint) {
        return PRECISE_UNIT;
    }

    /**
     * @return The result of multiplying x and y, interpreting the operands as fixed-point
     * decimals.
     *
     * @dev A unit factor is divided out after the product of x and y is evaluated,
     * so that product must be less than 2**256. As this is an integer division,
     * the internal division always rounds down. This helps save on gas. Rounding
     * is more expensive on gas.
     */
    function multiplyDecimal(uint x, uint y) internal pure returns (uint) {
        /* Divide by UNIT to remove the extra factor introduced by the product. */
        return x.mul(y) / UNIT;
    }

    /**
     * @return The result of safely multiplying x and y, interpreting the operands
     * as fixed-point decimals of the specified precision unit.
     *
     * @dev The operands should be in the form of a the specified unit factor which will be
     * divided out after the product of x and y is evaluated, so that product must be
     * less than 2**256.
     *
     * Unlike multiplyDecimal, this function rounds the result to the nearest increment.
     * Rounding is useful when you need to retain fidelity for small decimal numbers
     * (eg. small fractions or percentages).
     */
    function _multiplyDecimalRound(
        uint x,
        uint y,
        uint precisionUnit
    ) private pure returns (uint) {
        /* Divide by UNIT to remove the extra factor introduced by the product. */
        uint quotientTimesTen = x.mul(y) / (precisionUnit / 10);

        if (quotientTimesTen % 10 >= 5) {
            quotientTimesTen += 10;
        }

        return quotientTimesTen / 10;
    }

    /**
     * @return The result of safely multiplying x and y, interpreting the operands
     * as fixed-point decimals of a precise unit.
     *
     * @dev The operands should be in the precise unit factor which will be
     * divided out after the product of x and y is evaluated, so that product must be
     * less than 2**256.
     *
     * Unlike multiplyDecimal, this function rounds the result to the nearest increment.
     * Rounding is useful when you need to retain fidelity for small decimal numbers
     * (eg. small fractions or percentages).
     */
    function multiplyDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) {
        return _multiplyDecimalRound(x, y, PRECISE_UNIT);
    }

    /**
     * @return The result of safely multiplying x and y, interpreting the operands
     * as fixed-point decimals of a standard unit.
     *
     * @dev The operands should be in the standard unit factor which will be
     * divided out after the product of x and y is evaluated, so that product must be
     * less than 2**256.
     *
     * Unlike multiplyDecimal, this function rounds the result to the nearest increment.
     * Rounding is useful when you need to retain fidelity for small decimal numbers
     * (eg. small fractions or percentages).
     */
    function multiplyDecimalRound(uint x, uint y) internal pure returns (uint) {
        return _multiplyDecimalRound(x, y, UNIT);
    }

    /**
     * @return The result of safely dividing x and y. The return value is a high
     * precision decimal.
     *
     * @dev y is divided after the product of x and the standard precision unit
     * is evaluated, so the product of x and UNIT must be less than 2**256. As
     * this is an integer division, the result is always rounded down.
     * This helps save on gas. Rounding is more expensive on gas.
     */
    function divideDecimal(uint x, uint y) internal pure returns (uint) {
        /* Reintroduce the UNIT factor that will be divided out by y. */
        return x.mul(UNIT).div(y);
    }

    /**
     * @return The result of safely dividing x and y. The return value is as a rounded
     * decimal in the precision unit specified in the parameter.
     *
     * @dev y is divided after the product of x and the specified precision unit
     * is evaluated, so the product of x and the specified precision unit must
     * be less than 2**256. The result is rounded to the nearest increment.
     */
    function _divideDecimalRound(
        uint x,
        uint y,
        uint precisionUnit
    ) private pure returns (uint) {
        uint resultTimesTen = x.mul(precisionUnit * 10).div(y);

        if (resultTimesTen % 10 >= 5) {
            resultTimesTen += 10;
        }

        return resultTimesTen / 10;
    }

    /**
     * @return The result of safely dividing x and y. The return value is as a rounded
     * standard precision decimal.
     *
     * @dev y is divided after the product of x and the standard precision unit
     * is evaluated, so the product of x and the standard precision unit must
     * be less than 2**256. The result is rounded to the nearest increment.
     */
    function divideDecimalRound(uint x, uint y) internal pure returns (uint) {
        return _divideDecimalRound(x, y, UNIT);
    }

    /**
     * @return The result of safely dividing x and y. The return value is as a rounded
     * high precision decimal.
     *
     * @dev y is divided after the product of x and the high precision unit
     * is evaluated, so the product of x and the high precision unit must
     * be less than 2**256. The result is rounded to the nearest increment.
     */
    function divideDecimalRoundPrecise(uint x, uint y) internal pure returns (uint) {
        return _divideDecimalRound(x, y, PRECISE_UNIT);
    }

    /**
     * @dev Convert a standard decimal representation to a high precision one.
     */
    function decimalToPreciseDecimal(uint i) internal pure returns (uint) {
        return i.mul(UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR);
    }

    /**
     * @dev Convert a high precision decimal to a standard decimal representation.
     */
    function preciseDecimalToDecimal(uint i) internal pure returns (uint) {
        uint quotientTimesTen = i / (UNIT_TO_HIGH_PRECISION_CONVERSION_FACTOR / 10);

        if (quotientTimesTen % 10 >= 5) {
            quotientTimesTen += 10;
        }

        return quotientTimesTen / 10;
    }
}

Settings
{
  "evmVersion": "istanbul",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IAddressResolver","name":"_addrReso","type":"address"},{"internalType":"bytes32","name":"_tunnelKey","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"OTOKEN","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PPTOKEN","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"addrReso","outputs":[{"internalType":"contract IAddressResolver","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"borFeePerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"borFeePerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"claimFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earned","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"notifyBORFeeAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"notifyBTokenFeeAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"notifyPTokenAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"oTokenFeePerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oTokenFeePerTokenStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tunnelKey","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userBORFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userBORFeePaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userOTokenFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userOTokenFeePaid","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561001057600080fd5b506040516111823803806111828339818101604052604081101561003357600080fd5b50805160209091015160016000818155600280546001600160a01b0319166001600160a01b03909516949094179093555561110e90819061007490396000f3fe608060405234801561001057600080fd5b50600436106101415760003560e01c806370a08231116100b8578063c3d665871161007c578063c3d66587146102d5578063c544df0c146102fb578063c7daed2a14610303578063cf36ddcc14610329578063dad0e12314610331578063f3fef3a31461033957610141565b806370a082311461025c5780637ae316d01461028257806399d32fc41461028a5780639bc51d0914610292578063a5f72be3146102af57610141565b80632e9eaf611161010a5780632e9eaf61146101dd5780632f4f0d1c146101e55780633328817e146101ed57806346e992ae1461020a57806356f5ef04146102305780635c7975511461023857610141565b80628cc2621461014657806318160ddd146101855780631a63f35c1461019f57806326abdad4146101cd57806329b2cb43146101d5575b600080fd5b61016c6004803603602081101561015c57600080fd5b50356001600160a01b0316610365565b6040805192835260208301919091528051918290030190f35b61018d61042f565b60408051918252519081900360200190f35b6101cb600480360360408110156101b557600080fd5b506001600160a01b0381351690602001356104a2565b005b61018d6105f3565b61018d6105fd565b61018d610603565b61018d610609565b6101cb6004803603602081101561020357600080fd5b503561060f565b61018d6004803603602081101561022057600080fd5b50356001600160a01b0316610765565b61018d610777565b610240610785565b604080516001600160a01b039092168252519081900360200190f35b61018d6004803603602081101561027257600080fd5b50356001600160a01b0316610794565b61016c6107af565b6101cb6108bb565b6101cb600480360360208110156102a857600080fd5b50356108c6565b61018d600480360360208110156102c557600080fd5b50356001600160a01b03166109b1565b61018d600480360360208110156102eb57600080fd5b50356001600160a01b03166109c3565b61018d6109d5565b61018d6004803603602081101561031957600080fd5b50356001600160a01b03166109e2565b61018d6109f4565b61018d6109fa565b6101cb6004803603604081101561034f57600080fd5b506001600160a01b038135169060200135610a00565b6001600160a01b0381166000908152600560209081526040808320546006909252822054600354839283926103c7926103c1916103a29190610b1a565b6001600160a01b03881660009081526009602052604090205490610b65565b90610b89565b6001600160a01b03851660009081526007602090815260408083205460089092528220546004549394509192610423926103c19161040491610b1a565b6001600160a01b03891660009081526009602052604090205490610b65565b91935090915050915091565b6000610439610be3565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561047157600080fd5b505afa158015610485573d6000803e3d6000fd5b505050506040513d602081101561049b57600080fd5b5051905090565b6002546001546040805163130852b360e11b81526004810192909252516001600160a01b0390921691632610a56691602480820192602092909190829003018186803b1580156104f157600080fd5b505afa158015610505573d6000803e3d6000fd5b505050506040513d602081101561051b57600080fd5b50516001600160a01b03163314610570576040805162461bcd60e51b815260206004820152601460248201527318d85b1b195c881a5cc81b9bdd081d1d5b9b995b60621b604482015290519081900360640190fd5b60008061057c84610365565b6001600160a01b03861660009081526005602090815260408083208590556007825280832084905560035460068352818420556004546008835281842055600990915290205491935091506105d19084610b89565b6001600160a01b03909416600090815260096020526040902093909355505050565b622127a960e91b81565b60035490565b60035481565b60015481565b6002546001546040805163130852b360e11b81526004810192909252516001600160a01b0390921691632610a56691602480820192602092909190829003018186803b15801561065e57600080fd5b505afa158015610672573d6000803e3d6000fd5b505050506040513d602081101561068857600080fd5b50516001600160a01b031633146106dd576040805162461bcd60e51b815260206004820152601460248201527318d85b1b195c881a5cc81b9bdd081d1d5b9b995b60621b604482015290519081900360640190fd5b61075f6107566106eb610be3565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561072357600080fd5b505afa158015610737573d6000803e3d6000fd5b505050506040513d602081101561074d57600080fd5b50518390610c63565b60045490610b89565b60045550565b60056020526000908152604090205481565b6638382a37b5b2b760c91b81565b6002546001600160a01b031681565b6001600160a01b031660009081526009602052604090205490565b6000806107ba610c81565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561080657600080fd5b505afa15801561081a573d6000803e3d6000fd5b505050506040513d602081101561083057600080fd5b505161083a610cef565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561088657600080fd5b505afa15801561089a573d6000803e3d6000fd5b505050506040513d60208110156108b057600080fd5b505190925090509091565b6108c433610d6e565b565b6002546001546040805163130852b360e11b81526004810192909252516001600160a01b0390921691632610a56691602480820192602092909190829003018186803b15801561091557600080fd5b505afa158015610929573d6000803e3d6000fd5b505050506040513d602081101561093f57600080fd5b50516001600160a01b03163314610994576040805162461bcd60e51b815260206004820152601460248201527318d85b1b195c881a5cc81b9bdd081d1d5b9b995b60621b604482015290519081900360640190fd5b6109ab6109a26106eb610be3565b60035490610b89565b60035550565b60076020526000908152604090205481565b60066020526000908152604090205481565b6537aa37b5b2b760d11b81565b60086020526000908152604090205481565b60045481565b60045490565b6002546001546040805163130852b360e11b81526004810192909252516001600160a01b0390921691632610a56691602480820192602092909190829003018186803b158015610a4f57600080fd5b505afa158015610a63573d6000803e3d6000fd5b505050506040513d6020811015610a7957600080fd5b50516001600160a01b03163314610ace576040805162461bcd60e51b815260206004820152601460248201527318d85b1b195c881a5cc81b9bdd081d1d5b9b995b60621b604482015290519081900360640190fd5b610ad782610d6e565b6001600160a01b038216600090815260096020526040902054610afa9082610b1a565b6001600160a01b0390921660009081526009602052604090209190915550565b6000610b5c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ed8565b90505b92915050565b6000670de0b6b3a7640000610b7a8484610f6f565b81610b8157fe5b049392505050565b600082820183811015610b5c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6002546001546040516305ad37e160e11b8152600481018281526638382a37b5b2b760c91b602483018190526060604484019081526028606485018190526000966001600160a01b031695630b5a6fc2959094929160849091019061106b8239604001935050505060206040518083038186803b15801561047157600080fd5b6000610b5c82610c7b85670de0b6b3a7640000610f6f565b90610fc8565b60025460408051635da2251d60e11b8152622127a960e91b60048201818152602483019384526025604484018190526000956001600160a01b03169463bb444a3a9490916064909101906110b482396040019250505060206040518083038186803b15801561047157600080fd5b6002546001546040516305ad37e160e11b8152600481018281526537aa37b5b2b760d11b602483018190526060604484019081526028606485018190526000966001600160a01b031695630b5a6fc2959094929160849091019061106b8239604001935050505060206040518083038186803b15801561047157600080fd5b600080610d7a83610365565b6001600160a01b03851660009081526005602090815260408083208390556003546006835281842055600782528083208390556004546008909252909120559092509050610dc6610c81565b6001600160a01b031663a9059cbb84846040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610e1c57600080fd5b505af1158015610e30573d6000803e3d6000fd5b505050506040513d6020811015610e4657600080fd5b50610e519050610cef565b6001600160a01b031663a9059cbb84836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610ea757600080fd5b505af1158015610ebb573d6000803e3d6000fd5b505050506040513d6020811015610ed157600080fd5b5050505050565b60008184841115610f675760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f2c578181015183820152602001610f14565b50505050905090810190601f168015610f595780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082610f7e57506000610b5f565b82820282848281610f8b57fe5b0414610b5c5760405162461bcd60e51b81526004018080602001828103825260218152602001806110936021913960400191505060405180910390fd5b6000610b5c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836110545760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610f2c578181015183820152602001610f14565b50600083858161106057fe5b049594505050505056fe6f546f6b656e20636f6e7472616374206973206164647265737328302920696e20466565506f6f6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77424f5220636f6e7472616374206973206164647265737328302920696e20466565506f6f6ca26469706673582212206c288437447f5c60a4640c73577c614230d98d279c595b01d10580a924df650164736f6c634300060c0033000000000000000000000000a254bbb68a73d9bba7760ba6e1b4d0e005d8b671444f474500000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101415760003560e01c806370a08231116100b8578063c3d665871161007c578063c3d66587146102d5578063c544df0c146102fb578063c7daed2a14610303578063cf36ddcc14610329578063dad0e12314610331578063f3fef3a31461033957610141565b806370a082311461025c5780637ae316d01461028257806399d32fc41461028a5780639bc51d0914610292578063a5f72be3146102af57610141565b80632e9eaf611161010a5780632e9eaf61146101dd5780632f4f0d1c146101e55780633328817e146101ed57806346e992ae1461020a57806356f5ef04146102305780635c7975511461023857610141565b80628cc2621461014657806318160ddd146101855780631a63f35c1461019f57806326abdad4146101cd57806329b2cb43146101d5575b600080fd5b61016c6004803603602081101561015c57600080fd5b50356001600160a01b0316610365565b6040805192835260208301919091528051918290030190f35b61018d61042f565b60408051918252519081900360200190f35b6101cb600480360360408110156101b557600080fd5b506001600160a01b0381351690602001356104a2565b005b61018d6105f3565b61018d6105fd565b61018d610603565b61018d610609565b6101cb6004803603602081101561020357600080fd5b503561060f565b61018d6004803603602081101561022057600080fd5b50356001600160a01b0316610765565b61018d610777565b610240610785565b604080516001600160a01b039092168252519081900360200190f35b61018d6004803603602081101561027257600080fd5b50356001600160a01b0316610794565b61016c6107af565b6101cb6108bb565b6101cb600480360360208110156102a857600080fd5b50356108c6565b61018d600480360360208110156102c557600080fd5b50356001600160a01b03166109b1565b61018d600480360360208110156102eb57600080fd5b50356001600160a01b03166109c3565b61018d6109d5565b61018d6004803603602081101561031957600080fd5b50356001600160a01b03166109e2565b61018d6109f4565b61018d6109fa565b6101cb6004803603604081101561034f57600080fd5b506001600160a01b038135169060200135610a00565b6001600160a01b0381166000908152600560209081526040808320546006909252822054600354839283926103c7926103c1916103a29190610b1a565b6001600160a01b03881660009081526009602052604090205490610b65565b90610b89565b6001600160a01b03851660009081526007602090815260408083205460089092528220546004549394509192610423926103c19161040491610b1a565b6001600160a01b03891660009081526009602052604090205490610b65565b91935090915050915091565b6000610439610be3565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561047157600080fd5b505afa158015610485573d6000803e3d6000fd5b505050506040513d602081101561049b57600080fd5b5051905090565b6002546001546040805163130852b360e11b81526004810192909252516001600160a01b0390921691632610a56691602480820192602092909190829003018186803b1580156104f157600080fd5b505afa158015610505573d6000803e3d6000fd5b505050506040513d602081101561051b57600080fd5b50516001600160a01b03163314610570576040805162461bcd60e51b815260206004820152601460248201527318d85b1b195c881a5cc81b9bdd081d1d5b9b995b60621b604482015290519081900360640190fd5b60008061057c84610365565b6001600160a01b03861660009081526005602090815260408083208590556007825280832084905560035460068352818420556004546008835281842055600990915290205491935091506105d19084610b89565b6001600160a01b03909416600090815260096020526040902093909355505050565b622127a960e91b81565b60035490565b60035481565b60015481565b6002546001546040805163130852b360e11b81526004810192909252516001600160a01b0390921691632610a56691602480820192602092909190829003018186803b15801561065e57600080fd5b505afa158015610672573d6000803e3d6000fd5b505050506040513d602081101561068857600080fd5b50516001600160a01b031633146106dd576040805162461bcd60e51b815260206004820152601460248201527318d85b1b195c881a5cc81b9bdd081d1d5b9b995b60621b604482015290519081900360640190fd5b61075f6107566106eb610be3565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561072357600080fd5b505afa158015610737573d6000803e3d6000fd5b505050506040513d602081101561074d57600080fd5b50518390610c63565b60045490610b89565b60045550565b60056020526000908152604090205481565b6638382a37b5b2b760c91b81565b6002546001600160a01b031681565b6001600160a01b031660009081526009602052604090205490565b6000806107ba610c81565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561080657600080fd5b505afa15801561081a573d6000803e3d6000fd5b505050506040513d602081101561083057600080fd5b505161083a610cef565b6001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561088657600080fd5b505afa15801561089a573d6000803e3d6000fd5b505050506040513d60208110156108b057600080fd5b505190925090509091565b6108c433610d6e565b565b6002546001546040805163130852b360e11b81526004810192909252516001600160a01b0390921691632610a56691602480820192602092909190829003018186803b15801561091557600080fd5b505afa158015610929573d6000803e3d6000fd5b505050506040513d602081101561093f57600080fd5b50516001600160a01b03163314610994576040805162461bcd60e51b815260206004820152601460248201527318d85b1b195c881a5cc81b9bdd081d1d5b9b995b60621b604482015290519081900360640190fd5b6109ab6109a26106eb610be3565b60035490610b89565b60035550565b60076020526000908152604090205481565b60066020526000908152604090205481565b6537aa37b5b2b760d11b81565b60086020526000908152604090205481565b60045481565b60045490565b6002546001546040805163130852b360e11b81526004810192909252516001600160a01b0390921691632610a56691602480820192602092909190829003018186803b158015610a4f57600080fd5b505afa158015610a63573d6000803e3d6000fd5b505050506040513d6020811015610a7957600080fd5b50516001600160a01b03163314610ace576040805162461bcd60e51b815260206004820152601460248201527318d85b1b195c881a5cc81b9bdd081d1d5b9b995b60621b604482015290519081900360640190fd5b610ad782610d6e565b6001600160a01b038216600090815260096020526040902054610afa9082610b1a565b6001600160a01b0390921660009081526009602052604090209190915550565b6000610b5c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ed8565b90505b92915050565b6000670de0b6b3a7640000610b7a8484610f6f565b81610b8157fe5b049392505050565b600082820183811015610b5c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6002546001546040516305ad37e160e11b8152600481018281526638382a37b5b2b760c91b602483018190526060604484019081526028606485018190526000966001600160a01b031695630b5a6fc2959094929160849091019061106b8239604001935050505060206040518083038186803b15801561047157600080fd5b6000610b5c82610c7b85670de0b6b3a7640000610f6f565b90610fc8565b60025460408051635da2251d60e11b8152622127a960e91b60048201818152602483019384526025604484018190526000956001600160a01b03169463bb444a3a9490916064909101906110b482396040019250505060206040518083038186803b15801561047157600080fd5b6002546001546040516305ad37e160e11b8152600481018281526537aa37b5b2b760d11b602483018190526060604484019081526028606485018190526000966001600160a01b031695630b5a6fc2959094929160849091019061106b8239604001935050505060206040518083038186803b15801561047157600080fd5b600080610d7a83610365565b6001600160a01b03851660009081526005602090815260408083208390556003546006835281842055600782528083208390556004546008909252909120559092509050610dc6610c81565b6001600160a01b031663a9059cbb84846040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610e1c57600080fd5b505af1158015610e30573d6000803e3d6000fd5b505050506040513d6020811015610e4657600080fd5b50610e519050610cef565b6001600160a01b031663a9059cbb84836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610ea757600080fd5b505af1158015610ebb573d6000803e3d6000fd5b505050506040513d6020811015610ed157600080fd5b5050505050565b60008184841115610f675760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f2c578181015183820152602001610f14565b50505050905090810190601f168015610f595780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082610f7e57506000610b5f565b82820282848281610f8b57fe5b0414610b5c5760405162461bcd60e51b81526004018080602001828103825260218152602001806110936021913960400191505060405180910390fd5b6000610b5c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836110545760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610f2c578181015183820152602001610f14565b50600083858161106057fe5b049594505050505056fe6f546f6b656e20636f6e7472616374206973206164647265737328302920696e20466565506f6f6c536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77424f5220636f6e7472616374206973206164647265737328302920696e20466565506f6f6ca26469706673582212206c288437447f5c60a4640c73577c614230d98d279c595b01d10580a924df650164736f6c634300060c0033

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

000000000000000000000000a254bbb68a73d9bba7760ba6e1b4d0e005d8b671444f474500000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _addrReso (address): 0xa254bBb68A73d9BBa7760ba6E1B4D0E005D8B671
Arg [1] : _tunnelKey (bytes32): 0x444f474500000000000000000000000000000000000000000000000000000000

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000a254bbb68a73d9bba7760ba6e1b4d0e005d8b671
Arg [1] : 444f474500000000000000000000000000000000000000000000000000000000


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.