ETH Price: $2,326.42 (+1.32%)
Gas: 1.84 Gwei

Contract

0x92c95b6227a9f0B4602649BD83F83aDC48dae903
 
Transaction Hash
Method
Block
From
To
Churn207000022024-09-07 16:44:5939 hrs ago1725727499IN
0x92c95b62...C48dae903
0 ETH0.000085352.77319274
Churn205500342024-08-17 18:08:5922 days ago1723918139IN
0x92c95b62...C48dae903
0 ETH0.000079592.58621322
Churn205200282024-08-13 13:33:3526 days ago1723556015IN
0x92c95b62...C48dae903
0 ETH0.00010193.31119762
Churn204900682024-08-09 9:12:3530 days ago1723194755IN
0x92c95b62...C48dae903
0 ETH0.000147094.77922654
Churn204600082024-08-05 4:34:4735 days ago1722832487IN
0x92c95b62...C48dae903
0 ETH0.0009784424.30375863
Churn204000022024-07-27 19:34:1143 days ago1722108851IN
0x92c95b62...C48dae903
0 ETH0.000185834.61593169
Churn203700022024-07-23 15:02:5947 days ago1721746979IN
0x92c95b62...C48dae903
0 ETH0.000350188.57130742
Churn203400022024-07-19 10:32:4751 days ago1721385167IN
0x92c95b62...C48dae903
0 ETH0.000179025.81694464
Churn203100022024-07-15 6:04:2356 days ago1721023463IN
0x92c95b62...C48dae903
0 ETH0.000093113.02548793
Churn202500022024-07-06 20:57:3564 days ago1720299455IN
0x92c95b62...C48dae903
0 ETH0.0000732.37217721
Churn202200022024-07-02 16:24:3568 days ago1719937475IN
0x92c95b62...C48dae903
0 ETH0.000298539.69994347
Churn201600312024-06-24 7:23:4777 days ago1719213827IN
0x92c95b62...C48dae903
0 ETH0.000109423.55538349
Churn201300022024-06-20 2:35:5981 days ago1718850959IN
0x92c95b62...C48dae903
0 ETH0.00031617.85183249
Churn200700022024-06-11 17:13:1189 days ago1718125991IN
0x92c95b62...C48dae903
0 ETH0.0009556323.39040138
Churn200400062024-06-07 12:38:5993 days ago1717763939IN
0x92c95b62...C48dae903
0 ETH0.0005885519.12307975
Record Outcoming...200114972024-06-03 13:08:4797 days ago1717420127IN
0x92c95b62...C48dae903
0 ETH0.0022067414.95852052
Churn200100092024-06-03 8:09:1198 days ago1717402151IN
0x92c95b62...C48dae903
0 ETH0.000357828.88796358
Single Transfer ...200056502024-06-02 17:32:5998 days ago1717349579IN
0x92c95b62...C48dae903
0 ETH0.001429717.71523885
Record Outcoming...199976852024-06-01 14:52:1199 days ago1717253531IN
0x92c95b62...C48dae903
0 ETH0.000956138.69645985
Churn199800102024-05-30 3:34:35102 days ago1717040075IN
0x92c95b62...C48dae903
0 ETH0.00040089.81016534
Churn199500112024-05-25 22:55:47106 days ago1716677747IN
0x92c95b62...C48dae903
0 ETH0.000193046.27233775
Churn199200112024-05-21 18:16:47110 days ago1716315407IN
0x92c95b62...C48dae903
0 ETH0.0006363220.67539246
Churn198900092024-05-17 13:32:23114 days ago1715952743IN
0x92c95b62...C48dae903
0 ETH0.000309827.69589139
Update Params198804712024-05-16 5:32:23116 days ago1715837543IN
0x92c95b62...C48dae903
0 ETH0.000219475.26276669
Churn198600102024-05-13 8:50:11118 days ago1715590211IN
0x92c95b62...C48dae903
0 ETH0.000599876.48467957
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:
SwapContract

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 1000 runs

Other Settings:
default evmVersion
File 1 of 10 : SwapContract.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;
import "./interfaces/ISwapContract.sol";
import "./interfaces/ISwapRewards.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/lib/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";

//import "hardhat/console.sol"; //console.log()

