Contract 0x477d33813Cc569447F558480d2Df8b3738eE2684

  Note: Our ETH balance display is temporarily unavailable. Please check back later.

Contract Overview

Balance:
Txn Hash Method
Block
From
To
Value
0xe248d339dab808baddb3a1ea1b206e4294ca7666a2ea45b9ed846519e083ba410x608060408174072022-09-02 8:51:29593 days 2 hrs ago0x3363e40cd9ed1bfc82dfa42e059d82570dd8651d IN  Create: ThalesBonds0 ETH0.0000269693140.00001
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x6d515aa96dc9470dc09802dba6ad6cd0f603d28acdaa2ed19a26d229bba02d6d11313112022-09-15 14:44:27579 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x9fc414b22b45877bba736aab410a3e2d97e2b9d9e0de0c758b0ada2bacd3921611285622022-09-15 12:26:18579 days 23 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x91e7fbfff4e39cd3fefa08fce180c8662b2fca7fd6b57952835f2b83daed3ab011280142022-09-15 11:58:22579 days 23 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x00f7a97d1d041f10475dbf2dbd0c281d00f8550a87ddcf3e7b835902cee89ef211280022022-09-15 11:57:52579 days 23 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x5cc6b93bca5cd6cf640932bd7be1b93298dec9bf6237b766885badbafb32aaac11278992022-09-15 11:52:16579 days 23 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x4397953950304aea4ce5e35c2df106d3dba6b705e6012541c3da90224a6332c311275552022-09-15 11:31:05580 days 8 mins ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0xa00df822de7bcbe4c4e711d82718b0ec714fd6bb93d6edc3149c14a33ffa2e6911032752022-09-14 15:16:21580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0xa6cc774835d51064dfa80e0e7e931ddba16a2541538bf8c44e9f3a55f767018f11032652022-09-14 15:15:50580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0xa6cc774835d51064dfa80e0e7e931ddba16a2541538bf8c44e9f3a55f767018f11032652022-09-14 15:15:50580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0xa6cc774835d51064dfa80e0e7e931ddba16a2541538bf8c44e9f3a55f767018f11032652022-09-14 15:15:50580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x8d0225bbc49db74540b3461fabdaa0409bae210ca4276f9d285bf8879b7d400911032292022-09-14 15:14:21580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x9c4d43d802d745b78cc81e0bd346dcc7bee2fe64032300929a832df268996ef911032272022-09-14 15:13:54580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x9c4d43d802d745b78cc81e0bd346dcc7bee2fe64032300929a832df268996ef911032272022-09-14 15:13:54580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0xc012ca1fabd0b2318eb67000cd0f13a6c35795fe6a625666e54c98dec84793fe11031732022-09-14 15:11:41580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x9df11435bb6045e510353ec86ed250ca0635d3944f0b0ef4cb767b482a2159be11031612022-09-14 15:11:07580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x4ab4ecf72c092fa23bc02cc44b90cb24d8ad395405ffe0d5fdfbf5c5dcc8e7cc11031082022-09-14 15:08:20580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0xff48e0056830f21a45392af06d15bf43eddac38374d28df49f1e94da4493e75c11030892022-09-14 15:07:06580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0xff48e0056830f21a45392af06d15bf43eddac38374d28df49f1e94da4493e75c11030892022-09-14 15:07:06580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x34cf7f6c857d95a658531896ed6d7306b91225634037995f89b928cc6296410011030392022-09-14 15:05:17580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x34cf7f6c857d95a658531896ed6d7306b91225634037995f89b928cc6296410011030392022-09-14 15:05:17580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x55ceb2bf3e853db3cf0212d41d73ea393242ad717d02d79ae3759b5d74d453fc11029892022-09-14 15:02:13580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x8a2909b8da5a7750de1cbd669baed8e2358384c8b0f5a032401b0a503230879111029682022-09-14 15:00:54580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x3e3bee5ad68bbb8b7b82ba8e96f157c47095f22b0fe98b23ae591cbbaa362ccd11028472022-09-14 14:53:34580 days 20 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x6153b2f3e37e0b9ec367bc2d2ae9560ea90bf07a06196ae7d978e4ed1b61ca1911024202022-09-14 14:34:07580 days 21 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
0x02d6c9ebef68a23cc034151297d1f07890d3d1bd71ac95ef9896b7184c510c6e11024112022-09-14 14:33:45580 days 21 hrs ago 0xc1b3523a8abf8d01cd19730ab9f09de23c257b6b 0x477d33813cc569447f558480d2df8b3738ee26840 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ThalesBonds

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

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

pragma solidity ^0.8.0;

// external
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";

// internal
import "../utils/proxy/solidity-0.8.0/ProxyReentrancyGuard.sol";
import "../utils/proxy/solidity-0.8.0/ProxyOwned.sol";
import "../interfaces/IExoticPositionalMarketManager.sol";
import "../interfaces/IExoticPositionalMarket.sol";
import "../interfaces/IStakingThales.sol";
import "../interfaces/ICurveSUSD.sol";

