ETH Price: $3,097.18 (-1.18%)

Contract

0xF0301472c7e383310bE1D426aA59207818fB8a53
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Withdraw175780752023-06-28 13:20:23510 days ago1687958423IN
0xF0301472...818fB8a53
0 ETH0.002378816.01802585
Withdraw174918592023-06-16 10:38:47523 days ago1686911927IN
0xF0301472...818fB8a53
0 ETH0.0021495114.47409632
Withdraw173170072023-05-22 19:47:35547 days ago1684784855IN
0xF0301472...818fB8a53
0 ETH0.008397256.54379818
Withdraw172950082023-05-19 17:26:35550 days ago1684517195IN
0xF0301472...818fB8a53
0 ETH0.0067166145.22726647
Withdraw170725052023-04-18 8:51:35582 days ago1681807895IN
0xF0301472...818fB8a53
0 ETH0.0045344734.50686456
Withdraw170120932023-04-09 17:06:11590 days ago1681059971IN
0xF0301472...818fB8a53
0 ETH0.0033721622.70693193
Withdraw169959172023-04-07 10:05:59593 days ago1680861959IN
0xF0301472...818fB8a53
0 ETH0.0006313820.08168695
Withdraw169957372023-04-07 9:28:59593 days ago1680859739IN
0xF0301472...818fB8a53
0 ETH0.0007402223.54345698
Withdraw168124212023-03-12 14:04:23618 days ago1678629863IN
0xF0301472...818fB8a53
0 ETH0.0031769319.18624169
Harvest167235962023-02-28 2:08:47631 days ago1677550127IN
0xF0301472...818fB8a53
0 ETH0.0033530724.82783689
Harvest167073062023-02-25 19:15:47633 days ago1677352547IN
0xF0301472...818fB8a53
0 ETH0.0024258720.56642391
Deposit166736752023-02-21 1:39:59638 days ago1676943599IN
0xF0301472...818fB8a53
0 ETH0.0027453323.0216645
Deposit166648182023-02-19 19:49:35639 days ago1676836175IN
0xF0301472...818fB8a53
0 ETH0.0029149322.32398909
Deposit166648162023-02-19 19:49:11639 days ago1676836151IN
0xF0301472...818fB8a53
0 ETH0.0037288523.42674853
Withdraw166624282023-02-19 11:46:35640 days ago1676807195IN
0xF0301472...818fB8a53
0 ETH0.0031955421.52116118
Harvest166583882023-02-18 22:09:23640 days ago1676758163IN
0xF0301472...818fB8a53
0 ETH0.0024652820.90061233
Withdraw166422652023-02-16 15:44:23642 days ago1676562263IN
0xF0301472...818fB8a53
0 ETH0.0086126752.00640022
Harvest166383362023-02-16 2:32:47643 days ago1676514767IN
0xF0301472...818fB8a53
0 ETH0.0042982736.4405626
Deposit166380982023-02-16 1:44:59643 days ago1676511899IN
0xF0301472...818fB8a53
0 ETH0.0048129640.36028778
Withdraw166361342023-02-15 19:09:47643 days ago1676488187IN
0xF0301472...818fB8a53
0 ETH0.0064622643.51461931
Deposit166360512023-02-15 18:53:11643 days ago1676487191IN
0xF0301472...818fB8a53
0 ETH0.0053478344.84559614
Deposit166264532023-02-14 10:40:47645 days ago1676371247IN
0xF0301472...818fB8a53
0 ETH0.0020018916.78741275
Deposit166254402023-02-14 7:15:35645 days ago1676358935IN
0xF0301472...818fB8a53
0 ETH0.002153818.06486554
Harvest166238812023-02-14 2:01:47645 days ago1676340107IN
0xF0301472...818fB8a53
0 ETH0.0024233117.94342034
Deposit166112972023-02-12 7:50:47647 days ago1676188247IN
0xF0301472...818fB8a53
0 ETH0.002421717.04428844
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:
PolkaBridgeFarm

Compiler Version
v0.8.0+commit.c7dfd78e

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 7 : PolkaBridgeFarm.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
// import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./ReentrancyGuard.sol";