contract SwapContract is ISwapContract, Ownable {
    using SafeMath for uint256;
    using SafeERC20 for IERC20;

    IBurnableToken public immutable lpToken;
    ISwapRewards public immutable sw;

    /** Skybridge */
    mapping(address => bool) public whitelist;
    address public immutable BTCT_ADDR;
    uint256 private immutable convertScale;
    uint256 private immutable lpDivisor;
    address public buybackAddress;
    address public sbBTCPool;
    uint256 public withdrawalFeeBPS;
    uint256 public nodeRewardsRatio;
    uint256 public buybackRewardsRatio;

    mapping(address => uint256) private floatAmountOf;
    mapping(bytes32 => bool) private used; //used TX

    /** TSS */
    // Node lists state { 0 => not exist, 1 => exist, 2 => removed }
    mapping(address => uint8) private nodes;
    address[] private nodeAddrs;
    uint8 public activeNodeCount;
    uint8 public churnedInCount;
    uint8 public tssThreshold;

    /**
     * Events
     */
    event Swap(address from, address to, uint256 amount);

    event RewardsCollection(
        address feesToken,
        uint256 rewards,
        uint256 rewardsLPTTotal,
        uint256 currentPriceLP
    );

    event IssueLPTokensForFloat(
        address to,
        uint256 amountOfFloat,
        uint256 amountOfLP,
        uint256 currentPriceLP,
        uint256 depositFees,
        bytes32 txid
    );

    event BurnLPTokensForFloat(
        address token,
        uint256 amountOfLP,
        uint256 amountOfFloat,
        uint256 currentPriceLP,
        uint256 withdrawal,
        bytes32 txid
    );

    modifier priceCheck() {
        uint256 beforePrice = getCurrentPriceLP();
        _;
        require(getCurrentPriceLP() >= beforePrice, "Invalid LPT price");
    }

    constructor(
        address _lpToken,
        address _btct,
        address _sbBTCPool,
        address _swapRewards,
        address _buybackAddress,
        uint256 _initBTCFloat,
        uint256 _initWBTCFloat
    ) {
        //set address for sbBTCpool
        sbBTCPool = _sbBTCPool;
        //set ISwapRewards
        sw = ISwapRewards(_swapRewards);
        // Set lpToken address
        lpToken = IBurnableToken(_lpToken);
        // Set initial lpDivisor of LP token
        lpDivisor = 10 ** IERC20(_lpToken).decimals();
        // Set BTCT address
        BTCT_ADDR = _btct;
        // Set convertScale
        convertScale = 10 ** (IERC20(_btct).decimals() - 8);
        // Set whitelist addresses
        whitelist[_btct] = true;
        whitelist[_lpToken] = true;
        whitelist[address(0)] = true;
        floatAmountOf[address(0)] = _initBTCFloat;
        floatAmountOf[BTCT_ADDR] = _initWBTCFloat;
        buybackAddress = _buybackAddress;
        withdrawalFeeBPS = 20;
        nodeRewardsRatio = 66;
        buybackRewardsRatio = 25;
    }

    /**
     * Transfer part
     */
    /// @dev singleTransferERC20 sends tokens from contract.
    /// @param _destToken The address of target token.
    /// @param _to The address of recipient.
    /// @param _amount The amount of tokens.
    /// @param _totalSwapped The amount of swap.
    /// @param _rewardsAmount The fees that should be paid.
    /// @param _redeemedFloatTxIds The txids which is for recording.
    function singleTransferERC20(
        address _destToken,
        address _to,
        uint256 _amount,
        uint256 _totalSwapped,
        uint256 _rewardsAmount,
        bytes32[] memory _redeemedFloatTxIds
    ) external override onlyOwner returns (bool) {
        require(whitelist[_destToken], "14"); //_destToken is not whitelisted
        require(
            _destToken != address(0),
            "15" //_destToken should not be address(0)
        );
        address _feesToken = address(0);
        if (_totalSwapped > 0) {
            sw.pullRewards(_destToken, _to, _totalSwapped);
            _swap(address(0), BTCT_ADDR, _totalSwapped);
        } else {
            _feesToken = (_destToken == address(lpToken))
                ? address(lpToken)
                : BTCT_ADDR;
        }
        _rewardsCollection(_feesToken, _rewardsAmount);
        _addUsedTxs(_redeemedFloatTxIds);
        _safeTransfer(_destToken, _to, _amount);
        return true;
    }

    /// @dev multiTransferERC20TightlyPacked sends tokens from contract.
    /// @param _destToken The address of target token.
    /// @param _addressesAndAmounts The address of recipient and amount.
    /// @param _totalSwapped The amount of swap.
    /// @param _rewardsAmount The fees that should be paid.
    /// @param _redeemedFloatTxIds The txids which is for recording.
    function multiTransferERC20TightlyPacked(
        address _destToken,
        bytes32[] memory _addressesAndAmounts,
        uint256 _totalSwapped,
        uint256 _rewardsAmount,
        bytes32[] memory _redeemedFloatTxIds
    ) external override onlyOwner returns (bool) {
        require(whitelist[_destToken], "_destToken is not whitelisted");
        require(
            _destToken != address(0),
            "_destToken should not be address(0)"
        );
        address _feesToken = address(0);
        if (_totalSwapped > 0) {
            _swap(address(0), BTCT_ADDR, _totalSwapped);
        } else {
            _feesToken = (_destToken == address(lpToken))
                ? address(lpToken)
                : BTCT_ADDR;
        }
        _rewardsCollection(_feesToken, _rewardsAmount);
        _addUsedTxs(_redeemedFloatTxIds);
        for (uint256 i = 0; i < _addressesAndAmounts.length; i++) {
            _safeTransfer(
                _destToken,
                address(uint160(uint256(_addressesAndAmounts[i]))),
                uint256(uint96(bytes12(_addressesAndAmounts[i])))
            );
        }
        return true;
    }

    /// @dev collectSwapFeesForBTC collects fees in the case of swap BTCT to BTC.
    /// @param _incomingAmount The spent amount. (BTCT)
    /// @param _minerFee The miner fees of BTC transaction.
    /// @param _rewardsAmount The fees that should be paid.
    function collectSwapFeesForBTC(
        uint256 _incomingAmount,
        uint256 _minerFee,
        uint256 _rewardsAmount,
        address[] memory _spenders,
        uint256[] memory _swapAmounts
    ) external override onlyOwner returns (bool) {
        address _feesToken = BTCT_ADDR;
        if (_incomingAmount > 0) {
            uint256 swapAmount = _incomingAmount.sub(_rewardsAmount);
            sw.pullRewardsMulti(address(0), _spenders, _swapAmounts);
            _swap(BTCT_ADDR, address(0), swapAmount);
        } else if (_incomingAmount == 0) {
            _feesToken = address(0);
        }
        _rewardsCollection(_feesToken, _rewardsAmount);
        return true;
    }

    /**
     * Float part
     */
    /// @dev recordIncomingFloat mints LP token.
    /// @param _token The address of target token.
    /// @param _addressesAndAmountOfFloat The address of recipient and amount.
    /// @param _txid The txids which is for recording.
    function recordIncomingFloat(
        address _token,
        bytes32 _addressesAndAmountOfFloat,
        bytes32 _txid
    ) external override onlyOwner priceCheck returns (bool) {
        require(whitelist[_token], "16"); //_token is invalid
        require(
            _issueLPTokensForFloat(_token, _addressesAndAmountOfFloat, _txid)
        );
        return true;
    }

    /// @dev recordOutcomingFloat burns LP token.
    /// @param _token The address of target token.
    /// @param _addressesAndAmountOfLPtoken The address of recipient and amount.
    /// @param _minerFee The miner fees of BTC transaction.
    /// @param _txid The txid which is for recording.
    function recordOutcomingFloat(
        address _token,
        bytes32 _addressesAndAmountOfLPtoken,
        uint256 _minerFee,
        bytes32 _txid
    ) external override onlyOwner priceCheck returns (bool) {
        require(whitelist[_token], "16"); //_token is invalid
        require(
            _burnLPTokensForFloat(
                _token,
                _addressesAndAmountOfLPtoken,
                _minerFee,
                _txid
            )
        );
        return true;
    }

    fallback() external {
        revert(); // reject all ETH
    }

    /**
     * Life cycle part
     */

    /// @dev recordUTXOSweepMinerFee reduces float amount by collected miner fees.
    /// @param _minerFee The miner fees of BTC transaction.
    /// @param _txid The txid which is for recording.
    function recordUTXOSweepMinerFee(
        uint256 _minerFee,
        bytes32 _txid
    ) public override onlyOwner returns (bool) {
        require(!isTxUsed(_txid), "The txid is already used");
        floatAmountOf[address(0)] = floatAmountOf[address(0)].sub(
            _minerFee,
            "12" //"BTC float amount insufficient"
        );
        _addUsedTx(_txid);
        return true;
    }

    /// @dev churn transfers contract ownership and set variables of the next TSS validator set.
    /// @param _newOwner The address of new Owner.
    /// @param _nodes The reward addresses.
    /// @param _isRemoved The flags to remove node.
    /// @param _churnedInCount The number of next party size of TSS group.
    /// @param _tssThreshold The number of next threshold.
    function churn(
        address _newOwner,
        address[] memory _nodes,
        bool[] memory _isRemoved,
        uint8 _churnedInCount,
        uint8 _tssThreshold
    ) external override onlyOwner returns (bool) {
        require(
            _tssThreshold >= tssThreshold && _tssThreshold <= 2 ** 8 - 1,
            "01" //"_tssThreshold should be >= tssThreshold"
        );
        require(
            _churnedInCount >= _tssThreshold + uint8(1),
            "02" //"n should be >= t+1"
        );
        require(
            _nodes.length == _isRemoved.length,
            "05" //"_nodes and _isRemoved length is not match"
        );

        transferOwnership(_newOwner);
        // Update active node list
        for (uint256 i = 0; i < _nodes.length; i++) {
            if (!_isRemoved[i]) {
                if (nodes[_nodes[i]] == uint8(0)) {
                    nodeAddrs.push(_nodes[i]);
                }
                if (nodes[_nodes[i]] != uint8(1)) {
                    activeNodeCount++;
                }
                nodes[_nodes[i]] = uint8(1);
            } else {
                activeNodeCount--;
                nodes[_nodes[i]] = uint8(2);
            }
        }
        require(activeNodeCount <= 100, "Stored node size should be <= 100");
        churnedInCount = _churnedInCount;
        tssThreshold = _tssThreshold;
        return true;
    }

    /// @dev updateParams changes contract params.
    /// @param _sbBTCPool The address of new sbBTCPool.
    /// @param _buybackAddress The address of new buyback.
    /// @param _withdrawalFeeBPS The number of next withdarw fees.
    /// @param _nodeRewardsRatio The number of next node rewards ratio.
    /// @param _buybackRewardsRatio The number of next buyback rewards ratio.
    function updateParams(
        address _sbBTCPool,
        address _buybackAddress,
        uint256 _withdrawalFeeBPS,
        uint256 _nodeRewardsRatio,
        uint256 _buybackRewardsRatio
    ) external override onlyOwner returns (bool) {
        sbBTCPool = _sbBTCPool;
        buybackAddress = _buybackAddress;
        withdrawalFeeBPS = _withdrawalFeeBPS;
        nodeRewardsRatio = _nodeRewardsRatio;
        buybackRewardsRatio = _buybackRewardsRatio;
        return true;
    }

    /// @dev isTxUsed sends rewards for Nodes.
    /// @param _txid The txid which is for recording.
    function isTxUsed(bytes32 _txid) public view override returns (bool) {
        return used[_txid];
    }

    /// @dev getCurrentPriceLP returns the current exchange rate of LP token.
    function getCurrentPriceLP()
        public
        view
        override
        returns (uint256 nowPrice)
    {
        (uint256 reserveA, uint256 reserveB) = getFloatReserve(
            address(0),
            BTCT_ADDR
        );
        uint256 totalLPs = lpToken.totalSupply();
        // decimals of totalReserved == 8, lpDivisor == 8, decimals of rate == 8
        nowPrice = totalLPs == 0
            ? lpDivisor
            : (reserveA.add(reserveB)).mul(lpDivisor).div(totalLPs);
        return nowPrice;
    }

    /// @dev getFloatReserve returns float reserves
    /// @param _tokenA The address of target tokenA.
    /// @param _tokenB The address of target tokenB.
    function getFloatReserve(
        address _tokenA,
        address _tokenB
    ) public view override returns (uint256 reserveA, uint256 reserveB) {
        (reserveA, reserveB) = (floatAmountOf[_tokenA], floatAmountOf[_tokenB]);
    }

    /// @dev getActiveNodes returns active nodes list
    function getActiveNodes() public view override returns (address[] memory) {
        uint256 count = 0;
        address[] memory _nodes = new address[](activeNodeCount);
        for (uint256 i = 0; i < nodeAddrs.length; i++) {
            if (nodes[nodeAddrs[i]] == uint8(1)) {
                _nodes[count] = nodeAddrs[i];
                count++;
            }
        }
        return _nodes;
    }

    /// @dev isNodeSake returns true if the node is churned in
    function isNodeStake(address _user) public view override returns (bool) {
        if (nodes[_user] == uint8(1)) {
            return true;
        }
        return false;
    }

    /// @dev _issueLPTokensForFloat
    /// @param _token The address of target token.
    /// @param _transaction The recevier address and amount.
    /// @param _txid The txid which is for recording.
    function _issueLPTokensForFloat(
        address _token,
        bytes32 _transaction,
        bytes32 _txid
    ) internal returns (bool) {
        require(!isTxUsed(_txid), "06"); //"The txid is already used");
        require(_transaction != 0x0, "07"); //"The transaction is not valid");
        // Define target address which is recorded on the tx data (20 bytes)
        // Define amountOfFloat which is recorded top on tx data (12 bytes)
        (address to, uint256 amountOfFloat) = _splitToValues(_transaction);
        // Calculate the amount of LP token
        uint256 nowPrice = getCurrentPriceLP();
        uint256 amountOfLP = amountOfFloat.mul(lpDivisor).div(nowPrice);
        // Send LP tokens to LP
        lpToken.mint(to, amountOfLP);
        // Add float amount
        _addFloat(_token, amountOfFloat);
        _addUsedTx(_txid);

        emit IssueLPTokensForFloat(
            to,
            amountOfFloat,
            amountOfLP,
            nowPrice,
            0,
            _txid
        );
        return true;
    }

    /// @dev _burnLPTokensForFloat
    /// @param _token The address of target token.
    /// @param _transaction The address of sender and amount.
    /// @param _minerFee The miner fees of BTC transaction.
    /// @param _txid The txid which is for recording.
    function _burnLPTokensForFloat(
        address _token,
        bytes32 _transaction,
        uint256 _minerFee,
        bytes32 _txid
    ) internal returns (bool) {
        require(!isTxUsed(_txid), "06"); //"The txid is already used");
        require(_transaction != 0x0, "07"); //"The transaction is not valid");
        // Define target address which is recorded on the tx data (20bytes)
        // Define amountLP which is recorded top on tx data (12bytes)
        (address to, uint256 amountOfLP) = _splitToValues(_transaction);
        // Calculate the amount of LP token
        uint256 nowPrice = getCurrentPriceLP();
        // Calculate the amountOfFloat
        uint256 amountOfFloat = amountOfLP.mul(nowPrice).div(lpDivisor);
        uint256 withdrawalFees = amountOfFloat.mul(withdrawalFeeBPS).div(10000);
        require(
            amountOfFloat.sub(withdrawalFees) >= _minerFee,
            "09" //"Error: amountOfFloat.sub(withdrawalFees) < _minerFee"
        );
        uint256 withdrawal = amountOfFloat.sub(withdrawalFees).sub(_minerFee);
        (uint256 reserveA, uint256 reserveB) = getFloatReserve(
            address(0),
            BTCT_ADDR
        );
        if (_token == address(0)) {
            require(
                reserveA >= amountOfFloat.sub(withdrawalFees),
                "08" //"The float balance insufficient."
            );
        } else if (_token == BTCT_ADDR) {
            require(
                reserveB >= amountOfFloat.sub(withdrawalFees),
                "12" //"BTC float amount insufficient"
            );
        }
        // Collect fees before remove float
        _rewardsCollection(_token, withdrawalFees);
        // Remove float amount
        _removeFloat(_token, amountOfFloat);
        // Add txid for recording.
        _addUsedTx(_txid);
        // BTCT transfer if token address is BTCT_ADDR
        if (_token == BTCT_ADDR) {
            // _minerFee should be zero
            _safeTransfer(_token, to, withdrawal);
        }
        // Burn LP tokens
        require(lpToken.burn(amountOfLP));
        emit BurnLPTokensForFloat(
            to,
            amountOfLP,
            amountOfFloat,
            nowPrice,
            withdrawal,
            _txid
        );
        return true;
    }

    /// @dev _addFloat updates one side of the float.
    /// @param _token The address of target token.
    /// @param _amount The amount of float.
    function _addFloat(address _token, uint256 _amount) internal {
        floatAmountOf[_token] = floatAmountOf[_token].add(_amount);
    }

    /// @dev _removeFloat remove one side of the float - redone for skypools using tokens mapping
    /// @param _token The address of target token.
    /// @param _amount The amount of float.
    function _removeFloat(address _token, uint256 _amount) internal {
        floatAmountOf[_token] = floatAmountOf[_token].sub(
            _amount,
            "10" //"_removeFloat: float amount insufficient"
        );
    }

    /// @dev _swap collects swap amount to change float.
    /// @param _sourceToken The address of source token
    /// @param _destToken The address of target token.
    /// @param _swapAmount The amount of swap.
    function _swap(
        address _sourceToken,
        address _destToken,
        uint256 _swapAmount
    ) internal {
        floatAmountOf[_destToken] = floatAmountOf[_destToken].sub(
            _swapAmount,
            "11" //"_swap: float amount insufficient"
        );
        floatAmountOf[_sourceToken] = floatAmountOf[_sourceToken].add(
            _swapAmount
        );

        emit Swap(_sourceToken, _destToken, _swapAmount);
    }

    /// @dev _safeTransfer executes tranfer erc20 tokens
    /// @param _token The address of target token
    /// @param _to The address of receiver.
    /// @param _amount The amount of transfer.
    function _safeTransfer(
        address _token,
        address _to,
        uint256 _amount
    ) internal {
        if (_token == BTCT_ADDR) {
            _amount = _amount.mul(convertScale);
        }
        IERC20(_token).safeTransfer(_to, _amount);
    }

    /// @dev _rewardsCollection collects tx rewards.
    /// @param _feesToken The token address for collection fees.
    /// @param _rewardsAmount The amount of rewards.
    function _rewardsCollection(
        address _feesToken,
        uint256 _rewardsAmount
    ) internal {
        if (_rewardsAmount == 0) return;
        // if (_feesToken == lpToken) {
        //     IBurnableToken(lpToken).transfer(sbBTCPool, _rewardsAmount);
        //     emit RewardsCollection(_feesToken, 0, _rewardsAmount, 0);
        //     return;
        // }

        // Get current LP token price.
        uint256 nowPrice = getCurrentPriceLP();
        // Add all fees into pool
        floatAmountOf[_feesToken] = floatAmountOf[_feesToken].add(
            _rewardsAmount
        );
        uint256 feesTotal = _rewardsAmount.mul(nodeRewardsRatio).div(100);
        // Alloc LP tokens for nodes as fees
        uint256 feesLPTTotal = feesTotal.mul(lpDivisor).div(nowPrice);
        // Alloc Buyback tokens for nodes as fees
        uint256 feesBuyback = feesLPTTotal.mul(buybackRewardsRatio).div(100);
        // Mints LP tokens for Nodes
        lpToken.mint(sbBTCPool, feesLPTTotal.sub(feesBuyback));
        lpToken.mint(buybackAddress, feesBuyback);

        emit RewardsCollection(
            _feesToken,
            _rewardsAmount,
            feesLPTTotal,
            nowPrice
        );
    }

    /// @dev _addUsedTx updates txid list which is spent. (single hash)
    /// @param _txid The array of txid.
    function _addUsedTx(bytes32 _txid) internal {
        used[_txid] = true;
    }

    /// @dev _addUsedTxs updates txid list which is spent. (multiple hashes)
    /// @param _txids The array of txid.
    function _addUsedTxs(bytes32[] memory _txids) internal {
        for (uint256 i = 0; i < _txids.length; i++) {
            used[_txids[i]] = true;
        }
    }

    /// @dev _splitToValues returns address and amount of staked SWINGBYs
    /// @param _data The info of a staker.
    function _splitToValues(
        bytes32 _data
    ) internal pure returns (address, uint256) {
        return (
            address(uint160(uint256(_data))),
            uint256(uint96(bytes12(_data)))
        );
    }
}