contract ThalesBonds is Initializable, ProxyOwned, PausableUpgradeable, ProxyReentrancyGuard {
    using SafeMathUpgradeable for uint;
    using SafeERC20Upgradeable for IERC20Upgradeable;

    IExoticPositionalMarketManager public marketManager;
    struct MarketBond {
        uint totalDepositedMarketBond;
        uint totalMarketBond;
        uint creatorBond;
        uint resolverBond;
        uint disputorsTotalBond;
        uint disputorsCount;
        mapping(address => uint) disputorBond;
    }

    mapping(address => MarketBond) public marketBond;
    mapping(address => uint) public marketFunds;

    uint private constant MAX_APPROVAL = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
    uint private constant ONE = 1e18;
    uint private constant ONE_PERCENT = 1e16;

    bool public curveOnrampEnabled;
    ICurveSUSD public curveSUSD;
    address public usdc;
    address public usdt;
    address public dai;

    uint private constant CREATOR_BOND = 101;
    uint private constant RESOLVER_BOND = 102;
    uint private constant DISPUTOR_BOND = 103;
    uint private constant CREATOR_AND_DISPUTOR = 104;
    uint private constant RESOLVER_AND_DISPUTOR = 105;

    IStakingThales public stakingThales;

    function initialize(address _owner) public initializer {
        setOwner(_owner);
        initNonReentrant();
    }

    function getTotalDepositedBondAmountForMarket(address _market) external view returns (uint) {
        return marketBond[_market].totalDepositedMarketBond;
    }

    function getClaimedBondAmountForMarket(address _market) external view returns (uint) {
        return marketBond[_market].totalDepositedMarketBond.sub(marketBond[_market].totalMarketBond);
    }

    function getClaimableBondAmountForMarket(address _market) external view returns (uint) {
        return marketBond[_market].totalMarketBond;
    }

    function getDisputorBondForMarket(address _market, address _disputorAddress) external view returns (uint) {
        return marketBond[_market].disputorBond[_disputorAddress];
    }

    function getCreatorBondForMarket(address _market) external view returns (uint) {
        return marketBond[_market].creatorBond;
    }

    function getResolverBondForMarket(address _market) external view returns (uint) {
        return marketBond[_market].resolverBond;
    }

    // different deposit functions to flag the bond amount : creator
    function sendCreatorBondToMarket(
        address _market,
        address _creatorAddress,
        uint _amount
    ) external onlyOracleCouncilManagerAndOwner nonReentrant {
        require(_amount > 0, "Bond zero");
        // no checks for active market, market creation not finalized
        marketBond[_market].creatorBond = _amount;
        marketBond[_market].totalMarketBond = marketBond[_market].totalMarketBond.add(_amount);
        marketBond[_market].totalDepositedMarketBond = marketBond[_market].totalDepositedMarketBond.add(_amount);
        transferToMarketBond(_creatorAddress, _amount);
        emit CreatorBondSent(_market, _creatorAddress, _amount);
    }

    // different deposit functions to flag the bond amount : resolver
    function sendResolverBondToMarket(
        address _market,
        address _resolverAddress,
        uint _amount
    ) external onlyOracleCouncilManagerAndOwner nonReentrant {
        require(_amount > 0, "Bond zero");
        require(marketManager.isActiveMarket(_market), "Invalid address");
        // in case the creator is the resolver, move the bond to the resolver
        marketBond[_market].resolverBond = _amount;
        marketBond[_market].totalMarketBond = marketBond[_market].totalMarketBond.add(_amount);
        marketBond[_market].totalDepositedMarketBond = marketBond[_market].totalDepositedMarketBond.add(_amount);
        transferToMarketBond(_resolverAddress, _amount);
        emit ResolverBondSent(_market, _resolverAddress, _amount);
    }

    // different deposit functions to flag the bond amount : disputor
    function sendDisputorBondToMarket(
        address _market,
        address _disputorAddress,
        uint _amount
    ) external onlyOracleCouncilManagerAndOwner nonReentrant {
        require(_amount > 0, "Bond zero");
        require(marketManager.isActiveMarket(_market), "Invalid address");

        // if it is first dispute for the disputor, the counter is increased
        if (marketBond[_market].disputorBond[_disputorAddress] == 0) {
            marketBond[_market].disputorsCount = marketBond[_market].disputorsCount.add(1);
        }
        marketBond[_market].disputorBond[_disputorAddress] = marketBond[_market].disputorBond[_disputorAddress].add(_amount);
        marketBond[_market].disputorsTotalBond = marketBond[_market].disputorsTotalBond.add(_amount);
        marketBond[_market].totalMarketBond = marketBond[_market].totalMarketBond.add(_amount);
        marketBond[_market].totalDepositedMarketBond = marketBond[_market].totalDepositedMarketBond.add(_amount);
        transferToMarketBond(_disputorAddress, _amount);
        emit DisputorBondSent(_market, _disputorAddress, _amount);
    }

    // universal claiming amount function to adapt for different scenarios, e.g. SafeBox
    function sendBondFromMarketToUser(
        address _market,
        address _account,
        uint _amount,
        uint _bondToReduce,
        address _disputorAddress
    ) external onlyOracleCouncilManagerAndOwner nonReentrant {
        require(marketManager.isActiveMarket(_market), "Invalid address");
        require(_amount <= marketBond[_market].totalMarketBond, "Exceeds bond");
        require(_bondToReduce >= CREATOR_BOND && _bondToReduce <= RESOLVER_AND_DISPUTOR, "Invalid bondToReduce");
        if (_bondToReduce == CREATOR_BOND && _amount <= marketBond[_market].creatorBond) {
            marketBond[_market].creatorBond = marketBond[_market].creatorBond.sub(_amount);
        } else if (_bondToReduce == RESOLVER_BOND && _amount <= marketBond[_market].resolverBond) {
            marketBond[_market].resolverBond = marketBond[_market].resolverBond.sub(_amount);
        } else if (
            _bondToReduce == DISPUTOR_BOND &&
            marketBond[_market].disputorBond[_disputorAddress] >= 0 &&
            _amount <= IExoticPositionalMarket(_market).disputePrice()
        ) {
            marketBond[_market].disputorBond[_disputorAddress] = marketBond[_market].disputorBond[_disputorAddress].sub(
                _amount
            );
            marketBond[_market].disputorsTotalBond = marketBond[_market].disputorsTotalBond.sub(_amount);
            marketBond[_market].disputorsCount = marketBond[_market].disputorBond[_disputorAddress] > 0
                ? marketBond[_market].disputorsCount
                : marketBond[_market].disputorsCount.sub(1);
        } else if (
            _bondToReduce == CREATOR_AND_DISPUTOR &&
            _amount <= marketBond[_market].creatorBond.add(IExoticPositionalMarket(_market).disputePrice()) &&
            _amount > marketBond[_market].creatorBond
        ) {
            marketBond[_market].disputorBond[_disputorAddress] = marketBond[_market].disputorBond[_disputorAddress].sub(
                _amount.sub(marketBond[_market].creatorBond)
            );
            marketBond[_market].disputorsTotalBond = marketBond[_market].disputorsTotalBond.sub(
                _amount.sub(marketBond[_market].creatorBond)
            );
            marketBond[_market].creatorBond = 0;
            marketBond[_market].disputorsCount = marketBond[_market].disputorBond[_disputorAddress] > 0
                ? marketBond[_market].disputorsCount
                : marketBond[_market].disputorsCount.sub(1);
        } else if (
            _bondToReduce == RESOLVER_AND_DISPUTOR &&
            _amount <= marketBond[_market].resolverBond.add(IExoticPositionalMarket(_market).disputePrice()) &&
            _amount > marketBond[_market].resolverBond
        ) {
            marketBond[_market].disputorBond[_disputorAddress] = marketBond[_market].disputorBond[_disputorAddress].sub(
                _amount.sub(marketBond[_market].resolverBond)
            );
            marketBond[_market].disputorsTotalBond = marketBond[_market].disputorsTotalBond.sub(
                _amount.sub(marketBond[_market].resolverBond)
            );
            marketBond[_market].resolverBond = 0;
            marketBond[_market].disputorsCount = marketBond[_market].disputorBond[_disputorAddress] > 0
                ? marketBond[_market].disputorsCount
                : marketBond[_market].disputorsCount.sub(1);
        }
        marketBond[_market].totalMarketBond = marketBond[_market].totalMarketBond.sub(_amount);
        transferBondFromMarket(_account, _amount);
        emit BondTransferredFromMarketBondToUser(_market, _account, _amount);
    }

    function sendOpenDisputeBondFromMarketToDisputor(
        address _market,
        address _account,
        uint _amount
    ) external onlyOracleCouncilManagerAndOwner nonReentrant {
        require(marketManager.isActiveMarket(_market), "Invalid address");
        require(
            _amount <= marketBond[_market].totalMarketBond && _amount <= marketBond[_market].disputorsTotalBond,
            "Exceeds bond"
        );
        require(
            marketBond[_market].disputorsCount > 0 && marketBond[_market].disputorBond[_account] >= _amount,
            "Already claimed"
        );
        marketBond[_market].totalMarketBond = marketBond[_market].totalMarketBond.sub(_amount);
        marketBond[_market].disputorBond[_account] = marketBond[_market].disputorBond[_account].sub(_amount);
        marketBond[_market].disputorsTotalBond = marketBond[_market].disputorsTotalBond.sub(_amount);
        marketBond[_market].disputorsCount = marketBond[_market].disputorBond[_account] > 0
            ? marketBond[_market].disputorsCount
            : marketBond[_market].disputorsCount.sub(1);
        transferBondFromMarket(_account, _amount);
        emit BondTransferredFromMarketBondToUser(_market, _account, _amount);
    }

    function issueBondsBackToCreatorAndResolver(address _market) external onlyOracleCouncilManagerAndOwner nonReentrant {
        require(marketManager.isActiveMarket(_market), "Invalid address");
        uint totalIssuedBack;
        if (marketBond[_market].totalMarketBond >= marketBond[_market].creatorBond.add(marketBond[_market].resolverBond)) {
            marketBond[_market].totalMarketBond = marketBond[_market].totalMarketBond.sub(
                marketBond[_market].creatorBond.add(marketBond[_market].resolverBond)
            );
            if (
                marketManager.creatorAddress(_market) != marketManager.resolverAddress(_market) &&
                marketBond[_market].creatorBond > 0
            ) {
                totalIssuedBack = marketBond[_market].creatorBond;
                marketBond[_market].creatorBond = 0;
                transferBondFromMarket(marketManager.creatorAddress(_market), totalIssuedBack);
                emit BondTransferredFromMarketBondToUser(_market, marketManager.creatorAddress(_market), totalIssuedBack);
            }
            if (marketBond[_market].resolverBond > 0) {
                totalIssuedBack = marketBond[_market].resolverBond;
                marketBond[_market].resolverBond = 0;
                transferBondFromMarket(marketManager.resolverAddress(_market), totalIssuedBack);
                emit BondTransferredFromMarketBondToUser(_market, marketManager.resolverAddress(_market), totalIssuedBack);
            }
        }
    }

    function transferCreatorToResolverBonds(address _market) external onlyOracleCouncilManagerAndOwner nonReentrant {
        require(marketManager.isActiveMarket(_market), "Invalid address");
        require(marketBond[_market].creatorBond > 0, "Creator bond 0");
        marketBond[_market].resolverBond = marketBond[_market].creatorBond;
        marketBond[_market].creatorBond = 0;
        emit BondTransferredFromCreatorToResolver(_market, marketBond[_market].resolverBond);
    }

    function transferToMarket(address _account, uint _amount) external whenNotPaused {
        require(marketManager.isActiveMarket(msg.sender), "Not active market.");
        marketFunds[msg.sender] = marketFunds[msg.sender].add(_amount);
        if (address(stakingThales) != address(0)) {
            stakingThales.updateVolume(_account, _amount);
        }
        transferToMarketBond(_account, _amount);
    }

    function transferToMarket(
        address _account,
        uint _amount,
        address collateral,
        uint expectedPayout,
        uint additionalSlippage
    ) external whenNotPaused {
        require(marketManager.isActiveMarket(msg.sender), "Not active market.");
        marketFunds[msg.sender] = marketFunds[msg.sender].add(_amount);
        if (address(stakingThales) != address(0)) {
            stakingThales.updateVolume(_account, _amount);
        }

        if (collateral == marketManager.paymentToken()) {
            transferToMarketBond(_account, _amount);
        } else {
            int128 curveIndex = _mapCollateralToCurveIndex(collateral);
            require(curveIndex > 0 && curveOnrampEnabled, "unsupported collateral");

            uint collateralQuote = getCurveQuoteForDifferentCollateral(_amount, collateral, true);
            require(collateralQuote.mul(ONE).div(expectedPayout) <= ONE.add(additionalSlippage), "Slippage too high!");
            require(IERC20Upgradeable(collateral).balanceOf(_account) >= collateralQuote, "Sender balance low");
            require(
                IERC20Upgradeable(collateral).allowance(_account, marketManager.thalesBonds()) >= collateralQuote,
                "No allowance."
            );

            IERC20Upgradeable collateralToken = IERC20Upgradeable(collateral);
            collateralToken.safeTransferFrom(_account, address(this), collateralQuote);
            curveSUSD.exchange_underlying(curveIndex, 0, collateralQuote, _amount);
        }
    }

    function transferFromMarket(address _account, uint _amount) external whenNotPaused {
        require(marketManager.isActiveMarket(msg.sender), "Not active market.");
        require(marketFunds[msg.sender] >= _amount, "Low funds.");
        marketFunds[msg.sender] = marketFunds[msg.sender].sub(_amount);

        transferBondFromMarket(_account, _amount);
    }

    function transferToMarketBond(address _account, uint _amount) internal whenNotPaused {
        IERC20Upgradeable(marketManager.paymentToken()).safeTransferFrom(_account, address(this), _amount);
    }

    function transferBondFromMarket(address _account, uint _amount) internal whenNotPaused {
        IERC20Upgradeable(marketManager.paymentToken()).safeTransfer(_account, _amount);
    }

    function setMarketManager(address _managerAddress) external onlyOwner {
        require(_managerAddress != address(0), "Invalid OC");
        marketManager = IExoticPositionalMarketManager(_managerAddress);
        emit NewManagerAddress(_managerAddress);
    }

    function setStakingThalesContract(address _stakingThales) external onlyOwner {
        require(_stakingThales != address(0), "Invalid address");
        stakingThales = IStakingThales(_stakingThales);
        emit NewStakingThalesAddress(_stakingThales);
    }

    modifier onlyOracleCouncilManagerAndOwner() {
        require(
            msg.sender == marketManager.oracleCouncilAddress() ||
                msg.sender == address(marketManager) ||
                msg.sender == owner,
            "Not OC/Manager/Owner"
        );
        require(address(marketManager) != address(0), "Invalid Manager");
        require(marketManager.oracleCouncilAddress() != address(0), "Invalid OC");
        _;
    }

    /// @notice Updates contract parametars
    /// @param _curveSUSD curve sUSD pool exchanger contract
    /// @param _dai DAI address
    /// @param _usdc USDC address
    /// @param _usdt USDT addresss
    /// @param _curveOnrampEnabled whether AMM supports curve onramp
    function setCurveSUSD(
        address _curveSUSD,
        address _dai,
        address _usdc,
        address _usdt,
        bool _curveOnrampEnabled
    ) external onlyOwner {
        curveSUSD = ICurveSUSD(_curveSUSD);
        dai = _dai;
        usdc = _usdc;
        usdt = _usdt;

        IERC20Upgradeable(dai).approve(_curveSUSD, MAX_APPROVAL);
        IERC20Upgradeable(usdc).approve(_curveSUSD, MAX_APPROVAL);
        IERC20Upgradeable(usdt).approve(_curveSUSD, MAX_APPROVAL);
        IERC20Upgradeable(marketManager.paymentToken()).approve(_curveSUSD, MAX_APPROVAL);

        curveOnrampEnabled = _curveOnrampEnabled;
    }

    function _mapCollateralToCurveIndex(address collateral) internal view returns (int128) {
        if (collateral == dai) {
            return 1;
        }
        if (collateral == usdc) {
            return 2;
        }
        if (collateral == usdt) {
            return 3;
        }
        return 0;
    }

    /// @notice get a quote in the collateral of choice (USDC, USDT or DAI) on how much the trader would need to pay to get sUSD
    /// @param amount number of positions to buy with 18 decimals
    /// @param collateral USDT, USDC or DAI address
    /// @param toSUSD flag that determines should we get a quote for swapping to sUSD or from sUSD
    /// @return collateralQuote quote in collateral on how much the trader would need to pay to get sUSD
    function getCurveQuoteForDifferentCollateral(
        uint amount,
        address collateral,
        bool toSUSD
    ) public view returns (uint collateralQuote) {
        int128 curveIndex = _mapCollateralToCurveIndex(collateral);
        if (curveIndex == 0 || !curveOnrampEnabled) {
            return (0);
        }

        if (toSUSD) {
            //cant get a quote on how much collateral is needed from curve for sUSD,
            //so rather get how much of collateral you get for the sUSD quote and add 0.2% to that
            collateralQuote = curveSUSD.get_dy_underlying(0, curveIndex, amount).mul(ONE.add(ONE_PERCENT.div(5))).div(ONE);
        } else {
            // decreasing the amount by 0.1% due to possible slippage
            collateralQuote = curveSUSD.get_dy_underlying(0, curveIndex, amount).mul(ONE.sub(ONE_PERCENT.div(10))).div(ONE);
        }
    }

    event CreatorBondSent(address market, address creator, uint amount);
    event ResolverBondSent(address market, address resolver, uint amount);
    event DisputorBondSent(address market, address disputor, uint amount);
    event BondTransferredFromMarketBondToUser(address market, address account, uint amount);
    event NewOracleCouncilAddress(address oracleCouncil);
    event NewManagerAddress(address managerAddress);
    event BondTransferredFromCreatorToResolver(address market, uint amount);
    event NewStakingThalesAddress(address stakingThales);
}

File 2 of 16 : SafeERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20Upgradeable.sol";
import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable {
    using AddressUpgradeable for address;

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

    function safeTransferFrom(
        IERC20Upgradeable 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(
        IERC20Upgradeable 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(
        IERC20Upgradeable token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

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

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

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

File 3 of 16 : MathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library MathUpgradeable {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a / b + (a % b == 0 ? 0 : 1);
    }
}

File 4 of 16 : OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.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 OwnableUpgradeable is Initializable, ContextUpgradeable {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    function __Ownable_init() internal onlyInitializing {
        __Context_init_unchained();
        __Ownable_init_unchained();
    }

    function __Ownable_init_unchained() internal onlyInitializing {
        _transferOwnership(_msgSender());
    }

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

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _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);
    }
    uint256[49] private __gap;
}

File 5 of 16 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol)

pragma solidity ^0.8.0;

import "../../utils/AddressUpgradeable.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
 * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() initializer {}
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     */
    bool private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Modifier to protect an initializer function from being invoked twice.
     */
    modifier initializer() {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
        // contract may have been reentered.
        require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");

        bool isTopLevelCall = !_initializing;
        if (isTopLevelCall) {
            _initializing = true;
            _initialized = true;
        }

        _;

        if (isTopLevelCall) {
            _initializing = false;
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} modifier, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    function _isConstructor() private view returns (bool) {
        return !AddressUpgradeable.isContract(address(this));
    }
}