// PolkaBridgeFarm is the master of PolkaBridge. He can make PolkaBridge and he is a fair guy.
//
// Note that it's ownable and the owner wields tremendous power. The ownership
// will be transferred to a governance smart contract once PBR is sufficiently
// distributed and the community can show to govern itself.
//
// Have fun reading it. Hopefully it's bug-free. God bless.
contract PolkaBridgeFarm is Ownable, ReentrancyGuard {
    using SafeERC20 for IERC20;
    // Info of each user.
    struct UserInfo {
        uint256 amount; // How many LP tokens the user has provided.
        uint256 rewardDebt; // Reward debt. See explanation below.
        //
        // We do some fancy math here. Basically, any point in time, the amount of PBRs
        // entitled to a user but is pending to be distributed is:
        //
        //   pending reward = (user.amount * pool.accPBRPerShare) - user.rewardDebt
        //
        // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens:
        //   1. The pool's `accPBRPerShare` (and `lastRewardBlock`) gets updated.
        //   2. User receives the pending reward sent to his/her address.
        //   3. User's `amount` gets updated.
        //   4. User's `rewardDebt` gets updated.
    }
    // Info of each pool.
    struct PoolInfo {
        IERC20 lpToken; // Address of LP token contract.
        uint256 lpAmount; // LP token amount in the pool.
        uint256 allocPoint; // How many allocation points assigned to this pool. PBRs to distribute per block.
        uint256 lastRewardBlock; // Last block number that PBRs distribution occurs.
        uint256 accPBRPerShare; // Accumulated PBRs per share, times 1e18. See below.        
    }
    // The PBR TOKEN!
    address public polkaBridge;
    // PBR tokens created per block.
    uint256 public PBRPerBlock;
    // Bonus muliplier for early polkaBridge makers.
    uint256 public constant BONUS_MULTIPLIER = 1;
    // Info of each pool.
    PoolInfo[] public poolInfo;
    // Info of each user that stakes LP tokens.
    mapping(uint256 => mapping(address => UserInfo)) public userInfo;
    // Total allocation poitns. Must be the sum of all allocation points in all pools.
    uint256 public totalAllocPoint = 0;
    // The block number when PBR mining starts.
    uint256 public startBlock;
    event Deposit(address indexed user, uint256 indexed pid, uint256 amount);
    event Withdraw(address indexed user, uint256 indexed pid, uint256 amount);
    event EmergencyWithdraw(
        address indexed user,
        uint256 indexed pid,
        uint256 amount
    );
    event LogPoolAddition(uint256 indexed pid, uint256 allocPoint, IERC20 indexed lpToken, bool withUpdate);
    event LogSetPool(uint256 indexed pid, uint256 allocPoint, bool withUpdate);
    event LogUpdatePool(uint256 indexed pid, uint256 lastRewardBlock, uint256 lpSupply, uint256 accPBRPerShare);

    constructor(
        address _polkaBridge,
        uint256 _PBRPerBlock,
        uint256 _startBlock
    ) {
        polkaBridge = _polkaBridge;
        PBRPerBlock = _PBRPerBlock;
        startBlock = _startBlock;
    }

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

    function changePBRBlock(uint256 _PBRPerBlock) external onlyOwner {
         PBRPerBlock = _PBRPerBlock;
    }
    // Add a new lp to the pool. Can only be called by the owner.
    // XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do.
    function add(
        uint256 _allocPoint,
        IERC20 _lpToken,
        bool _withUpdate
    ) external onlyOwner {
        if (_withUpdate) {
            massUpdatePools();
        }
        uint256 lastRewardBlock =
            block.number > startBlock ? block.number : startBlock;
        totalAllocPoint = totalAllocPoint + _allocPoint;
        poolInfo.push(
            PoolInfo({
                lpToken: _lpToken,
                lpAmount: 0,
                allocPoint: _allocPoint,
                lastRewardBlock: lastRewardBlock,
                accPBRPerShare: 0
            })
        );
        emit LogPoolAddition(poolInfo.length - 1, _allocPoint, _lpToken, _withUpdate);
    }

    // Update the given pool's PBR allocation point. Can only be called by the owner.
    function set(
        uint256 _pid,
        uint256 _allocPoint,
        bool _withUpdate
    ) external onlyOwner {
        if(_withUpdate) {
            massUpdatePools();
        } else {
            updatePool(_pid);
        }
        totalAllocPoint = totalAllocPoint - poolInfo[_pid].allocPoint + _allocPoint;
        poolInfo[_pid].allocPoint = _allocPoint;
        emit LogSetPool(_pid, _allocPoint, _withUpdate);
    }

    // Return reward multiplier over the given _from to _to block.
    function getMultiplier(uint256 _from, uint256 _to) public pure returns (uint256) {        
        return _to - _from * BONUS_MULTIPLIER;
    }

    // View function to see pending PBRs on frontend.
    function pendingPBR(uint256 _pid, address _user)
        external
        view
        returns (uint256)
    {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][_user];
        uint256 accPBRPerShare = pool.accPBRPerShare;
        uint256 lpSupply = pool.lpToken.balanceOf(address(this));

        if (block.number > pool.lastRewardBlock && lpSupply != 0) {
            uint256 multiplier =
                getMultiplier(pool.lastRewardBlock, block.number);
            uint256 PBRReward = multiplier * PBRPerBlock * pool.allocPoint / totalAllocPoint;
            accPBRPerShare = accPBRPerShare + PBRReward * 1e18 / lpSupply;
        }
        return user.amount * accPBRPerShare / 1e18 - user.rewardDebt;
    }

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

    // Update reward variables of the given pool to be up-to-date.
    function updatePool(uint256 _pid) public {
        PoolInfo storage pool = poolInfo[_pid];
        if (block.number <= pool.lastRewardBlock) {
            return;
        }
        uint256 lpSupply = pool.lpToken.balanceOf(address(this));
        if (lpSupply == 0) {
            pool.lastRewardBlock = block.number;
            return;
        }
        uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number);
        uint256 PBRReward = multiplier * PBRPerBlock * pool.allocPoint / totalAllocPoint;
        pool.accPBRPerShare = pool.accPBRPerShare + PBRReward * 1e18 / lpSupply;
        pool.lastRewardBlock = block.number;
        emit LogUpdatePool(_pid, pool.lastRewardBlock, lpSupply, pool.accPBRPerShare);
    }


    // Harvest
    function harvest(uint256 _pid) external nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        updatePool(_pid);
        if (user.amount > 0) {
            uint256 pending = user.amount * pool.accPBRPerShare / 1e18 - user.rewardDebt;
            IERC20(polkaBridge).safeTransfer(msg.sender, pending);
        }
        // pool.lpToken.safeTransferFrom(
        //     address(msg.sender),
        //     address(this),
        //     _amount
        // );
        // user.amount = user.amount + _amount;
        user.rewardDebt = user.amount * pool.accPBRPerShare / 1e18;
        // emit Deposit(msg.sender, _pid, _amount);
    }

    // Deposit LP tokens to PolkaBridgeFarm for PBR allocation.
    function deposit(uint256 _pid, uint256 _amount) external nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        updatePool(_pid);
        if (user.amount > 0) {
            uint256 pending = user.amount * pool.accPBRPerShare / 1e18 - user.rewardDebt;
            IERC20(polkaBridge).safeTransfer(msg.sender, pending);
        }
        pool.lpToken.safeTransferFrom(
            address(msg.sender),
            address(this),
            _amount
        );
        user.amount = user.amount + _amount;
        pool.lpAmount = pool.lpAmount + _amount;
        user.rewardDebt = user.amount * pool.accPBRPerShare / 1e18;
        emit Deposit(msg.sender, _pid, _amount);
    }

    // Withdraw LP tokens from PolkaBridgeFarm.
    function withdraw(uint256 _pid, uint256 _amount) external nonReentrant {
        PoolInfo storage pool = poolInfo[_pid];
        UserInfo storage user = userInfo[_pid][msg.sender];
        require(user.amount >= _amount, "withdraw: not good");
        updatePool(_pid);
        uint256 pending = user.amount * pool.accPBRPerShare / 1e18 - user.rewardDebt;
        IERC20(polkaBridge).safeTransfer(msg.sender, pending);
        user.amount = user.amount - _amount;
        pool.lpAmount = pool.lpAmount - _amount;
        user.rewardDebt = user.amount * pool.accPBRPerShare / 1e18;
        pool.lpToken.safeTransfer(address(msg.sender), _amount);
        emit Withdraw(msg.sender, _pid, _amount);
    }

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

}

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