File 2 of 10 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

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

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

pragma solidity ^0.8.0;

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

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

File 4 of 10 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

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

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

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

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

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

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

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

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

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

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

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * 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) {
        unchecked {
            require(b > 0, errorMessage);
            return a / b;
        }
    }

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

File 5 of 10 : IBurnableToken.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import "./IERC20.sol";

interface IBurnableToken is IERC20 {
    function mint(address target, uint256 amount) external returns (bool);

    function burn(uint256 amount) external returns (bool);

    function mintable() external returns (bool);
}

File 6 of 10 : IERC20.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the token decimals.
     */
    function decimals() external view returns (uint8);

    /**
     * @dev Returns the token symbol.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the token name.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the bep token owner. (This is a BEP-20 token specific.)
     */
    function getOwner() external view returns (address);

    /**
     * @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 10 : ISwapContract.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;
pragma experimental ABIEncoderV2;

import "./IBurnableToken.sol";

interface ISwapContract {
    function BTCT_ADDR() external returns (address);

    function lpToken() external returns (IBurnableToken);

    function singleTransferERC20(
        address _destToken,
        address _to,
        uint256 _amount,
        uint256 _totalSwapped,
        uint256 _rewardsAmount,
        bytes32[] memory _redeemedFloatTxIds
    ) external returns (bool);

    function multiTransferERC20TightlyPacked(
        address _destToken,
        bytes32[] memory _addressesAndAmounts,
        uint256 _totalSwapped,
        uint256 _rewardsAmount,
        bytes32[] memory _redeemedFloatTxIds
    ) external returns (bool);

    function collectSwapFeesForBTC(
        uint256 _incomingAmount,
        uint256 _minerFee,
        uint256 _rewardsAmount,
        address[] memory _spenders,
        uint256[] memory _swapAmounts
    ) external returns (bool);

    function recordIncomingFloat(
        address _token,
        bytes32 _addressesAndAmountOfFloat,
        bytes32 _txid
    ) external returns (bool);

    function recordOutcomingFloat(
        address _token,
        bytes32 _addressesAndAmountOfLPtoken,
        uint256 _minerFee,
        bytes32 _txid
    ) external returns (bool);

    function recordUTXOSweepMinerFee(
        uint256 _minerFee,
        bytes32 _txid
    ) external returns (bool);

    function churn(
        address _newOwner,
        address[] memory _nodes,
        bool[] memory _isRemoved,
        uint8 _churnedInCount,
        uint8 _tssThreshold
    ) external returns (bool);

    function updateParams(
        address _sbBTCPool,
        address _buybackAddress,
        uint256 _withdrawalFeeBPS,
        uint256 _nodeRewardsRatio,
        uint256 _buybackRewardsRatio
    ) external returns (bool);

    function isTxUsed(bytes32 _txid) external view returns (bool);

    function getCurrentPriceLP() external view returns (uint256);

    function getFloatReserve(
        address _tokenA,
        address _tokenB
    ) external returns (uint256 reserveA, uint256 reserveB);

    function getActiveNodes() external view returns (address[] memory);

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

File 8 of 10 : ISwapRewards.sol
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

interface ISwapRewards {

    function setSWINGBYPrice(uint256 _pricePerBTC) external;

    function pullRewards(address _dest, address _receiver, uint256 _swapped) external returns (bool);

    function pullRewardsMulti(address _dest, address[] memory _receiver, uint256[] memory _swapped) external returns (bool);
}

File 9 of 10 : Address.sol
// SPDX-License-Identifier: AGPL-3.0

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 10 of 10 : SafeERC20.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "./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));
    }

    

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_lpToken","type":"address"},{"internalType":"address","name":"_btct","type":"address"},{"internalType":"address","name":"_sbBTCPool","type":"address"},{"internalType":"address","name":"_swapRewards","type":"address"},{"internalType":"address","name":"_buybackAddress","type":"address"},{"internalType":"uint256","name":"_initBTCFloat","type":"uint256"},{"internalType":"uint256","name":"_initWBTCFloat","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountOfLP","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountOfFloat","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"currentPriceLP","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"withdrawal","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"txid","type":"bytes32"}],"name":"BurnLPTokensForFloat","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountOfFloat","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountOfLP","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"currentPriceLP","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"depositFees","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"txid","type":"bytes32"}],"name":"IssueLPTokensForFloat","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":false,"internalType":"address","name":"feesToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"rewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewardsLPTTotal","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"currentPriceLP","type":"uint256"}],"name":"RewardsCollection","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Swap","type":"event"},{"stateMutability":"nonpayable","type":"fallback"},{"inputs":[],"name":"BTCT_ADDR","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"activeNodeCount","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buybackAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"buybackRewardsRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newOwner","type":"address"},{"internalType":"address[]","name":"_nodes","type":"address[]"},{"internalType":"bool[]","name":"_isRemoved","type":"bool[]"},{"internalType":"uint8","name":"_churnedInCount","type":"uint8"},{"internalType":"uint8","name":"_tssThreshold","type":"uint8"}],"name":"churn","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"churnedInCount","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_incomingAmount","type":"uint256"},{"internalType":"uint256","name":"_minerFee","type":"uint256"},{"internalType":"uint256","name":"_rewardsAmount","type":"uint256"},{"internalType":"address[]","name":"_spenders","type":"address[]"},{"internalType":"uint256[]","name":"_swapAmounts","type":"uint256[]"}],"name":"collectSwapFeesForBTC","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getActiveNodes","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentPriceLP","outputs":[{"internalType":"uint256","name":"nowPrice","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenA","type":"address"},{"internalType":"address","name":"_tokenB","type":"address"}],"name":"getFloatReserve","outputs":[{"internalType":"uint256","name":"reserveA","type":"uint256"},{"internalType":"uint256","name":"reserveB","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"isNodeStake","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_txid","type":"bytes32"}],"name":"isTxUsed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lpToken","outputs":[{"internalType":"contract IBurnableToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_destToken","type":"address"},{"internalType":"bytes32[]","name":"_addressesAndAmounts","type":"bytes32[]"},{"internalType":"uint256","name":"_totalSwapped","type":"uint256"},{"internalType":"uint256","name":"_rewardsAmount","type":"uint256"},{"internalType":"bytes32[]","name":"_redeemedFloatTxIds","type":"bytes32[]"}],"name":"multiTransferERC20TightlyPacked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nodeRewardsRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bytes32","name":"_addressesAndAmountOfFloat","type":"bytes32"},{"internalType":"bytes32","name":"_txid","type":"bytes32"}],"name":"recordIncomingFloat","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"bytes32","name":"_addressesAndAmountOfLPtoken","type":"bytes32"},{"internalType":"uint256","name":"_minerFee","type":"uint256"},{"internalType":"bytes32","name":"_txid","type":"bytes32"}],"name":"recordOutcomingFloat","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minerFee","type":"uint256"},{"internalType":"bytes32","name":"_txid","type":"bytes32"}],"name":"recordUTXOSweepMinerFee","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sbBTCPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_destToken","type":"address"},{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_totalSwapped","type":"uint256"},{"internalType":"uint256","name":"_rewardsAmount","type":"uint256"},{"internalType":"bytes32[]","name":"_redeemedFloatTxIds","type":"bytes32[]"}],"name":"singleTransferERC20","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"sw","outputs":[{"internalType":"contract ISwapRewards","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tssThreshold","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sbBTCPool","type":"address"},{"internalType":"address","name":"_buybackAddress","type":"address"},{"internalType":"uint256","name":"_withdrawalFeeBPS","type":"uint256"},{"internalType":"uint256","name":"_nodeRewardsRatio","type":"uint256"},{"internalType":"uint256","name":"_buybackRewardsRatio","type":"uint256"}],"name":"updateParams","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"whitelist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawalFeeBPS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]

6101206040523480156200001257600080fd5b50604051620031a2380380620031a28339810160408190526200003591620002a9565b62000040336200023c565b600380546001600160a01b0319166001600160a01b038781169190911790915584811660a052871660808190526040805163313ce56760e01b8152905163313ce567916004808201926020929091908290030181865afa158015620000a9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000cf91906200032c565b620000dc90600a6200046d565b610100526001600160a01b03861660c08190526040805163313ce56760e01b815290516008929163313ce5679160048083019260209291908290030181865afa1580156200012e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200015491906200032c565b6200016091906200047e565b6200016d90600a6200046d565b60e0526001600160a01b039586166000908152600160208181526040808420805460ff1990811685179091559a8a16845280842080548c16841790557fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb498054909b1690921790995560079098527f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df9290925560c05186168252959020949094555050600280546001600160a01b031916929091169190911790556014600455604260055560196006556200049a565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b0381168114620002a457600080fd5b919050565b600080600080600080600060e0888a031215620002c557600080fd5b620002d0886200028c565b9650620002e0602089016200028c565b9550620002f0604089016200028c565b945062000300606089016200028c565b935062000310608089016200028c565b925060a0880151915060c0880151905092959891949750929550565b6000602082840312156200033f57600080fd5b815160ff811681146200035157600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b600181815b80851115620003af57816000190482111562000393576200039362000358565b80851615620003a157918102915b93841c939080029062000373565b509250929050565b600082620003c85750600162000467565b81620003d75750600062000467565b8160018114620003f05760028114620003fb576200041b565b600191505062000467565b60ff8411156200040f576200040f62000358565b50506001821b62000467565b5060208310610133831016604e8410600b841016171562000440575081810a62000467565b6200044c83836200036e565b806000190482111562000463576200046362000358565b0290505b92915050565b60006200035160ff841683620003b7565b60ff828116828216039081111562000467576200046762000358565b60805160a05160c05160e05161010051612c0d6200059560003960008181610a0a01528181610a46015281816116b501528181611a2e0152611f120152600061195b015260008181610289015281816106150152818161067a015281816107d8015281816108bf01528181610940015281816110fb015281816111600152818161191e01528181611b1801528181611baf0152611c5901526000818161021f015281816105a0015261083c0152600081816102f101528181610641015281816106a001528181610979015281816111270152818161118601528181611707015281816117eb01528181611cca0152611f5f0152612c0d6000f3fe608060405234801561001057600080fd5b50600436106101c15760003560e01c8063715018a6116100f9578063c810a53911610097578063e6ca208411610071578063e6ca2084146103ee578063e880afd414610411578063ec48272914610424578063f2fde38b1461047157600080fd5b8063c810a539146103b5578063cc2fbd66146103c8578063cf10b16b146103db57600080fd5b80639b19251a116100d35780639b19251a14610363578063a742329d14610386578063ad289e7614610399578063b6268e5d146103ac57600080fd5b8063715018a61461033b57806375340815146103455780638da5cb5b1461035257600080fd5b806312d1441e1161016657806345137e271161014057806345137e27146102e45780635fcbd285146102ec5780636845a025146103135780636b51e9191461032657600080fd5b806312d1441e146102ab5780632586c562146102be5780632adf9f87146102d157600080fd5b80630b513f1d116101a25780630b513f1d146102415780630b68134d146102585780630d63aca7146102615780630f9094861461028457600080fd5b806285aea1146101c657806289356f146101f6578062e5cee41461021a575b600080fd5b6003546101d9906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b600b5461020890610100900460ff1681565b60405160ff90911681526020016101ed565b6101d97f000000000000000000000000000000000000000000000000000000000000000081565b61024a60065481565b6040519081526020016101ed565b61024a60055481565b61027461026f3660046124e9565b610484565b60405190151581526020016101ed565b6101d97f000000000000000000000000000000000000000000000000000000000000000081565b600b546102089062010000900460ff1681565b6102746102cc366004612563565b6106ef565b6102746102df3660046125fe565b6107cc565b61024a61090f565b6101d97f000000000000000000000000000000000000000000000000000000000000000081565b6102746103213660046126f4565b610a6e565b61032e610e8c565b6040516101ed919061282d565b610343610fb6565b005b600b546102089060ff1681565b6000546001600160a01b03166101d9565b610274610371366004612840565b60016020526000908152604090205460ff1681565b610274610394366004612840565b610fca565b6102746103a736600461285b565b610ffe565b61024a60045481565b6102746103c33660046128e3565b61122b565b6002546101d9906001600160a01b031681565b6102746103e9366004612905565b61132b565b6102746103fc366004612938565b60009081526008602052604090205460ff1690565b61027461041f366004612951565b611406565b61045c61043236600461299e565b6001600160a01b039182166000908152600760205260408082205492909316815291909120549091565b604080519283526020830191909152016101ed565b61034361047f366004612840565b61145f565b600061048e6114ef565b6001600160a01b03871660009081526001602052604090205460ff166104fb5760405162461bcd60e51b815260206004820152600260248201527f313400000000000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6001600160a01b0387166105515760405162461bcd60e51b815260206004820152600260248201527f313500000000000000000000000000000000000000000000000000000000000060448201526064016104f2565b6000841561063f576040517fff320aae0000000000000000000000000000000000000000000000000000000081526001600160a01b0389811660048301528881166024830152604482018790527f0000000000000000000000000000000000000000000000000000000000000000169063ff320aae906064016020604051808303816000875af11580156105e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060d91906129d1565b5061063a60007f000000000000000000000000000000000000000000000000000000000000000087611549565b6106c3565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316886001600160a01b03161461069e577f00000000000000000000000000000000000000000000000000000000000000006106c0565b7f00000000000000000000000000000000000000000000000000000000000000005b90505b6106cd818561163a565b6106d6836118b4565b6106e188888861191c565b506001979650505050505050565b60006106f96114ef565b600061070361090f565b6001600160a01b03871660009081526001602052604090205490915060ff166107535760405162461bcd60e51b8152602060048201526002602482015261189b60f11b60448201526064016104f2565b61075f8686868661199b565b61076857600080fd5b600191508061077561090f565b10156107c35760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964204c505420707269636500000000000000000000000000000060448201526064016104f2565b50949350505050565b60006107d66114ef565b7f000000000000000000000000000000000000000000000000000000000000000086156108ec5760006108098887611dba565b6040517f49e031a50000000000000000000000000000000000000000000000000000000081529091506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016906349e031a59061087690600090899089906004016129ee565b6020604051808303816000875af1158015610895573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b991906129d1565b506108e67f0000000000000000000000000000000000000000000000000000000000000000600083611549565b506108f8565b866000036108f8575060005b610902818661163a565b5060019695505050505050565b60076020527f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df546001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001660009081526040812054909182918291909150915060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f99190612a52565b90508015610a4457610a3f81610a397f0000000000000000000000000000000000000000000000000000000000000000610a338787611dcd565b90611dd9565b90611de5565b610a66565b7f00000000000000000000000000000000000000000000000000000000000000005b935050505090565b6000610a786114ef565b600b5460ff62010000909104811690831610801590610a9b575060ff8260ff1611155b610ae75760405162461bcd60e51b815260206004820152600260248201527f303100000000000000000000000000000000000000000000000000000000000060448201526064016104f2565b610af2600183612a81565b60ff168360ff161015610b475760405162461bcd60e51b815260206004820152600260248201527f303200000000000000000000000000000000000000000000000000000000000060448201526064016104f2565b8351855114610b985760405162461bcd60e51b815260206004820152600260248201527f303500000000000000000000000000000000000000000000000000000000000060448201526064016104f2565b610ba18661145f565b60005b8551811015610dd757848181518110610bbf57610bbf612a9a565b6020026020010151610d4057600060ff1660096000888481518110610be657610be6612a9a565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff1603610c6f57600a868281518110610c2657610c26612a9a565b602090810291909101810151825460018101845560009384529190922001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039092169190911790555b600160ff1660096000888481518110610c8a57610c8a612a9a565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff1614610ce357600b805460ff16906000610cc983612ab0565b91906101000a81548160ff021916908360ff160217905550505b600160096000888481518110610cfb57610cfb612a9a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908360ff160217905550610dc5565b600b805460ff16906000610d5383612acf565b91906101000a81548160ff021916908360ff16021790555050600260096000888481518110610d8457610d84612a9a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908360ff1602179055505b80610dcf81612aec565b915050610ba4565b50600b54606460ff9091161115610e565760405162461bcd60e51b815260206004820152602160248201527f53746f726564206e6f64652073697a652073686f756c64206265203c3d20313060448201527f300000000000000000000000000000000000000000000000000000000000000060648201526084016104f2565b50600b805462ffff00191661010060ff9485160262ff000019161762010000929093169190910291909117905550600192915050565b600b54606090600090819060ff1667ffffffffffffffff811115610eb257610eb2612413565b604051908082528060200260200182016040528015610edb578160200160208202803683370190505b50905060005b600a54811015610faf57600160ff1660096000600a8481548110610f0757610f07612a9a565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1603610f9d57600a8181548110610f4757610f47612a9a565b9060005260206000200160009054906101000a90046001600160a01b0316828481518110610f7757610f77612a9a565b6001600160a01b039092166020928302919091019091015282610f9981612aec565b9350505b80610fa781612aec565b915050610ee1565b5092915050565b610fbe6114ef565b610fc86000611df1565b565b6001600160a01b03811660009081526009602052604081205460ff1660001901610ff657506001919050565b506000919050565b60006110086114ef565b6001600160a01b03861660009081526001602052604090205460ff166110705760405162461bcd60e51b815260206004820152601d60248201527f5f64657374546f6b656e206973206e6f742077686974656c697374656400000060448201526064016104f2565b6001600160a01b0386166110ec5760405162461bcd60e51b815260206004820152602360248201527f5f64657374546f6b656e2073686f756c64206e6f74206265206164647265737360448201527f283029000000000000000000000000000000000000000000000000000000000060648201526084016104f2565b600084156111255761112060007f000000000000000000000000000000000000000000000000000000000000000087611549565b6111a9565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316876001600160a01b031614611184577f00000000000000000000000000000000000000000000000000000000000000006111a6565b7f00000000000000000000000000000000000000000000000000000000000000005b90505b6111b3818561163a565b6111bc836118b4565b60005b86518110156106e157611219888883815181106111de576111de612a9a565b602002602001015160001c8984815181106111fb576111fb612a9a565b602002602001015160a01c6bffffffffffffffffffffffff1661191c565b8061122381612aec565b9150506111bf565b60006112356114ef565b60008281526008602052604090205460ff16156112945760405162461bcd60e51b815260206004820152601860248201527f546865207478696420697320616c72656164792075736564000000000000000060448201526064016104f2565b604080518082019091526002815261189960f11b60208083019190915260008052600790527f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df546112e6918590611e4e565b7f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df556000828152600860205260409020805460ff191660011790555060015b92915050565b60006113356114ef565b600061133f61090f565b6001600160a01b03861660009081526001602052604090205490915060ff1661138f5760405162461bcd60e51b8152602060048201526002602482015261189b60f11b60448201526064016104f2565b61139a858585611e7a565b6113a357600080fd5b60019150806113b061090f565b10156113fe5760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964204c505420707269636500000000000000000000000000000060448201526064016104f2565b509392505050565b60006114106114ef565b50600380546001600160a01b0396871673ffffffffffffffffffffffffffffffffffffffff19918216179091556002805495909616941693909317909355600455600591909155600655600190565b6114676114ef565b6001600160a01b0381166114e35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016104f2565b6114ec81611df1565b50565b6000546001600160a01b03163314610fc85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104f2565b604080518082018252600281527f31310000000000000000000000000000000000000000000000000000000000006020808301919091526001600160a01b0385166000908152600790915291909120546115a4918390611e4e565b6001600160a01b0380841660009081526007602052604080822093909355908516815220546115d39082611dcd565b6001600160a01b038481166000818152600760209081526040918290209490945580519182529185169281019290925281018290527fea368a40e9570069bb8e6511d668293ad2e1f03b0d982431fd223de9f3b70ca69060600160405180910390a1505050565b80600003611646575050565b600061165061090f565b6001600160a01b0384166000908152600760205260409020549091506116769083611dcd565b6001600160a01b0384166000908152600760205260408120919091556005546116a790606490610a39908690611dd9565b905060006116d983610a39847f0000000000000000000000000000000000000000000000000000000000000000611dd9565b905060006116f76064610a3960065485611dd990919063ffffffff16565b6003549091506001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116916340c10f19911661173a8585611dba565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af115801561179d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c191906129d1565b506002546040516340c10f1960e01b81526001600160a01b039182166004820152602481018390527f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f19906044016020604051808303816000875af1158015611836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185a91906129d1565b50604080516001600160a01b038816815260208101879052908101839052606081018590527fe3debe835f6848edc082b32a1d729781d3bfcd7e14422d80bcaa6794d3816b2f9060800160405180910390a1505050505050565b60005b8151811015611918576001600860008484815181106118d8576118d8612a9a565b6020026020010151815260200190815260200160002060006101000a81548160ff021916908315150217905550808061191090612aec565b9150506118b7565b5050565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b0316036119825761197f817f0000000000000000000000000000000000000000000000000000000000000000611dd9565b90505b6119966001600160a01b0384168383612065565b505050565b60008181526008602052604081205460ff16156119df5760405162461bcd60e51b8152602060048201526002602482015261181b60f11b60448201526064016104f2565b6000849003611a155760405162461bcd60e51b8152602060048201526002602482015261303760f01b60448201526064016104f2565b8360a081901c6000611a2561090f565b90506000611a577f0000000000000000000000000000000000000000000000000000000000000000610a398585611dd9565b90506000611a76612710610a3960045485611dd990919063ffffffff16565b905087611a838383611dba565b1015611ad15760405162461bcd60e51b815260206004820152600260248201527f303900000000000000000000000000000000000000000000000000000000000060448201526064016104f2565b6000611ae789611ae18585611dba565b90611dba565b60076020527f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df546001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600090815260409020549293509091908d16611bad57611b598585611dba565b821015611ba85760405162461bcd60e51b815260206004820152600260248201527f303800000000000000000000000000000000000000000000000000000000000060448201526064016104f2565b611c24565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d6001600160a01b031603611c2457611bf08585611dba565b811015611c245760405162461bcd60e51b8152602060048201526002602482015261189960f11b60448201526064016104f2565b611c2e8d8561163a565b611c388d866120e5565b611c578a6000908152600860205260409020805460ff19166001179055565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168d6001600160a01b031603611c9b57611c9b8d898561191c565b6040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018890527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906342966c68906024016020604051808303816000875af1158015611d1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d3f91906129d1565b611d4857600080fd5b604080516001600160a01b038a16815260208101899052908101869052606081018790526080810184905260a081018b90527fa9da34e5e4a956b744307ae7611795634e8365951073bf049d76b64b2ae7a0589060c00160405180910390a15060019c9b505050505050505050505050565b6000611dc68284612b05565b9392505050565b6000611dc68284612b18565b6000611dc68284612b2b565b6000611dc68284612b42565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008184841115611e725760405162461bcd60e51b81526004016104f29190612b88565b505050900390565b60008181526008602052604081205460ff1615611ebe5760405162461bcd60e51b8152602060048201526002602482015261181b60f11b60448201526064016104f2565b6000839003611ef45760405162461bcd60e51b8152602060048201526002602482015261303760f01b60448201526064016104f2565b8260a081901c6000611f0461090f565b90506000611f3682610a39857f0000000000000000000000000000000000000000000000000000000000000000611dd9565b6040516340c10f1960e01b81526001600160a01b038681166004830152602482018390529192507f0000000000000000000000000000000000000000000000000000000000000000909116906340c10f19906044016020604051808303816000875af1158015611faa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fce91906129d1565b50611fd98884612160565b611ff8866000908152600860205260409020805460ff19166001179055565b604080516001600160a01b038616815260208101859052908101829052606081018390526000608082015260a081018790527fdfaf4e23f7030adafec91a682e05bf9fb30c721f9cec3d8bcfae0459c5362db19060c00160405180910390a1506001979650505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052611996908490612183565b604080518082018252600281527f31300000000000000000000000000000000000000000000000000000000000006020808301919091526001600160a01b038516600090815260079091529190912054612140918390611e4e565b6001600160a01b0390921660009081526007602052604090209190915550565b6001600160a01b0382166000908152600760205260409020546121409082611dcd565b60006121d8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166122689092919063ffffffff16565b80519091501561199657808060200190518101906121f691906129d1565b6119965760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016104f2565b6060612277848460008561227f565b949350505050565b6060824710156122f75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016104f2565b843b6123455760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104f2565b600080866001600160a01b031685876040516123619190612bbb565b60006040518083038185875af1925050503d806000811461239e576040519150601f19603f3d011682016040523d82523d6000602084013e6123a3565b606091505b50915091506123b38282866123be565b979650505050505050565b606083156123cd575081611dc6565b8251156123dd5782518084602001fd5b8160405162461bcd60e51b81526004016104f29190612b88565b80356001600160a01b038116811461240e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561245257612452612413565b604052919050565b600067ffffffffffffffff82111561247457612474612413565b5060051b60200190565b600082601f83011261248f57600080fd5b813560206124a461249f8361245a565b612429565b82815260059290921b840181019181810190868411156124c357600080fd5b8286015b848110156124de57803583529183019183016124c7565b509695505050505050565b60008060008060008060c0878903121561250257600080fd5b61250b876123f7565b9550612519602088016123f7565b945060408701359350606087013592506080870135915060a087013567ffffffffffffffff81111561254a57600080fd5b61255689828a0161247e565b9150509295509295509295565b6000806000806080858703121561257957600080fd5b612582856123f7565b966020860135965060408601359560600135945092505050565b600082601f8301126125ad57600080fd5b813560206125bd61249f8361245a565b82815260059290921b840181019181810190868411156125dc57600080fd5b8286015b848110156124de576125f1816123f7565b83529183019183016125e0565b600080600080600060a0868803121561261657600080fd5b85359450602080870135945060408701359350606087013567ffffffffffffffff8082111561264457600080fd5b6126508a838b0161259c565b9450608089013591508082111561266657600080fd5b508701601f8101891361267857600080fd5b803561268661249f8261245a565b81815260059190911b8201830190838101908b8311156126a557600080fd5b928401925b828410156126c3578335825292840192908401906126aa565b80955050505050509295509295909350565b80151581146114ec57600080fd5b803560ff8116811461240e57600080fd5b600080600080600060a0868803121561270c57600080fd5b612715866123f7565b945060208087013567ffffffffffffffff8082111561273357600080fd5b61273f8a838b0161259c565b9650604089013591508082111561275557600080fd5b508701601f8101891361276757600080fd5b803561277561249f8261245a565b81815260059190911b8201830190838101908b83111561279457600080fd5b928401925b828410156127bb5783356127ac816126d5565b82529284019290840190612799565b80975050505050506127cf606087016126e3565b91506127dd608087016126e3565b90509295509295909350565b600081518084526020808501945080840160005b838110156128225781516001600160a01b0316875295820195908201906001016127fd565b509495945050505050565b602081526000611dc660208301846127e9565b60006020828403121561285257600080fd5b611dc6826123f7565b600080600080600060a0868803121561287357600080fd5b61287c866123f7565b9450602086013567ffffffffffffffff8082111561289957600080fd5b6128a589838a0161247e565b9550604088013594506060880135935060808801359150808211156128c957600080fd5b506128d68882890161247e565b9150509295509295909350565b600080604083850312156128f657600080fd5b50508035926020909101359150565b60008060006060848603121561291a57600080fd5b612923846123f7565b95602085013595506040909401359392505050565b60006020828403121561294a57600080fd5b5035919050565b600080600080600060a0868803121561296957600080fd5b612972866123f7565b9450612980602087016123f7565b94979496505050506040830135926060810135926080909101359150565b600080604083850312156129b157600080fd5b6129ba836123f7565b91506129c8602084016123f7565b90509250929050565b6000602082840312156129e357600080fd5b8151611dc6816126d5565b6001600160a01b038416815260006020606081840152612a1160608401866127e9565b838103604085015284518082528286019183019060005b81811015612a4457835183529284019291840191600101612a28565b509098975050505050505050565b600060208284031215612a6457600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60ff818116838216019081111561132557611325612a6b565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff8103612ac657612ac6612a6b565b60010192915050565b600060ff821680612ae257612ae2612a6b565b6000190192915050565b600060018201612afe57612afe612a6b565b5060010190565b8181038181111561132557611325612a6b565b8082018082111561132557611325612a6b565b808202811582820484141761132557611325612a6b565b600082612b5f57634e487b7160e01b600052601260045260246000fd5b500490565b60005b83811015612b7f578181015183820152602001612b67565b50506000910152565b6020815260008251806020840152612ba7816040850160208701612b64565b601f01601f19169190910160400192915050565b60008251612bcd818460208701612b64565b919091019291505056fea26469706673582212200b9ff2852df22de9d24b385490ba422e99ba7246e90b8f85a9f4abfc6bbabbf264736f6c63430008130033000000000000000000000000679199877e56b8e68fdb1ddae122e843ecaca2680000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c599000000000000000000000000d81a368a9606e09ad7877116536706d256fe76650000000000000000000000002a3040d8b2a4ea8d3c36c04ae2affb9c5a8e856d0000000000000000000000006f1e586c62f7d8a1b7394f1a81a75aa68e1093650000000000000000000000000000000000000000000000000000000001f661ef000000000000000000000000000000000000000000000000000000000506e72d

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101c15760003560e01c8063715018a6116100f9578063c810a53911610097578063e6ca208411610071578063e6ca2084146103ee578063e880afd414610411578063ec48272914610424578063f2fde38b1461047157600080fd5b8063c810a539146103b5578063cc2fbd66146103c8578063cf10b16b146103db57600080fd5b80639b19251a116100d35780639b19251a14610363578063a742329d14610386578063ad289e7614610399578063b6268e5d146103ac57600080fd5b8063715018a61461033b57806375340815146103455780638da5cb5b1461035257600080fd5b806312d1441e1161016657806345137e271161014057806345137e27146102e45780635fcbd285146102ec5780636845a025146103135780636b51e9191461032657600080fd5b806312d1441e146102ab5780632586c562146102be5780632adf9f87146102d157600080fd5b80630b513f1d116101a25780630b513f1d146102415780630b68134d146102585780630d63aca7146102615780630f9094861461028457600080fd5b806285aea1146101c657806289356f146101f6578062e5cee41461021a575b600080fd5b6003546101d9906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b600b5461020890610100900460ff1681565b60405160ff90911681526020016101ed565b6101d97f0000000000000000000000002a3040d8b2a4ea8d3c36c04ae2affb9c5a8e856d81565b61024a60065481565b6040519081526020016101ed565b61024a60055481565b61027461026f3660046124e9565b610484565b60405190151581526020016101ed565b6101d97f0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c59981565b600b546102089062010000900460ff1681565b6102746102cc366004612563565b6106ef565b6102746102df3660046125fe565b6107cc565b61024a61090f565b6101d97f000000000000000000000000679199877e56b8e68fdb1ddae122e843ecaca26881565b6102746103213660046126f4565b610a6e565b61032e610e8c565b6040516101ed919061282d565b610343610fb6565b005b600b546102089060ff1681565b6000546001600160a01b03166101d9565b610274610371366004612840565b60016020526000908152604090205460ff1681565b610274610394366004612840565b610fca565b6102746103a736600461285b565b610ffe565b61024a60045481565b6102746103c33660046128e3565b61122b565b6002546101d9906001600160a01b031681565b6102746103e9366004612905565b61132b565b6102746103fc366004612938565b60009081526008602052604090205460ff1690565b61027461041f366004612951565b611406565b61045c61043236600461299e565b6001600160a01b039182166000908152600760205260408082205492909316815291909120549091565b604080519283526020830191909152016101ed565b61034361047f366004612840565b61145f565b600061048e6114ef565b6001600160a01b03871660009081526001602052604090205460ff166104fb5760405162461bcd60e51b815260206004820152600260248201527f313400000000000000000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6001600160a01b0387166105515760405162461bcd60e51b815260206004820152600260248201527f313500000000000000000000000000000000000000000000000000000000000060448201526064016104f2565b6000841561063f576040517fff320aae0000000000000000000000000000000000000000000000000000000081526001600160a01b0389811660048301528881166024830152604482018790527f0000000000000000000000002a3040d8b2a4ea8d3c36c04ae2affb9c5a8e856d169063ff320aae906064016020604051808303816000875af11580156105e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060d91906129d1565b5061063a60007f0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c59987611549565b6106c3565b7f000000000000000000000000679199877e56b8e68fdb1ddae122e843ecaca2686001600160a01b0316886001600160a01b03161461069e577f0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c5996106c0565b7f000000000000000000000000679199877e56b8e68fdb1ddae122e843ecaca2685b90505b6106cd818561163a565b6106d6836118b4565b6106e188888861191c565b506001979650505050505050565b60006106f96114ef565b600061070361090f565b6001600160a01b03871660009081526001602052604090205490915060ff166107535760405162461bcd60e51b8152602060048201526002602482015261189b60f11b60448201526064016104f2565b61075f8686868661199b565b61076857600080fd5b600191508061077561090f565b10156107c35760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964204c505420707269636500000000000000000000000000000060448201526064016104f2565b50949350505050565b60006107d66114ef565b7f0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c59986156108ec5760006108098887611dba565b6040517f49e031a50000000000000000000000000000000000000000000000000000000081529091506001600160a01b037f0000000000000000000000002a3040d8b2a4ea8d3c36c04ae2affb9c5a8e856d16906349e031a59061087690600090899089906004016129ee565b6020604051808303816000875af1158015610895573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b991906129d1565b506108e67f0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c599600083611549565b506108f8565b866000036108f8575060005b610902818661163a565b5060019695505050505050565b60076020527f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df546001600160a01b037f0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c5991660009081526040812054909182918291909150915060007f000000000000000000000000679199877e56b8e68fdb1ddae122e843ecaca2686001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f99190612a52565b90508015610a4457610a3f81610a397f0000000000000000000000000000000000000000000000000000000005f5e100610a338787611dcd565b90611dd9565b90611de5565b610a66565b7f0000000000000000000000000000000000000000000000000000000005f5e1005b935050505090565b6000610a786114ef565b600b5460ff62010000909104811690831610801590610a9b575060ff8260ff1611155b610ae75760405162461bcd60e51b815260206004820152600260248201527f303100000000000000000000000000000000000000000000000000000000000060448201526064016104f2565b610af2600183612a81565b60ff168360ff161015610b475760405162461bcd60e51b815260206004820152600260248201527f303200000000000000000000000000000000000000000000000000000000000060448201526064016104f2565b8351855114610b985760405162461bcd60e51b815260206004820152600260248201527f303500000000000000000000000000000000000000000000000000000000000060448201526064016104f2565b610ba18661145f565b60005b8551811015610dd757848181518110610bbf57610bbf612a9a565b6020026020010151610d4057600060ff1660096000888481518110610be657610be6612a9a565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff1603610c6f57600a868281518110610c2657610c26612a9a565b602090810291909101810151825460018101845560009384529190922001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b039092169190911790555b600160ff1660096000888481518110610c8a57610c8a612a9a565b6020908102919091018101516001600160a01b031682528101919091526040016000205460ff1614610ce357600b805460ff16906000610cc983612ab0565b91906101000a81548160ff021916908360ff160217905550505b600160096000888481518110610cfb57610cfb612a9a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908360ff160217905550610dc5565b600b805460ff16906000610d5383612acf565b91906101000a81548160ff021916908360ff16021790555050600260096000888481518110610d8457610d84612a9a565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908360ff1602179055505b80610dcf81612aec565b915050610ba4565b50600b54606460ff9091161115610e565760405162461bcd60e51b815260206004820152602160248201527f53746f726564206e6f64652073697a652073686f756c64206265203c3d20313060448201527f300000000000000000000000000000000000000000000000000000000000000060648201526084016104f2565b50600b805462ffff00191661010060ff9485160262ff000019161762010000929093169190910291909117905550600192915050565b600b54606090600090819060ff1667ffffffffffffffff811115610eb257610eb2612413565b604051908082528060200260200182016040528015610edb578160200160208202803683370190505b50905060005b600a54811015610faf57600160ff1660096000600a8481548110610f0757610f07612a9a565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff1603610f9d57600a8181548110610f4757610f47612a9a565b9060005260206000200160009054906101000a90046001600160a01b0316828481518110610f7757610f77612a9a565b6001600160a01b039092166020928302919091019091015282610f9981612aec565b9350505b80610fa781612aec565b915050610ee1565b5092915050565b610fbe6114ef565b610fc86000611df1565b565b6001600160a01b03811660009081526009602052604081205460ff1660001901610ff657506001919050565b506000919050565b60006110086114ef565b6001600160a01b03861660009081526001602052604090205460ff166110705760405162461bcd60e51b815260206004820152601d60248201527f5f64657374546f6b656e206973206e6f742077686974656c697374656400000060448201526064016104f2565b6001600160a01b0386166110ec5760405162461bcd60e51b815260206004820152602360248201527f5f64657374546f6b656e2073686f756c64206e6f74206265206164647265737360448201527f283029000000000000000000000000000000000000000000000000000000000060648201526084016104f2565b600084156111255761112060007f0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c59987611549565b6111a9565b7f000000000000000000000000679199877e56b8e68fdb1ddae122e843ecaca2686001600160a01b0316876001600160a01b031614611184577f0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c5996111a6565b7f000000000000000000000000679199877e56b8e68fdb1ddae122e843ecaca2685b90505b6111b3818561163a565b6111bc836118b4565b60005b86518110156106e157611219888883815181106111de576111de612a9a565b602002602001015160001c8984815181106111fb576111fb612a9a565b602002602001015160a01c6bffffffffffffffffffffffff1661191c565b8061122381612aec565b9150506111bf565b60006112356114ef565b60008281526008602052604090205460ff16156112945760405162461bcd60e51b815260206004820152601860248201527f546865207478696420697320616c72656164792075736564000000000000000060448201526064016104f2565b604080518082019091526002815261189960f11b60208083019190915260008052600790527f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df546112e6918590611e4e565b7f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df556000828152600860205260409020805460ff191660011790555060015b92915050565b60006113356114ef565b600061133f61090f565b6001600160a01b03861660009081526001602052604090205490915060ff1661138f5760405162461bcd60e51b8152602060048201526002602482015261189b60f11b60448201526064016104f2565b61139a858585611e7a565b6113a357600080fd5b60019150806113b061090f565b10156113fe5760405162461bcd60e51b815260206004820152601160248201527f496e76616c6964204c505420707269636500000000000000000000000000000060448201526064016104f2565b509392505050565b60006114106114ef565b50600380546001600160a01b0396871673ffffffffffffffffffffffffffffffffffffffff19918216179091556002805495909616941693909317909355600455600591909155600655600190565b6114676114ef565b6001600160a01b0381166114e35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016104f2565b6114ec81611df1565b50565b6000546001600160a01b03163314610fc85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104f2565b604080518082018252600281527f31310000000000000000000000000000000000000000000000000000000000006020808301919091526001600160a01b0385166000908152600790915291909120546115a4918390611e4e565b6001600160a01b0380841660009081526007602052604080822093909355908516815220546115d39082611dcd565b6001600160a01b038481166000818152600760209081526040918290209490945580519182529185169281019290925281018290527fea368a40e9570069bb8e6511d668293ad2e1f03b0d982431fd223de9f3b70ca69060600160405180910390a1505050565b80600003611646575050565b600061165061090f565b6001600160a01b0384166000908152600760205260409020549091506116769083611dcd565b6001600160a01b0384166000908152600760205260408120919091556005546116a790606490610a39908690611dd9565b905060006116d983610a39847f0000000000000000000000000000000000000000000000000000000005f5e100611dd9565b905060006116f76064610a3960065485611dd990919063ffffffff16565b6003549091506001600160a01b037f000000000000000000000000679199877e56b8e68fdb1ddae122e843ecaca2688116916340c10f19911661173a8585611dba565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af115801561179d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117c191906129d1565b506002546040516340c10f1960e01b81526001600160a01b039182166004820152602481018390527f000000000000000000000000679199877e56b8e68fdb1ddae122e843ecaca268909116906340c10f19906044016020604051808303816000875af1158015611836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061185a91906129d1565b50604080516001600160a01b038816815260208101879052908101839052606081018590527fe3debe835f6848edc082b32a1d729781d3bfcd7e14422d80bcaa6794d3816b2f9060800160405180910390a1505050505050565b60005b8151811015611918576001600860008484815181106118d8576118d8612a9a565b6020026020010151815260200190815260200160002060006101000a81548160ff021916908315150217905550808061191090612aec565b9150506118b7565b5050565b7f0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c5996001600160a01b0316836001600160a01b0316036119825761197f817f0000000000000000000000000000000000000000000000000000000000000001611dd9565b90505b6119966001600160a01b0384168383612065565b505050565b60008181526008602052604081205460ff16156119df5760405162461bcd60e51b8152602060048201526002602482015261181b60f11b60448201526064016104f2565b6000849003611a155760405162461bcd60e51b8152602060048201526002602482015261303760f01b60448201526064016104f2565b8360a081901c6000611a2561090f565b90506000611a577f0000000000000000000000000000000000000000000000000000000005f5e100610a398585611dd9565b90506000611a76612710610a3960045485611dd990919063ffffffff16565b905087611a838383611dba565b1015611ad15760405162461bcd60e51b815260206004820152600260248201527f303900000000000000000000000000000000000000000000000000000000000060448201526064016104f2565b6000611ae789611ae18585611dba565b90611dba565b60076020527f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df546001600160a01b037f0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c5998116600090815260409020549293509091908d16611bad57611b598585611dba565b821015611ba85760405162461bcd60e51b815260206004820152600260248201527f303800000000000000000000000000000000000000000000000000000000000060448201526064016104f2565b611c24565b7f0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c5996001600160a01b03168d6001600160a01b031603611c2457611bf08585611dba565b811015611c245760405162461bcd60e51b8152602060048201526002602482015261189960f11b60448201526064016104f2565b611c2e8d8561163a565b611c388d866120e5565b611c578a6000908152600860205260409020805460ff19166001179055565b7f0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c5996001600160a01b03168d6001600160a01b031603611c9b57611c9b8d898561191c565b6040517f42966c68000000000000000000000000000000000000000000000000000000008152600481018890527f000000000000000000000000679199877e56b8e68fdb1ddae122e843ecaca2686001600160a01b0316906342966c68906024016020604051808303816000875af1158015611d1b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d3f91906129d1565b611d4857600080fd5b604080516001600160a01b038a16815260208101899052908101869052606081018790526080810184905260a081018b90527fa9da34e5e4a956b744307ae7611795634e8365951073bf049d76b64b2ae7a0589060c00160405180910390a15060019c9b505050505050505050505050565b6000611dc68284612b05565b9392505050565b6000611dc68284612b18565b6000611dc68284612b2b565b6000611dc68284612b42565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008184841115611e725760405162461bcd60e51b81526004016104f29190612b88565b505050900390565b60008181526008602052604081205460ff1615611ebe5760405162461bcd60e51b8152602060048201526002602482015261181b60f11b60448201526064016104f2565b6000839003611ef45760405162461bcd60e51b8152602060048201526002602482015261303760f01b60448201526064016104f2565b8260a081901c6000611f0461090f565b90506000611f3682610a39857f0000000000000000000000000000000000000000000000000000000005f5e100611dd9565b6040516340c10f1960e01b81526001600160a01b038681166004830152602482018390529192507f000000000000000000000000679199877e56b8e68fdb1ddae122e843ecaca268909116906340c10f19906044016020604051808303816000875af1158015611faa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fce91906129d1565b50611fd98884612160565b611ff8866000908152600860205260409020805460ff19166001179055565b604080516001600160a01b038616815260208101859052908101829052606081018390526000608082015260a081018790527fdfaf4e23f7030adafec91a682e05bf9fb30c721f9cec3d8bcfae0459c5362db19060c00160405180910390a1506001979650505050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052611996908490612183565b604080518082018252600281527f31300000000000000000000000000000000000000000000000000000000000006020808301919091526001600160a01b038516600090815260079091529190912054612140918390611e4e565b6001600160a01b0390921660009081526007602052604090209190915550565b6001600160a01b0382166000908152600760205260409020546121409082611dcd565b60006121d8826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166122689092919063ffffffff16565b80519091501561199657808060200190518101906121f691906129d1565b6119965760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016104f2565b6060612277848460008561227f565b949350505050565b6060824710156122f75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016104f2565b843b6123455760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016104f2565b600080866001600160a01b031685876040516123619190612bbb565b60006040518083038185875af1925050503d806000811461239e576040519150601f19603f3d011682016040523d82523d6000602084013e6123a3565b606091505b50915091506123b38282866123be565b979650505050505050565b606083156123cd575081611dc6565b8251156123dd5782518084602001fd5b8160405162461bcd60e51b81526004016104f29190612b88565b80356001600160a01b038116811461240e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561245257612452612413565b604052919050565b600067ffffffffffffffff82111561247457612474612413565b5060051b60200190565b600082601f83011261248f57600080fd5b813560206124a461249f8361245a565b612429565b82815260059290921b840181019181810190868411156124c357600080fd5b8286015b848110156124de57803583529183019183016124c7565b509695505050505050565b60008060008060008060c0878903121561250257600080fd5b61250b876123f7565b9550612519602088016123f7565b945060408701359350606087013592506080870135915060a087013567ffffffffffffffff81111561254a57600080fd5b61255689828a0161247e565b9150509295509295509295565b6000806000806080858703121561257957600080fd5b612582856123f7565b966020860135965060408601359560600135945092505050565b600082601f8301126125ad57600080fd5b813560206125bd61249f8361245a565b82815260059290921b840181019181810190868411156125dc57600080fd5b8286015b848110156124de576125f1816123f7565b83529183019183016125e0565b600080600080600060a0868803121561261657600080fd5b85359450602080870135945060408701359350606087013567ffffffffffffffff8082111561264457600080fd5b6126508a838b0161259c565b9450608089013591508082111561266657600080fd5b508701601f8101891361267857600080fd5b803561268661249f8261245a565b81815260059190911b8201830190838101908b8311156126a557600080fd5b928401925b828410156126c3578335825292840192908401906126aa565b80955050505050509295509295909350565b80151581146114ec57600080fd5b803560ff8116811461240e57600080fd5b600080600080600060a0868803121561270c57600080fd5b612715866123f7565b945060208087013567ffffffffffffffff8082111561273357600080fd5b61273f8a838b0161259c565b9650604089013591508082111561275557600080fd5b508701601f8101891361276757600080fd5b803561277561249f8261245a565b81815260059190911b8201830190838101908b83111561279457600080fd5b928401925b828410156127bb5783356127ac816126d5565b82529284019290840190612799565b80975050505050506127cf606087016126e3565b91506127dd608087016126e3565b90509295509295909350565b600081518084526020808501945080840160005b838110156128225781516001600160a01b0316875295820195908201906001016127fd565b509495945050505050565b602081526000611dc660208301846127e9565b60006020828403121561285257600080fd5b611dc6826123f7565b600080600080600060a0868803121561287357600080fd5b61287c866123f7565b9450602086013567ffffffffffffffff8082111561289957600080fd5b6128a589838a0161247e565b9550604088013594506060880135935060808801359150808211156128c957600080fd5b506128d68882890161247e565b9150509295509295909350565b600080604083850312156128f657600080fd5b50508035926020909101359150565b60008060006060848603121561291a57600080fd5b612923846123f7565b95602085013595506040909401359392505050565b60006020828403121561294a57600080fd5b5035919050565b600080600080600060a0868803121561296957600080fd5b612972866123f7565b9450612980602087016123f7565b94979496505050506040830135926060810135926080909101359150565b600080604083850312156129b157600080fd5b6129ba836123f7565b91506129c8602084016123f7565b90509250929050565b6000602082840312156129e357600080fd5b8151611dc6816126d5565b6001600160a01b038416815260006020606081840152612a1160608401866127e9565b838103604085015284518082528286019183019060005b81811015612a4457835183529284019291840191600101612a28565b509098975050505050505050565b600060208284031215612a6457600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b60ff818116838216019081111561132557611325612a6b565b634e487b7160e01b600052603260045260246000fd5b600060ff821660ff8103612ac657612ac6612a6b565b60010192915050565b600060ff821680612ae257612ae2612a6b565b6000190192915050565b600060018201612afe57612afe612a6b565b5060010190565b8181038181111561132557611325612a6b565b8082018082111561132557611325612a6b565b808202811582820484141761132557611325612a6b565b600082612b5f57634e487b7160e01b600052601260045260246000fd5b500490565b60005b83811015612b7f578181015183820152602001612b67565b50506000910152565b6020815260008251806020840152612ba7816040850160208701612b64565b601f01601f19169190910160400192915050565b60008251612bcd818460208701612b64565b919091019291505056fea26469706673582212200b9ff2852df22de9d24b385490ba422e99ba7246e90b8f85a9f4abfc6bbabbf264736f6c63430008130033

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

000000000000000000000000679199877e56b8e68fdb1ddae122e843ecaca2680000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c599000000000000000000000000d81a368a9606e09ad7877116536706d256fe76650000000000000000000000002a3040d8b2a4ea8d3c36c04ae2affb9c5a8e856d0000000000000000000000006f1e586c62f7d8a1b7394f1a81a75aa68e1093650000000000000000000000000000000000000000000000000000000001f661ef000000000000000000000000000000000000000000000000000000000506e72d

-----Decoded View---------------
Arg [0] : _lpToken (address): 0x679199877E56b8E68Fdb1dDaE122E843EcAcA268
Arg [1] : _btct (address): 0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599
Arg [2] : _sbBTCPool (address): 0xD81a368A9606E09ad7877116536706D256fe7665
Arg [3] : _swapRewards (address): 0x2a3040D8B2a4ea8d3C36c04AE2affB9c5a8e856d
Arg [4] : _buybackAddress (address): 0x6f1e586C62F7d8A1B7394F1a81a75AA68E109365
Arg [5] : _initBTCFloat (uint256): 32924143
Arg [6] : _initWBTCFloat (uint256): 84338477

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000679199877e56b8e68fdb1ddae122e843ecaca268
Arg [1] : 0000000000000000000000002260fac5e5542a773aa44fbcfedf7c193bc2c599
Arg [2] : 000000000000000000000000d81a368a9606e09ad7877116536706d256fe7665
Arg [3] : 0000000000000000000000002a3040d8b2a4ea8d3c36c04ae2affb9c5a8e856d
Arg [4] : 0000000000000000000000006f1e586c62f7d8a1b7394f1a81a75aa68e109365
Arg [5] : 0000000000000000000000000000000000000000000000000000000001f661ef
Arg [6] : 000000000000000000000000000000000000000000000000000000000506e72d


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.