File 6 of 16 : SafeMathUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 SafeMathUpgradeable {
    /**
     * @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 substraction 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 7 of 16 : IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20Upgradeable {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 8 of 16 : PausableUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)

pragma solidity ^0.8.0;

import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

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

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

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    function __Pausable_init() internal onlyInitializing {
        __Context_init_unchained();
        __Pausable_init_unchained();
    }

    function __Pausable_init_unchained() internal onlyInitializing {
        _paused = false;
    }

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

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

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

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

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

File 9 of 16 : ProxyReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the `nonReentrant` modifier
 * available, which can be aplied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 */
contract ProxyReentrancyGuard {
    /// @dev counter to allow mutex lock with only one SSTORE operation
    uint256 private _guardCounter;
    bool private _initialized;

    function initNonReentrant() public {
        require(!_initialized, "Already initialized");
        _initialized = true;
        _guardCounter = 1;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and make it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _guardCounter += 1;
        uint256 localCounter = _guardCounter;
        _;
        require(localCounter == _guardCounter, "ReentrancyGuard: reentrant call");
    }
}

File 10 of 16 : ProxyOwned.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

// Clone of syntetix contract without constructor
contract ProxyOwned {
    address public owner;
    address public nominatedOwner;
    bool private _initialized;
    bool private _transferredAtInit;

    function setOwner(address _owner) public {
        require(_owner != address(0), "Owner address cannot be 0");
        require(!_initialized, "Already initialized, use nominateNewOwner");
        _initialized = true;
        owner = _owner;
        emit OwnerChanged(address(0), _owner);
    }

    function nominateNewOwner(address _owner) external onlyOwner {
        nominatedOwner = _owner;
        emit OwnerNominated(_owner);
    }

    function acceptOwnership() external {
        require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership");
        emit OwnerChanged(owner, nominatedOwner);
        owner = nominatedOwner;
        nominatedOwner = address(0);
    }

    function transferOwnershipAtInit(address proxyAddress) external onlyOwner {
        require(proxyAddress != address(0), "Invalid address");
        require(!_transferredAtInit, "Already transferred");
        owner = proxyAddress;
        _transferredAtInit = true;
        emit OwnerChanged(owner, proxyAddress);
    }

    modifier onlyOwner {
        _onlyOwner();
        _;
    }

    function _onlyOwner() private view {
        require(msg.sender == owner, "Only the contract owner may perform this action");
    }

    event OwnerNominated(address newOwner);
    event OwnerChanged(address oldOwner, address newOwner);
}

File 11 of 16 : IExoticPositionalMarketManager.sol
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

interface IExoticPositionalMarketManager {
    /* ========== VIEWS / VARIABLES ========== */
    function paused() external view returns (bool);

    function getActiveMarketAddress(uint _index) external view returns (address);

    function getActiveMarketIndex(address _marketAddress) external view returns (uint);

    function isActiveMarket(address _marketAddress) external view returns (bool);

    function numberOfActiveMarkets() external view returns (uint);

    function getMarketBondAmount(address _market) external view returns (uint);

    function maximumPositionsAllowed() external view returns (uint);

    function paymentToken() external view returns (address);

    function owner() external view returns (address);

    function thalesBonds() external view returns (address);

    function oracleCouncilAddress() external view returns (address);

    function safeBoxAddress() external view returns (address);

    function creatorAddress(address _market) external view returns (address);

    function resolverAddress(address _market) external view returns (address);

    function isPauserAddress(address _pauserAddress) external view returns (bool);

    function safeBoxPercentage() external view returns (uint);

    function creatorPercentage() external view returns (uint);

    function resolverPercentage() external view returns (uint);

    function withdrawalPercentage() external view returns (uint);

    function pDAOResolveTimePeriod() external view returns (uint);

    function claimTimeoutDefaultPeriod() external view returns (uint);

    function maxOracleCouncilMembers() external view returns (uint);

    function fixedBondAmount() external view returns (uint);

    function disputePrice() external view returns (uint);

    function safeBoxLowAmount() external view returns (uint);

    function arbitraryRewardForDisputor() external view returns (uint);

    function disputeStringLengthLimit() external view returns (uint);

    function cancelledByCreator(address _market) external view returns (bool);

    function withdrawalTimePeriod() external view returns (uint);

    function maxAmountForOpenBidPosition() external view returns (uint);

    function maxFinalWithdrawPercentage() external view returns (uint);

    function minFixedTicketPrice() external view returns (uint);

    function createExoticMarket(
        string memory _marketQuestion,
        string memory _marketSource,
        uint _endOfPositioning,
        uint _fixedTicketPrice,
        bool _withdrawalAllowed,
        uint[] memory _tags,
        uint _positionCount,
        string[] memory _positionPhrases
    ) external;

    function createCLMarket(
        string memory _marketQuestion,
        string memory _marketSource,
        uint _endOfPositioning,
        uint _fixedTicketPrice,
        bool _withdrawalAllowed,
        uint[] memory _tags,
        uint _positionCount,
        uint[] memory _positionsOfCreator,
        string[] memory _positionPhrases
    ) external;

    function disputeMarket(address _marketAddress, address disputor) external;

    function resolveMarket(address _marketAddress, uint _outcomePosition) external;

    function resetMarket(address _marketAddress) external;

    function cancelMarket(address _market) external;

    function closeDispute(address _market) external;

    function setBackstopTimeout(address _market) external;

    function sendMarketBondAmountTo(
        address _market,
        address _recepient,
        uint _amount
    ) external;

    function addPauserAddress(address _pauserAddress) external;

    function removePauserAddress(address _pauserAddress) external;

    function sendRewardToDisputor(
        address _market,
        address _disputorAddress,
        uint amount
    ) external;

    function issueBondsBackToCreatorAndResolver(address _marketAddress) external;
}

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

pragma solidity ^0.8.0;

interface IExoticPositionalMarket {
    /* ========== VIEWS / VARIABLES ========== */
    function isMarketCreated() external view returns (bool);

    function creatorAddress() external view returns (address);

    function resolverAddress() external view returns (address);

    function totalBondAmount() external view returns (uint);

    function marketQuestion() external view returns (string memory);

    function marketSource() external view returns (string memory);

    function positionPhrase(uint index) external view returns (string memory);

    function getTicketType() external view returns (uint);

    function positionCount() external view returns (uint);

    function endOfPositioning() external view returns (uint);

    function resolvedTime() external view returns (uint);

    function fixedTicketPrice() external view returns (uint);

    function creationTime() external view returns (uint);

    function winningPosition() external view returns (uint);

    function getTags() external view returns (uint[] memory);

    function getTotalPlacedAmount() external view returns (uint);

    function getTotalClaimableAmount() external view returns (uint);

    function getPlacedAmountPerPosition(uint index) external view returns (uint);

    function fixedBondAmount() external view returns (uint);

    function disputePrice() external view returns (uint);

    function safeBoxLowAmount() external view returns (uint);

    function arbitraryRewardForDisputor() external view returns (uint);

    function backstopTimeout() external view returns (uint);

    function disputeClosedTime() external view returns (uint);

    function totalUsersTakenPositions() external view returns (uint);

    function withdrawalAllowed() external view returns (bool);

    function disputed() external view returns (bool);

    function resolved() external view returns (bool);

    function canUsersPlacePosition() external view returns (bool);

    function canMarketBeResolvedByPDAO() external view returns (bool);

    function canMarketBeResolved() external view returns (bool);

    function canUsersClaim() external view returns (bool);

    function isMarketCancelled() external view returns (bool);

    function paused() external view returns (bool);

    function canCreatorCancelMarket() external view returns (bool);

    function getAllFees()
        external
        view
        returns (
            uint,
            uint,
            uint,
            uint
        );

    function canIssueFees() external view returns (bool);

    function noWinners() external view returns (bool);

    function transferBondToMarket(address _sender, uint _amount) external;

    function resolveMarket(uint _outcomePosition, address _resolverAddress) external;

    function cancelMarket() external;

    function resetMarket() external;

    function claimWinningTicketOnBehalf(address _user) external;

    function openDispute() external;

    function closeDispute() external;

    function setBackstopTimeout(uint _timeoutPeriod) external;
}

File 13 of 16 : IStakingThales.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.5.16;

interface IStakingThales {
    function updateVolume(address account, uint amount) external;

    /* ========== VIEWS / VARIABLES ========== */
    function totalStakedAmount() external view returns (uint);

    function stakedBalanceOf(address account) external view returns (uint);

    function currentPeriodRewards() external view returns (uint);

    function currentPeriodFees() external view returns (uint);

    function getLastPeriodOfClaimedRewards(address account) external view returns (uint);

    function getRewardsAvailable(address account) external view returns (uint);

    function getRewardFeesAvailable(address account) external view returns (uint);

    function getAlreadyClaimedRewards(address account) external view returns (uint);

    function getContractRewardFunds() external view returns (uint);

    function getContractFeeFunds() external view returns (uint);
}

File 14 of 16 : ICurveSUSD.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.5.16;

interface ICurveSUSD {
    function exchange_underlying(
        int128 i,
        int128 j,
        uint256 _dx,
        uint256 _min_dy
    ) external returns (uint256);

    function get_dy_underlying(
        int128 i,
        int128 j,
        uint256 _dx
    ) external view returns (uint256);

    //    @notice Perform an exchange between two underlying coins
    //    @param i Index value for the underlying coin to send
    //    @param j Index valie of the underlying coin to receive
    //    @param _dx Amount of `i` being exchanged
    //    @param _min_dy Minimum amount of `j` to receive
    //    @param _receiver Address that receives `j`
    //    @return Actual amount of `j` received

    // indexes:
    // 0 = sUSD 18 dec 0x8c6f28f2F1A3C87F0f938b96d27520d9751ec8d9
    // 1= DAI 18 dec 0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1
    // 2= USDC 6 dec 0x7F5c764cBc14f9669B88837ca1490cCa17c31607
    // 3= USDT 6 dec 0x94b008aA00579c1307B0EF2c499aD98a8ce58e58
}

File 15 of 16 : AddressUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)