pragma solidity ^0.8.0;


abstract contract ReentrancyGuard {
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _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 3 of 7 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

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

File 4 of 7 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

        uint256 size;
        assembly {
            size := extcodesize(account)
        }
        return size > 0;
    }

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

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

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

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

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

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

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

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

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

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _setOwner(_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 {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_polkaBridge","type":"address"},{"internalType":"uint256","name":"_PBRPerBlock","type":"uint256"},{"internalType":"uint256","name":"_startBlock","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"allocPoint","type":"uint256"},{"indexed":true,"internalType":"contract IERC20","name":"lpToken","type":"address"},{"indexed":false,"internalType":"bool","name":"withUpdate","type":"bool"}],"name":"LogPoolAddition","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"allocPoint","type":"uint256"},{"indexed":false,"internalType":"bool","name":"withUpdate","type":"bool"}],"name":"LogSetPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lpSupply","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"accPBRPerShare","type":"uint256"}],"name":"LogUpdatePool","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"uint256","name":"pid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"BONUS_MULTIPLIER","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PBRPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"contract IERC20","name":"_lpToken","type":"address"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"add","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_PBRPerBlock","type":"uint256"}],"name":"changePBRBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_from","type":"uint256"},{"internalType":"uint256","name":"_to","type":"uint256"}],"name":"getMultiplier","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"massUpdatePools","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"address","name":"_user","type":"address"}],"name":"pendingPBR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"polkaBridge","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolInfo","outputs":[{"internalType":"contract IERC20","name":"lpToken","type":"address"},{"internalType":"uint256","name":"lpAmount","type":"uint256"},{"internalType":"uint256","name":"allocPoint","type":"uint256"},{"internalType":"uint256","name":"lastRewardBlock","type":"uint256"},{"internalType":"uint256","name":"accPBRPerShare","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_allocPoint","type":"uint256"},{"internalType":"bool","name":"_withUpdate","type":"bool"}],"name":"set","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAllocPoint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"}],"name":"updatePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_pid","type":"uint256"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

6080604052600060065534801561001557600080fd5b506040516200186938038062001869833981016040819052610036916100ca565b610046610041610076565b61007a565b60018055600280546001600160a01b0319166001600160a01b03949094169390931790925560035560075561010b565b3390565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000806000606084860312156100de578283fd5b83516001600160a01b03811681146100f4578384fd5b602085015160409095015190969495509392505050565b61174e806200011b6000396000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c80636f55b350116100b857806393f1a40b1161007c57806393f1a40b14610255578063af28816a14610276578063b2e8dead1461027e578063ddc6326214610291578063e2bbb158146102a4578063f2fde38b146102b757610142565b80636f55b35014610215578063715018a61461022a5780638aa28550146102325780638da5cb5b1461023a5780638dbb1e3a1461024257610142565b806348cd4cb11161010a57806348cd4cb1146101b957806351eb05a6146101c15780635312ea8e146101d4578063630b5ba1146101e757806364482f79146101ef5780636e0b675d1461020257610142565b8063081e3eda146101475780631526fe271461016557806317caf6f1146101895780631eaaa04514610191578063441a3e70146101a6575b600080fd5b61014f6102ca565b60405161015c91906115ed565b60405180910390f35b61017861017336600461128c565b6102d0565b60405161015c9594939291906113e7565b61014f61031b565b6101a461019f3660046112eb565b610321565b005b6101a46101b436600461132c565b610508565b61014f6106ac565b6101a46101cf36600461128c565b6106b2565b6101a46101e236600461128c565b610849565b6101a461090c565b6101a46101fd36600461134d565b610937565b6101a461021036600461128c565b610a59565b61021d610a9d565b60405161015c9190611396565b6101a4610aac565b61014f610af7565b61021d610afc565b61014f61025036600461132c565b610b0b565b6102686102633660046112bc565b610b29565b60405161015c929190611606565b61014f610b4d565b61014f61028c3660046112bc565b610b53565b6101a461029f36600461128c565b610ce8565b6101a46102b236600461132c565b610df2565b6101a46102c5366004611254565b610f76565b60045490565b600481815481106102e057600080fd5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0390931694509092909185565b60065481565b610329610fe4565b6001600160a01b031661033a610afc565b6001600160a01b0316146103695760405162461bcd60e51b8152600401610360906114d4565b60405180910390fd5b80156103775761037761090c565b6000600754431161038a5760075461038c565b435b90508360065461039c919061162a565b6006556040805160a0810182526001600160a01b03858116808352600060208401818152948401898152606085018781526080860183815260048054600180820183559582905297517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b600590990298890180546001600160a01b031916919098161790965596517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c87015590517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d860155517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19e85015593517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19f909301929092555490916104c991611681565b7fad5b09333e221a3ab1ec48f5594f2ba9fd1c56d813d8928281574015e18c0a5b86856040516104fa9291906115f6565b60405180910390a350505050565b6002600154141561052b5760405162461bcd60e51b8152600401610360906115b6565b600260018190555060006004838154811061055657634e487b7160e01b600052603260045260246000fd5b60009182526020808320868452600580835260408086203387529093529190932080549290910290920192508311156105a15760405162461bcd60e51b815260040161036090611540565b6105aa846106b2565b60008160010154670de0b6b3a7640000846004015484600001546105ce9190611662565b6105d89190611642565b6105e29190611681565b6002549091506105fc906001600160a01b03163383610fe8565b8154610609908590611681565b8255600183015461061b908590611681565b600184015560048301548254670de0b6b3a76400009161063a91611662565b6106449190611642565b6001830155825461065f906001600160a01b03163386610fe8565b84336001600160a01b03167ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5688660405161069991906115ed565b60405180910390a3505060018055505050565b60075481565b6000600482815481106106d557634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502019050806003015443116106f65750610846565b80546040516370a0823160e01b81526000916001600160a01b0316906370a0823190610726903090600401611396565b60206040518083038186803b15801561073e57600080fd5b505afa158015610752573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077691906112a4565b90508061078a575043600390910155610846565b600061079a836003015443610b0b565b905060006006548460020154600354846107b49190611662565b6107be9190611662565b6107c89190611642565b9050826107dd82670de0b6b3a7640000611662565b6107e79190611642565b84600401546107f6919061162a565b60048501819055436003860181905560405187927fcb7325664a4a3b7c7223eefc492a97ca4fdf94d46884621e5a8fae5a04b2b9d2926108399290918891611614565b60405180910390a2505050505b50565b60006004828154811061086c57634e487b7160e01b600052603260045260246000fd5b600091825260208083208584526005808352604080862033808852945290942080549490930201805490945091926108ae926001600160a01b03169190610fe8565b8054604051849133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae0595916108e2916115ed565b60405180910390a3805460018301546108fb9190611681565b600192830155600080825591015550565b60045460005b8181101561093357610923816106b2565b61092c816116c4565b9050610912565b5050565b61093f610fe4565b6001600160a01b0316610950610afc565b6001600160a01b0316146109765760405162461bcd60e51b8152600401610360906114d4565b80156109895761098461090c565b610992565b610992836106b2565b81600484815481106109b457634e487b7160e01b600052603260045260246000fd5b9060005260206000209060050201600201546006546109d39190611681565b6109dd919061162a565b6006819055508160048481548110610a0557634e487b7160e01b600052603260045260246000fd5b906000526020600020906005020160020181905550827f31b4adb47fe10f535ba0f237d0ef37a1281f4974f03b5f1bb1ca4172aceb70c48383604051610a4c9291906115f6565b60405180910390a2505050565b610a61610fe4565b6001600160a01b0316610a72610afc565b6001600160a01b031614610a985760405162461bcd60e51b8152600401610360906114d4565b600355565b6002546001600160a01b031681565b610ab4610fe4565b6001600160a01b0316610ac5610afc565b6001600160a01b031614610aeb5760405162461bcd60e51b8152600401610360906114d4565b610af56000611043565b565b600181565b6000546001600160a01b031690565b6000610b18600184611662565b610b229083611681565b9392505050565b60056020908152600092835260408084209091529082529020805460019091015482565b60035481565b60008060048481548110610b7757634e487b7160e01b600052603260045260246000fd5b60009182526020808320878452600580835260408086206001600160a01b03808b168852945280862060049290950290920181810154815493516370a0823160e01b815291975094959392909216916370a0823191610bd891309101611396565b60206040518083038186803b158015610bf057600080fd5b505afa158015610c04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2891906112a4565b9050836003015443118015610c3c57508015155b15610cad576000610c51856003015443610b0b565b90506000600654866002015460035484610c6b9190611662565b610c759190611662565b610c7f9190611642565b905082610c9482670de0b6b3a7640000611662565b610c9e9190611642565b610ca8908561162a565b935050505b60018301548354670de0b6b3a764000090610cc9908590611662565b610cd39190611642565b610cdd9190611681565b979650505050505050565b60026001541415610d0b5760405162461bcd60e51b8152600401610360906115b6565b6002600181905550600060048281548110610d3657634e487b7160e01b600052603260045260246000fd5b60009182526020808320858452600580835260408086203387529093529190932091029091019150610d67836106b2565b805415610dc25760008160010154670de0b6b3a764000084600401548460000154610d929190611662565b610d9c9190611642565b610da69190611681565b600254909150610dc0906001600160a01b03163383610fe8565b505b60048201548154670de0b6b3a764000091610ddc91611662565b610de69190611642565b60019182015580555050565b60026001541415610e155760405162461bcd60e51b8152600401610360906115b6565b6002600181905550600060048381548110610e4057634e487b7160e01b600052603260045260246000fd5b60009182526020808320868452600580835260408086203387529093529190932091029091019150610e71846106b2565b805415610ecc5760008160010154670de0b6b3a764000084600401548460000154610e9c9190611662565b610ea69190611642565b610eb09190611681565b600254909150610eca906001600160a01b03163383610fe8565b505b8154610ee3906001600160a01b0316333086611093565b8054610ef090849061162a565b81556001820154610f0290849061162a565b600183015560048201548154670de0b6b3a764000091610f2191611662565b610f2b9190611642565b6001820155604051849033907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a1590610f649087906115ed565b60405180910390a35050600180555050565b610f7e610fe4565b6001600160a01b0316610f8f610afc565b6001600160a01b031614610fb55760405162461bcd60e51b8152600401610360906114d4565b6001600160a01b038116610fdb5760405162461bcd60e51b815260040161036090611448565b61084681611043565b3390565b61103e8363a9059cbb60e01b84846040516024016110079291906113ce565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526110ba565b505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6110b4846323b872dd60e01b858585604051602401611007939291906113aa565b50505050565b600061110f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166111499092919063ffffffff16565b80519091501561103e578080602001905181019061112d9190611270565b61103e5760405162461bcd60e51b81526004016103609061156c565b60606111588484600085611160565b949350505050565b6060824710156111825760405162461bcd60e51b81526004016103609061148e565b61118b85611215565b6111a75760405162461bcd60e51b815260040161036090611509565b600080866001600160a01b031685876040516111c3919061137a565b60006040518083038185875af1925050503d8060008114611200576040519150601f19603f3d011682016040523d82523d6000602084013e611205565b606091505b5091509150610cdd82828661121b565b3b151590565b6060831561122a575081610b22565b82511561123a5782518084602001fd5b8160405162461bcd60e51b81526004016103609190611415565b600060208284031215611265578081fd5b8135610b22816116f5565b600060208284031215611281578081fd5b8151610b228161170a565b60006020828403121561129d578081fd5b5035919050565b6000602082840312156112b5578081fd5b5051919050565b600080604083850312156112ce578081fd5b8235915060208301356112e0816116f5565b809150509250929050565b6000806000606084860312156112ff578081fd5b833592506020840135611311816116f5565b915060408401356113218161170a565b809150509250925092565b6000806040838503121561133e578182fd5b50508035926020909101359150565b600080600060608486031215611361578283fd5b833592506020840135915060408401356113218161170a565b6000825161138c818460208701611698565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b03959095168552602085019390935260408401919091526060830152608082015260a00190565b6000602082528251806020840152611434816040850160208701611698565b601f01601f19169190910160400192915050565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252601290820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b90815260200190565b9182521515602082015260400190565b918252602082015260400190565b9283526020830191909152604082015260600190565b6000821982111561163d5761163d6116df565b500190565b60008261165d57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561167c5761167c6116df565b500290565b600082821015611693576116936116df565b500390565b60005b838110156116b357818101518382015260200161169b565b838111156110b45750506000910152565b60006000198214156116d8576116d86116df565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461084657600080fd5b801515811461084657600080fdfea26469706673582212200165973d9e4938f6f31bc59da7f9303bfb5fd6136a44a34b09335ca327340dc864736f6c63430008000033000000000000000000000000298d492e8c1d909d3f63bc4a36c66c64acb3d69500000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101425760003560e01c80636f55b350116100b857806393f1a40b1161007c57806393f1a40b14610255578063af28816a14610276578063b2e8dead1461027e578063ddc6326214610291578063e2bbb158146102a4578063f2fde38b146102b757610142565b80636f55b35014610215578063715018a61461022a5780638aa28550146102325780638da5cb5b1461023a5780638dbb1e3a1461024257610142565b806348cd4cb11161010a57806348cd4cb1146101b957806351eb05a6146101c15780635312ea8e146101d4578063630b5ba1146101e757806364482f79146101ef5780636e0b675d1461020257610142565b8063081e3eda146101475780631526fe271461016557806317caf6f1146101895780631eaaa04514610191578063441a3e70146101a6575b600080fd5b61014f6102ca565b60405161015c91906115ed565b60405180910390f35b61017861017336600461128c565b6102d0565b60405161015c9594939291906113e7565b61014f61031b565b6101a461019f3660046112eb565b610321565b005b6101a46101b436600461132c565b610508565b61014f6106ac565b6101a46101cf36600461128c565b6106b2565b6101a46101e236600461128c565b610849565b6101a461090c565b6101a46101fd36600461134d565b610937565b6101a461021036600461128c565b610a59565b61021d610a9d565b60405161015c9190611396565b6101a4610aac565b61014f610af7565b61021d610afc565b61014f61025036600461132c565b610b0b565b6102686102633660046112bc565b610b29565b60405161015c929190611606565b61014f610b4d565b61014f61028c3660046112bc565b610b53565b6101a461029f36600461128c565b610ce8565b6101a46102b236600461132c565b610df2565b6101a46102c5366004611254565b610f76565b60045490565b600481815481106102e057600080fd5b6000918252602090912060059091020180546001820154600283015460038401546004909401546001600160a01b0390931694509092909185565b60065481565b610329610fe4565b6001600160a01b031661033a610afc565b6001600160a01b0316146103695760405162461bcd60e51b8152600401610360906114d4565b60405180910390fd5b80156103775761037761090c565b6000600754431161038a5760075461038c565b435b90508360065461039c919061162a565b6006556040805160a0810182526001600160a01b03858116808352600060208401818152948401898152606085018781526080860183815260048054600180820183559582905297517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b600590990298890180546001600160a01b031916919098161790965596517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c87015590517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d860155517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19e85015593517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19f909301929092555490916104c991611681565b7fad5b09333e221a3ab1ec48f5594f2ba9fd1c56d813d8928281574015e18c0a5b86856040516104fa9291906115f6565b60405180910390a350505050565b6002600154141561052b5760405162461bcd60e51b8152600401610360906115b6565b600260018190555060006004838154811061055657634e487b7160e01b600052603260045260246000fd5b60009182526020808320868452600580835260408086203387529093529190932080549290910290920192508311156105a15760405162461bcd60e51b815260040161036090611540565b6105aa846106b2565b60008160010154670de0b6b3a7640000846004015484600001546105ce9190611662565b6105d89190611642565b6105e29190611681565b6002549091506105fc906001600160a01b03163383610fe8565b8154610609908590611681565b8255600183015461061b908590611681565b600184015560048301548254670de0b6b3a76400009161063a91611662565b6106449190611642565b6001830155825461065f906001600160a01b03163386610fe8565b84336001600160a01b03167ff279e6a1f5e320cca91135676d9cb6e44ca8a08c0b88342bcdb1144f6511b5688660405161069991906115ed565b60405180910390a3505060018055505050565b60075481565b6000600482815481106106d557634e487b7160e01b600052603260045260246000fd5b90600052602060002090600502019050806003015443116106f65750610846565b80546040516370a0823160e01b81526000916001600160a01b0316906370a0823190610726903090600401611396565b60206040518083038186803b15801561073e57600080fd5b505afa158015610752573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077691906112a4565b90508061078a575043600390910155610846565b600061079a836003015443610b0b565b905060006006548460020154600354846107b49190611662565b6107be9190611662565b6107c89190611642565b9050826107dd82670de0b6b3a7640000611662565b6107e79190611642565b84600401546107f6919061162a565b60048501819055436003860181905560405187927fcb7325664a4a3b7c7223eefc492a97ca4fdf94d46884621e5a8fae5a04b2b9d2926108399290918891611614565b60405180910390a2505050505b50565b60006004828154811061086c57634e487b7160e01b600052603260045260246000fd5b600091825260208083208584526005808352604080862033808852945290942080549490930201805490945091926108ae926001600160a01b03169190610fe8565b8054604051849133917fbb757047c2b5f3974fe26b7c10f732e7bce710b0952a71082702781e62ae0595916108e2916115ed565b60405180910390a3805460018301546108fb9190611681565b600192830155600080825591015550565b60045460005b8181101561093357610923816106b2565b61092c816116c4565b9050610912565b5050565b61093f610fe4565b6001600160a01b0316610950610afc565b6001600160a01b0316146109765760405162461bcd60e51b8152600401610360906114d4565b80156109895761098461090c565b610992565b610992836106b2565b81600484815481106109b457634e487b7160e01b600052603260045260246000fd5b9060005260206000209060050201600201546006546109d39190611681565b6109dd919061162a565b6006819055508160048481548110610a0557634e487b7160e01b600052603260045260246000fd5b906000526020600020906005020160020181905550827f31b4adb47fe10f535ba0f237d0ef37a1281f4974f03b5f1bb1ca4172aceb70c48383604051610a4c9291906115f6565b60405180910390a2505050565b610a61610fe4565b6001600160a01b0316610a72610afc565b6001600160a01b031614610a985760405162461bcd60e51b8152600401610360906114d4565b600355565b6002546001600160a01b031681565b610ab4610fe4565b6001600160a01b0316610ac5610afc565b6001600160a01b031614610aeb5760405162461bcd60e51b8152600401610360906114d4565b610af56000611043565b565b600181565b6000546001600160a01b031690565b6000610b18600184611662565b610b229083611681565b9392505050565b60056020908152600092835260408084209091529082529020805460019091015482565b60035481565b60008060048481548110610b7757634e487b7160e01b600052603260045260246000fd5b60009182526020808320878452600580835260408086206001600160a01b03808b168852945280862060049290950290920181810154815493516370a0823160e01b815291975094959392909216916370a0823191610bd891309101611396565b60206040518083038186803b158015610bf057600080fd5b505afa158015610c04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c2891906112a4565b9050836003015443118015610c3c57508015155b15610cad576000610c51856003015443610b0b565b90506000600654866002015460035484610c6b9190611662565b610c759190611662565b610c7f9190611642565b905082610c9482670de0b6b3a7640000611662565b610c9e9190611642565b610ca8908561162a565b935050505b60018301548354670de0b6b3a764000090610cc9908590611662565b610cd39190611642565b610cdd9190611681565b979650505050505050565b60026001541415610d0b5760405162461bcd60e51b8152600401610360906115b6565b6002600181905550600060048281548110610d3657634e487b7160e01b600052603260045260246000fd5b60009182526020808320858452600580835260408086203387529093529190932091029091019150610d67836106b2565b805415610dc25760008160010154670de0b6b3a764000084600401548460000154610d929190611662565b610d9c9190611642565b610da69190611681565b600254909150610dc0906001600160a01b03163383610fe8565b505b60048201548154670de0b6b3a764000091610ddc91611662565b610de69190611642565b60019182015580555050565b60026001541415610e155760405162461bcd60e51b8152600401610360906115b6565b6002600181905550600060048381548110610e4057634e487b7160e01b600052603260045260246000fd5b60009182526020808320868452600580835260408086203387529093529190932091029091019150610e71846106b2565b805415610ecc5760008160010154670de0b6b3a764000084600401548460000154610e9c9190611662565b610ea69190611642565b610eb09190611681565b600254909150610eca906001600160a01b03163383610fe8565b505b8154610ee3906001600160a01b0316333086611093565b8054610ef090849061162a565b81556001820154610f0290849061162a565b600183015560048201548154670de0b6b3a764000091610f2191611662565b610f2b9190611642565b6001820155604051849033907f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a1590610f649087906115ed565b60405180910390a35050600180555050565b610f7e610fe4565b6001600160a01b0316610f8f610afc565b6001600160a01b031614610fb55760405162461bcd60e51b8152600401610360906114d4565b6001600160a01b038116610fdb5760405162461bcd60e51b815260040161036090611448565b61084681611043565b3390565b61103e8363a9059cbb60e01b84846040516024016110079291906113ce565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526110ba565b505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6110b4846323b872dd60e01b858585604051602401611007939291906113aa565b50505050565b600061110f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166111499092919063ffffffff16565b80519091501561103e578080602001905181019061112d9190611270565b61103e5760405162461bcd60e51b81526004016103609061156c565b60606111588484600085611160565b949350505050565b6060824710156111825760405162461bcd60e51b81526004016103609061148e565b61118b85611215565b6111a75760405162461bcd60e51b815260040161036090611509565b600080866001600160a01b031685876040516111c3919061137a565b60006040518083038185875af1925050503d8060008114611200576040519150601f19603f3d011682016040523d82523d6000602084013e611205565b606091505b5091509150610cdd82828661121b565b3b151590565b6060831561122a575081610b22565b82511561123a5782518084602001fd5b8160405162461bcd60e51b81526004016103609190611415565b600060208284031215611265578081fd5b8135610b22816116f5565b600060208284031215611281578081fd5b8151610b228161170a565b60006020828403121561129d578081fd5b5035919050565b6000602082840312156112b5578081fd5b5051919050565b600080604083850312156112ce578081fd5b8235915060208301356112e0816116f5565b809150509250929050565b6000806000606084860312156112ff578081fd5b833592506020840135611311816116f5565b915060408401356113218161170a565b809150509250925092565b6000806040838503121561133e578182fd5b50508035926020909101359150565b600080600060608486031215611361578283fd5b833592506020840135915060408401356113218161170a565b6000825161138c818460208701611698565b9190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b03959095168552602085019390935260408401919091526060830152608082015260a00190565b6000602082528251806020840152611434816040850160208701611698565b601f01601f19169190910160400192915050565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b6020808252601290820152711dda5d1a191c985dce881b9bdd0819dbdbd960721b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b90815260200190565b9182521515602082015260400190565b918252602082015260400190565b9283526020830191909152604082015260600190565b6000821982111561163d5761163d6116df565b500190565b60008261165d57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561167c5761167c6116df565b500290565b600082821015611693576116936116df565b500390565b60005b838110156116b357818101518382015260200161169b565b838111156110b45750506000910152565b60006000198214156116d8576116d86116df565b5060010190565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461084657600080fd5b801515811461084657600080fdfea26469706673582212200165973d9e4938f6f31bc59da7f9303bfb5fd6136a44a34b09335ca327340dc864736f6c63430008000033

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

000000000000000000000000298d492e8c1d909d3f63bc4a36c66c64acb3d69500000000000000000000000000000000000000000000000006f05b59d3b200000000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _polkaBridge (address): 0x298d492e8c1d909D3F63Bc4A36C66c64ACB3d695
Arg [1] : _PBRPerBlock (uint256): 500000000000000000
Arg [2] : _startBlock (uint256): 0

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000298d492e8c1d909d3f63bc4a36c66c64acb3d695
Arg [1] : 00000000000000000000000000000000000000000000000006f05b59d3b20000
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000


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.