pragma solidity ^0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library AddressUpgradeable {
    /**
     * @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 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 16 of 16 : ContextUpgradeable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";

/**
 * @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 ContextUpgradeable is Initializable {
    function __Context_init() internal onlyInitializing {
        __Context_init_unchained();
    }

    function __Context_init_unchained() internal onlyInitializing {
    }
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
    uint256[50] private __gap;
}

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

Contract ABI

[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"market","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BondTransferredFromCreatorToResolver","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"market","type":"address"},{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BondTransferredFromMarketBondToUser","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"market","type":"address"},{"indexed":false,"internalType":"address","name":"creator","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CreatorBondSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"market","type":"address"},{"indexed":false,"internalType":"address","name":"disputor","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DisputorBondSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"managerAddress","type":"address"}],"name":"NewManagerAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oracleCouncil","type":"address"}],"name":"NewOracleCouncilAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"stakingThales","type":"address"}],"name":"NewStakingThalesAddress","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldOwner","type":"address"},{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnerNominated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"market","type":"address"},{"indexed":false,"internalType":"address","name":"resolver","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ResolverBondSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"acceptOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"curveOnrampEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"curveSUSD","outputs":[{"internalType":"contract ICurveSUSD","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dai","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"}],"name":"getClaimableBondAmountForMarket","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"}],"name":"getClaimedBondAmountForMarket","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"}],"name":"getCreatorBondForMarket","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"collateral","type":"address"},{"internalType":"bool","name":"toSUSD","type":"bool"}],"name":"getCurveQuoteForDifferentCollateral","outputs":[{"internalType":"uint256","name":"collateralQuote","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"address","name":"_disputorAddress","type":"address"}],"name":"getDisputorBondForMarket","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"}],"name":"getResolverBondForMarket","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"}],"name":"getTotalDepositedBondAmountForMarket","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initNonReentrant","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"}],"name":"issueBondsBackToCreatorAndResolver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"marketBond","outputs":[{"internalType":"uint256","name":"totalDepositedMarketBond","type":"uint256"},{"internalType":"uint256","name":"totalMarketBond","type":"uint256"},{"internalType":"uint256","name":"creatorBond","type":"uint256"},{"internalType":"uint256","name":"resolverBond","type":"uint256"},{"internalType":"uint256","name":"disputorsTotalBond","type":"uint256"},{"internalType":"uint256","name":"disputorsCount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"marketFunds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"marketManager","outputs":[{"internalType":"contract IExoticPositionalMarketManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"nominateNewOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nominatedOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"uint256","name":"_bondToReduce","type":"uint256"},{"internalType":"address","name":"_disputorAddress","type":"address"}],"name":"sendBondFromMarketToUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"address","name":"_creatorAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"sendCreatorBondToMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"address","name":"_disputorAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"sendDisputorBondToMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"sendOpenDisputeBondFromMarketToDisputor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"},{"internalType":"address","name":"_resolverAddress","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"sendResolverBondToMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_curveSUSD","type":"address"},{"internalType":"address","name":"_dai","type":"address"},{"internalType":"address","name":"_usdc","type":"address"},{"internalType":"address","name":"_usdt","type":"address"},{"internalType":"bool","name":"_curveOnrampEnabled","type":"bool"}],"name":"setCurveSUSD","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_managerAddress","type":"address"}],"name":"setMarketManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakingThales","type":"address"}],"name":"setStakingThalesContract","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakingThales","outputs":[{"internalType":"contract IStakingThales","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_market","type":"address"}],"name":"transferCreatorToResolverBonds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferFromMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"proxyAddress","type":"address"}],"name":"transferOwnershipAtInit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"collateral","type":"address"},{"internalType":"uint256","name":"expectedPayout","type":"uint256"},{"internalType":"uint256","name":"additionalSlippage","type":"uint256"}],"name":"transferToMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_account","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferToMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"usdc","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"usdt","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b5061479c806100206000396000f3fe608060405234801561001057600080fd5b50600436106102325760003560e01c8063857afabd11610130578063d82aff11116100b8578063ec9fc3cc1161007c578063ec9fc3cc146105af578063f29e0d0f146105c2578063f4b9fa75146105ee578063fd8a8cc614610601578063ffe0b03f1461061457600080fd5b8063d82aff111461054e578063db2d274814610561578063df999f6214610581578063e03e2d0214610594578063ebc79772146105a757600080fd5b8063b42b5798116100ff578063b42b579814610479578063b584159b1461048c578063c0f166fb146104fc578063c3b83f5f14610528578063c4d66de81461053b57600080fd5b8063857afabd146104225780638da5cb5b146104355780639cd0d4a41461044e578063a5bf660d1461046157600080fd5b8063403b1412116101be5780635a090b68116101825780635a090b68146103ac5780635c975abb146103bf5780637190e815146103ca57806379ba5097146103dd57806380af208b146103e557600080fd5b8063403b14121461032f57806341ed2c121461034257806353a47bb71461035a578063579175bf1461036d578063584226961461038057600080fd5b80631fbb38e8116102055780631fbb38e81461028557806327b153a0146102a75780632f48ab7d146102ba5780633009101f146102e55780633e413bee1461031c57600080fd5b8063105743d11461023757806313af40351461024c5780631627540c1461025f57806317f7a1e414610272575b600080fd5b61024a610245366004614328565b610627565b005b61024a61025a366004614248565b610906565b61024a61026d366004614248565b610a41565b61024a6102803660046143b8565b610a97565b606a546102929060ff1681565b60405190151581526020015b60405180910390f35b61024a6102b5366004614368565b610bd9565b606c546102cd906001600160a01b031681565b6040516001600160a01b03909116815260200161029e565b61030e6102f3366004614248565b6001600160a01b031660009081526068602052604090205490565b60405190815260200161029e565b606b546102cd906001600160a01b031681565b61024a61033d366004614328565b61163c565b6067546102cd9061010090046001600160a01b031681565b6001546102cd906001600160a01b031681565b61024a61037b3660046143e3565b611b36565b61030e61038e366004614248565b6001600160a01b031660009081526068602052604090206002015490565b61024a6103ba366004614328565b6120fa565b60345460ff16610292565b61024a6103d8366004614328565b612440565b61024a61286e565b61030e6103f3366004614280565b6001600160a01b0391821660009081526068602090815260408083209390941682526006909201909152205490565b61024a610430366004614248565b61296b565b6000546102cd906201000090046001600160a01b031681565b61030e61045c366004614248565b6129e7565b606a546102cd9061010090046001600160a01b031681565b61024a6104873660046142b8565b612a15565b6104cf61049a366004614248565b606860205260009081526040902080546001820154600283015460038401546004850154600590950154939492939192909186565b604080519687526020870195909552938501929092526060840152608083015260a082015260c00161029e565b61030e61050a366004614248565b6001600160a01b031660009081526068602052604090206001015490565b61024a610536366004614248565b612d27565b61024a610549366004614248565b612e1e565b61024a61055c366004614248565b612ee8565b61030e61056f366004614248565b60696020526000908152604090205481565b61024a61058f366004614248565b612f6c565b61024a6105a23660046143b8565b61367b565b61024a6137e5565b61024a6105bd366004614248565b613843565b61030e6105d0366004614248565b6001600160a01b031660009081526068602052604090206003015490565b606d546102cd906001600160a01b031681565b606e546102cd906001600160a01b031681565b61030e610622366004614468565b613b9c565b606760019054906101000a90046001600160a01b03166001600160a01b03166307cf018c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561067557600080fd5b505afa158015610689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ad9190614264565b6001600160a01b0316336001600160a01b031614806106db575060675461010090046001600160a01b031633145b806106f657506000546201000090046001600160a01b031633145b61071b5760405162461bcd60e51b815260040161071290614642565b60405180910390fd5b60675461010090046001600160a01b03166107485760405162461bcd60e51b815260040161071290614593565b606754604080516301f3c06360e21b8152905160009261010090046001600160a01b0316916307cf018c916004808301926020929190829003018186803b15801561079257600080fd5b505afa1580156107a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ca9190614264565b6001600160a01b031614156107f15760405162461bcd60e51b81526004016107129061451c565b6001606660008282546108049190614670565b9091555050606654816108295760405162461bcd60e51b8152600401610712906145bc565b6001600160a01b038416600090815260686020526040902060028101839055600101546108569083613ce4565b6001600160a01b03851660009081526068602052604090206001810191909155546108819083613ce4565b6001600160a01b0385166000908152606860205260409020556108a48383613cf0565b7f6a3ed0c1b8ff320f39fbf20d25cb3bc6bc231d2a05b280fc0ede537f0ae587458484846040516108d7939291906144c5565b60405180910390a160665481146109005760405162461bcd60e51b81526004016107129061460b565b50505050565b6001600160a01b03811661095c5760405162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f742062652030000000000000006044820152606401610712565b600154600160a01b900460ff16156109c85760405162461bcd60e51b815260206004820152602960248201527f416c726561647920696e697469616c697a65642c20757365206e6f6d696e617460448201526832a732bba7bbb732b960b91b6064820152608401610712565b6001805460ff60a01b1916600160a01b179055600080546001600160a01b03831662010000810262010000600160b01b03199092169190911782556040805192835260208301919091527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91015b60405180910390a150565b610a49613db0565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290602001610a36565b60345460ff1615610aba5760405162461bcd60e51b815260040161071290614569565b606754604051633761c52760e11b81523360048201526101009091046001600160a01b031690636ec38a4e9060240160206040518083038186803b158015610b0157600080fd5b505afa158015610b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b399190614434565b610b555760405162461bcd60e51b8152600401610712906145df565b33600090815260696020526040902054811115610ba15760405162461bcd60e51b815260206004820152600a6024820152692637bb90333ab732399760b11b6044820152606401610712565b33600090815260696020526040902054610bbb9082613e2a565b33600090815260696020526040902055610bd58282613e36565b5050565b606760019054906101000a90046001600160a01b03166001600160a01b03166307cf018c6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c2757600080fd5b505afa158015610c3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5f9190614264565b6001600160a01b0316336001600160a01b03161480610c8d575060675461010090046001600160a01b031633145b80610ca857506000546201000090046001600160a01b031633145b610cc45760405162461bcd60e51b815260040161071290614642565b60675461010090046001600160a01b0316610cf15760405162461bcd60e51b815260040161071290614593565b606754604080516301f3c06360e21b8152905160009261010090046001600160a01b0316916307cf018c916004808301926020929190829003018186803b158015610d3b57600080fd5b505afa158015610d4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d739190614264565b6001600160a01b03161415610d9a5760405162461bcd60e51b81526004016107129061451c565b600160666000828254610dad9190614670565b9091555050606654606754604051633761c52760e11b81526001600160a01b03888116600483015261010090920490911690636ec38a4e9060240160206040518083038186803b158015610e0057600080fd5b505afa158015610e14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e389190614434565b610e545760405162461bcd60e51b815260040161071290614540565b6001600160a01b038616600090815260686020526040902060010154841115610eae5760405162461bcd60e51b815260206004820152600c60248201526b115e18d959591cc8189bdb9960a21b6044820152606401610712565b60658310158015610ec0575060698311155b610f035760405162461bcd60e51b8152602060048201526014602482015273496e76616c696420626f6e64546f52656475636560601b6044820152606401610712565b606583148015610f2e57506001600160a01b0386166000908152606860205260409020600201548411155b15610f7a576001600160a01b038616600090815260686020526040902060020154610f599085613e2a565b6001600160a01b03871660009081526068602052604090206002015561159e565b606683148015610fa557506001600160a01b0386166000908152606860205260409020600301548411155b15610ff1576001600160a01b038616600090815260686020526040902060030154610fd09085613e2a565b6001600160a01b03871660009081526068602052604090206003015561159e565b60678314801561102757506001600160a01b03808716600090815260686020908152604082209285169091526006909101905260015b80156110a35750856001600160a01b0316636da19c356040518163ffffffff1660e01b815260040160206040518083038186803b15801561106757600080fd5b505afa15801561107b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109f9190614450565b8411155b156111bf576001600160a01b03808716600090815260686020908152604080832093861683526006909301905220546110dc9085613e2a565b6001600160a01b03808816600081815260686020818152604080842095891684526006860182528320959095559190529091526004015461111d9085613e2a565b6001600160a01b038088166000908152606860209081526040808320600481019590955592861682526006909301909252902054611181576001600160a01b03861660009081526068602052604090206005015461117c906001613e2a565b61119e565b6001600160a01b0386166000908152606860205260409020600501545b6001600160a01b03871660009081526068602052604090206005015561159e565b6068831480156112645750611260866001600160a01b0316636da19c356040518163ffffffff1660e01b815260040160206040518083038186803b15801561120657600080fd5b505afa15801561121a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123e9190614450565b6001600160a01b03881660009081526068602052604090206002015490613ce4565b8411155b801561128a57506001600160a01b03861660009081526068602052604090206002015484115b156113b8576001600160a01b0386166000908152606860205260409020600201546112ea906112ba908690613e2a565b6001600160a01b038089166000908152606860209081526040808320938816835260069093019052205490613e2a565b6001600160a01b03808816600081815260686020818152604080842095891684526006860182528320959095559190529091526002015461135290611330908690613e2a565b6001600160a01b03881660009081526068602052604090206004015490613e2a565b6001600160a01b03808816600090815260686020908152604080832060048101959095556002850183905592861682526006909301909252902054611181576001600160a01b03861660009081526068602052604090206005015461117c906001613e2a565b60698314801561145d5750611459866001600160a01b0316636da19c356040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ff57600080fd5b505afa158015611413573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114379190614450565b6001600160a01b03881660009081526068602052604090206003015490613ce4565b8411155b801561148357506001600160a01b03861660009081526068602052604090206003015484115b1561159e576001600160a01b0386166000908152606860205260409020600301546114b3906112ba908690613e2a565b6001600160a01b0380881660008181526068602081815260408084209589168452600686018252832095909555919052909152600301546114f990611330908690613e2a565b6001600160a01b03808816600090815260686020908152604080832060048101959095556003850183905592861682526006909301909252902054611564576001600160a01b03861660009081526068602052604090206005015461155f906001613e2a565b611581565b6001600160a01b0386166000908152606860205260409020600501545b6001600160a01b0387166000908152606860205260409020600501555b6001600160a01b0386166000908152606860205260409020600101546115c49085613e2a565b6001600160a01b0387166000908152606860205260409020600101556115ea8585613e36565b60008051602061474783398151915286868660405161160b939291906144c5565b60405180910390a160665481146116345760405162461bcd60e51b81526004016107129061460b565b505050505050565b606760019054906101000a90046001600160a01b03166001600160a01b03166307cf018c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561168a57600080fd5b505afa15801561169e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116c29190614264565b6001600160a01b0316336001600160a01b031614806116f0575060675461010090046001600160a01b031633145b8061170b57506000546201000090046001600160a01b031633145b6117275760405162461bcd60e51b815260040161071290614642565b60675461010090046001600160a01b03166117545760405162461bcd60e51b815260040161071290614593565b606754604080516301f3c06360e21b8152905160009261010090046001600160a01b0316916307cf018c916004808301926020929190829003018186803b15801561179e57600080fd5b505afa1580156117b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d69190614264565b6001600160a01b031614156117fd5760405162461bcd60e51b81526004016107129061451c565b6001606660008282546118109190614670565b9091555050606654606754604051633761c52760e11b81526001600160a01b03868116600483015261010090920490911690636ec38a4e9060240160206040518083038186803b15801561186357600080fd5b505afa158015611877573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189b9190614434565b6118b75760405162461bcd60e51b815260040161071290614540565b6001600160a01b03841660009081526068602052604090206001015482118015906118fd57506001600160a01b0384166000908152606860205260409020600401548211155b6119385760405162461bcd60e51b815260206004820152600c60248201526b115e18d959591cc8189bdb9960a21b6044820152606401610712565b6001600160a01b0384166000908152606860205260409020600501541580159061198b57506001600160a01b03808516600090815260686020908152604080832093871683526006909301905220548211155b6119c95760405162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e4818db185a5b5959608a1b6044820152606401610712565b6001600160a01b0384166000908152606860205260409020600101546119ef9083613e2a565b6001600160a01b038086166000908152606860209081526040808320600181019590955592871682526006909301909252902054611a2d9083613e2a565b6001600160a01b038086166000818152606860208181526040808420958a16845260068601825283209590955591905290915260040154611a6e9083613e2a565b6001600160a01b038086166000908152606860209081526040808320600481019590955592871682526006909301909252902054611ad2576001600160a01b038416600090815260686020526040902060050154611acd906001613e2a565b611aef565b6001600160a01b0384166000908152606860205260409020600501545b6001600160a01b038516600090815260686020526040902060050155611b158383613e36565b6000805160206147478339815191528484846040516108d7939291906144c5565b60345460ff1615611b595760405162461bcd60e51b815260040161071290614569565b606754604051633761c52760e11b81523360048201526101009091046001600160a01b031690636ec38a4e9060240160206040518083038186803b158015611ba057600080fd5b505afa158015611bb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bd89190614434565b611bf45760405162461bcd60e51b8152600401610712906145df565b33600090815260696020526040902054611c0e9085613ce4565b33600090815260696020526040902055606e546001600160a01b031615611c9657606e546040516302c7739b60e01b81526001600160a01b03878116600483015260248201879052909116906302c7739b90604401600060405180830381600087803b158015611c7d57600080fd5b505af1158015611c91573d6000803e3d6000fd5b505050505b606760019054906101000a90046001600160a01b03166001600160a01b0316633013ce296040518163ffffffff1660e01b815260040160206040518083038186803b158015611ce457600080fd5b505afa158015611cf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d1c9190614264565b6001600160a01b0316836001600160a01b03161415611d4457611d3f8585613cf0565b6120f3565b6000611d4f84613ef4565b9050600081600f0b138015611d665750606a5460ff165b611dab5760405162461bcd60e51b81526020600482015260166024820152751d5b9cdd5c1c1bdc9d19590818dbdb1b185d195c985b60521b6044820152606401610712565b6000611db986866001613b9c565b9050611dcd670de0b6b3a764000084613ce4565b611de985611de384670de0b6b3a7640000613f59565b90613f65565b1115611e2c5760405162461bcd60e51b8152602060048201526012602482015271536c69707061676520746f6f20686967682160701b6044820152606401610712565b6040516370a0823160e01b81526001600160a01b0388811660048301528291908716906370a082319060240160206040518083038186803b158015611e7057600080fd5b505afa158015611e84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea89190614450565b1015611eeb5760405162461bcd60e51b815260206004820152601260248201527153656e6465722062616c616e6365206c6f7760701b6044820152606401610712565b80856001600160a01b031663dd62ed3e89606760019054906101000a90046001600160a01b03166001600160a01b031663dfb8bae76040518163ffffffff1660e01b815260040160206040518083038186803b158015611f4a57600080fd5b505afa158015611f5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f829190614264565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260440160206040518083038186803b158015611fc857600080fd5b505afa158015611fdc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120009190614450565b101561203e5760405162461bcd60e51b815260206004820152600d60248201526c27379030b63637bbb0b731b29760991b6044820152606401610712565b846120546001600160a01b038216893085613f71565b606a54604051635320bf6b60e11b8152600f85900b60048201526000602482015260448101849052606481018990526101009091046001600160a01b03169063a6417ed690608401602060405180830381600087803b1580156120b657600080fd5b505af11580156120ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ee9190614450565b505050505b5050505050565b606760019054906101000a90046001600160a01b03166001600160a01b03166307cf018c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561214857600080fd5b505afa15801561215c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121809190614264565b6001600160a01b0316336001600160a01b031614806121ae575060675461010090046001600160a01b031633145b806121c957506000546201000090046001600160a01b031633145b6121e55760405162461bcd60e51b815260040161071290614642565b60675461010090046001600160a01b03166122125760405162461bcd60e51b815260040161071290614593565b606754604080516301f3c06360e21b8152905160009261010090046001600160a01b0316916307cf018c916004808301926020929190829003018186803b15801561225c57600080fd5b505afa158015612270573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122949190614264565b6001600160a01b031614156122bb5760405162461bcd60e51b81526004016107129061451c565b6001606660008282546122ce9190614670565b9091555050606654816122f35760405162461bcd60e51b8152600401610712906145bc565b606754604051633761c52760e11b81526001600160a01b03868116600483015261010090920490911690636ec38a4e9060240160206040518083038186803b15801561233e57600080fd5b505afa158015612352573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123769190614434565b6123925760405162461bcd60e51b815260040161071290614540565b6001600160a01b038416600090815260686020526040902060038101839055600101546123bf9083613ce4565b6001600160a01b03851660009081526068602052604090206001810191909155546123ea9083613ce4565b6001600160a01b03851660009081526068602052604090205561240d8383613cf0565b7fa1563e4764b03f0c6fb0ee9834943e1235597748f321123fe47fd43e46086f5c8484846040516108d7939291906144c5565b606760019054906101000a90046001600160a01b03166001600160a01b03166307cf018c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561248e57600080fd5b505afa1580156124a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124c69190614264565b6001600160a01b0316336001600160a01b031614806124f4575060675461010090046001600160a01b031633145b8061250f57506000546201000090046001600160a01b031633145b61252b5760405162461bcd60e51b815260040161071290614642565b60675461010090046001600160a01b03166125585760405162461bcd60e51b815260040161071290614593565b606754604080516301f3c06360e21b8152905160009261010090046001600160a01b0316916307cf018c916004808301926020929190829003018186803b1580156125a257600080fd5b505afa1580156125b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125da9190614264565b6001600160a01b031614156126015760405162461bcd60e51b81526004016107129061451c565b6001606660008282546126149190614670565b9091555050606654816126395760405162461bcd60e51b8152600401610712906145bc565b606754604051633761c52760e11b81526001600160a01b03868116600483015261010090920490911690636ec38a4e9060240160206040518083038186803b15801561268457600080fd5b505afa158015612698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126bc9190614434565b6126d85760405162461bcd60e51b815260040161071290614540565b6001600160a01b038085166000908152606860209081526040808320938716835260069093019052205461274a576001600160a01b03841660009081526068602052604090206005015461272d906001613ce4565b6001600160a01b0385166000908152606860205260409020600501555b6001600160a01b038085166000908152606860209081526040808320938716835260069093019052205461277e9083613ce4565b6001600160a01b038086166000818152606860208181526040808420958a168452600686018252832095909555919052909152600401546127bf9083613ce4565b6001600160a01b03851660009081526068602052604090206004810191909155600101546127ed9083613ce4565b6001600160a01b03851660009081526068602052604090206001810191909155546128189083613ce4565b6001600160a01b03851660009081526068602052604090205561283b8383613cf0565b7f7ebc12537ecdb10642293d25ea451b4ad812314aa64e90b1f439ef169860be2e8484846040516108d7939291906144c5565b6001546001600160a01b031633146128e65760405162461bcd60e51b815260206004820152603560248201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560448201527402063616e20616363657074206f776e65727368697605c1b6064820152608401610712565b60005460015460408051620100009093046001600160a01b03908116845290911660208301527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a1600180546000805462010000600160b01b0319166001600160a01b03831662010000021790556001600160a01b0319169055565b612973613db0565b6001600160a01b0381166129995760405162461bcd60e51b815260040161071290614540565b606e80546001600160a01b0319166001600160a01b0383169081179091556040519081527f05512095eb21e363428331e28648a88bf60350d313141549929a846c6d2ddfb190602001610a36565b6001600160a01b038116600090815260686020526040812060018101549054612a0f91613e2a565b92915050565b612a1d613db0565b606a8054610100600160a81b0319166101006001600160a01b0388811691820292909217909255606d80546001600160a01b0319908116888416908117909255606b80548216888516179055606c80549091169286169290921790915560405163095ea7b360e01b8152600481019290925260001960248301529063095ea7b390604401602060405180830381600087803b158015612abb57600080fd5b505af1158015612acf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612af39190614434565b50606b5460405163095ea7b360e01b81526001600160a01b03878116600483015260001960248301529091169063095ea7b390604401602060405180830381600087803b158015612b4357600080fd5b505af1158015612b57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b7b9190614434565b50606c5460405163095ea7b360e01b81526001600160a01b03878116600483015260001960248301529091169063095ea7b390604401602060405180830381600087803b158015612bcb57600080fd5b505af1158015612bdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c039190614434565b50606760019054906101000a90046001600160a01b03166001600160a01b0316633013ce296040518163ffffffff1660e01b815260040160206040518083038186803b158015612c5257600080fd5b505afa158015612c66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c8a9190614264565b60405163095ea7b360e01b81526001600160a01b0387811660048301526000196024830152919091169063095ea7b390604401602060405180830381600087803b158015612cd757600080fd5b505af1158015612ceb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d0f9190614434565b50606a805460ff191691151591909117905550505050565b612d2f613db0565b6001600160a01b038116612d555760405162461bcd60e51b815260040161071290614540565b600154600160a81b900460ff1615612da55760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481d1c985b9cd9995c9c9959606a1b6044820152606401610712565b600080546001600160a01b038381166201000081810262010000600160b01b031990941693909317938490556001805460ff60a81b1916600160a81b1790556040805193909404909116825260208201527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9101610a36565b600054610100900460ff16612e395760005460ff1615612e3d565b303b155b612ea05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610712565b600054610100900460ff16158015612ec2576000805461ffff19166101011790555b612ecb82610906565b612ed36137e5565b8015610bd5576000805461ff00191690555050565b612ef0613db0565b6001600160a01b038116612f165760405162461bcd60e51b81526004016107129061451c565b60678054610100600160a81b0319166101006001600160a01b038416908102919091179091556040519081527f154e089317c4af354b1797cbc6b5e25eec4bdd82fd25292b9b8ede870b7d056e90602001610a36565b606760019054906101000a90046001600160a01b03166001600160a01b03166307cf018c6040518163ffffffff1660e01b815260040160206040518083038186803b158015612fba57600080fd5b505afa158015612fce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ff29190614264565b6001600160a01b0316336001600160a01b03161480613020575060675461010090046001600160a01b031633145b8061303b57506000546201000090046001600160a01b031633145b6130575760405162461bcd60e51b815260040161071290614642565b60675461010090046001600160a01b03166130845760405162461bcd60e51b815260040161071290614593565b606754604080516301f3c06360e21b8152905160009261010090046001600160a01b0316916307cf018c916004808301926020929190829003018186803b1580156130ce57600080fd5b505afa1580156130e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131069190614264565b6001600160a01b0316141561312d5760405162461bcd60e51b81526004016107129061451c565b6001606660008282546131409190614670565b9091555050606654606754604051633761c52760e11b81526001600160a01b03848116600483015261010090920490911690636ec38a4e9060240160206040518083038186803b15801561319357600080fd5b505afa1580156131a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131cb9190614434565b6131e75760405162461bcd60e51b815260040161071290614540565b6001600160a01b0382166000908152606860205260408120600381015460029091015461321391613ce4565b6001600160a01b03841660009081526068602052604090206001015410613659576001600160a01b03831660009081526068602052604090206003810154600290910154613287916132659190613ce4565b6001600160a01b03851660009081526068602052604090206001015490613e2a565b6001600160a01b0384811660008181526068602052604090819020600101939093556067549251630187eab160e71b81526004810191909152610100909204169063c3f558809060240160206040518083038186803b1580156132e957600080fd5b505afa1580156132fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133219190614264565b60675460405163677755bb60e01b81526001600160a01b038681166004830152928316926101009092049091169063677755bb9060240160206040518083038186803b15801561337057600080fd5b505afa158015613384573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133a89190614264565b6001600160a01b0316141580156133d957506001600160a01b03831660009081526068602052604090206002015415155b1561353457506001600160a01b038281166000818152606860205260408082206002018054929055606754905163677755bb60e01b81526004810193909352909261348692610100909204169063677755bb906024015b60206040518083038186803b15801561344857600080fd5b505afa15801561345c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134809190614264565b82613e36565b60675460405163677755bb60e01b81526001600160a01b0380861660048301526000805160206147478339815191529286926101009091049091169063677755bb9060240160206040518083038186803b1580156134e357600080fd5b505afa1580156134f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061351b9190614264565b8360405161352b939291906144c5565b60405180910390a15b6001600160a01b0383166000908152606860205260409020600301541561365957506001600160a01b0382811660008181526068602052604080822060030180549290556067549051630187eab160e71b8152600481019390935290926135ab92610100909204169063c3f5588090602401613430565b606754604051630187eab160e71b81526001600160a01b0380861660048301526000805160206147478339815191529286926101009091049091169063c3f558809060240160206040518083038186803b15801561360857600080fd5b505afa15801561361c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136409190614264565b83604051613650939291906144c5565b60405180910390a15b506066548114610bd55760405162461bcd60e51b81526004016107129061460b565b60345460ff161561369e5760405162461bcd60e51b815260040161071290614569565b606754604051633761c52760e11b81523360048201526101009091046001600160a01b031690636ec38a4e9060240160206040518083038186803b1580156136e557600080fd5b505afa1580156136f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061371d9190614434565b6137395760405162461bcd60e51b8152600401610712906145df565b336000908152606960205260409020546137539082613ce4565b33600090815260696020526040902055606e546001600160a01b0316156137db57606e546040516302c7739b60e01b81526001600160a01b03848116600483015260248201849052909116906302c7739b90604401600060405180830381600087803b1580156137c257600080fd5b505af11580156137d6573d6000803e3d6000fd5b505050505b610bd58282613cf0565b60675460ff161561382e5760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b6044820152606401610712565b6067805460ff19166001908117909155606655565b606760019054906101000a90046001600160a01b03166001600160a01b03166307cf018c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561389157600080fd5b505afa1580156138a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138c99190614264565b6001600160a01b0316336001600160a01b031614806138f7575060675461010090046001600160a01b031633145b8061391257506000546201000090046001600160a01b031633145b61392e5760405162461bcd60e51b815260040161071290614642565b60675461010090046001600160a01b031661395b5760405162461bcd60e51b815260040161071290614593565b606754604080516301f3c06360e21b8152905160009261010090046001600160a01b0316916307cf018c916004808301926020929190829003018186803b1580156139a557600080fd5b505afa1580156139b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139dd9190614264565b6001600160a01b03161415613a045760405162461bcd60e51b81526004016107129061451c565b600160666000828254613a179190614670565b9091555050606654606754604051633761c52760e11b81526001600160a01b03848116600483015261010090920490911690636ec38a4e9060240160206040518083038186803b158015613a6a57600080fd5b505afa158015613a7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613aa29190614434565b613abe5760405162461bcd60e51b815260040161071290614540565b6001600160a01b038216600090815260686020526040902060020154613b175760405162461bcd60e51b815260206004820152600e60248201526d043726561746f7220626f6e6420360941b6044820152606401610712565b6001600160a01b03821660008181526068602090815260408083206002810180546003909201829055939093558051938452908301919091527faf46e37b31310de99d1702f74e0089413810f8072b991cb092f925ae7124d4a5910160405180910390a16066548114610bd55760405162461bcd60e51b81526004016107129061460b565b600080613ba884613ef4565b905080600f0b60001480613bbf5750606a5460ff16155b15613bce576000915050613cdd565b8215613ca557613c9e670de0b6b3a7640000611de3613c07613bf8662386f26fc100006005613f65565b670de0b6b3a764000090613ce4565b606a546040516307211ef760e01b815260006004820152600f87900b6024820152604481018b90526101009091046001600160a01b0316906307211ef79060640160206040518083038186803b158015613c6057600080fd5b505afa158015613c74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c989190614450565b90613f59565b9150613cdb565b613cd8670de0b6b3a7640000611de3613c07613cc9662386f26fc10000600a613f65565b670de0b6b3a764000090613e2a565b91505b505b9392505050565b6000613cdd8284614670565b60345460ff1615613d135760405162461bcd60e51b815260040161071290614569565b610bd5823083606760019054906101000a90046001600160a01b03166001600160a01b0316633013ce296040518163ffffffff1660e01b815260040160206040518083038186803b158015613d6757600080fd5b505afa158015613d7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d9f9190614264565b6001600160a01b0316929190613f71565b6000546201000090046001600160a01b03163314613e285760405162461bcd60e51b815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201526e37b936903a3434b99030b1ba34b7b760891b6064820152608401610712565b565b6000613cdd82846146c7565b60345460ff1615613e595760405162461bcd60e51b815260040161071290614569565b610bd58282606760019054906101000a90046001600160a01b03166001600160a01b0316633013ce296040518163ffffffff1660e01b815260040160206040518083038186803b158015613eac57600080fd5b505afa158015613ec0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ee49190614264565b6001600160a01b03169190613fc9565b606d546000906001600160a01b0383811691161415613f1557506001919050565b606b546001600160a01b0383811691161415613f3357506002919050565b606c546001600160a01b0383811691161415613f5157506003919050565b506000919050565b6000613cdd82846146a8565b6000613cdd8284614688565b610900846323b872dd60e01b858585604051602401613f92939291906144c5565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613ffe565b6040516001600160a01b038316602482015260448101829052613ff990849063a9059cbb60e01b90606401613f92565b505050565b6000614053826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166140d09092919063ffffffff16565b805190915015613ff957808060200190518101906140719190614434565b613ff95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610712565b60606140df84846000856140e7565b949350505050565b6060824710156141485760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610712565b843b6141965760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610712565b600080866001600160a01b031685876040516141b291906144a9565b60006040518083038185875af1925050503d80600081146141ef576040519150601f19603f3d011682016040523d82523d6000602084013e6141f4565b606091505b509150915061420482828661420f565b979650505050505050565b6060831561421e575081613cdd565b82511561422e5782518084602001fd5b8160405162461bcd60e51b815260040161071291906144e9565b600060208284031215614259578081fd5b8135613cdd81614720565b600060208284031215614275578081fd5b8151613cdd81614720565b60008060408385031215614292578081fd5b823561429d81614720565b915060208301356142ad81614720565b809150509250929050565b600080600080600060a086880312156142cf578081fd5b85356142da81614720565b945060208601356142ea81614720565b935060408601356142fa81614720565b9250606086013561430a81614720565b9150608086013561431a81614738565b809150509295509295909350565b60008060006060848603121561433c578283fd5b833561434781614720565b9250602084013561435781614720565b929592945050506040919091013590565b600080600080600060a0868803121561437f578081fd5b853561438a81614720565b9450602086013561439a81614720565b93506040860135925060608601359150608086013561431a81614720565b600080604083850312156143ca578182fd5b82356143d581614720565b946020939093013593505050565b600080600080600060a086880312156143fa578081fd5b853561440581614720565b945060208601359350604086013561441c81614720565b94979396509394606081013594506080013592915050565b600060208284031215614445578081fd5b8151613cdd81614738565b600060208284031215614461578081fd5b5051919050565b60008060006060848603121561447c578283fd5b83359250602084013561448e81614720565b9150604084013561449e81614738565b809150509250925092565b600082516144bb8184602087016146de565b9190910192915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208152600082518060208401526145088160408501602087016146de565b601f01601f19169190910160400192915050565b6020808252600a9082015269496e76616c6964204f4360b01b604082015260600190565b6020808252600f908201526e496e76616c6964206164647265737360881b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252600f908201526e24b73b30b634b21026b0b730b3b2b960891b604082015260600190565b602080825260099082015268426f6e64207a65726f60b81b604082015260600190565b6020808252601290820152712737ba1030b1ba34bb329036b0b935b2ba1760711b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601490820152732737ba1027a197a6b0b730b3b2b917a7bbb732b960611b604082015260600190565b600082198211156146835761468361470a565b500190565b6000826146a357634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156146c2576146c261470a565b500290565b6000828210156146d9576146d961470a565b500390565b60005b838110156146f95781810151838201526020016146e1565b838111156109005750506000910152565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461473557600080fd5b50565b801515811461473557600080fdfe60e37aa44e6b2c1aba5879edbe0d4326eff064606eb49d2d8f5d38fe8537e7d0a26469706673582212209809d050a8708afc72d1246364e67d346ee280946e201640850d7caa27a2a73f64736f6c63430008040033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106102325760003560e01c8063857afabd11610130578063d82aff11116100b8578063ec9fc3cc1161007c578063ec9fc3cc146105af578063f29e0d0f146105c2578063f4b9fa75146105ee578063fd8a8cc614610601578063ffe0b03f1461061457600080fd5b8063d82aff111461054e578063db2d274814610561578063df999f6214610581578063e03e2d0214610594578063ebc79772146105a757600080fd5b8063b42b5798116100ff578063b42b579814610479578063b584159b1461048c578063c0f166fb146104fc578063c3b83f5f14610528578063c4d66de81461053b57600080fd5b8063857afabd146104225780638da5cb5b146104355780639cd0d4a41461044e578063a5bf660d1461046157600080fd5b8063403b1412116101be5780635a090b68116101825780635a090b68146103ac5780635c975abb146103bf5780637190e815146103ca57806379ba5097146103dd57806380af208b146103e557600080fd5b8063403b14121461032f57806341ed2c121461034257806353a47bb71461035a578063579175bf1461036d578063584226961461038057600080fd5b80631fbb38e8116102055780631fbb38e81461028557806327b153a0146102a75780632f48ab7d146102ba5780633009101f146102e55780633e413bee1461031c57600080fd5b8063105743d11461023757806313af40351461024c5780631627540c1461025f57806317f7a1e414610272575b600080fd5b61024a610245366004614328565b610627565b005b61024a61025a366004614248565b610906565b61024a61026d366004614248565b610a41565b61024a6102803660046143b8565b610a97565b606a546102929060ff1681565b60405190151581526020015b60405180910390f35b61024a6102b5366004614368565b610bd9565b606c546102cd906001600160a01b031681565b6040516001600160a01b03909116815260200161029e565b61030e6102f3366004614248565b6001600160a01b031660009081526068602052604090205490565b60405190815260200161029e565b606b546102cd906001600160a01b031681565b61024a61033d366004614328565b61163c565b6067546102cd9061010090046001600160a01b031681565b6001546102cd906001600160a01b031681565b61024a61037b3660046143e3565b611b36565b61030e61038e366004614248565b6001600160a01b031660009081526068602052604090206002015490565b61024a6103ba366004614328565b6120fa565b60345460ff16610292565b61024a6103d8366004614328565b612440565b61024a61286e565b61030e6103f3366004614280565b6001600160a01b0391821660009081526068602090815260408083209390941682526006909201909152205490565b61024a610430366004614248565b61296b565b6000546102cd906201000090046001600160a01b031681565b61030e61045c366004614248565b6129e7565b606a546102cd9061010090046001600160a01b031681565b61024a6104873660046142b8565b612a15565b6104cf61049a366004614248565b606860205260009081526040902080546001820154600283015460038401546004850154600590950154939492939192909186565b604080519687526020870195909552938501929092526060840152608083015260a082015260c00161029e565b61030e61050a366004614248565b6001600160a01b031660009081526068602052604090206001015490565b61024a610536366004614248565b612d27565b61024a610549366004614248565b612e1e565b61024a61055c366004614248565b612ee8565b61030e61056f366004614248565b60696020526000908152604090205481565b61024a61058f366004614248565b612f6c565b61024a6105a23660046143b8565b61367b565b61024a6137e5565b61024a6105bd366004614248565b613843565b61030e6105d0366004614248565b6001600160a01b031660009081526068602052604090206003015490565b606d546102cd906001600160a01b031681565b606e546102cd906001600160a01b031681565b61030e610622366004614468565b613b9c565b606760019054906101000a90046001600160a01b03166001600160a01b03166307cf018c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561067557600080fd5b505afa158015610689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ad9190614264565b6001600160a01b0316336001600160a01b031614806106db575060675461010090046001600160a01b031633145b806106f657506000546201000090046001600160a01b031633145b61071b5760405162461bcd60e51b815260040161071290614642565b60405180910390fd5b60675461010090046001600160a01b03166107485760405162461bcd60e51b815260040161071290614593565b606754604080516301f3c06360e21b8152905160009261010090046001600160a01b0316916307cf018c916004808301926020929190829003018186803b15801561079257600080fd5b505afa1580156107a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ca9190614264565b6001600160a01b031614156107f15760405162461bcd60e51b81526004016107129061451c565b6001606660008282546108049190614670565b9091555050606654816108295760405162461bcd60e51b8152600401610712906145bc565b6001600160a01b038416600090815260686020526040902060028101839055600101546108569083613ce4565b6001600160a01b03851660009081526068602052604090206001810191909155546108819083613ce4565b6001600160a01b0385166000908152606860205260409020556108a48383613cf0565b7f6a3ed0c1b8ff320f39fbf20d25cb3bc6bc231d2a05b280fc0ede537f0ae587458484846040516108d7939291906144c5565b60405180910390a160665481146109005760405162461bcd60e51b81526004016107129061460b565b50505050565b6001600160a01b03811661095c5760405162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f742062652030000000000000006044820152606401610712565b600154600160a01b900460ff16156109c85760405162461bcd60e51b815260206004820152602960248201527f416c726561647920696e697469616c697a65642c20757365206e6f6d696e617460448201526832a732bba7bbb732b960b91b6064820152608401610712565b6001805460ff60a01b1916600160a01b179055600080546001600160a01b03831662010000810262010000600160b01b03199092169190911782556040805192835260208301919091527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c91015b60405180910390a150565b610a49613db0565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce2290602001610a36565b60345460ff1615610aba5760405162461bcd60e51b815260040161071290614569565b606754604051633761c52760e11b81523360048201526101009091046001600160a01b031690636ec38a4e9060240160206040518083038186803b158015610b0157600080fd5b505afa158015610b15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b399190614434565b610b555760405162461bcd60e51b8152600401610712906145df565b33600090815260696020526040902054811115610ba15760405162461bcd60e51b815260206004820152600a6024820152692637bb90333ab732399760b11b6044820152606401610712565b33600090815260696020526040902054610bbb9082613e2a565b33600090815260696020526040902055610bd58282613e36565b5050565b606760019054906101000a90046001600160a01b03166001600160a01b03166307cf018c6040518163ffffffff1660e01b815260040160206040518083038186803b158015610c2757600080fd5b505afa158015610c3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5f9190614264565b6001600160a01b0316336001600160a01b03161480610c8d575060675461010090046001600160a01b031633145b80610ca857506000546201000090046001600160a01b031633145b610cc45760405162461bcd60e51b815260040161071290614642565b60675461010090046001600160a01b0316610cf15760405162461bcd60e51b815260040161071290614593565b606754604080516301f3c06360e21b8152905160009261010090046001600160a01b0316916307cf018c916004808301926020929190829003018186803b158015610d3b57600080fd5b505afa158015610d4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d739190614264565b6001600160a01b03161415610d9a5760405162461bcd60e51b81526004016107129061451c565b600160666000828254610dad9190614670565b9091555050606654606754604051633761c52760e11b81526001600160a01b03888116600483015261010090920490911690636ec38a4e9060240160206040518083038186803b158015610e0057600080fd5b505afa158015610e14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e389190614434565b610e545760405162461bcd60e51b815260040161071290614540565b6001600160a01b038616600090815260686020526040902060010154841115610eae5760405162461bcd60e51b815260206004820152600c60248201526b115e18d959591cc8189bdb9960a21b6044820152606401610712565b60658310158015610ec0575060698311155b610f035760405162461bcd60e51b8152602060048201526014602482015273496e76616c696420626f6e64546f52656475636560601b6044820152606401610712565b606583148015610f2e57506001600160a01b0386166000908152606860205260409020600201548411155b15610f7a576001600160a01b038616600090815260686020526040902060020154610f599085613e2a565b6001600160a01b03871660009081526068602052604090206002015561159e565b606683148015610fa557506001600160a01b0386166000908152606860205260409020600301548411155b15610ff1576001600160a01b038616600090815260686020526040902060030154610fd09085613e2a565b6001600160a01b03871660009081526068602052604090206003015561159e565b60678314801561102757506001600160a01b03808716600090815260686020908152604082209285169091526006909101905260015b80156110a35750856001600160a01b0316636da19c356040518163ffffffff1660e01b815260040160206040518083038186803b15801561106757600080fd5b505afa15801561107b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109f9190614450565b8411155b156111bf576001600160a01b03808716600090815260686020908152604080832093861683526006909301905220546110dc9085613e2a565b6001600160a01b03808816600081815260686020818152604080842095891684526006860182528320959095559190529091526004015461111d9085613e2a565b6001600160a01b038088166000908152606860209081526040808320600481019590955592861682526006909301909252902054611181576001600160a01b03861660009081526068602052604090206005015461117c906001613e2a565b61119e565b6001600160a01b0386166000908152606860205260409020600501545b6001600160a01b03871660009081526068602052604090206005015561159e565b6068831480156112645750611260866001600160a01b0316636da19c356040518163ffffffff1660e01b815260040160206040518083038186803b15801561120657600080fd5b505afa15801561121a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061123e9190614450565b6001600160a01b03881660009081526068602052604090206002015490613ce4565b8411155b801561128a57506001600160a01b03861660009081526068602052604090206002015484115b156113b8576001600160a01b0386166000908152606860205260409020600201546112ea906112ba908690613e2a565b6001600160a01b038089166000908152606860209081526040808320938816835260069093019052205490613e2a565b6001600160a01b03808816600081815260686020818152604080842095891684526006860182528320959095559190529091526002015461135290611330908690613e2a565b6001600160a01b03881660009081526068602052604090206004015490613e2a565b6001600160a01b03808816600090815260686020908152604080832060048101959095556002850183905592861682526006909301909252902054611181576001600160a01b03861660009081526068602052604090206005015461117c906001613e2a565b60698314801561145d5750611459866001600160a01b0316636da19c356040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ff57600080fd5b505afa158015611413573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114379190614450565b6001600160a01b03881660009081526068602052604090206003015490613ce4565b8411155b801561148357506001600160a01b03861660009081526068602052604090206003015484115b1561159e576001600160a01b0386166000908152606860205260409020600301546114b3906112ba908690613e2a565b6001600160a01b0380881660008181526068602081815260408084209589168452600686018252832095909555919052909152600301546114f990611330908690613e2a565b6001600160a01b03808816600090815260686020908152604080832060048101959095556003850183905592861682526006909301909252902054611564576001600160a01b03861660009081526068602052604090206005015461155f906001613e2a565b611581565b6001600160a01b0386166000908152606860205260409020600501545b6001600160a01b0387166000908152606860205260409020600501555b6001600160a01b0386166000908152606860205260409020600101546115c49085613e2a565b6001600160a01b0387166000908152606860205260409020600101556115ea8585613e36565b60008051602061474783398151915286868660405161160b939291906144c5565b60405180910390a160665481146116345760405162461bcd60e51b81526004016107129061460b565b505050505050565b606760019054906101000a90046001600160a01b03166001600160a01b03166307cf018c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561168a57600080fd5b505afa15801561169e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116c29190614264565b6001600160a01b0316336001600160a01b031614806116f0575060675461010090046001600160a01b031633145b8061170b57506000546201000090046001600160a01b031633145b6117275760405162461bcd60e51b815260040161071290614642565b60675461010090046001600160a01b03166117545760405162461bcd60e51b815260040161071290614593565b606754604080516301f3c06360e21b8152905160009261010090046001600160a01b0316916307cf018c916004808301926020929190829003018186803b15801561179e57600080fd5b505afa1580156117b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117d69190614264565b6001600160a01b031614156117fd5760405162461bcd60e51b81526004016107129061451c565b6001606660008282546118109190614670565b9091555050606654606754604051633761c52760e11b81526001600160a01b03868116600483015261010090920490911690636ec38a4e9060240160206040518083038186803b15801561186357600080fd5b505afa158015611877573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189b9190614434565b6118b75760405162461bcd60e51b815260040161071290614540565b6001600160a01b03841660009081526068602052604090206001015482118015906118fd57506001600160a01b0384166000908152606860205260409020600401548211155b6119385760405162461bcd60e51b815260206004820152600c60248201526b115e18d959591cc8189bdb9960a21b6044820152606401610712565b6001600160a01b0384166000908152606860205260409020600501541580159061198b57506001600160a01b03808516600090815260686020908152604080832093871683526006909301905220548211155b6119c95760405162461bcd60e51b815260206004820152600f60248201526e105b1c9958591e4818db185a5b5959608a1b6044820152606401610712565b6001600160a01b0384166000908152606860205260409020600101546119ef9083613e2a565b6001600160a01b038086166000908152606860209081526040808320600181019590955592871682526006909301909252902054611a2d9083613e2a565b6001600160a01b038086166000818152606860208181526040808420958a16845260068601825283209590955591905290915260040154611a6e9083613e2a565b6001600160a01b038086166000908152606860209081526040808320600481019590955592871682526006909301909252902054611ad2576001600160a01b038416600090815260686020526040902060050154611acd906001613e2a565b611aef565b6001600160a01b0384166000908152606860205260409020600501545b6001600160a01b038516600090815260686020526040902060050155611b158383613e36565b6000805160206147478339815191528484846040516108d7939291906144c5565b60345460ff1615611b595760405162461bcd60e51b815260040161071290614569565b606754604051633761c52760e11b81523360048201526101009091046001600160a01b031690636ec38a4e9060240160206040518083038186803b158015611ba057600080fd5b505afa158015611bb4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bd89190614434565b611bf45760405162461bcd60e51b8152600401610712906145df565b33600090815260696020526040902054611c0e9085613ce4565b33600090815260696020526040902055606e546001600160a01b031615611c9657606e546040516302c7739b60e01b81526001600160a01b03878116600483015260248201879052909116906302c7739b90604401600060405180830381600087803b158015611c7d57600080fd5b505af1158015611c91573d6000803e3d6000fd5b505050505b606760019054906101000a90046001600160a01b03166001600160a01b0316633013ce296040518163ffffffff1660e01b815260040160206040518083038186803b158015611ce457600080fd5b505afa158015611cf8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d1c9190614264565b6001600160a01b0316836001600160a01b03161415611d4457611d3f8585613cf0565b6120f3565b6000611d4f84613ef4565b9050600081600f0b138015611d665750606a5460ff165b611dab5760405162461bcd60e51b81526020600482015260166024820152751d5b9cdd5c1c1bdc9d19590818dbdb1b185d195c985b60521b6044820152606401610712565b6000611db986866001613b9c565b9050611dcd670de0b6b3a764000084613ce4565b611de985611de384670de0b6b3a7640000613f59565b90613f65565b1115611e2c5760405162461bcd60e51b8152602060048201526012602482015271536c69707061676520746f6f20686967682160701b6044820152606401610712565b6040516370a0823160e01b81526001600160a01b0388811660048301528291908716906370a082319060240160206040518083038186803b158015611e7057600080fd5b505afa158015611e84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea89190614450565b1015611eeb5760405162461bcd60e51b815260206004820152601260248201527153656e6465722062616c616e6365206c6f7760701b6044820152606401610712565b80856001600160a01b031663dd62ed3e89606760019054906101000a90046001600160a01b03166001600160a01b031663dfb8bae76040518163ffffffff1660e01b815260040160206040518083038186803b158015611f4a57600080fd5b505afa158015611f5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f829190614264565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260440160206040518083038186803b158015611fc857600080fd5b505afa158015611fdc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120009190614450565b101561203e5760405162461bcd60e51b815260206004820152600d60248201526c27379030b63637bbb0b731b29760991b6044820152606401610712565b846120546001600160a01b038216893085613f71565b606a54604051635320bf6b60e11b8152600f85900b60048201526000602482015260448101849052606481018990526101009091046001600160a01b03169063a6417ed690608401602060405180830381600087803b1580156120b657600080fd5b505af11580156120ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ee9190614450565b505050505b5050505050565b606760019054906101000a90046001600160a01b03166001600160a01b03166307cf018c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561214857600080fd5b505afa15801561215c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121809190614264565b6001600160a01b0316336001600160a01b031614806121ae575060675461010090046001600160a01b031633145b806121c957506000546201000090046001600160a01b031633145b6121e55760405162461bcd60e51b815260040161071290614642565b60675461010090046001600160a01b03166122125760405162461bcd60e51b815260040161071290614593565b606754604080516301f3c06360e21b8152905160009261010090046001600160a01b0316916307cf018c916004808301926020929190829003018186803b15801561225c57600080fd5b505afa158015612270573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122949190614264565b6001600160a01b031614156122bb5760405162461bcd60e51b81526004016107129061451c565b6001606660008282546122ce9190614670565b9091555050606654816122f35760405162461bcd60e51b8152600401610712906145bc565b606754604051633761c52760e11b81526001600160a01b03868116600483015261010090920490911690636ec38a4e9060240160206040518083038186803b15801561233e57600080fd5b505afa158015612352573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123769190614434565b6123925760405162461bcd60e51b815260040161071290614540565b6001600160a01b038416600090815260686020526040902060038101839055600101546123bf9083613ce4565b6001600160a01b03851660009081526068602052604090206001810191909155546123ea9083613ce4565b6001600160a01b03851660009081526068602052604090205561240d8383613cf0565b7fa1563e4764b03f0c6fb0ee9834943e1235597748f321123fe47fd43e46086f5c8484846040516108d7939291906144c5565b606760019054906101000a90046001600160a01b03166001600160a01b03166307cf018c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561248e57600080fd5b505afa1580156124a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124c69190614264565b6001600160a01b0316336001600160a01b031614806124f4575060675461010090046001600160a01b031633145b8061250f57506000546201000090046001600160a01b031633145b61252b5760405162461bcd60e51b815260040161071290614642565b60675461010090046001600160a01b03166125585760405162461bcd60e51b815260040161071290614593565b606754604080516301f3c06360e21b8152905160009261010090046001600160a01b0316916307cf018c916004808301926020929190829003018186803b1580156125a257600080fd5b505afa1580156125b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125da9190614264565b6001600160a01b031614156126015760405162461bcd60e51b81526004016107129061451c565b6001606660008282546126149190614670565b9091555050606654816126395760405162461bcd60e51b8152600401610712906145bc565b606754604051633761c52760e11b81526001600160a01b03868116600483015261010090920490911690636ec38a4e9060240160206040518083038186803b15801561268457600080fd5b505afa158015612698573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126bc9190614434565b6126d85760405162461bcd60e51b815260040161071290614540565b6001600160a01b038085166000908152606860209081526040808320938716835260069093019052205461274a576001600160a01b03841660009081526068602052604090206005015461272d906001613ce4565b6001600160a01b0385166000908152606860205260409020600501555b6001600160a01b038085166000908152606860209081526040808320938716835260069093019052205461277e9083613ce4565b6001600160a01b038086166000818152606860208181526040808420958a168452600686018252832095909555919052909152600401546127bf9083613ce4565b6001600160a01b03851660009081526068602052604090206004810191909155600101546127ed9083613ce4565b6001600160a01b03851660009081526068602052604090206001810191909155546128189083613ce4565b6001600160a01b03851660009081526068602052604090205561283b8383613cf0565b7f7ebc12537ecdb10642293d25ea451b4ad812314aa64e90b1f439ef169860be2e8484846040516108d7939291906144c5565b6001546001600160a01b031633146128e65760405162461bcd60e51b815260206004820152603560248201527f596f75206d757374206265206e6f6d696e61746564206265666f726520796f7560448201527402063616e20616363657074206f776e65727368697605c1b6064820152608401610712565b60005460015460408051620100009093046001600160a01b03908116845290911660208301527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c910160405180910390a1600180546000805462010000600160b01b0319166001600160a01b03831662010000021790556001600160a01b0319169055565b612973613db0565b6001600160a01b0381166129995760405162461bcd60e51b815260040161071290614540565b606e80546001600160a01b0319166001600160a01b0383169081179091556040519081527f05512095eb21e363428331e28648a88bf60350d313141549929a846c6d2ddfb190602001610a36565b6001600160a01b038116600090815260686020526040812060018101549054612a0f91613e2a565b92915050565b612a1d613db0565b606a8054610100600160a81b0319166101006001600160a01b0388811691820292909217909255606d80546001600160a01b0319908116888416908117909255606b80548216888516179055606c80549091169286169290921790915560405163095ea7b360e01b8152600481019290925260001960248301529063095ea7b390604401602060405180830381600087803b158015612abb57600080fd5b505af1158015612acf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612af39190614434565b50606b5460405163095ea7b360e01b81526001600160a01b03878116600483015260001960248301529091169063095ea7b390604401602060405180830381600087803b158015612b4357600080fd5b505af1158015612b57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b7b9190614434565b50606c5460405163095ea7b360e01b81526001600160a01b03878116600483015260001960248301529091169063095ea7b390604401602060405180830381600087803b158015612bcb57600080fd5b505af1158015612bdf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c039190614434565b50606760019054906101000a90046001600160a01b03166001600160a01b0316633013ce296040518163ffffffff1660e01b815260040160206040518083038186803b158015612c5257600080fd5b505afa158015612c66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c8a9190614264565b60405163095ea7b360e01b81526001600160a01b0387811660048301526000196024830152919091169063095ea7b390604401602060405180830381600087803b158015612cd757600080fd5b505af1158015612ceb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612d0f9190614434565b50606a805460ff191691151591909117905550505050565b612d2f613db0565b6001600160a01b038116612d555760405162461bcd60e51b815260040161071290614540565b600154600160a81b900460ff1615612da55760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481d1c985b9cd9995c9c9959606a1b6044820152606401610712565b600080546001600160a01b038381166201000081810262010000600160b01b031990941693909317938490556001805460ff60a81b1916600160a81b1790556040805193909404909116825260208201527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9101610a36565b600054610100900460ff16612e395760005460ff1615612e3d565b303b155b612ea05760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610712565b600054610100900460ff16158015612ec2576000805461ffff19166101011790555b612ecb82610906565b612ed36137e5565b8015610bd5576000805461ff00191690555050565b612ef0613db0565b6001600160a01b038116612f165760405162461bcd60e51b81526004016107129061451c565b60678054610100600160a81b0319166101006001600160a01b038416908102919091179091556040519081527f154e089317c4af354b1797cbc6b5e25eec4bdd82fd25292b9b8ede870b7d056e90602001610a36565b606760019054906101000a90046001600160a01b03166001600160a01b03166307cf018c6040518163ffffffff1660e01b815260040160206040518083038186803b158015612fba57600080fd5b505afa158015612fce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ff29190614264565b6001600160a01b0316336001600160a01b03161480613020575060675461010090046001600160a01b031633145b8061303b57506000546201000090046001600160a01b031633145b6130575760405162461bcd60e51b815260040161071290614642565b60675461010090046001600160a01b03166130845760405162461bcd60e51b815260040161071290614593565b606754604080516301f3c06360e21b8152905160009261010090046001600160a01b0316916307cf018c916004808301926020929190829003018186803b1580156130ce57600080fd5b505afa1580156130e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131069190614264565b6001600160a01b0316141561312d5760405162461bcd60e51b81526004016107129061451c565b6001606660008282546131409190614670565b9091555050606654606754604051633761c52760e11b81526001600160a01b03848116600483015261010090920490911690636ec38a4e9060240160206040518083038186803b15801561319357600080fd5b505afa1580156131a7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906131cb9190614434565b6131e75760405162461bcd60e51b815260040161071290614540565b6001600160a01b0382166000908152606860205260408120600381015460029091015461321391613ce4565b6001600160a01b03841660009081526068602052604090206001015410613659576001600160a01b03831660009081526068602052604090206003810154600290910154613287916132659190613ce4565b6001600160a01b03851660009081526068602052604090206001015490613e2a565b6001600160a01b0384811660008181526068602052604090819020600101939093556067549251630187eab160e71b81526004810191909152610100909204169063c3f558809060240160206040518083038186803b1580156132e957600080fd5b505afa1580156132fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133219190614264565b60675460405163677755bb60e01b81526001600160a01b038681166004830152928316926101009092049091169063677755bb9060240160206040518083038186803b15801561337057600080fd5b505afa158015613384573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906133a89190614264565b6001600160a01b0316141580156133d957506001600160a01b03831660009081526068602052604090206002015415155b1561353457506001600160a01b038281166000818152606860205260408082206002018054929055606754905163677755bb60e01b81526004810193909352909261348692610100909204169063677755bb906024015b60206040518083038186803b15801561344857600080fd5b505afa15801561345c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134809190614264565b82613e36565b60675460405163677755bb60e01b81526001600160a01b0380861660048301526000805160206147478339815191529286926101009091049091169063677755bb9060240160206040518083038186803b1580156134e357600080fd5b505afa1580156134f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061351b9190614264565b8360405161352b939291906144c5565b60405180910390a15b6001600160a01b0383166000908152606860205260409020600301541561365957506001600160a01b0382811660008181526068602052604080822060030180549290556067549051630187eab160e71b8152600481019390935290926135ab92610100909204169063c3f5588090602401613430565b606754604051630187eab160e71b81526001600160a01b0380861660048301526000805160206147478339815191529286926101009091049091169063c3f558809060240160206040518083038186803b15801561360857600080fd5b505afa15801561361c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906136409190614264565b83604051613650939291906144c5565b60405180910390a15b506066548114610bd55760405162461bcd60e51b81526004016107129061460b565b60345460ff161561369e5760405162461bcd60e51b815260040161071290614569565b606754604051633761c52760e11b81523360048201526101009091046001600160a01b031690636ec38a4e9060240160206040518083038186803b1580156136e557600080fd5b505afa1580156136f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061371d9190614434565b6137395760405162461bcd60e51b8152600401610712906145df565b336000908152606960205260409020546137539082613ce4565b33600090815260696020526040902055606e546001600160a01b0316156137db57606e546040516302c7739b60e01b81526001600160a01b03848116600483015260248201849052909116906302c7739b90604401600060405180830381600087803b1580156137c257600080fd5b505af11580156137d6573d6000803e3d6000fd5b505050505b610bd58282613cf0565b60675460ff161561382e5760405162461bcd60e51b8152602060048201526013602482015272105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b6044820152606401610712565b6067805460ff19166001908117909155606655565b606760019054906101000a90046001600160a01b03166001600160a01b03166307cf018c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561389157600080fd5b505afa1580156138a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906138c99190614264565b6001600160a01b0316336001600160a01b031614806138f7575060675461010090046001600160a01b031633145b8061391257506000546201000090046001600160a01b031633145b61392e5760405162461bcd60e51b815260040161071290614642565b60675461010090046001600160a01b031661395b5760405162461bcd60e51b815260040161071290614593565b606754604080516301f3c06360e21b8152905160009261010090046001600160a01b0316916307cf018c916004808301926020929190829003018186803b1580156139a557600080fd5b505afa1580156139b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906139dd9190614264565b6001600160a01b03161415613a045760405162461bcd60e51b81526004016107129061451c565b600160666000828254613a179190614670565b9091555050606654606754604051633761c52760e11b81526001600160a01b03848116600483015261010090920490911690636ec38a4e9060240160206040518083038186803b158015613a6a57600080fd5b505afa158015613a7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613aa29190614434565b613abe5760405162461bcd60e51b815260040161071290614540565b6001600160a01b038216600090815260686020526040902060020154613b175760405162461bcd60e51b815260206004820152600e60248201526d043726561746f7220626f6e6420360941b6044820152606401610712565b6001600160a01b03821660008181526068602090815260408083206002810180546003909201829055939093558051938452908301919091527faf46e37b31310de99d1702f74e0089413810f8072b991cb092f925ae7124d4a5910160405180910390a16066548114610bd55760405162461bcd60e51b81526004016107129061460b565b600080613ba884613ef4565b905080600f0b60001480613bbf5750606a5460ff16155b15613bce576000915050613cdd565b8215613ca557613c9e670de0b6b3a7640000611de3613c07613bf8662386f26fc100006005613f65565b670de0b6b3a764000090613ce4565b606a546040516307211ef760e01b815260006004820152600f87900b6024820152604481018b90526101009091046001600160a01b0316906307211ef79060640160206040518083038186803b158015613c6057600080fd5b505afa158015613c74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613c989190614450565b90613f59565b9150613cdb565b613cd8670de0b6b3a7640000611de3613c07613cc9662386f26fc10000600a613f65565b670de0b6b3a764000090613e2a565b91505b505b9392505050565b6000613cdd8284614670565b60345460ff1615613d135760405162461bcd60e51b815260040161071290614569565b610bd5823083606760019054906101000a90046001600160a01b03166001600160a01b0316633013ce296040518163ffffffff1660e01b815260040160206040518083038186803b158015613d6757600080fd5b505afa158015613d7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d9f9190614264565b6001600160a01b0316929190613f71565b6000546201000090046001600160a01b03163314613e285760405162461bcd60e51b815260206004820152602f60248201527f4f6e6c792074686520636f6e7472616374206f776e6572206d6179207065726660448201526e37b936903a3434b99030b1ba34b7b760891b6064820152608401610712565b565b6000613cdd82846146c7565b60345460ff1615613e595760405162461bcd60e51b815260040161071290614569565b610bd58282606760019054906101000a90046001600160a01b03166001600160a01b0316633013ce296040518163ffffffff1660e01b815260040160206040518083038186803b158015613eac57600080fd5b505afa158015613ec0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ee49190614264565b6001600160a01b03169190613fc9565b606d546000906001600160a01b0383811691161415613f1557506001919050565b606b546001600160a01b0383811691161415613f3357506002919050565b606c546001600160a01b0383811691161415613f5157506003919050565b506000919050565b6000613cdd82846146a8565b6000613cdd8284614688565b610900846323b872dd60e01b858585604051602401613f92939291906144c5565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152613ffe565b6040516001600160a01b038316602482015260448101829052613ff990849063a9059cbb60e01b90606401613f92565b505050565b6000614053826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166140d09092919063ffffffff16565b805190915015613ff957808060200190518101906140719190614434565b613ff95760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610712565b60606140df84846000856140e7565b949350505050565b6060824710156141485760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610712565b843b6141965760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610712565b600080866001600160a01b031685876040516141b291906144a9565b60006040518083038185875af1925050503d80600081146141ef576040519150601f19603f3d011682016040523d82523d6000602084013e6141f4565b606091505b509150915061420482828661420f565b979650505050505050565b6060831561421e575081613cdd565b82511561422e5782518084602001fd5b8160405162461bcd60e51b815260040161071291906144e9565b600060208284031215614259578081fd5b8135613cdd81614720565b600060208284031215614275578081fd5b8151613cdd81614720565b60008060408385031215614292578081fd5b823561429d81614720565b915060208301356142ad81614720565b809150509250929050565b600080600080600060a086880312156142cf578081fd5b85356142da81614720565b945060208601356142ea81614720565b935060408601356142fa81614720565b9250606086013561430a81614720565b9150608086013561431a81614738565b809150509295509295909350565b60008060006060848603121561433c578283fd5b833561434781614720565b9250602084013561435781614720565b929592945050506040919091013590565b600080600080600060a0868803121561437f578081fd5b853561438a81614720565b9450602086013561439a81614720565b93506040860135925060608601359150608086013561431a81614720565b600080604083850312156143ca578182fd5b82356143d581614720565b946020939093013593505050565b600080600080600060a086880312156143fa578081fd5b853561440581614720565b945060208601359350604086013561441c81614720565b94979396509394606081013594506080013592915050565b600060208284031215614445578081fd5b8151613cdd81614738565b600060208284031215614461578081fd5b5051919050565b60008060006060848603121561447c578283fd5b83359250602084013561448e81614720565b9150604084013561449e81614738565b809150509250925092565b600082516144bb8184602087016146de565b9190910192915050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b60208152600082518060208401526145088160408501602087016146de565b601f01601f19169190910160400192915050565b6020808252600a9082015269496e76616c6964204f4360b01b604082015260600190565b6020808252600f908201526e496e76616c6964206164647265737360881b604082015260600190565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6020808252600f908201526e24b73b30b634b21026b0b730b3b2b960891b604082015260600190565b602080825260099082015268426f6e64207a65726f60b81b604082015260600190565b6020808252601290820152712737ba1030b1ba34bb329036b0b935b2ba1760711b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601490820152732737ba1027a197a6b0b730b3b2b917a7bbb732b960611b604082015260600190565b600082198211156146835761468361470a565b500190565b6000826146a357634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156146c2576146c261470a565b500290565b6000828210156146d9576146d961470a565b500390565b60005b838110156146f95781810151838201526020016146e1565b838111156109005750506000910152565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461473557600080fd5b50565b801515811461473557600080fdfe60e37aa44e6b2c1aba5879edbe0d4326eff064606eb49d2d8f5d38fe8537e7d0a26469706673582212209809d050a8708afc72d1246364e67d346ee280946e201640850d7caa27a2a73f64736f6c63430008040033

Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading