diff --git a/contracts/BinaryOption.sol b/contracts/BinaryOption.sol deleted file mode 100644 index 54fe3f18ad..0000000000 --- a/contracts/BinaryOption.sol +++ /dev/null @@ -1,223 +0,0 @@ -pragma solidity ^0.5.16; - -// Inheritance -import "./interfaces/IERC20.sol"; -import "./interfaces/IBinaryOption.sol"; - -// Libraries -import "./SafeDecimalMath.sol"; - -// Internal references -import "./BinaryOptionMarket.sol"; - -// https://docs.synthetix.io/contracts/source/contracts/binaryoption -contract BinaryOption is IERC20, IBinaryOption { - /* ========== LIBRARIES ========== */ - - using SafeMath for uint; - using SafeDecimalMath for uint; - - /* ========== STATE VARIABLES ========== */ - - string public constant name = "SNX Binary Option"; - string public constant symbol = "sOPT"; - uint8 public constant decimals = 18; - - BinaryOptionMarket public market; - - mapping(address => uint) public bidOf; - uint public totalBids; - - mapping(address => uint) public balanceOf; - uint public totalSupply; - - // The argument order is allowance[owner][spender] - mapping(address => mapping(address => uint)) public allowance; - - // Enforce a 1 cent minimum bid balance - uint internal constant _MINIMUM_BID = 1e16; - - /* ========== CONSTRUCTOR ========== */ - - constructor(address initialBidder, uint initialBid) public { - market = BinaryOptionMarket(msg.sender); - bidOf[initialBidder] = initialBid; - totalBids = initialBid; - } - - /* ========== VIEWS ========== */ - - function _claimableBalanceOf( - uint _bid, - uint price, - uint exercisableDeposits - ) internal view returns (uint) { - uint owed = _bid.divideDecimal(price); - uint supply = _totalClaimableSupply(exercisableDeposits); - - /* The last claimant might be owed slightly more or less than the actual remaining deposit - based on rounding errors with the price. - Therefore if the user's bid is the entire rest of the pot, just give them everything that's left. - If there is no supply, then this option lost, and we'll return 0. - */ - if ((_bid == totalBids && _bid != 0) || supply == 0) { - return supply; - } - - /* Note that option supply on the losing side and deposits can become decoupled, - but losing options are not claimable, therefore we only need to worry about - the situation where supply < owed on the winning side. - - If somehow a user who is not the last bidder is owed more than what's available, - subsequent bidders will be disadvantaged. Given that the minimum bid is 10^16 wei, - this should never occur in reality. */ - require(owed <= supply, "supply < claimable"); - return owed; - } - - function claimableBalanceOf(address account) external view returns (uint) { - (uint price, uint exercisableDeposits) = market.senderPriceAndExercisableDeposits(); - return _claimableBalanceOf(bidOf[account], price, exercisableDeposits); - } - - function _totalClaimableSupply(uint exercisableDeposits) internal view returns (uint) { - uint _totalSupply = totalSupply; - // We'll avoid throwing an exception here to avoid breaking any dapps, but this case - // should never occur given the minimum bid size. - if (exercisableDeposits <= _totalSupply) { - return 0; - } - return exercisableDeposits.sub(_totalSupply); - } - - function totalClaimableSupply() external view returns (uint) { - (, uint exercisableDeposits) = market.senderPriceAndExercisableDeposits(); - return _totalClaimableSupply(exercisableDeposits); - } - - /* ========== MUTATIVE FUNCTIONS ========== */ - - function _requireMinimumBid(uint bid) internal pure returns (uint) { - require(bid >= _MINIMUM_BID || bid == 0, "Balance < $0.01"); - return bid; - } - - // This must only be invoked during bidding. - function bid(address bidder, uint newBid) external onlyMarket { - bidOf[bidder] = _requireMinimumBid(bidOf[bidder].add(newBid)); - totalBids = totalBids.add(newBid); - } - - // This must only be invoked during bidding. - function refund(address bidder, uint newRefund) external onlyMarket { - // The safe subtraction will catch refunds that are too large. - bidOf[bidder] = _requireMinimumBid(bidOf[bidder].sub(newRefund)); - totalBids = totalBids.sub(newRefund); - } - - // This must only be invoked after bidding. - function claim( - address claimant, - uint price, - uint depositsRemaining - ) external onlyMarket returns (uint optionsClaimed) { - uint _bid = bidOf[claimant]; - uint claimable = _claimableBalanceOf(_bid, price, depositsRemaining); - // No options to claim? Nothing happens. - if (claimable == 0) { - return 0; - } - - totalBids = totalBids.sub(_bid); - bidOf[claimant] = 0; - - totalSupply = totalSupply.add(claimable); - balanceOf[claimant] = balanceOf[claimant].add(claimable); // Increment rather than assigning since a transfer may have occurred. - - emit Transfer(address(0), claimant, claimable); - emit Issued(claimant, claimable); - - return claimable; - } - - // This must only be invoked after maturity. - function exercise(address claimant) external onlyMarket { - uint balance = balanceOf[claimant]; - - if (balance == 0) { - return; - } - - balanceOf[claimant] = 0; - totalSupply = totalSupply.sub(balance); - - emit Transfer(claimant, address(0), balance); - emit Burned(claimant, balance); - } - - // This must only be invoked after the exercise window is complete. - // Note that any options which have not been exercised will linger. - function expire(address payable beneficiary) external onlyMarket { - selfdestruct(beneficiary); - } - - /* ---------- ERC20 Functions ---------- */ - - // This should only operate after bidding; - // Since options can't be claimed until after bidding, all balances are zero until that time. - // So we don't need to explicitly check the timestamp to prevent transfers. - function _transfer( - address _from, - address _to, - uint _value - ) internal returns (bool success) { - market.requireActiveAndUnpaused(); - require(_to != address(0) && _to != address(this), "Invalid address"); - - uint fromBalance = balanceOf[_from]; - require(_value <= fromBalance, "Insufficient balance"); - - balanceOf[_from] = fromBalance.sub(_value); - balanceOf[_to] = balanceOf[_to].add(_value); - - emit Transfer(_from, _to, _value); - return true; - } - - function transfer(address _to, uint _value) external returns (bool success) { - return _transfer(msg.sender, _to, _value); - } - - function transferFrom( - address _from, - address _to, - uint _value - ) external returns (bool success) { - uint fromAllowance = allowance[_from][msg.sender]; - require(_value <= fromAllowance, "Insufficient allowance"); - - allowance[_from][msg.sender] = fromAllowance.sub(_value); - return _transfer(_from, _to, _value); - } - - function approve(address _spender, uint _value) external returns (bool success) { - require(_spender != address(0)); - allowance[msg.sender][_spender] = _value; - emit Approval(msg.sender, _spender, _value); - return true; - } - - /* ========== MODIFIERS ========== */ - - modifier onlyMarket() { - require(msg.sender == address(market), "Only market allowed"); - _; - } - - /* ========== EVENTS ========== */ - - event Issued(address indexed account, uint value); - event Burned(address indexed account, uint value); - event Transfer(address indexed from, address indexed to, uint value); - event Approval(address indexed owner, address indexed spender, uint value); -} diff --git a/contracts/BinaryOptionMarket.sol b/contracts/BinaryOptionMarket.sol deleted file mode 100644 index 06928f7f00..0000000000 --- a/contracts/BinaryOptionMarket.sol +++ /dev/null @@ -1,641 +0,0 @@ -pragma solidity ^0.5.16; - -// Inheritance -import "./Owned.sol"; -import "./MixinResolver.sol"; -import "./interfaces/IBinaryOptionMarket.sol"; - -// Libraries -import "./SafeDecimalMath.sol"; - -// Internal references -import "./BinaryOptionMarketManager.sol"; -import "./BinaryOption.sol"; -import "./interfaces/IExchangeRates.sol"; -import "./interfaces/IERC20.sol"; -import "./interfaces/IFeePool.sol"; - -// https://docs.synthetix.io/contracts/source/contracts/binaryoptionmarket -contract BinaryOptionMarket is Owned, MixinResolver, IBinaryOptionMarket { - /* ========== LIBRARIES ========== */ - - using SafeMath for uint; - using SafeDecimalMath for uint; - - /* ========== TYPES ========== */ - - struct Options { - BinaryOption long; - BinaryOption short; - } - - struct Prices { - uint long; - uint short; - } - - struct Times { - uint biddingEnd; - uint maturity; - uint expiry; - } - - struct OracleDetails { - bytes32 key; - uint strikePrice; - uint finalPrice; - } - - /* ========== STATE VARIABLES ========== */ - - Options public options; - Prices public prices; - Times public times; - OracleDetails public oracleDetails; - BinaryOptionMarketManager.Fees public fees; - BinaryOptionMarketManager.CreatorLimits public creatorLimits; - - // `deposited` tracks the sum of open bids on short and long, plus withheld refund fees. - // This must explicitly be kept, in case tokens are transferred to the contract directly. - uint public deposited; - address public creator; - bool public resolved; - bool public refundsEnabled; - - uint internal _feeMultiplier; - - /* ---------- Address Resolver Configuration ---------- */ - - bytes32 internal constant CONTRACT_SYSTEMSTATUS = "SystemStatus"; - bytes32 internal constant CONTRACT_EXRATES = "ExchangeRates"; - bytes32 internal constant CONTRACT_SYNTHSUSD = "SynthsUSD"; - bytes32 internal constant CONTRACT_FEEPOOL = "FeePool"; - - /* ========== CONSTRUCTOR ========== */ - - constructor( - address _owner, - address _creator, - address _resolver, - uint[2] memory _creatorLimits, // [capitalRequirement, skewLimit] - bytes32 _oracleKey, - uint _strikePrice, - bool _refundsEnabled, - uint[3] memory _times, // [biddingEnd, maturity, expiry] - uint[2] memory _bids, // [longBid, shortBid] - uint[3] memory _fees // [poolFee, creatorFee, refundFee] - ) public Owned(_owner) MixinResolver(_resolver) { - creator = _creator; - creatorLimits = BinaryOptionMarketManager.CreatorLimits(_creatorLimits[0], _creatorLimits[1]); - - oracleDetails = OracleDetails(_oracleKey, _strikePrice, 0); - times = Times(_times[0], _times[1], _times[2]); - - refundsEnabled = _refundsEnabled; - - (uint longBid, uint shortBid) = (_bids[0], _bids[1]); - _checkCreatorLimits(longBid, shortBid); - emit Bid(Side.Long, _creator, longBid); - emit Bid(Side.Short, _creator, shortBid); - - // Note that the initial deposit of synths must be made by the manager, otherwise the contract's assumed - // deposits will fall out of sync with its actual balance. Similarly the total system deposits must be updated in the manager. - // A balance check isn't performed here since the manager doesn't know the address of the new contract until after it is created. - uint initialDeposit = longBid.add(shortBid); - deposited = initialDeposit; - - (uint poolFee, uint creatorFee) = (_fees[0], _fees[1]); - fees = BinaryOptionMarketManager.Fees(poolFee, creatorFee, _fees[2]); - _feeMultiplier = SafeDecimalMath.unit().sub(poolFee.add(creatorFee)); - - // Compute the prices now that the fees and deposits have been set. - _updatePrices(longBid, shortBid, initialDeposit); - - // Instantiate the options themselves - options.long = new BinaryOption(_creator, longBid); - options.short = new BinaryOption(_creator, shortBid); - } - - /* ========== VIEWS ========== */ - - function resolverAddressesRequired() public view returns (bytes32[] memory addresses) { - addresses = new bytes32[](4); - addresses[0] = CONTRACT_SYSTEMSTATUS; - addresses[1] = CONTRACT_EXRATES; - addresses[2] = CONTRACT_SYNTHSUSD; - addresses[3] = CONTRACT_FEEPOOL; - } - - /* ---------- External Contracts ---------- */ - - function _systemStatus() internal view returns (ISystemStatus) { - return ISystemStatus(requireAndGetAddress(CONTRACT_SYSTEMSTATUS)); - } - - function _exchangeRates() internal view returns (IExchangeRates) { - return IExchangeRates(requireAndGetAddress(CONTRACT_EXRATES)); - } - - function _sUSD() internal view returns (IERC20) { - return IERC20(requireAndGetAddress(CONTRACT_SYNTHSUSD)); - } - - function _feePool() internal view returns (IFeePool) { - return IFeePool(requireAndGetAddress(CONTRACT_FEEPOOL)); - } - - function _manager() internal view returns (BinaryOptionMarketManager) { - return BinaryOptionMarketManager(owner); - } - - /* ---------- Phases ---------- */ - - function _biddingEnded() internal view returns (bool) { - return times.biddingEnd < now; - } - - function _matured() internal view returns (bool) { - return times.maturity < now; - } - - function _expired() internal view returns (bool) { - return resolved && (times.expiry < now || deposited == 0); - } - - function phase() external view returns (Phase) { - if (!_biddingEnded()) { - return Phase.Bidding; - } - if (!_matured()) { - return Phase.Trading; - } - if (!_expired()) { - return Phase.Maturity; - } - return Phase.Expiry; - } - - /* ---------- Market Resolution ---------- */ - - function _oraclePriceAndTimestamp() internal view returns (uint price, uint updatedAt) { - return _exchangeRates().rateAndUpdatedTime(oracleDetails.key); - } - - function oraclePriceAndTimestamp() external view returns (uint price, uint updatedAt) { - return _oraclePriceAndTimestamp(); - } - - function _isFreshPriceUpdateTime(uint timestamp) internal view returns (bool) { - (uint maxOraclePriceAge, , ) = _manager().durations(); - return (times.maturity.sub(maxOraclePriceAge)) <= timestamp; - } - - function canResolve() external view returns (bool) { - (, uint updatedAt) = _oraclePriceAndTimestamp(); - return !resolved && _matured() && _isFreshPriceUpdateTime(updatedAt); - } - - function _result() internal view returns (Side) { - uint price; - if (resolved) { - price = oracleDetails.finalPrice; - } else { - (price, ) = _oraclePriceAndTimestamp(); - } - - return oracleDetails.strikePrice <= price ? Side.Long : Side.Short; - } - - function result() external view returns (Side) { - return _result(); - } - - /* ---------- Option Prices ---------- */ - - function _computePrices( - uint longBids, - uint shortBids, - uint _deposited - ) internal view returns (uint long, uint short) { - require(longBids != 0 && shortBids != 0, "Bids must be nonzero"); - uint optionsPerSide = _exercisableDeposits(_deposited); - - // The math library rounds up on an exact half-increment -- the price on one side may be an increment too high, - // but this only implies a tiny extra quantity will go to fees. - return (longBids.divideDecimalRound(optionsPerSide), shortBids.divideDecimalRound(optionsPerSide)); - } - - function senderPriceAndExercisableDeposits() external view returns (uint price, uint exercisable) { - // When the market is not yet resolved, both sides might be able to exercise all the options. - // On the other hand, if the market has resolved, then only the winning side may exercise. - exercisable = 0; - if (!resolved || address(_option(_result())) == msg.sender) { - exercisable = _exercisableDeposits(deposited); - } - - // Send the correct price for each side of the market. - if (msg.sender == address(options.long)) { - price = prices.long; - } else if (msg.sender == address(options.short)) { - price = prices.short; - } else { - revert("Sender is not an option"); - } - } - - function pricesAfterBidOrRefund( - Side side, - uint value, - bool refund - ) external view returns (uint long, uint short) { - (uint longTotalBids, uint shortTotalBids) = _totalBids(); - // prettier-ignore - function(uint, uint) pure returns (uint) operation = refund ? SafeMath.sub : SafeMath.add; - - if (side == Side.Long) { - longTotalBids = operation(longTotalBids, value); - } else { - shortTotalBids = operation(shortTotalBids, value); - } - - if (refund) { - value = value.multiplyDecimalRound(SafeDecimalMath.unit().sub(fees.refundFee)); - } - return _computePrices(longTotalBids, shortTotalBids, operation(deposited, value)); - } - - // Returns zero if the result would be negative. See the docs for the formulae this implements. - function bidOrRefundForPrice( - Side bidSide, - Side priceSide, - uint price, - bool refund - ) external view returns (uint) { - uint adjustedPrice = price.multiplyDecimalRound(_feeMultiplier); - uint bids = _option(priceSide).totalBids(); - uint _deposited = deposited; - uint unit = SafeDecimalMath.unit(); - uint refundFeeMultiplier = unit.sub(fees.refundFee); - - if (bidSide == priceSide) { - uint depositedByPrice = _deposited.multiplyDecimalRound(adjustedPrice); - - // For refunds, the numerator is the negative of the bid case and, - // in the denominator the adjusted price has an extra factor of (1 - the refundFee). - if (refund) { - (depositedByPrice, bids) = (bids, depositedByPrice); - adjustedPrice = adjustedPrice.multiplyDecimalRound(refundFeeMultiplier); - } - - // The adjusted price is guaranteed to be less than 1: all its factors are also less than 1. - return _subToZero(depositedByPrice, bids).divideDecimalRound(unit.sub(adjustedPrice)); - } else { - uint bidsPerPrice = bids.divideDecimalRound(adjustedPrice); - - // For refunds, the numerator is the negative of the bid case. - if (refund) { - (bidsPerPrice, _deposited) = (_deposited, bidsPerPrice); - } - - uint value = _subToZero(bidsPerPrice, _deposited); - return refund ? value.divideDecimalRound(refundFeeMultiplier) : value; - } - } - - /* ---------- Option Balances and Bids ---------- */ - - function _bidsOf(address account) internal view returns (uint long, uint short) { - return (options.long.bidOf(account), options.short.bidOf(account)); - } - - function bidsOf(address account) external view returns (uint long, uint short) { - return _bidsOf(account); - } - - function _totalBids() internal view returns (uint long, uint short) { - return (options.long.totalBids(), options.short.totalBids()); - } - - function totalBids() external view returns (uint long, uint short) { - return _totalBids(); - } - - function _claimableBalancesOf(address account) internal view returns (uint long, uint short) { - return (options.long.claimableBalanceOf(account), options.short.claimableBalanceOf(account)); - } - - function claimableBalancesOf(address account) external view returns (uint long, uint short) { - return _claimableBalancesOf(account); - } - - function totalClaimableSupplies() external view returns (uint long, uint short) { - return (options.long.totalClaimableSupply(), options.short.totalClaimableSupply()); - } - - function _balancesOf(address account) internal view returns (uint long, uint short) { - return (options.long.balanceOf(account), options.short.balanceOf(account)); - } - - function balancesOf(address account) external view returns (uint long, uint short) { - return _balancesOf(account); - } - - function totalSupplies() external view returns (uint long, uint short) { - return (options.long.totalSupply(), options.short.totalSupply()); - } - - function _exercisableDeposits(uint _deposited) internal view returns (uint) { - // Fees are deducted at resolution, so remove them if we're still bidding or trading. - return resolved ? _deposited : _deposited.multiplyDecimalRound(_feeMultiplier); - } - - function exercisableDeposits() external view returns (uint) { - return _exercisableDeposits(deposited); - } - - /* ---------- Utilities ---------- */ - - function _chooseSide( - Side side, - uint longValue, - uint shortValue - ) internal pure returns (uint) { - if (side == Side.Long) { - return longValue; - } - return shortValue; - } - - function _option(Side side) internal view returns (BinaryOption) { - if (side == Side.Long) { - return options.long; - } - return options.short; - } - - // Returns zero if the result would be negative. - function _subToZero(uint a, uint b) internal pure returns (uint) { - return a < b ? 0 : a.sub(b); - } - - function _checkCreatorLimits(uint longBid, uint shortBid) internal view { - uint totalBid = longBid.add(shortBid); - require(creatorLimits.capitalRequirement <= totalBid, "Insufficient capital"); - uint skewLimit = creatorLimits.skewLimit; - require( - skewLimit <= longBid.divideDecimal(totalBid) && skewLimit <= shortBid.divideDecimal(totalBid), - "Bids too skewed" - ); - } - - function _incrementDeposited(uint value) internal returns (uint _deposited) { - _deposited = deposited.add(value); - deposited = _deposited; - _manager().incrementTotalDeposited(value); - } - - function _decrementDeposited(uint value) internal returns (uint _deposited) { - _deposited = deposited.sub(value); - deposited = _deposited; - _manager().decrementTotalDeposited(value); - } - - function _requireManagerNotPaused() internal view { - require(!_manager().paused(), "This action cannot be performed while the contract is paused"); - } - - function requireActiveAndUnpaused() external view { - _systemStatus().requireSystemActive(); - _requireManagerNotPaused(); - } - - /* ========== MUTATIVE FUNCTIONS ========== */ - - /* ---------- Bidding and Refunding ---------- */ - - function _updatePrices( - uint longBids, - uint shortBids, - uint _deposited - ) internal { - (uint256 longPrice, uint256 shortPrice) = _computePrices(longBids, shortBids, _deposited); - prices = Prices(longPrice, shortPrice); - emit PricesUpdated(longPrice, shortPrice); - } - - function bid(Side side, uint value) external duringBidding { - if (value == 0) { - return; - } - - _option(side).bid(msg.sender, value); - emit Bid(side, msg.sender, value); - - uint _deposited = _incrementDeposited(value); - _sUSD().transferFrom(msg.sender, address(this), value); - - (uint longTotalBids, uint shortTotalBids) = _totalBids(); - _updatePrices(longTotalBids, shortTotalBids, _deposited); - } - - function refund(Side side, uint value) external duringBidding returns (uint refundMinusFee) { - require(refundsEnabled, "Refunds disabled"); - if (value == 0) { - return 0; - } - - // Require the market creator to leave sufficient capital in the market. - if (msg.sender == creator) { - (uint thisBid, uint thatBid) = _bidsOf(msg.sender); - if (side == Side.Short) { - (thisBid, thatBid) = (thatBid, thisBid); - } - _checkCreatorLimits(thisBid.sub(value), thatBid); - } - - // Safe subtraction here and in related contracts will fail if either the - // total supply, deposits, or wallet balance are too small to support the refund. - refundMinusFee = value.multiplyDecimalRound(SafeDecimalMath.unit().sub(fees.refundFee)); - - _option(side).refund(msg.sender, value); - emit Refund(side, msg.sender, refundMinusFee, value.sub(refundMinusFee)); - - uint _deposited = _decrementDeposited(refundMinusFee); - _sUSD().transfer(msg.sender, refundMinusFee); - - (uint longTotalBids, uint shortTotalBids) = _totalBids(); - _updatePrices(longTotalBids, shortTotalBids, _deposited); - } - - /* ---------- Market Resolution ---------- */ - - function resolve() external onlyOwner afterMaturity systemActive managerNotPaused { - require(!resolved, "Market already resolved"); - - // We don't need to perform stale price checks, so long as the price was - // last updated recently enough before the maturity date. - (uint price, uint updatedAt) = _oraclePriceAndTimestamp(); - require(_isFreshPriceUpdateTime(updatedAt), "Price is stale"); - - oracleDetails.finalPrice = price; - resolved = true; - - // Now remit any collected fees. - // Since the constructor enforces that creatorFee + poolFee < 1, the balance - // in the contract will be sufficient to cover these transfers. - IERC20 sUSD = _sUSD(); - - uint _deposited = deposited; - uint poolFees = _deposited.multiplyDecimalRound(fees.poolFee); - uint creatorFees = _deposited.multiplyDecimalRound(fees.creatorFee); - _decrementDeposited(creatorFees.add(poolFees)); - sUSD.transfer(_feePool().FEE_ADDRESS(), poolFees); - sUSD.transfer(creator, creatorFees); - - emit MarketResolved(_result(), price, updatedAt, deposited, poolFees, creatorFees); - } - - /* ---------- Claiming and Exercising Options ---------- */ - - function _claimOptions() - internal - systemActive - managerNotPaused - afterBidding - returns (uint longClaimed, uint shortClaimed) - { - uint exercisable = _exercisableDeposits(deposited); - Side outcome = _result(); - bool _resolved = resolved; - - // Only claim options if we aren't resolved, and only claim the winning side. - uint longOptions; - uint shortOptions; - if (!_resolved || outcome == Side.Long) { - longOptions = options.long.claim(msg.sender, prices.long, exercisable); - } - if (!_resolved || outcome == Side.Short) { - shortOptions = options.short.claim(msg.sender, prices.short, exercisable); - } - - require(longOptions != 0 || shortOptions != 0, "Nothing to claim"); - emit OptionsClaimed(msg.sender, longOptions, shortOptions); - return (longOptions, shortOptions); - } - - function claimOptions() external returns (uint longClaimed, uint shortClaimed) { - return _claimOptions(); - } - - function exerciseOptions() external returns (uint) { - // The market must be resolved if it has not been. - if (!resolved) { - _manager().resolveMarket(address(this)); - } - - // If there are options to be claimed, claim them and proceed. - (uint claimableLong, uint claimableShort) = _claimableBalancesOf(msg.sender); - if (claimableLong != 0 || claimableShort != 0) { - _claimOptions(); - } - - // If the account holds no options, revert. - (uint longBalance, uint shortBalance) = _balancesOf(msg.sender); - require(longBalance != 0 || shortBalance != 0, "Nothing to exercise"); - - // Each option only needs to be exercised if the account holds any of it. - if (longBalance != 0) { - options.long.exercise(msg.sender); - } - if (shortBalance != 0) { - options.short.exercise(msg.sender); - } - - // Only pay out the side that won. - uint payout = _chooseSide(_result(), longBalance, shortBalance); - emit OptionsExercised(msg.sender, payout); - if (payout != 0) { - _decrementDeposited(payout); - _sUSD().transfer(msg.sender, payout); - } - return payout; - } - - /* ---------- Market Expiry ---------- */ - - function _selfDestruct(address payable beneficiary) internal { - uint _deposited = deposited; - if (_deposited != 0) { - _decrementDeposited(_deposited); - } - - // Transfer the balance rather than the deposit value in case there are any synths left over - // from direct transfers. - IERC20 sUSD = _sUSD(); - uint balance = sUSD.balanceOf(address(this)); - if (balance != 0) { - sUSD.transfer(beneficiary, balance); - } - - // Destroy the option tokens before destroying the market itself. - options.long.expire(beneficiary); - options.short.expire(beneficiary); - selfdestruct(beneficiary); - } - - function cancel(address payable beneficiary) external onlyOwner duringBidding { - (uint longTotalBids, uint shortTotalBids) = _totalBids(); - (uint creatorLongBids, uint creatorShortBids) = _bidsOf(creator); - bool cancellable = longTotalBids == creatorLongBids && shortTotalBids == creatorShortBids; - require(cancellable, "Not cancellable"); - _selfDestruct(beneficiary); - } - - function expire(address payable beneficiary) external onlyOwner { - require(_expired(), "Unexpired options remaining"); - _selfDestruct(beneficiary); - } - - /* ========== MODIFIERS ========== */ - - modifier duringBidding() { - require(!_biddingEnded(), "Bidding inactive"); - _; - } - - modifier afterBidding() { - require(_biddingEnded(), "Bidding incomplete"); - _; - } - - modifier afterMaturity() { - require(_matured(), "Not yet mature"); - _; - } - - modifier systemActive() { - _systemStatus().requireSystemActive(); - _; - } - - modifier managerNotPaused() { - _requireManagerNotPaused(); - _; - } - - /* ========== EVENTS ========== */ - - event Bid(Side side, address indexed account, uint value); - event Refund(Side side, address indexed account, uint value, uint fee); - event PricesUpdated(uint longPrice, uint shortPrice); - event MarketResolved( - Side result, - uint oraclePrice, - uint oracleTimestamp, - uint deposited, - uint poolFees, - uint creatorFees - ); - event OptionsClaimed(address indexed account, uint longOptions, uint shortOptions); - event OptionsExercised(address indexed account, uint value); -} diff --git a/contracts/BinaryOptionMarketData.sol b/contracts/BinaryOptionMarketData.sol deleted file mode 100644 index a1267f3a45..0000000000 --- a/contracts/BinaryOptionMarketData.sol +++ /dev/null @@ -1,114 +0,0 @@ -pragma solidity ^0.5.16; -pragma experimental ABIEncoderV2; - -// Inheritance -import "./BinaryOption.sol"; -import "./BinaryOptionMarket.sol"; -import "./BinaryOptionMarketManager.sol"; - -// https://docs.synthetix.io/contracts/source/contracts/binaryoptionmarketdata -contract BinaryOptionMarketData { - struct OptionValues { - uint long; - uint short; - } - - struct Deposits { - uint deposited; - uint exercisableDeposits; - } - - struct Resolution { - bool resolved; - bool canResolve; - } - - struct OraclePriceAndTimestamp { - uint price; - uint updatedAt; - } - - // used for things that don't change over the lifetime of the contract - struct MarketParameters { - address creator; - BinaryOptionMarket.Options options; - BinaryOptionMarket.Times times; - BinaryOptionMarket.OracleDetails oracleDetails; - BinaryOptionMarketManager.Fees fees; - BinaryOptionMarketManager.CreatorLimits creatorLimits; - } - - struct MarketData { - OraclePriceAndTimestamp oraclePriceAndTimestamp; - BinaryOptionMarket.Prices prices; - Deposits deposits; - Resolution resolution; - BinaryOptionMarket.Phase phase; - BinaryOptionMarket.Side result; - OptionValues totalBids; - OptionValues totalClaimableSupplies; - OptionValues totalSupplies; - } - - struct AccountData { - OptionValues bids; - OptionValues claimable; - OptionValues balances; - } - - function getMarketParameters(BinaryOptionMarket market) public view returns (MarketParameters memory) { - (BinaryOption long, BinaryOption short) = market.options(); - (uint biddingEndDate, uint maturityDate, uint expiryDate) = market.times(); - (bytes32 key, uint strikePrice, uint finalPrice) = market.oracleDetails(); - (uint poolFee, uint creatorFee, uint refundFee) = market.fees(); - - MarketParameters memory data = - MarketParameters( - market.creator(), - BinaryOptionMarket.Options(long, short), - BinaryOptionMarket.Times(biddingEndDate, maturityDate, expiryDate), - BinaryOptionMarket.OracleDetails(key, strikePrice, finalPrice), - BinaryOptionMarketManager.Fees(poolFee, creatorFee, refundFee), - BinaryOptionMarketManager.CreatorLimits(0, 0) - ); - - // Stack too deep otherwise. - (uint capitalRequirement, uint skewLimit) = market.creatorLimits(); - data.creatorLimits = BinaryOptionMarketManager.CreatorLimits(capitalRequirement, skewLimit); - return data; - } - - function getMarketData(BinaryOptionMarket market) public view returns (MarketData memory) { - (uint price, uint updatedAt) = market.oraclePriceAndTimestamp(); - (uint longClaimable, uint shortClaimable) = market.totalClaimableSupplies(); - (uint longSupply, uint shortSupply) = market.totalSupplies(); - (uint longBids, uint shortBids) = market.totalBids(); - (uint longPrice, uint shortPrice) = market.prices(); - - return - MarketData( - OraclePriceAndTimestamp(price, updatedAt), - BinaryOptionMarket.Prices(longPrice, shortPrice), - Deposits(market.deposited(), market.exercisableDeposits()), - Resolution(market.resolved(), market.canResolve()), - market.phase(), - market.result(), - OptionValues(longBids, shortBids), - OptionValues(longClaimable, shortClaimable), - OptionValues(longSupply, shortSupply) - ); - } - - function getAccountMarketData(BinaryOptionMarket market, address account) public view returns (AccountData memory) { - (uint longBid, uint shortBid) = market.bidsOf(account); - (uint longClaimable, uint shortClaimable) = market.claimableBalancesOf(account); - (uint longBalance, uint shortBalance) = market.balancesOf(account); - - return - AccountData( - OptionValues(longBid, shortBid), - OptionValues(longClaimable, shortClaimable), - OptionValues(longBalance, shortBalance) - ); - } -} diff --git a/contracts/BinaryOptionMarketFactory.sol b/contracts/BinaryOptionMarketFactory.sol deleted file mode 100644 index e86ce5e2cc..0000000000 --- a/contracts/BinaryOptionMarketFactory.sol +++ /dev/null @@ -1,64 +0,0 @@ -pragma solidity ^0.5.16; - -// Inheritance -import "./Owned.sol"; -import "./MixinResolver.sol"; - -// Internal references -import "./BinaryOptionMarket.sol"; - -// https://docs.synthetix.io/contracts/source/contracts/binaryoptionmarketfactory -contract BinaryOptionMarketFactory is Owned, MixinResolver { - /* ========== STATE VARIABLES ========== */ - - /* ---------- Address Resolver Configuration ---------- */ - - bytes32 internal constant CONTRACT_BINARYOPTIONMARKETMANAGER = "BinaryOptionMarketManager"; - - /* ========== CONSTRUCTOR ========== */ - - constructor(address _owner, address _resolver) public Owned(_owner) MixinResolver(_resolver) {} - - /* ========== VIEWS ========== */ - - function resolverAddressesRequired() public view returns (bytes32[] memory addresses) { - addresses = new bytes32[](1); - addresses[0] = CONTRACT_BINARYOPTIONMARKETMANAGER; - } - - /* ---------- Related Contracts ---------- */ - - function _manager() internal view returns (address) { - return requireAndGetAddress(CONTRACT_BINARYOPTIONMARKETMANAGER); - } - - /* ========== MUTATIVE FUNCTIONS ========== */ - - function createMarket( - address creator, - uint[2] calldata creatorLimits, - bytes32 oracleKey, - uint strikePrice, - bool refundsEnabled, - uint[3] calldata times, // [biddingEnd, maturity, expiry] - uint[2] calldata bids, // [longBid, shortBid] - uint[3] calldata fees // [poolFee, creatorFee, refundFee] - ) external returns (BinaryOptionMarket) { - address manager = _manager(); - require(address(manager) == msg.sender, "Only permitted by the manager."); - - return - new BinaryOptionMarket( - manager, - creator, - address(resolver), - creatorLimits, - oracleKey, - strikePrice, - refundsEnabled, - times, - bids, - fees - ); - } -} diff --git a/contracts/BinaryOptionMarketManager.sol b/contracts/BinaryOptionMarketManager.sol deleted file mode 100644 index d259bb8a27..0000000000 --- a/contracts/BinaryOptionMarketManager.sol +++ /dev/null @@ -1,440 +0,0 @@ -pragma solidity ^0.5.16; - -// Inheritance -import "./Owned.sol"; -import "./Pausable.sol"; -import "./MixinResolver.sol"; -import "./interfaces/IBinaryOptionMarketManager.sol"; - -// Libraries -import "./AddressSetLib.sol"; -import "./SafeDecimalMath.sol"; - -// Internal references -import "./BinaryOptionMarketFactory.sol"; -import "./BinaryOptionMarket.sol"; -import "./interfaces/IBinaryOptionMarket.sol"; -import "./interfaces/IExchangeRates.sol"; -import "./interfaces/ISystemStatus.sol"; -import "./interfaces/IERC20.sol"; - -// https://docs.synthetix.io/contracts/source/contracts/binaryoptionmarketmanager -contract BinaryOptionMarketManager is Owned, Pausable, MixinResolver, IBinaryOptionMarketManager { - /* ========== LIBRARIES ========== */ - - using SafeMath for uint; - using AddressSetLib for AddressSetLib.AddressSet; - - /* ========== TYPES ========== */ - - struct Fees { - uint poolFee; - uint creatorFee; - uint refundFee; - } - - struct Durations { - uint maxOraclePriceAge; - uint expiryDuration; - uint maxTimeToMaturity; - } - - struct CreatorLimits { - uint capitalRequirement; - uint skewLimit; - } - - /* ========== STATE VARIABLES ========== */ - - Fees public fees; - Durations public durations; - CreatorLimits public creatorLimits; - - bool public marketCreationEnabled = true; - uint public totalDeposited; - - AddressSetLib.AddressSet internal _activeMarkets; - AddressSetLib.AddressSet internal _maturedMarkets; - - BinaryOptionMarketManager internal _migratingManager; - - /* ---------- Address Resolver Configuration ---------- */ - - bytes32 internal constant CONTRACT_SYSTEMSTATUS = "SystemStatus"; - bytes32 internal constant CONTRACT_SYNTHSUSD = "SynthsUSD"; - bytes32 internal constant CONTRACT_EXRATES = "ExchangeRates"; - bytes32 internal constant CONTRACT_BINARYOPTIONMARKETFACTORY = "BinaryOptionMarketFactory"; - - /* ========== CONSTRUCTOR ========== */ - - constructor( - address _owner, - address _resolver, - uint _maxOraclePriceAge, - uint _expiryDuration, - uint _maxTimeToMaturity, - uint _creatorCapitalRequirement, - uint _creatorSkewLimit, - uint _poolFee, - uint _creatorFee, - uint _refundFee - ) public Owned(_owner) Pausable() MixinResolver(_resolver) { - // Temporarily change the owner so that the setters don't revert. - owner = msg.sender; - setExpiryDuration(_expiryDuration); - setMaxOraclePriceAge(_maxOraclePriceAge); - setMaxTimeToMaturity(_maxTimeToMaturity); - setCreatorCapitalRequirement(_creatorCapitalRequirement); - setCreatorSkewLimit(_creatorSkewLimit); - setPoolFee(_poolFee); - setCreatorFee(_creatorFee); - setRefundFee(_refundFee); - owner = _owner; - } - - /* ========== VIEWS ========== */ - - function resolverAddressesRequired() public view returns (bytes32[] memory addresses) { - addresses = new bytes32[](4); - addresses[0] = CONTRACT_SYSTEMSTATUS; - addresses[1] = CONTRACT_SYNTHSUSD; - addresses[2] = CONTRACT_EXRATES; - addresses[3] = CONTRACT_BINARYOPTIONMARKETFACTORY; - } - - /* ---------- Related Contracts ---------- */ - - function _systemStatus() internal view returns (ISystemStatus) { - return ISystemStatus(requireAndGetAddress(CONTRACT_SYSTEMSTATUS)); - } - - function _sUSD() internal view returns (IERC20) { - return IERC20(requireAndGetAddress(CONTRACT_SYNTHSUSD)); - } - - function _exchangeRates() internal view returns (IExchangeRates) { - return IExchangeRates(requireAndGetAddress(CONTRACT_EXRATES)); - } - - function _factory() internal view returns (BinaryOptionMarketFactory) { - return BinaryOptionMarketFactory(requireAndGetAddress(CONTRACT_BINARYOPTIONMARKETFACTORY)); - } - - /* ---------- Market Information ---------- */ - - function _isKnownMarket(address candidate) internal view returns (bool) { - return _activeMarkets.contains(candidate) || _maturedMarkets.contains(candidate); - } - - function numActiveMarkets() external view returns (uint) { - return _activeMarkets.elements.length; - } - - function activeMarkets(uint index, uint pageSize) external view returns (address[] memory) { - return _activeMarkets.getPage(index, pageSize); - } - - function numMaturedMarkets() external view returns (uint) { - return _maturedMarkets.elements.length; - } - - function maturedMarkets(uint index, uint pageSize) external view returns (address[] memory) { - return _maturedMarkets.getPage(index, pageSize); - } - - function _isValidKey(bytes32 oracleKey) internal view returns (bool) { - IExchangeRates exchangeRates = _exchangeRates(); - - // If it has a rate, then it's possibly a valid key - if (exchangeRates.rateForCurrency(oracleKey) != 0) { - // But not sUSD - if (oracleKey == "sUSD") { - return false; - } - - // and not inverse rates - (uint entryPoint, , , , ) = exchangeRates.inversePricing(oracleKey); - if (entryPoint != 0) { - return false; - } - - return true; - } - - return false; - } - - /* ========== MUTATIVE FUNCTIONS ========== */ - - /* ---------- Setters ---------- */ - - function setMaxOraclePriceAge(uint _maxOraclePriceAge) public onlyOwner { - durations.maxOraclePriceAge = _maxOraclePriceAge; - emit MaxOraclePriceAgeUpdated(_maxOraclePriceAge); - } - - function setExpiryDuration(uint _expiryDuration) public onlyOwner { - durations.expiryDuration = _expiryDuration; - emit ExpiryDurationUpdated(_expiryDuration); - } - - function setMaxTimeToMaturity(uint _maxTimeToMaturity) public onlyOwner { - durations.maxTimeToMaturity = _maxTimeToMaturity; - emit MaxTimeToMaturityUpdated(_maxTimeToMaturity); - } - - function setPoolFee(uint _poolFee) public onlyOwner { - uint totalFee = _poolFee + fees.creatorFee; - require(totalFee < SafeDecimalMath.unit(), "Total fee must be less than 100%."); - require(0 < totalFee, "Total fee must be nonzero."); - fees.poolFee = _poolFee; - emit PoolFeeUpdated(_poolFee); - } - - function setCreatorFee(uint _creatorFee) public onlyOwner { - uint totalFee = _creatorFee + fees.poolFee; - require(totalFee < SafeDecimalMath.unit(), "Total fee must be less than 100%."); - require(0 < totalFee, "Total fee must be nonzero."); - fees.creatorFee = _creatorFee; - emit CreatorFeeUpdated(_creatorFee); - } - - function setRefundFee(uint _refundFee) public onlyOwner { - require(_refundFee <= SafeDecimalMath.unit(), "Refund fee must be no greater than 100%."); - fees.refundFee = _refundFee; - emit RefundFeeUpdated(_refundFee); - } - - function setCreatorCapitalRequirement(uint _creatorCapitalRequirement) public onlyOwner { - creatorLimits.capitalRequirement = _creatorCapitalRequirement; - emit CreatorCapitalRequirementUpdated(_creatorCapitalRequirement); - } - - function setCreatorSkewLimit(uint _creatorSkewLimit) public onlyOwner { - require(_creatorSkewLimit <= SafeDecimalMath.unit(), "Creator skew limit must be no greater than 1."); - creatorLimits.skewLimit = _creatorSkewLimit; - emit CreatorSkewLimitUpdated(_creatorSkewLimit); - } - - /* ---------- Deposit Management ---------- */ - - function incrementTotalDeposited(uint delta) external onlyActiveMarkets notPaused { - _systemStatus().requireSystemActive(); - totalDeposited = totalDeposited.add(delta); - } - - function decrementTotalDeposited(uint delta) external onlyKnownMarkets notPaused { - _systemStatus().requireSystemActive(); - // NOTE: As individual market debt is not tracked here, the underlying markets - // need to be careful never to subtract more debt than they added. - // This can't be enforced without additional state/communication overhead. - totalDeposited = totalDeposited.sub(delta); - } - - /* ---------- Market Lifecycle ---------- */ - - function createMarket( - bytes32 oracleKey, - uint strikePrice, - bool refundsEnabled, - uint[2] calldata times, // [biddingEnd, maturity] - uint[2] calldata bids // [longBid, shortBid] - ) - external - notPaused - returns ( - IBinaryOptionMarket // no support for returning BinaryOptionMarket polymorphically given the interface - ) - { - _systemStatus().requireSystemActive(); - require(marketCreationEnabled, "Market creation is disabled"); - require(_isValidKey(oracleKey), "Invalid key"); - - (uint biddingEnd, uint maturity) = (times[0], times[1]); - require(maturity <= now + durations.maxTimeToMaturity, "Maturity too far in the future"); - uint expiry = maturity.add(durations.expiryDuration); - - uint initialDeposit = bids[0].add(bids[1]); - require(now < biddingEnd, "End of bidding has passed"); - require(biddingEnd < maturity, "Maturity predates end of bidding"); - // We also require maturity < expiry. But there is no need to check this. - // Fees being in range are checked in the setters. - // The market itself validates the capital and skew requirements. - - BinaryOptionMarket market = - _factory().createMarket( - msg.sender, - [creatorLimits.capitalRequirement, creatorLimits.skewLimit], - oracleKey, - strikePrice, - refundsEnabled, - [biddingEnd, maturity, expiry], - bids, - [fees.poolFee, fees.creatorFee, fees.refundFee] - ); - market.rebuildCache(); - _activeMarkets.add(address(market)); - - // The debt can't be incremented in the new market's constructor because until construction is complete, - // the manager doesn't know its address in order to grant it permission. - totalDeposited = totalDeposited.add(initialDeposit); - _sUSD().transferFrom(msg.sender, address(market), initialDeposit); - - emit MarketCreated(address(market), msg.sender, oracleKey, strikePrice, biddingEnd, maturity, expiry); - return market; - } - - function resolveMarket(address market) external { - require(_activeMarkets.contains(market), "Not an active market"); - BinaryOptionMarket(market).resolve(); - _activeMarkets.remove(market); - _maturedMarkets.add(market); - } - - function cancelMarket(address market) external notPaused { - require(_activeMarkets.contains(market), "Not an active market"); - address creator = BinaryOptionMarket(market).creator(); - require(msg.sender == creator, "Sender not market creator"); - BinaryOptionMarket(market).cancel(msg.sender); - _activeMarkets.remove(market); - emit MarketCancelled(market); - } - - function expireMarkets(address[] calldata markets) external notPaused { - for (uint i = 0; i < markets.length; i++) { - address market = markets[i]; - - // The market itself handles decrementing the total deposits. - BinaryOptionMarket(market).expire(msg.sender); - // Note that we required that the market is known, which guarantees - // its index is defined and that the list of markets is not empty. - _maturedMarkets.remove(market); - emit MarketExpired(market); - } - } - - /* ---------- Upgrade and Administration ---------- */ - - function rebuildMarketCaches(BinaryOptionMarket[] calldata marketsToSync) external { - for (uint i = 0; i < marketsToSync.length; i++) { - address market = address(marketsToSync[i]); - - // solhint-disable avoid-low-level-calls - bytes memory payload = abi.encodeWithSignature("rebuildCache()"); - (bool success, ) = market.call(payload); - - if (!success) { - // handle legacy markets that used an old cache rebuilding logic - bytes memory payloadForLegacyCache = - abi.encodeWithSignature("setResolverAndSyncCache(address)", address(resolver)); - - // solhint-disable avoid-low-level-calls - (bool legacySuccess, ) = market.call(payloadForLegacyCache); - require(legacySuccess, "Cannot rebuild cache for market"); - } - } - } - - function setMarketCreationEnabled(bool enabled) public onlyOwner { - if (enabled != marketCreationEnabled) { - marketCreationEnabled = enabled; - emit MarketCreationEnabledUpdated(enabled); - } - } - - function setMigratingManager(BinaryOptionMarketManager manager) public onlyOwner { - _migratingManager = manager; - } - - function migrateMarkets( - BinaryOptionMarketManager receivingManager, - bool active, - BinaryOptionMarket[] calldata marketsToMigrate - ) external onlyOwner { - uint _numMarkets = marketsToMigrate.length; - if (_numMarkets == 0) { - return; - } - AddressSetLib.AddressSet storage markets = active ? _activeMarkets : _maturedMarkets; - - uint runningDepositTotal; - for (uint i; i < _numMarkets; i++) { - BinaryOptionMarket market = marketsToMigrate[i]; - require(_isKnownMarket(address(market)), "Market unknown."); - - // Remove it from our list and deposit total. - markets.remove(address(market)); - runningDepositTotal = runningDepositTotal.add(market.deposited()); - - // Prepare to transfer ownership to the new manager. - market.nominateNewOwner(address(receivingManager)); - } - // Deduct the total deposits of the migrated markets. - totalDeposited = totalDeposited.sub(runningDepositTotal); - emit MarketsMigrated(receivingManager, marketsToMigrate); - - // Now actually transfer the markets over to the new manager. - receivingManager.receiveMarkets(active, marketsToMigrate); - } - - function receiveMarkets(bool active, BinaryOptionMarket[] calldata marketsToReceive) external { - require(msg.sender == address(_migratingManager), "Only permitted for migrating manager."); - - uint _numMarkets = marketsToReceive.length; - if (_numMarkets == 0) { - return; - } - AddressSetLib.AddressSet storage markets = active ? _activeMarkets : _maturedMarkets; - - uint runningDepositTotal; - for (uint i; i < _numMarkets; i++) { - BinaryOptionMarket market = marketsToReceive[i]; - require(!_isKnownMarket(address(market)), "Market already known."); - - market.acceptOwnership(); - markets.add(address(market)); - // Update the market with the new manager address, - runningDepositTotal = runningDepositTotal.add(market.deposited()); - } - totalDeposited = totalDeposited.add(runningDepositTotal); - emit MarketsReceived(_migratingManager, marketsToReceive); - } - - /* ========== MODIFIERS ========== */ - - modifier onlyActiveMarkets() { - require(_activeMarkets.contains(msg.sender), "Permitted only for active markets."); - _; - } - - modifier onlyKnownMarkets() { - require(_isKnownMarket(msg.sender), "Permitted only for known markets."); - _; - } - - /* ========== EVENTS ========== */ - - event MarketCreated( - address market, - address indexed creator, - bytes32 indexed oracleKey, - uint strikePrice, - uint biddingEndDate, - uint maturityDate, - uint expiryDate - ); - event MarketExpired(address market); - event MarketCancelled(address market); - event MarketsMigrated(BinaryOptionMarketManager receivingManager, BinaryOptionMarket[] markets); - event MarketsReceived(BinaryOptionMarketManager migratingManager, BinaryOptionMarket[] markets); - event MarketCreationEnabledUpdated(bool enabled); - event MaxOraclePriceAgeUpdated(uint duration); - event ExerciseDurationUpdated(uint duration); - event ExpiryDurationUpdated(uint duration); - event MaxTimeToMaturityUpdated(uint duration); - event CreatorCapitalRequirementUpdated(uint value); - event CreatorSkewLimitUpdated(uint value); - event PoolFeeUpdated(uint fee); - event CreatorFeeUpdated(uint fee); - event RefundFeeUpdated(uint fee); -} diff --git a/contracts/interfaces/IBinaryOption.sol b/contracts/interfaces/IBinaryOption.sol deleted file mode 100644 index 13b3a99226..0000000000 --- a/contracts/interfaces/IBinaryOption.sol +++ /dev/null @@ -1,23 +0,0 @@ -pragma solidity >=0.4.24; - -import "../interfaces/IBinaryOptionMarket.sol"; -import "../interfaces/IERC20.sol"; - -// https://docs.synthetix.io/contracts/source/interfaces/ibinaryoption -interface IBinaryOption { - /* ========== VIEWS / VARIABLES ========== */ - - function market() external view returns (IBinaryOptionMarket); - - function bidOf(address account) external view returns (uint); - - function totalBids() external view returns (uint); - - function balanceOf(address account) external view returns (uint); - - function totalSupply() external view returns (uint); - - function claimableBalanceOf(address account) external view returns (uint); - - function totalClaimableSupply() external view returns (uint); -} diff --git a/contracts/interfaces/IBinaryOptionMarket.sol b/contracts/interfaces/IBinaryOptionMarket.sol deleted file mode 100644 index bbab7ea9eb..0000000000 --- a/contracts/interfaces/IBinaryOptionMarket.sol +++ /dev/null @@ -1,100 +0,0 @@ -pragma solidity >=0.4.24; - -import "../interfaces/IBinaryOptionMarketManager.sol"; -import "../interfaces/IBinaryOption.sol"; - -// https://docs.synthetix.io/contracts/source/interfaces/ibinaryoptionmarket -interface IBinaryOptionMarket { - /* ========== TYPES ========== */ - - enum Phase {Bidding, Trading, Maturity, Expiry} - enum Side {Long, Short} - - /* ========== VIEWS / VARIABLES ========== */ - - function options() external view returns (IBinaryOption long, IBinaryOption short); - - function prices() external view returns (uint long, uint short); - - function times() - external - view - returns ( - uint biddingEnd, - uint maturity, - uint destructino - ); - - function oracleDetails() - external - view - returns ( - bytes32 key, - uint strikePrice, - uint finalPrice - ); - - function fees() - external - view - returns ( - uint poolFee, - uint creatorFee, - uint refundFee - ); - - function creatorLimits() external view returns (uint capitalRequirement, uint skewLimit); - - function deposited() external view returns (uint); - - function creator() external view returns (address); - - function resolved() external view returns (bool); - - function refundsEnabled() external view returns (bool); - - function phase() external view returns (Phase); - - function oraclePriceAndTimestamp() external view returns (uint price, uint updatedAt); - - function canResolve() external view returns (bool); - - function result() external view returns (Side); - - function pricesAfterBidOrRefund( - Side side, - uint value, - bool refund - ) external view returns (uint long, uint short); - - function bidOrRefundForPrice( - Side bidSide, - Side priceSide, - uint price, - bool refund - ) external view returns (uint); - - function bidsOf(address account) external view returns (uint long, uint short); - - function totalBids() external view returns (uint long, uint short); - - function claimableBalancesOf(address account) external view returns (uint long, uint short); - - function totalClaimableSupplies() external view returns (uint long, uint short); - - function balancesOf(address account) external view returns (uint long, uint short); - - function totalSupplies() external view returns (uint long, uint short); - - function exercisableDeposits() external view returns (uint); - - /* ========== MUTATIVE FUNCTIONS ========== */ - - function bid(Side side, uint value) external; - - function refund(Side side, uint value) external returns (uint refundMinusFee); - - function claimOptions() external returns (uint longClaimed, uint shortClaimed); - - function exerciseOptions() external returns (uint); -} diff --git a/contracts/interfaces/IBinaryOptionMarketManager.sol b/contracts/interfaces/IBinaryOptionMarketManager.sol deleted file mode 100644 index 224ddd18a1..0000000000 --- a/contracts/interfaces/IBinaryOptionMarketManager.sol +++ /dev/null @@ -1,56 +0,0 @@ -pragma solidity >=0.4.24; - -import "../interfaces/IBinaryOptionMarket.sol"; - -// https://docs.synthetix.io/contracts/source/interfaces/ibinaryoptionmarketmanager -interface IBinaryOptionMarketManager { - /* ========== VIEWS / VARIABLES ========== */ - - function fees() - external - view - returns ( - uint poolFee, - uint creatorFee, - uint refundFee - ); - - function durations() - external - view - returns ( - uint maxOraclePriceAge, - uint expiryDuration, - uint maxTimeToMaturity - ); - - function creatorLimits() external view returns (uint capitalRequirement, uint skewLimit); - - function marketCreationEnabled() external view returns (bool); - - function totalDeposited() external view returns (uint); - - function numActiveMarkets() external view returns (uint); - - function activeMarkets(uint index, uint pageSize) external view returns (address[] memory); - - function numMaturedMarkets() external view returns (uint); - - function maturedMarkets(uint index, uint pageSize) external view returns (address[] memory); - - /* ========== MUTATIVE FUNCTIONS ========== */ - - function createMarket( - bytes32 oracleKey, - uint strikePrice, - bool refundsEnabled, - uint[2] calldata times, // [biddingEnd, maturity] - uint[2] calldata bids // [longBid, shortBid] - ) external returns (IBinaryOptionMarket); - - function resolveMarket(address market) external; - - function cancelMarket(address market) external; - - function expireMarkets(address[] calldata market) external; -} diff --git a/contracts/test-helpers/MockBinaryOptionMarket.sol b/contracts/test-helpers/MockBinaryOptionMarket.sol deleted file mode 100644 index bcc5f25b67..0000000000 --- a/contracts/test-helpers/MockBinaryOptionMarket.sol +++ /dev/null @@ -1,62 +0,0 @@ -pragma solidity ^0.5.16; - -import "../BinaryOption.sol"; - -import "../SafeDecimalMath.sol"; - -contract MockBinaryOptionMarket { - using SafeDecimalMath for uint; - - uint public deposited; - uint public senderPrice; - BinaryOption public binaryOption; - - function setDeposited(uint newDeposited) external { - deposited = newDeposited; - } - - function setSenderPrice(uint newPrice) external { - senderPrice = newPrice; - } - - function exercisableDeposits() external view returns (uint) { - return deposited; - } - - function senderPriceAndExercisableDeposits() external view returns (uint price, uint _deposited) { - return (senderPrice, deposited); - } - - function deployOption(address initialBidder, uint initialBid) external { - binaryOption = new BinaryOption(initialBidder, initialBid); - } - - function claimOptions() external returns (uint) { - return binaryOption.claim(msg.sender, senderPrice, deposited); - } - - function exerciseOptions() external { - deposited -= binaryOption.balanceOf(msg.sender); - binaryOption.exercise(msg.sender); - } - - function bid(address bidder, uint newBid) external { - binaryOption.bid(bidder, newBid); - deposited += newBid.divideDecimalRound(senderPrice); - } - - function refund(address bidder, uint newRefund) external { - binaryOption.refund(bidder, newRefund); - deposited -= newRefund.divideDecimalRound(senderPrice); - } - - function expireOption(address payable beneficiary) external { - binaryOption.expire(beneficiary); - } - - function requireActiveAndUnpaused() external pure { - return; - } - - event NewOption(BinaryOption newAddress); -} diff --git a/contracts/test-helpers/MockBinaryOptionMarketManager.sol b/contracts/test-helpers/MockBinaryOptionMarketManager.sol deleted file mode 100644 index cd3d562ea7..0000000000 --- a/contracts/test-helpers/MockBinaryOptionMarketManager.sol +++ /dev/null @@ -1,55 +0,0 @@ -pragma solidity ^0.5.16; - -import "../BinaryOptionMarket.sol"; -import "../AddressResolver.sol"; - -contract MockBinaryOptionMarketManager { - BinaryOptionMarket public market; - bool public paused = false; - - function createMarket( - AddressResolver resolver, - address creator, - uint[2] calldata creatorLimits, - bytes32 oracleKey, - uint strikePrice, - bool refundsEnabled, - uint[3] calldata times, // [biddingEnd, maturity, expiry] - uint[2] calldata bids, // [longBid, shortBid] - uint[3] calldata fees // [poolFee, creatorFee, refundFee] - ) external { - market = new BinaryOptionMarket( - address(this), - creator, - address(resolver), - creatorLimits, - oracleKey, - strikePrice, - refundsEnabled, - times, - bids, - fees - ); - market.rebuildCache(); - } - - function decrementTotalDeposited(uint) external pure { - return; - } - - function resolveMarket() external { - market.resolve(); - } - - function durations() - external - pure - returns ( - uint, - uint, - uint - ) - { - return (60 * 60 * 24, 0, 0); - } -} diff --git a/contracts/test-helpers/TestableBinaryOptionMarket.sol b/contracts/test-helpers/TestableBinaryOptionMarket.sol deleted file mode 100644 index 8edde3d0eb..0000000000 --- a/contracts/test-helpers/TestableBinaryOptionMarket.sol +++ /dev/null @@ -1,49 +0,0 @@ -pragma solidity ^0.5.16; - -import "../BinaryOptionMarket.sol"; - -contract TestableBinaryOptionMarket is BinaryOptionMarket { - constructor( - address _owner, - address _creator, - address _resolver, - uint[2] memory _creatorLimits, - bytes32 _oracleKey, - uint256 _strikePrice, - bool _refundsEnabled, - uint[3] memory _times, - uint[2] memory _bids, - uint[3] memory _fees - ) - public - BinaryOptionMarket( - _owner, - _creator, - _resolver, - _creatorLimits, - _oracleKey, - _strikePrice, - _refundsEnabled, - _times, - _bids, - _fees - ) - {} - - function updatePrices( - uint256 longBids, - uint256 shortBids, - uint totalDebt - ) public { - _updatePrices(longBids, shortBids, totalDebt); - } - - function setManager(address _manager) public { - owner = _manager; - } - - function forceClaim(address account) public { - options.long.claim(account, prices.long, _exercisableDeposits(deposited)); - options.short.claim(account, prices.short, _exercisableDeposits(deposited)); - } -} diff --git a/publish/deployed/kovan/config.json b/publish/deployed/kovan/config.json index b7aed925eb..edc2777fd8 100644 --- a/publish/deployed/kovan/config.json +++ b/publish/deployed/kovan/config.json @@ -2,15 +2,6 @@ "AddressResolver": { "deploy": false }, - "BinaryOptionMarketFactory": { - "deploy": false - }, - "BinaryOptionMarketManager": { - "deploy": false - }, - "BinaryOptionMarketData": { - "deploy": false - }, "CollateralManager": { "deploy": false }, diff --git a/publish/deployed/kovan/deployment.json b/publish/deployed/kovan/deployment.json index a913c99537..e370e1b2a7 100644 --- a/publish/deployed/kovan/deployment.json +++ b/publish/deployed/kovan/deployment.json @@ -1305,33 +1305,6 @@ "txn": "https://kovan.etherscan.io/tx/0x3bfcd0e32f4ed21894074f2eb7f84fb3e13b843b10bd1f80672c0abb531feaa9", "network": "kovan" }, - "BinaryOptionMarketFactory": { - "name": "BinaryOptionMarketFactory", - "address": "0x16Aa67021fdDEa0f7E75bB54998Fa438832e9E5e", - "source": "BinaryOptionMarketFactory", - "link": "https://kovan.etherscan.io/address/0x16Aa67021fdDEa0f7E75bB54998Fa438832e9E5e", - "timestamp": "2020-12-22T13:55:01.324Z", - "txn": "", - "network": "kovan" - }, - "BinaryOptionMarketManager": { - "name": "BinaryOptionMarketManager", - "address": "0x95dCaDDaa40aC726BF4734754e6B75eAe6F5eb9F", - "source": "BinaryOptionMarketManager", - "link": "https://kovan.etherscan.io/address/0x95dCaDDaa40aC726BF4734754e6B75eAe6F5eb9F", - "timestamp": "2020-12-22T13:55:12.872Z", - "txn": "", - "network": "kovan" - }, - "BinaryOptionMarketData": { - "name": "BinaryOptionMarketData", - "address": "0xaEA08c2Eb990d5552c327353b310bFeB0a36463C", - "source": "BinaryOptionMarketData", - "link": "https://kovan.etherscan.io/address/0xaEA08c2Eb990d5552c327353b310bFeB0a36463C", - "timestamp": "2020-08-05T23:24:04.000Z", - "txn": "https://kovan.etherscan.io/tx/0xdc6b8f21dbb9c6cde938f2ec9e85598554507646ddb9dc759417902b2c0f6539", - "network": "kovan" - }, "SynthUtil": { "name": "SynthUtil", "address": "0xC88AE3be40CAa09CD16Db5816e6145E0E929c93c", @@ -21233,1782 +21206,6 @@ "version": 1 } }, - "BinaryOptionMarketFactory": { - "bytecode": "608060405234801561001057600080fd5b506040516158493803806158498339818101604052604081101561003357600080fd5b50805160209091015180826001600160a01b038116610099576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a150600280546001600160a01b039092166001600160a01b03199092169190911790555050615725806101246000396000f3fe60806040523480156200001157600080fd5b5060043610620000a05760003560e01c806353a47bb7116200006f57806353a47bb7146200016857806374185360146200017257806379ba5097146200017c578063899ffef414620001865780638da5cb5b14620001e257620000a0565b806304f3bcec14620000a5578063130efa5014620000cb5780631627540c146200011f5780632af64bd3146200014a575b600080fd5b620000af620001ec565b604080516001600160a01b039092168252519081900360200190f35b620000af60048036036101c0811015620000e457600080fd5b506001600160a01b0381351690602081019060608101359060808101359060a081013515159060c081019061012081019061016001620001fb565b62000148600480360360208110156200013757600080fd5b50356001600160a01b03166200036e565b005b62000154620003cc565b604080519115158252519081900360200190f35b620000af620004e2565b62000148620004f1565b62000148620006c4565b6200019062000782565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015620001ce578181015183820152602001620001b4565b505050509050019250505060405180910390f35b620000af620007de565b6002546001600160a01b031681565b60008062000208620007ed565b90506001600160a01b038116331462000268576040805162461bcd60e51b815260206004820152601e60248201527f4f6e6c79207065726d697474656420627920746865206d616e616765722e0000604482015290519081900360640190fd5b808a600260009054906101000a90046001600160a01b03168b8b8b8b8b8b8b604051620002959062000950565b6001600160a01b03808c1682528a8116602083015289166040808301919091526060820190899080828437600083820152601f01601f191690910188815260208101889052861515604082015260609081019150859080828437600083820152601f01601f1916909101905083604080828437600083820152601f01601f19169091019050826060808284376000838201819052604051601f909201601f19169093018190039d509b50909950505050505050505050f0801580156200035f573d6000803e3d6000fd5b509a9950505050505050505050565b620003786200081b565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b60006060620003da62000782565b905060005b8151811015620004d8576000828281518110620003f857fe5b6020908102919091018101516000818152600383526040908190205460025482516321f8a72160e01b81526004810185905292519395506001600160a01b03918216949116926321f8a721926024808201939291829003018186803b1580156200046157600080fd5b505afa15801562000476573d6000803e3d6000fd5b505050506040513d60208110156200048d57600080fd5b50516001600160a01b0316141580620004bb57506000818152600360205260409020546001600160a01b0316155b15620004ce5760009350505050620004df565b50600101620003df565b5060019150505b90565b6001546001600160a01b031681565b6060620004fd62000782565b905060005b8151811015620006c05760008282815181106200051b57fe5b602090810291909101810151600254604080517f5265736f6c766572206d697373696e67207461726765743a2000000000000000818601526039808201859052825180830390910181526059820180845263dacb2d0160e01b9052605d8201858152607d83019384528151609d84015281519597506000966001600160a01b039095169563dacb2d01958995939492939260bd0191908501908083838c5b83811015620005d3578181015183820152602001620005b9565b50505050905090810190601f168015620006015780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b1580156200062057600080fd5b505afa15801562000635573d6000803e3d6000fd5b505050506040513d60208110156200064c57600080fd5b505160008381526003602090815260409182902080546001600160a01b0319166001600160a01b03851690811790915582518681529182015281519293507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68929081900390910190a1505060010162000502565b5050565b6001546001600160a01b031633146200070f5760405162461bcd60e51b81526004018080602001828103825260358152602001806200568d6035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60408051600180825281830190925260609160208083019080388339019050509050782134b730b93ca7b83a34b7b726b0b935b2ba26b0b730b3b2b960391b81600081518110620007cf57fe5b60200260200101818152505090565b6000546001600160a01b031681565b600062000816782134b730b93ca7b83a34b7b726b0b935b2ba26b0b730b3b2b960391b62000868565b905090565b6000546001600160a01b03163314620008665760405162461bcd60e51b815260040180806020018281038252602f815260200180620056c2602f913960400191505060405180910390fd5b565b600081815260036020908152604080832054815170026b4b9b9b4b7339030b2323932b9b99d1607d1b9381019390935260318084018690528251808503909101815260519093019091526001600160a01b03169081620009495760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156200090d578181015183820152602001620008f3565b50505050905090810190601f1680156200093b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5092915050565b614d2e806200095f8339019056fe60806040523480156200001157600080fd5b5060405162004d2e38038062004d2e83398181016040526102008110156200003857600080fd5b5080516020820151604083015160a084015160c085015160e08601519495939492936060810193906101008101906101608101906101a001878a6001600160a01b038116620000ce576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a150600280546001600160a01b03199081166001600160a01b0393841617909155601480546040805180820182528c518082526020808f01519281018390526011919091556012919091558151606080820184528d82528183018d90526000918401829052600b8e9055600c8d9055600d919091558251908101835289518082528a8301518284018190528b85015192909401829052600855600992909255600a919091559216928c169290921760ff60a81b1916600160a81b8715150217909155825190830151620001f982826200047b565b8a6001600160a01b031660008051602062004d0e833981519152600084604051808360018111156200022757fe5b60ff1681526020018281526020019250505060405180910390a28a6001600160a01b031660008051602062004d0e833981519152600183604051808360018111156200026f57fe5b60ff1681526020018281526020019250505060405180910390a26000620002a582846200058260201b620021f71790919060201c565b6013819055845160208087015160408051606081018252848152808401839052818a01519101819052600e849055600f8290556010559293509091906200038490620002fe908490849062000582811b620021f717901c565b73__$60f5066a95a61bfd95691e5518aae05f18$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200034357600080fd5b505af415801562000358573d6000803e3d6000fd5b505050506040513d60208110156200036f57600080fd5b505190620005e6602090811b62002bb317901c565b6015556200039d8585856001600160e01b036200064416565b8d85604051620003ad9062000976565b6001600160a01b0390921682526020820152604080519182900301906000f080158015620003df573d6000803e3d6000fd5b50600480546001600160a01b0319166001600160a01b03929092169190911790556040518e908590620004129062000976565b6001600160a01b0390921682526020820152604080519182900301906000f08015801562000444573d6000803e3d6000fd5b50600580546001600160a01b0319166001600160a01b039290921691909117905550620009849d5050505050505050505050505050565b60006200049782846200058260201b620021f71790919060201c565b9050806011600001541115620004f4576040805162461bcd60e51b815260206004820152601460248201527f496e73756666696369656e74206361706974616c000000000000000000000000604482015290519081900360640190fd5b6012546200050f8483620006be602090811b6200300417901c565b8111158015620005385750620005348284620006be60201b620030041790919060201c565b8111155b6200057c576040805162461bcd60e51b815260206004820152600f60248201526e109a591cc81d1bdbc81cdad95dd959608a1b604482015290519081900360640190fd5b50505050565b600082820183811015620005dd576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b6000828211156200063e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000806200065d8585856001600160e01b03620006f916565b604080518082018252838152602090810183905260068490556007839055815184815290810183905281519395509193507f6546f60f34df611fa42503098acc39d5ab88bc73febe64b3cc14e5a92e3a66a792918290030190a15050505050565b6000620005dd82620006e585670de0b6b3a7640000620007b6602090811b6200305417901c565b6200081460201b620030ad1790919060201c565b60008084158015906200070b57508315155b6200075d576040805162461bcd60e51b815260206004820152601460248201527f42696473206d757374206265206e6f6e7a65726f000000000000000000000000604482015290519081900360640190fd5b600062000773846001600160e01b036200088016565b90506200078f8187620008bb60201b62002e271790919060201c565b620007a98287620008bb60201b62002e271790919060201c565b9250925050935093915050565b600082620007c757506000620005e0565b82820282848281620007d557fe5b0414620005dd5760405162461bcd60e51b815260040180806020018281038252602181526020018062004ced6021913960400191505060405180910390fd5b60008082116200086b576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b60008284816200087757fe5b04949350505050565b601454600090600160a01b900460ff16620008b757620008b160155483620008db60201b620021db1790919060201c565b620005e0565b5090565b6000620005dd8383670de0b6b3a76400006001600160e01b03620008fb16565b6000620005dd8383670de0b6b3a76400006001600160e01b036200093f16565b6000806200092084620006e585600a0288620007b660201b620030541790919060201c565b90506005600a825b06106200093357600a015b600a9004949350505050565b600080600a8304620009608587620007b660201b620030541790919060201c565b816200096857fe5b0490506005600a8262000928565b61114a8062003ba383390190565b61320f80620009946000396000f3fe608060405234801561001057600080fd5b50600436106102485760003560e01c8063851492581161013b578063be5af9fe116100b8578063d3419bf31161007c578063d3419bf31461055c578063dbea363814610564578063e4cfbdbd1461058a578063eef49ee3146105c2578063fd087ee5146105ca57610248565b8063be5af9fe14610516578063c588f5261461051e578063c7a5bdc814610526578063c8db233e1461052e578063d068cdc51461055457610248565b80639af1d35a116100ff5780639af1d35a146104c05780639e3b34bf146104c8578063ac3791e3146104d0578063b1c9fe6e146104d8578063b634bfbc146104f057610248565b8063851492581461042a578063899ffef4146104325780638b0341361461048a5780638da5cb5b1461049257806398508ecd1461049a57610248565b80633dae89eb116101c957806353a47bb71161018d57806353a47bb7146103c05780636392a51f146103c857806365372147146103ee578063741853601461041a57806379ba50971461042257610248565b80633dae89eb1461035c5780633f6fa65514610364578063408e82af1461036c5780634c33fe9414610392578063532f1179146103b857610248565b806327745bae1161021057806327745bae146102e95780632810e1d6146102f157806329e77b5d146102f95780632af64bd3146103385780633d7a783b1461035457610248565b806302d05d3f1461024d57806304f3bcec146102715780631069143a146102795780631627540c146102a75780632115e303146102cf575b600080fd5b6102556105f8565b604080516001600160a01b039092168252519081900360200190f35b610255610607565b610281610616565b604080516001600160a01b03938416815291909216602082015281519081900390910190f35b6102cd600480360360208110156102bd57600080fd5b50356001600160a01b031661062c565b005b6102d7610688565b60408051918252519081900360200190f35b6102cd61069b565b6102cd6106fd565b61031f6004803603602081101561030f57600080fd5b50356001600160a01b0316610ad1565b6040805192835260208301919091528051918290030190f35b610340610ae6565b604080519115158252519081900360200190f35b61031f610bf0565b61031f610cdb565b610340610cee565b61031f6004803603602081101561038257600080fd5b50356001600160a01b0316610cfe565b6102cd600480360360208110156103a857600080fd5b50356001600160a01b0316610d0a565b610340610df4565b610255610e04565b61031f600480360360208110156103de57600080fd5b50356001600160a01b0316610e13565b6103f6610e1f565b6040518082600181111561040657fe5b60ff16815260200191505060405180910390f35b6102cd610e29565b6102cd610ff1565b6102d76110ad565b61043a61139e565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561047657818101518382015260200161045e565b505050509050019250505060405180910390f35b61031f611461565b61025561146c565b6104a261147b565b60408051938452602084019290925282820152519081900360600190f35b6104a2611487565b6104a2611493565b61034061149f565b6104e06114e2565b6040518082600381111561040657fe5b6102d76004803603604081101561050657600080fd5b5060ff8135169060200135611526565b61031f61186d565b61031f611876565b61031f611945565b6102cd6004803603602081101561054457600080fd5b50356001600160a01b0316611950565b61031f6119bd565b61031f611a72565b6102cd6004803603604081101561057a57600080fd5b5060ff8135169060200135611a7b565b6102d7600480360360808110156105a057600080fd5b5060ff8135811691602081013590911690604081013590606001351515611c64565b6102d7611e65565b61031f600480360360608110156105e057600080fd5b5060ff81351690602081013590604001351515611e6b565b6014546001600160a01b031681565b6002546001600160a01b031681565b6004546005546001600160a01b03918216911682565b610634611f5c565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b6000610695601354611fa5565b90505b90565b6106a3611fdc565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b1580156106db57600080fd5b505afa1580156106ef573d6000803e3d6000fd5b505050506106fb611ff6565b565b610705611f5c565b61070d61209e565b61074f576040805162461bcd60e51b815260206004820152600e60248201526d4e6f7420796574206d617475726560901b604482015290519081900360640190fd5b610757611fdc565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561078f57600080fd5b505afa1580156107a3573d6000803e3d6000fd5b505050506107af611ff6565b601454600160a01b900460ff161561080e576040805162461bcd60e51b815260206004820152601760248201527f4d61726b657420616c7265616479207265736f6c766564000000000000000000604482015290519081900360640190fd5b6000806108196120a6565b9150915061082681612134565b610868576040805162461bcd60e51b815260206004820152600e60248201526d5072696365206973207374616c6560901b604482015290519081900360640190fd5b600d8290556014805460ff60a01b1916600160a01b179055600061088a6121c4565b601354600e54919250906000906108a890839063ffffffff6121db16565b600f549091506000906108c290849063ffffffff6121db16565b90506108dc6108d7828463ffffffff6121f716565b612251565b50836001600160a01b031663a9059cbb6108f46122d8565b6001600160a01b031663eb1edd616040518163ffffffff1660e01b815260040160206040518083038186803b15801561092c57600080fd5b505afa158015610940573d6000803e3d6000fd5b505050506040513d602081101561095657600080fd5b5051604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482018690525160448083019260209291908290030181600087803b1580156109a657600080fd5b505af11580156109ba573d6000803e3d6000fd5b505050506040513d60208110156109d057600080fd5b50506014546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810184905290519186169163a9059cbb916044808201926020929091908290030181600087803b158015610a2857600080fd5b505af1158015610a3c573d6000803e3d6000fd5b505050506040513d6020811015610a5257600080fd5b507f5528b7e06f48a519cf814c4e5293ee2737c3f5c28d93e30cca112ac649fdd2359050610a7e6122ed565b8787601354868660405180876001811115610a9557fe5b60ff1681526020810196909652506040808601949094526060850192909252608084015260a0830152519081900360c0019150a1505050505050565b600080610add83612332565b91509150915091565b60006060610af261139e565b905060005b8151811015610be7576000828281518110610b0e57fe5b6020908102919091018101516000818152600383526040908190205460025482516321f8a72160e01b81526004810185905292519395506001600160a01b03918216949116926321f8a721926024808201939291829003018186803b158015610b7657600080fd5b505afa158015610b8a573d6000803e3d6000fd5b505050506040513d6020811015610ba057600080fd5b50516001600160a01b0316141580610bcd57506000818152600360205260409020546001600160a01b0316155b15610bde5760009350505050610698565b50600101610af7565b50600191505090565b6004805460408051636b7f817160e11b8152905160009384936001600160a01b03169263d6ff02e29281830192602092829003018186803b158015610c3457600080fd5b505afa158015610c48573d6000803e3d6000fd5b505050506040513d6020811015610c5e57600080fd5b505160055460408051636b7f817160e11b815290516001600160a01b039092169163d6ff02e291600481810192602092909190829003018186803b158015610ca557600080fd5b505afa158015610cb9573d6000803e3d6000fd5b505050506040513d6020811015610ccf57600080fd5b505190925090505b9091565b600080610ce6612433565b915091509091565b601454600160a01b900460ff1681565b600080610add836126fd565b610d12611f5c565b610d1a6127c8565b15610d5f576040805162461bcd60e51b815260206004820152601060248201526f42696464696e6720696e61637469766560801b604482015290519081900360640190fd5b600080610d6a6127d0565b60145491935091506000908190610d89906001600160a01b0316612332565b9150915060008285148015610d9d57508184145b905080610de3576040805162461bcd60e51b815260206004820152600f60248201526e4e6f742063616e63656c6c61626c6560881b604482015290519081900360640190fd5b610dec86612885565b505050505050565b601454600160a81b900460ff1681565b6001546001600160a01b031681565b600080610add83612a8c565b60006106956122ed565b6060610e3361139e565b905060005b8151811015610fed576000828281518110610e4f57fe5b602090810291909101810151600254604080517f5265736f6c766572206d697373696e67207461726765743a2000000000000000818601526039808201859052825180830390910181526059820180845263dacb2d0160e01b9052605d8201858152607d83019384528151609d84015281519597506000966001600160a01b039095169563dacb2d01958995939492939260bd0191908501908083838c5b83811015610f05578181015183820152602001610eed565b50505050905090810190601f168015610f325780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b158015610f5057600080fd5b505afa158015610f64573d6000803e3d6000fd5b505050506040513d6020811015610f7a57600080fd5b505160008381526003602090815260409182902080546001600160a01b0319166001600160a01b03851690811790915582518681529182015281519293507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68929081900390910190a15050600101610e38565b5050565b6001546001600160a01b0316331461103a5760405162461bcd60e51b815260040180806020018281038252603581526020018061311a6035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b601454600090600160a01b900460ff16611139576110c9612b57565b6001600160a01b0316637859f410306040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561112057600080fd5b505af1158015611134573d6000803e3d6000fd5b505050505b600080611145336126fd565b9150915081600014158061115857508015155b1561116857611165612433565b50505b60008061117433612a8c565b9150915081600014158061118757508015155b6111ce576040805162461bcd60e51b81526020600482015260136024820152724e6f7468696e6720746f20657865726369736560681b604482015290519081900360640190fd5b811561123a576004805460408051630d8acc1560e11b81523393810193909352516001600160a01b0390911691631b15982a91602480830192600092919082900301818387803b15801561122157600080fd5b505af1158015611235573d6000803e3d6000fd5b505050505b80156112a55760055460408051630d8acc1560e11b815233600482015290516001600160a01b0390921691631b15982a9160248082019260009290919082900301818387803b15801561128c57600080fd5b505af11580156112a0573d6000803e3d6000fd5b505050505b60006112b96112b26122ed565b8484612b66565b60408051828152905191925033917fd82b6f69d7477fb41cd83d936de94990cee2fa1a309feeee90101fc0513b6a439181900360200190a280156113955761130081612251565b506113096121c4565b6001600160a01b031663a9059cbb33836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561136857600080fd5b505af115801561137c573d6000803e3d6000fd5b505050506040513d602081101561139257600080fd5b50505b94505050505090565b60408051600480825260a08201909252606091602082016080803883390190505090506b53797374656d53746174757360a01b816000815181106113de57fe5b6020026020010181815250506c45786368616e6765526174657360981b8160018151811061140857fe5b6020026020010181815250506814de5b9d1a1cd554d160ba1b8160028151811061142e57fe5b60200260200101818152505066119959541bdbdb60ca1b8160038151811061145257fe5b60200260200101818152505090565b600080610ce66127d0565b6000546001600160a01b031681565b600b54600c54600d5483565b600e54600f5460105483565b600854600954600a5483565b6000806114aa6120a6565b601454909250600160a01b900460ff1615905080156114cc57506114cc61209e565b80156114dc57506114dc81612134565b91505090565b60006114ec6127c8565b6114f857506000610698565b61150061209e565b61150c57506001610698565b611514612b89565b61152057506002610698565b50600390565b60006115306127c8565b15611575576040805162461bcd60e51b815260206004820152601060248201526f42696464696e6720696e61637469766560801b604482015290519081900360640190fd5b601454600160a81b900460ff166115c6576040805162461bcd60e51b815260206004820152601060248201526f1499599d5b991cc8191a5cd8589b195960821b604482015290519081900360640190fd5b816115d357506000611867565b6014546001600160a01b0316331415611629576000806115f233612332565b9092509050600185600181111561160557fe5b141561160d57905b611626611620838663ffffffff612bb316565b82612c10565b50505b6116be6116b1600e6002015473__$60f5066a95a61bfd95691e5518aae05f18$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b15801561167957600080fd5b505af415801561168d573d6000803e3d6000fd5b505050506040513d60208110156116a357600080fd5b50519063ffffffff612bb316565b839063ffffffff6121db16565b90506116c983612cef565b6001600160a01b031663410085df33846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561172857600080fd5b505af115801561173c573d6000803e3d6000fd5b503392507f9bd0a8ca6625e01a9cee5e86eec7813a8234b41f1ca0c9f15a008d1e1d00ee5f915085905083611777868263ffffffff612bb316565b6040518084600181111561178757fe5b60ff168152602001838152602001828152602001935050505060405180910390a260006117b382612251565b90506117bd6121c4565b6001600160a01b031663a9059cbb33846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561181c57600080fd5b505af1158015611830573d6000803e3d6000fd5b505050506040513d602081101561184657600080fd5b5060009050806118546127d0565b91509150611863828285612d27565b5050505b92915050565b60115460125482565b6014546000908190600160a01b900460ff1615806118ab5750336118a061189b6122ed565b612cef565b6001600160a01b0316145b156118be576118bb601354611fa5565b90505b6004546001600160a01b03163314156118db576006549150610cd7565b6005546001600160a01b03163314156118f8576007549150610cd7565b6040805162461bcd60e51b815260206004820152601760248201527f53656e646572206973206e6f7420616e206f7074696f6e000000000000000000604482015290519081900360640190fd5b600080610ce66120a6565b611958611f5c565b611960612b89565b6119b1576040805162461bcd60e51b815260206004820152601b60248201527f556e65787069726564206f7074696f6e732072656d61696e696e670000000000604482015290519081900360640190fd5b6119ba81612885565b50565b60048054604080516318160ddd60e01b8152905160009384936001600160a01b0316926318160ddd9281830192602092829003018186803b158015611a0157600080fd5b505afa158015611a15573d6000803e3d6000fd5b505050506040513d6020811015611a2b57600080fd5b5051600554604080516318160ddd60e01b815290516001600160a01b03909216916318160ddd91600481810192602092909190829003018186803b158015610ca557600080fd5b60065460075482565b611a836127c8565b15611ac8576040805162461bcd60e51b815260206004820152601060248201526f42696464696e6720696e61637469766560801b604482015290519081900360640190fd5b80611ad257610fed565b611adb82612cef565b6001600160a01b03166359d667a533836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015611b3a57600080fd5b505af1158015611b4e573d6000803e3d6000fd5b50505050336001600160a01b03167f70bd4a33bf447720d717d08f3affb5aecfe4d2ebb8e3dd94539f5313e2447643838360405180836001811115611b8f57fe5b60ff1681526020018281526020019250505060405180910390a26000611bb482612d96565b9050611bbe6121c4565b604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b0392909216916323b872dd916064808201926020929091908290030181600087803b158015611c1657600080fd5b505af1158015611c2a573d6000803e3d6000fd5b505050506040513d6020811015611c4057600080fd5b506000905080611c4e6127d0565b91509150611c5d828285612d27565b5050505050565b600080611c7c601554856121db90919063ffffffff16565b90506000611c8986612cef565b6001600160a01b0316638b0341366040518163ffffffff1660e01b815260040160206040518083038186803b158015611cc157600080fd5b505afa158015611cd5573d6000803e3d6000fd5b505050506040513d6020811015611ceb57600080fd5b505160135460408051630241ebdb60e61b81529051929350909160009173__$60f5066a95a61bfd95691e5518aae05f18$__9163907af6c091600480820192602092909190829003018186803b158015611d4457600080fd5b505af4158015611d58573d6000803e3d6000fd5b505050506040513d6020811015611d6e57600080fd5b5051601054909150600090611d8a90839063ffffffff612bb316565b9050886001811115611d9857fe5b8a6001811115611da457fe5b1415611e0e576000611dbc848763ffffffff6121db16565b90508715611dd85793611dd5868363ffffffff6121db16565b95505b611e01611deb848863ffffffff612bb316565b611df58388612e00565b9063ffffffff612e2716565b9650505050505050611e5d565b6000611e20858763ffffffff612e2716565b90508715611e2a57925b6000611e368286612e00565b905088611e435780611e53565b611e53818463ffffffff612e2716565b9750505050505050505b949350505050565b60135481565b600080600080611e796127d0565b9150915061311785611e8d576121f7611e91565b612bb35b90506000886001811115611ea157fe5b1415611ebc57611eb583888363ffffffff16565b9250611ecd565b611eca82888363ffffffff16565b91505b8515611f3357611f30611f23600e6002015473__$60f5066a95a61bfd95691e5518aae05f18$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b15801561167957600080fd5b889063ffffffff6121db16565b96505b611f4d8383611f486013548b8663ffffffff16565b612e3c565b94509450505050935093915050565b6000546001600160a01b031633146106fb5760405162461bcd60e51b815260040180806020018281038252602f81526020018061314f602f913960400191505060405180910390fd5b601454600090600160a01b900460ff16611fd257601554611fcd90839063ffffffff6121db16565b611fd4565b815b90505b919050565b60006106956b53797374656d53746174757360a01b612ecf565b611ffe612b57565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b15801561203657600080fd5b505afa15801561204a573d6000803e3d6000fd5b505050506040513d602081101561206057600080fd5b5051156106fb5760405162461bcd60e51b815260040180806020018281038252603c81526020018061319f603c913960400191505060405180910390fd5b600954421190565b6000806120b1612fac565b6001600160a01b0316634308a94f600b600001546040518263ffffffff1660e01b815260040180828152602001915050604080518083038186803b1580156120f857600080fd5b505afa15801561210c573d6000803e3d6000fd5b505050506040513d604081101561212257600080fd5b50805160209091015190925090509091565b60008061213f612b57565b6001600160a01b0316634a41d89d6040518163ffffffff1660e01b815260040160606040518083038186803b15801561217757600080fd5b505afa15801561218b573d6000803e3d6000fd5b505050506040513d60608110156121a157600080fd5b505160095490915083906121bb908363ffffffff612bb316565b11159392505050565b60006106956814de5b9d1a1cd554d160ba1b612ecf565b60006121f08383670de0b6b3a7640000612fc7565b9392505050565b6000828201838110156121f0576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b601354600090612267908363ffffffff612bb316565b60138190559050612276612b57565b6001600160a01b0316636b3a0984836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156122bb57600080fd5b505af11580156122cf573d6000803e3d6000fd5b50505050919050565b600061069566119959541bdbdb60ca1b612ecf565b6014546000908190600160a01b900460ff161561230d5750600d54612319565b6123156120a6565b5090505b600c5481101561232a5760016114dc565b600091505090565b60048054604080516308dc30b760e41b81526001600160a01b0385811694820194909452905160009384931691638dc30b70916024808301926020929190829003018186803b15801561238457600080fd5b505afa158015612398573d6000803e3d6000fd5b505050506040513d60208110156123ae57600080fd5b5051600554604080516308dc30b760e41b81526001600160a01b03878116600483015291519190921691638dc30b70916024808301926020929190829003018186803b1580156123fd57600080fd5b505afa158015612411573d6000803e3d6000fd5b505050506040513d602081101561242757600080fd5b50519092509050915091565b60008061243e611fdc565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561247657600080fd5b505afa15801561248a573d6000803e3d6000fd5b50505050612496611ff6565b61249e6127c8565b6124e4576040805162461bcd60e51b815260206004820152601260248201527142696464696e6720696e636f6d706c65746560701b604482015290519081900360640190fd5b60006124f1601354611fa5565b905060006124fd6122ed565b601454909150600160a01b900460ff166000808215806125285750600084600181111561252657fe5b145b156125bc576004805460065460408051632bc43fd960e01b81523394810194909452602484019190915260448301889052516001600160a01b0390911691632bc43fd99160648083019260209291908290030181600087803b15801561258d57600080fd5b505af11580156125a1573d6000803e3d6000fd5b505050506040513d60208110156125b757600080fd5b505191505b8215806125d4575060018460018111156125d257fe5b145b156126665760055460075460408051632bc43fd960e01b8152336004820152602481019290925260448201889052516001600160a01b0390921691632bc43fd9916064808201926020929091908290030181600087803b15801561263757600080fd5b505af115801561264b573d6000803e3d6000fd5b505050506040513d602081101561266157600080fd5b505190505b8115158061267357508015155b6126b7576040805162461bcd60e51b815260206004820152601060248201526f4e6f7468696e6720746f20636c61696d60801b604482015290519081900360640190fd5b6040805183815260208101839052815133927fbbe753caa9bb201dbd1740ee3d61c6d2adf5fa89f30233d732281ae5db6a03d4928290030190a290955093505050509091565b600480546040805163270fb89160e21b81526001600160a01b0385811694820194909452905160009384931691639c3ee244916024808301926020929190829003018186803b15801561274f57600080fd5b505afa158015612763573d6000803e3d6000fd5b505050506040513d602081101561277957600080fd5b50516005546040805163270fb89160e21b81526001600160a01b03878116600483015291519190921691639c3ee244916024808301926020929190829003018186803b1580156123fd57600080fd5b600854421190565b6004805460408051634581a09b60e11b8152905160009384936001600160a01b031692638b0341369281830192602092829003018186803b15801561281457600080fd5b505afa158015612828573d6000803e3d6000fd5b505050506040513d602081101561283e57600080fd5b505160055460408051634581a09b60e11b815290516001600160a01b0390921691638b03413691600481810192602092909190829003018186803b158015610ca557600080fd5b60135480156128995761289781612251565b505b60006128a36121c4565b604080516370a0823160e01b815230600482015290519192506000916001600160a01b038416916370a08231916024808301926020929190829003018186803b1580156128ef57600080fd5b505afa158015612903573d6000803e3d6000fd5b505050506040513d602081101561291957600080fd5b5051905080156129b057816001600160a01b031663a9059cbb85836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561298357600080fd5b505af1158015612997573d6000803e3d6000fd5b505050506040513d60208110156129ad57600080fd5b50505b600480546040805163646d919f60e11b81526001600160a01b03888116948201949094529051929091169163c8db233e9160248082019260009290919082900301818387803b158015612a0257600080fd5b505af1158015612a16573d6000803e3d6000fd5b50506005546040805163646d919f60e11b81526001600160a01b038981166004830152915191909216935063c8db233e9250602480830192600092919082900301818387803b158015612a6857600080fd5b505af1158015612a7c573d6000803e3d6000fd5b50505050836001600160a01b0316ff5b60048054604080516370a0823160e01b81526001600160a01b03858116948201949094529051600093849316916370a08231916024808301926020929190829003018186803b158015612ade57600080fd5b505afa158015612af2573d6000803e3d6000fd5b505050506040513d6020811015612b0857600080fd5b5051600554604080516370a0823160e01b81526001600160a01b038781166004830152915191909216916370a08231916024808301926020929190829003018186803b1580156123fd57600080fd5b6000546001600160a01b031690565b600080846001811115612b7557fe5b1415612b825750816121f0565b5092915050565b601454600090600160a01b900460ff1680156106955750600a544211806106955750506013541590565b600082821115612c0a576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000612c22838363ffffffff6121f716565b9050806011600001541115612c75576040805162461bcd60e51b8152602060048201526014602482015273125b9cdd59999a58da595b9d0818d85c1a5d185b60621b604482015290519081900360640190fd5b601254612c88848363ffffffff61300416565b8111158015612ca65750612ca2838363ffffffff61300416565b8111155b612ce9576040805162461bcd60e51b815260206004820152600f60248201526e109a591cc81d1bdbc81cdad95dd959608a1b604482015290519081900360640190fd5b50505050565b600080826001811115612cfe57fe5b1415612d1657506004546001600160a01b0316611fd7565b50506005546001600160a01b031690565b600080612d35858585612e3c565b604080518082018252838152602090810183905260068490556007839055815184815290810183905281519395509193507f6546f60f34df611fa42503098acc39d5ab88bc73febe64b3cc14e5a92e3a66a792918290030190a15050505050565b601354600090612dac908363ffffffff6121f716565b60138190559050612dbb612b57565b6001600160a01b031663aeab5849836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156122bb57600080fd5b6000818310612e1e57612e19838363ffffffff612bb316565b6121f0565b50600092915050565b60006121f08383670de0b6b3a764000061302e565b6000808415801590612e4d57508315155b612e95576040805162461bcd60e51b815260206004820152601460248201527342696473206d757374206265206e6f6e7a65726f60601b604482015290519081900360640190fd5b6000612ea084611fa5565b9050612eb2868263ffffffff612e2716565b612ec2868363ffffffff612e2716565b9250925050935093915050565b600081815260036020908152604080832054815170026b4b9b9b4b7339030b2323932b9b99d1607d1b9381019390935260318084018690528251808503909101815260519093019091526001600160a01b03169081612b825760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612f71578181015183820152602001612f59565b50505050905090810190601f168015612f9e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b60006106956c45786368616e6765526174657360981b612ecf565b600080600a8304612fde868663ffffffff61305416565b81612fe557fe5b0490506005600a825b0610612ff857600a015b600a9004949350505050565b60006121f08261302285670de0b6b3a764000063ffffffff61305416565b9063ffffffff6130ad16565b6000806130488461302287600a870263ffffffff61305416565b90506005600a82612fee565b60008261306357506000611867565b8282028284828161307057fe5b04146121f05760405162461bcd60e51b815260040180806020018281038252602181526020018061317e6021913960400191505060405180910390fd5b6000808211613103576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b600082848161310e57fe5b04949350505050565bfefe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775468697320616374696f6e2063616e6e6f7420626520706572666f726d6564207768696c652074686520636f6e747261637420697320706175736564a265627a7a723158203cdc0f6a4f960a244d3aaf162a409c098389893e232ea6472dcb391f9d5a928464736f6c63430005100032608060405234801561001057600080fd5b5060405161114a38038061114a8339818101604052604081101561003357600080fd5b508051602091820151600080546001600160a01b031916331781556001600160a01b0390921682526001909252604090208190556002556110d1806100796000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad5780639c3ee244116100715780639c3ee24414610383578063a9059cbb146103a9578063c8db233e146103d5578063d6ff02e2146103fb578063dd62ed3e1461040357610121565b806370a082311461030357806380f55605146103295780638b0341361461034d5780638dc30b701461035557806395d89b411461037b57610121565b806323b872dd116100f457806323b872dd146102255780632bc43fd91461025b578063313ce5671461028d578063410085df146102ab57806359d667a5146102d757610121565b806306fdde0314610126578063095ea7b3146101a357806318160ddd146101e35780631b15982a146101fd575b600080fd5b61012e610431565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101cf600480360360408110156101b957600080fd5b506001600160a01b03813516906020013561045e565b604080519115158252519081900360200190f35b6101eb6104db565b60408051918252519081900360200190f35b6102236004803603602081101561021357600080fd5b50356001600160a01b03166104e1565b005b6101cf6004803603606081101561023b57600080fd5b506001600160a01b0381358116916020810135909116906040013561060e565b6101eb6004803603606081101561027157600080fd5b506001600160a01b0381351690602081013590604001356106ca565b610295610861565b6040805160ff9092168252519081900360200190f35b610223600480360360408110156102c157600080fd5b506001600160a01b038135169060200135610866565b610223600480360360408110156102ed57600080fd5b506001600160a01b038135169060200135610920565b6101eb6004803603602081101561031957600080fd5b50356001600160a01b03166109ce565b6103316109e0565b604080516001600160a01b039092168252519081900360200190f35b6101eb6109ef565b6101eb6004803603602081101561036b57600080fd5b50356001600160a01b03166109f5565b61012e610a07565b6101eb6004803603602081101561039957600080fd5b50356001600160a01b0316610a27565b6101cf600480360360408110156103bf57600080fd5b506001600160a01b038135169060200135610ad4565b610223600480360360208110156103eb57600080fd5b50356001600160a01b0316610ae1565b6101eb610b42565b6101eb6004803603604081101561041957600080fd5b506001600160a01b0381358116916020013516610bc3565b6040518060400160405280601181526020017029a72c102134b730b93c9027b83a34b7b760791b81525081565b60006001600160a01b03831661047357600080fd5b3360008181526005602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60045481565b6000546001600160a01b03163314610536576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b6001600160a01b0381166000908152600360205260409020548061055a575061060b565b6001600160a01b038216600090815260036020526040812055600454610586908263ffffffff610be016565b6004556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a36040805182815290516001600160a01b038416917f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7919081900360200190a2505b50565b6001600160a01b038316600090815260056020908152604080832033845290915281205480831115610680576040805162461bcd60e51b8152602060048201526016602482015275496e73756666696369656e7420616c6c6f77616e636560501b604482015290519081900360640190fd5b610690818463ffffffff610be016565b6001600160a01b03861660009081526005602090815260408083203384529091529020556106bf858585610c3d565b9150505b9392505050565b600080546001600160a01b03163314610720576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b6001600160a01b03841660009081526001602052604081205490610745828686610e14565b905080610757576000925050506106c3565b60025461076a908363ffffffff610be016565b6002556001600160a01b038616600090815260016020526040812055600454610799908263ffffffff610eb016565b6004556001600160a01b0386166000908152600360205260409020546107c5908263ffffffff610eb016565b6001600160a01b03871660008181526003602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a36040805182815290516001600160a01b038816917fa59f12e354e8cd10bb74c559844c2dd69a5458e31fe56c7594c62ca57480509a919081900360200190a295945050505050565b601281565b6000546001600160a01b031633146108bb576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b6001600160a01b0382166000908152600160205260409020546108ed906108e8908363ffffffff610be016565b610f0a565b6001600160a01b038316600090815260016020526040902055600254610919908263ffffffff610be016565b6002555050565b6000546001600160a01b03163314610975576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b6001600160a01b0382166000908152600160205260409020546109a2906108e8908363ffffffff610eb016565b6001600160a01b038316600090815260016020526040902055600254610919908263ffffffff610eb016565b60036020526000908152604090205481565b6000546001600160a01b031681565b60025481565b60016020526000908152604090205481565b604051806040016040528060048152602001631cd3d41560e21b81525081565b60008054604080516362c47a9360e11b81528151849384936001600160a01b039091169263c588f5269260048083019392829003018186803b158015610a6c57600080fd5b505afa158015610a80573d6000803e3d6000fd5b505050506040513d6040811015610a9657600080fd5b5080516020918201516001600160a01b03871660009081526001909352604090922054909350909150610aca908383610e14565b925050505b919050565b60006106c3338484610c3d565b6000546001600160a01b03163314610b36576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b806001600160a01b0316ff5b60008054604080516362c47a9360e11b8152815184936001600160a01b03169263c588f5269260048082019391829003018186803b158015610b8357600080fd5b505afa158015610b97573d6000803e3d6000fd5b505050506040513d6040811015610bad57600080fd5b50602001519050610bbd81610f67565b91505090565b600560209081526000928352604080842090915290825290205481565b600082821115610c37576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008060009054906101000a90046001600160a01b03166001600160a01b03166327745bae6040518163ffffffff1660e01b815260040160006040518083038186803b158015610c8c57600080fd5b505afa158015610ca0573d6000803e3d6000fd5b505050506001600160a01b03831615801590610cc557506001600160a01b0383163014155b610d08576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b6001600160a01b03841660009081526003602052604090205480831115610d6d576040805162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015290519081900360640190fd5b610d7d818463ffffffff610be016565b6001600160a01b038087166000908152600360205260408082209390935590861681522054610db2908463ffffffff610eb016565b6001600160a01b0380861660008181526003602090815260409182902094909455805187815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3506001949350505050565b600080610e27858563ffffffff610f8e16565b90506000610e3484610f67565b905060025486148015610e4657508515155b80610e4f575080155b15610e5d5791506106c39050565b80821115610ea7576040805162461bcd60e51b8152602060048201526012602482015271737570706c79203c20636c61696d61626c6560701b604482015290519081900360640190fd5b50949350505050565b6000828201838110156106c3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000662386f26fc1000082101580610f20575081155b610f63576040805162461bcd60e51b815260206004820152600f60248201526e42616c616e6365203c2024302e303160881b604482015290519081900360640190fd5b5090565b600454600090808311610f7e576000915050610acf565b6106c3838263ffffffff610be016565b60006106c382610fac85670de0b6b3a764000063ffffffff610fb816565b9063ffffffff61101116565b600082610fc7575060006104d5565b82820282848281610fd457fe5b04146106c35760405162461bcd60e51b815260040180806020018281038252602181526020018061107c6021913960400191505060405180910390fd5b6000808211611067576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b600082848161107257fe5b0494935050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723158205d090c4ad5e2cf2be86a9a54ad3efeb79f51d7ce904dce7c2f29cc801656731f64736f6c63430005100032536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7770bd4a33bf447720d717d08f3affb5aecfe4d2ebb8e3dd94539f5313e2447643596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6ea265627a7a72315820b93aeb12684444bf79dbc1b5964c0ba412118f88ff93a3af632d18f62a233b3464736f6c63430005100032", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "address", - "name": "_resolver", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor", - "signature": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "name", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "name": "CacheUpdated", - "type": "event", - "signature": "0x88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event", - "signature": "0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event", - "signature": "0x906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22" - }, - { - "constant": false, - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x79ba5097" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "creatorLimits", - "type": "uint256[2]" - }, - { - "internalType": "bytes32", - "name": "oracleKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "strikePrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "refundsEnabled", - "type": "bool" - }, - { - "internalType": "uint256[3]", - "name": "times", - "type": "uint256[3]" - }, - { - "internalType": "uint256[2]", - "name": "bids", - "type": "uint256[2]" - }, - { - "internalType": "uint256[3]", - "name": "fees", - "type": "uint256[3]" - } - ], - "name": "createMarket", - "outputs": [ - { - "internalType": "contract BinaryOptionMarket", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x130efa50" - }, - { - "constant": true, - "inputs": [], - "name": "isResolverCached", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x2af64bd3" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x1627540c" - }, - { - "constant": true, - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x53a47bb7" - }, - { - "constant": true, - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x8da5cb5b" - }, - { - "constant": false, - "inputs": [], - "name": "rebuildCache", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x74185360" - }, - { - "constant": true, - "inputs": [], - "name": "resolver", - "outputs": [ - { - "internalType": "contract AddressResolver", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x04f3bcec" - }, - { - "constant": true, - "inputs": [], - "name": "resolverAddressesRequired", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "addresses", - "type": "bytes32[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x899ffef4" - } - ], - "source": { - "keccak256": "0x5d2ba3c7638d20ed2e1243dab07bb5319536c92f1547b28768303ec4c25d3d33", - "urls": [ - "bzz-raw://cb6c2aa25c44628fe9c7ee2be48dc903e994eb97378af642df7573ac6ba3cdc5", - "dweb:/ipfs/QmSHQ3r9jBKsw7Moat6JyCaGPcoLAVc8gAPgSbfBC7Rwi9" - ] - }, - "metadata": { - "compiler": { - "version": "0.5.16+commit.9c3226ce" - }, - "language": "Solidity", - "settings": { - "compilationTarget": { - "BinaryOptionMarketFactory.sol": "BinaryOptionMarketFactory" - }, - "evmVersion": "istanbul", - "libraries": {}, - "optimizer": { - "enabled": true, - "runs": 200 - }, - "remappings": [] - }, - "sources": { - "BinaryOptionMarketFactory.sol": { - "keccak256": "0x5d2ba3c7638d20ed2e1243dab07bb5319536c92f1547b28768303ec4c25d3d33", - "urls": [ - "bzz-raw://cb6c2aa25c44628fe9c7ee2be48dc903e994eb97378af642df7573ac6ba3cdc5", - "dweb:/ipfs/QmSHQ3r9jBKsw7Moat6JyCaGPcoLAVc8gAPgSbfBC7Rwi9" - ] - } - }, - "version": 1 - } - }, - "BinaryOptionMarketManager": { - "bytecode": "6080604052600d805460ff191660011790553480156200001e57600080fd5b50604051620038d9380380620038d983398181016040526101408110156200004557600080fd5b508051602082015160408301516060840151608085015160a086015160c087015160e08801516101008901516101209099015197989697959694959394929391929091888a6001600160a01b038116620000e6576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a1506000546001600160a01b031662000191576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b600380546001600160a01b0390921661010002610100600160a81b0319909216919091179055600080546001600160a01b03191633179055620001dd876001600160e01b036200029a16565b620001f1886001600160e01b03620002e816565b62000205866001600160e01b036200033616565b62000219856001600160e01b036200038416565b6200022d846001600160e01b03620003d216565b62000241836001600160e01b03620004d316565b62000255826001600160e01b036200063616565b62000269816001600160e01b036200079916565b5050600080546001600160a01b0319166001600160a01b03999099169890981790975550620008e795505050505050565b620002ad6001600160e01b036200089a16565b60098190556040805182815290517ff378a0fd4ad3ffd9d7d50986f16b04acd2dc42691c4f412f34e8eefe883e66529181900360200190a150565b620002fb6001600160e01b036200089a16565b60088190556040805182815290517f5a2f2eae84f9e787d8159d363a776fa2b61d084686190cdc5a2c1ea833480b099181900360200190a150565b620003496001600160e01b036200089a16565b600a8190556040805182815290517f6de18e808fc4e6cb9c8910cf4bdc188ddbbdab65faecff65dab871720e8484899181900360200190a150565b620003976001600160e01b036200089a16565b600b8190556040805182815290517fdf7a26ae2e2eb953b81fd76b72fcdc74ebff7c21faa8f8f55323183d9785f52d9181900360200190a150565b620003e56001600160e01b036200089a16565b73__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200042a57600080fd5b505af41580156200043f573d6000803e3d6000fd5b505050506040513d60208110156200045657600080fd5b5051811115620004985760405162461bcd60e51b815260040180806020018281038252602d81526020018062003834602d913960400191505060405180910390fd5b600c8190556040805182815290517fd39cfbe31b20dbb6d995a675cf5c369555bf8bb908b6efc03873907fe9e133cf9181900360200190a150565b620004e66001600160e01b036200089a16565b60006005600101548201905073__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200053757600080fd5b505af41580156200054c573d6000803e3d6000fd5b505050506040513d60208110156200056357600080fd5b50518110620005a45760405162461bcd60e51b8152600401808060200182810382526021815260200180620038616021913960400191505060405180910390fd5b80600010620005fa576040805162461bcd60e51b815260206004820152601a60248201527f546f74616c20666565206d757374206265206e6f6e7a65726f2e000000000000604482015290519081900360640190fd5b60058290556040805183815290517f7b30e8f8e3de254785fbcb3068449dc18060f1fdb37b02731ecada99a78492c39181900360200190a15050565b620006496001600160e01b036200089a16565b60006005600001548201905073__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200069a57600080fd5b505af4158015620006af573d6000803e3d6000fd5b505050506040513d6020811015620006c657600080fd5b50518110620007075760405162461bcd60e51b8152600401808060200182810382526021815260200180620038616021913960400191505060405180910390fd5b806000106200075d576040805162461bcd60e51b815260206004820152601a60248201527f546f74616c20666565206d757374206265206e6f6e7a65726f2e000000000000604482015290519081900360640190fd5b60068290556040805183815290517f8c14462add32e0ae0fbfcf9e60711ecae573da337dc9127fff98fb7cfb3973b49181900360200190a15050565b620007ac6001600160e01b036200089a16565b73__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015620007f157600080fd5b505af415801562000806573d6000803e3d6000fd5b505050506040513d60208110156200081d57600080fd5b50518111156200085f5760405162461bcd60e51b8152600401808060200182810382526028815260200180620038b16028913960400191505060405180910390fd5b60078190556040805182815290517f01634ac4e9f09be1ef87b8d09e14926870261dcb9a0929d2d6460af6e4c5ad1e9181900360200190a150565b6000546001600160a01b03163314620008e55760405162461bcd60e51b815260040180806020018281038252602f81526020018062003882602f913960400191505060405180910390fd5b565b612f3d80620008f76000396000f3fe608060405234801561001057600080fd5b506004361061023d5760003560e01c80637859f4101161013b578063ac60c486116100b8578063c014fb841161007c578063c014fb84146106fc578063c095daf21461076a578063e73efc9b14610787578063fe40c470146107aa578063ff50abdc146107d05761023d565b8063ac60c48614610622578063adfd31af1461062a578063aeab5849146106a1578063bd6a10b8146106be578063be5af9fe146106db5761023d565b806391b4ded9116100ff57806391b4ded91461055257806394fcf3c31461055a5780639501dc871461058f5780639af1d35a146105ac5780639b11dc40146105b45761023d565b80637859f410146104a157806379ba5097146104c7578063899ffef4146104cf57806389c6318d146105275780638da5cb5b1461054a5761023d565b806336fd711e116101c957806364af2d871161018d57806364af2d871461043a57806364cf34bd146104425780636b3a09841461045f57806373b7de151461047c57806374185360146104995761023d565b806336fd711e146103c857806339ab4c41146103e55780634a41d89d1461040457806353a47bb71461042a5780635c975abb146104325761023d565b8063155028401161021057806315502840146103245780631627540c1461034157806316c38b3c146103675780631f3f10b0146103865780632af64bd3146103ac5761023d565b806302610c501461024257806303ff60181461025c57806304f3bcec146102e35780630dd16fd514610307575b600080fd5b61024a6107d8565b60408051918252519081900360200190f35b6102e16004803603606081101561027257600080fd5b6001600160a01b03823516916020810135151591810190606081016040820135600160201b8111156102a357600080fd5b8201836020820111156102b557600080fd5b803590602001918460208302840111600160201b831117156102d657600080fd5b5090925090506107df565b005b6102eb610ab1565b604080516001600160a01b039092168252519081900360200190f35b6102e16004803603602081101561031d57600080fd5b5035610ac5565b6102e16004803603602081101561033a57600080fd5b5035610c17565b6102e16004803603602081101561035757600080fd5b50356001600160a01b0316610c5a565b6102e16004803603602081101561037d57600080fd5b50351515610cb6565b6102e16004803603602081101561039c57600080fd5b50356001600160a01b0316610d30565b6103b4610d5a565b604080519115158252519081900360200190f35b6102e1600480360360208110156103de57600080fd5b5035610e6a565b6102e1600480360360208110156103fb57600080fd5b50351515610f5b565b61040c610fba565b60408051938452602084019290925282820152519081900360600190f35b6102eb610fc6565b6103b4610fd5565b6103b4610fde565b6102e16004803603602081101561045857600080fd5b5035610fe7565b6102e16004803603602081101561047557600080fd5b503561102a565b6102e16004803603602081101561049257600080fd5b5035611122565b6102e1611213565b6102e1600480360360208110156104b757600080fd5b50356001600160a01b03166113f0565b6102e16114c1565b6104d761157d565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156105135781810151838201526020016104fb565b505050509050019250505060405180910390f35b6104d76004803603604081101561053d57600080fd5b5080359060200135611652565b6102eb61166f565b61024a61167e565b6102eb600480360360e081101561057057600080fd5b508035906020810135906040810135151590606081019060a001611684565b6102e1600480360360208110156105a557600080fd5b5035611c2a565b61040c611d7c565b6102e1600480360360208110156105ca57600080fd5b810190602081018135600160201b8111156105e457600080fd5b8201836020820111156105f657600080fd5b803590602001918460208302840111600160201b8311171561061757600080fd5b509092509050611d88565b61024a611fd0565b6102e16004803603604081101561064057600080fd5b813515159190810190604081016020820135600160201b81111561066357600080fd5b82018360208201111561067557600080fd5b803590602001918460208302840111600160201b8311171561069657600080fd5b509092509050611fd6565b6102e1600480360360208110156106b757600080fd5b5035612206565b6102e1600480360360208110156106d457600080fd5b5035612300565b6106e3612343565b6040805192835260208301919091528051918290030190f35b6102e16004803603602081101561071257600080fd5b810190602081018135600160201b81111561072c57600080fd5b82018360208201111561073e57600080fd5b803590602001918460208302840111600160201b8311171561075f57600080fd5b50909250905061234c565b6102e16004803603602081101561078057600080fd5b5035612482565b6104d76004803603604081101561079d57600080fd5b50803590602001356124c5565b6102e1600480360360208110156107c057600080fd5b50356001600160a01b03166124d9565b61024a6126ed565b600f545b90565b6107e76126f3565b80806107f35750610aab565b600084610801576011610804565b600f5b90506000805b8381101561098257600086868381811061082057fe5b905060200201356001600160a01b0316905061083b8161273e565b61087e576040805162461bcd60e51b815260206004820152600f60248201526e26b0b935b2ba103ab735b737bbb71760891b604482015290519081900360640190fd5b61088e848263ffffffff61277016565b610903816001600160a01b031663eef49ee36040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ca57600080fd5b505afa1580156108de573d6000803e3d6000fd5b505050506040513d60208110156108f457600080fd5b5051849063ffffffff6128b116565b9250806001600160a01b0316631627540c8a6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561095d57600080fd5b505af1158015610971573d6000803e3d6000fd5b50506001909301925061080a915050565b50600e54610996908263ffffffff61290b16565b600e55604080516001600160a01b038916815260208082018381529282018790527f3e429aa34462b428d3f7277acb67e1c83d80a57faab2a47924369b5060f35679928a92899289929060608301908590850280828437600083820152604051601f909101601f1916909201829003965090945050505050a16040805163adfd31af60e01b81528715156004820190815260248201928352604482018790526001600160a01b038a169263adfd31af928a928a928a92606401846020850280828437600081840152601f19601f820116905080830192505050945050505050600060405180830381600087803b158015610a8f57600080fd5b505af1158015610aa3573d6000803e3d6000fd5b505050505050505b50505050565b60035461010090046001600160a01b031681565b610acd6126f3565b60006005600001548201905073__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1d57600080fd5b505af4158015610b31573d6000803e3d6000fd5b505050506040513d6020811015610b4757600080fd5b50518110610b865760405162461bcd60e51b8152600401808060200182810382526021815260200180612ded6021913960400191505060405180910390fd5b80600010610bdb576040805162461bcd60e51b815260206004820152601a60248201527f546f74616c20666565206d757374206265206e6f6e7a65726f2e000000000000604482015290519081900360640190fd5b60068290556040805183815290517f8c14462add32e0ae0fbfcf9e60711ecae573da337dc9127fff98fb7cfb3973b49181900360200190a15050565b610c1f6126f3565b60098190556040805182815290517ff378a0fd4ad3ffd9d7d50986f16b04acd2dc42691c4f412f34e8eefe883e66529181900360200190a150565b610c626126f3565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b610cbe6126f3565b60035460ff1615158115151415610cd457610d2d565b6003805460ff1916821515179081905560ff1615610cf157426002555b6003546040805160ff90921615158252517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec59181900360200190a15b50565b610d386126f3565b601380546001600160a01b0319166001600160a01b0392909216919091179055565b60006060610d6661157d565b905060005b8151811015610e61576000828281518110610d8257fe5b602090810291909101810151600081815260048084526040918290205460035483516321f8a72160e01b815292830185905292519395506001600160a01b039081169461010090930416926321f8a72192602480840193919291829003018186803b158015610df057600080fd5b505afa158015610e04573d6000803e3d6000fd5b505050506040513d6020811015610e1a57600080fd5b50516001600160a01b0316141580610e4757506000818152600460205260409020546001600160a01b0316155b15610e5857600093505050506107dc565b50600101610d6b565b50600191505090565b610e726126f3565b73__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015610eb657600080fd5b505af4158015610eca573d6000803e3d6000fd5b505050506040513d6020811015610ee057600080fd5b5051811115610f205760405162461bcd60e51b8152600401808060200182810382526028815260200180612ee16028913960400191505060405180910390fd5b60078190556040805182815290517f01634ac4e9f09be1ef87b8d09e14926870261dcb9a0929d2d6460af6e4c5ad1e9181900360200190a150565b610f636126f3565b600d5460ff16151581151514610d2d57600d805482151560ff19909116811790915560408051918252517fcc590b6309435383b617aaa0cae6aba938f2ee471cfb539201dd7655a23caff99181900360200190a150565b600854600954600a5483565b6001546001600160a01b031681565b60035460ff1681565b600d5460ff1681565b610fef6126f3565b600a8190556040805182815290517f6de18e808fc4e6cb9c8910cf4bdc188ddbbdab65faecff65dab871720e8484899181900360200190a150565b6110333361273e565b61106e5760405162461bcd60e51b8152600401808060200182810382526021815260200180612e306021913960400191505060405180910390fd5b60035460ff16156110b05760405162461bcd60e51b815260040180806020018281038252603c815260200180612ea5603c913960400191505060405180910390fd5b6110b8612968565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b1580156110f057600080fd5b505afa158015611104573d6000803e3d6000fd5b5050600e5461111c925090508263ffffffff61290b16565b600e5550565b61112a6126f3565b73__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b15801561116e57600080fd5b505af4158015611182573d6000803e3d6000fd5b505050506040513d602081101561119857600080fd5b50518111156111d85760405162461bcd60e51b815260040180806020018281038252602d815260200180612dc0602d913960400191505060405180910390fd5b600c8190556040805182815290517fd39cfbe31b20dbb6d995a675cf5c369555bf8bb908b6efc03873907fe9e133cf9181900360200190a150565b606061121d61157d565b905060005b81518110156113ec57600082828151811061123957fe5b602002602001015190506000600360019054906101000a90046001600160a01b03166001600160a01b031663dacb2d01838460405160200180807f5265736f6c766572206d697373696e67207461726765743a20000000000000008152506019018281526020019150506040516020818303038152906040526040518363ffffffff1660e01b81526004018083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156113045781810151838201526020016112ec565b50505050905090810190601f1680156113315780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b15801561134f57600080fd5b505afa158015611363573d6000803e3d6000fd5b505050506040513d602081101561137957600080fd5b505160008381526004602090815260409182902080546001600160a01b0319166001600160a01b03851690811790915582518681529182015281519293507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68929081900390910190a15050600101611222565b5050565b611401600f8263ffffffff61298716565b611449576040805162461bcd60e51b8152602060048201526014602482015273139bdd08185b881858dd1a5d99481b585c9ad95d60621b604482015290519081900360640190fd5b806001600160a01b0316632810e1d66040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561148457600080fd5b505af1158015611498573d6000803e3d6000fd5b505050506114b081600f61277090919063ffffffff16565b610d2d60118263ffffffff6129f516565b6001546001600160a01b0316331461150a5760405162461bcd60e51b8152600401808060200182810382526035815260200180612d8b6035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60408051600480825260a08201909252606091602082016080803883390190505090506b53797374656d53746174757360a01b816000815181106115bd57fe5b6020026020010181815250506814de5b9d1a1cd554d160ba1b816001815181106115e357fe5b6020026020010181815250506c45786368616e6765526174657360981b8160028151811061160d57fe5b6020026020010181815250507842696e6172794f7074696f6e4d61726b6574466163746f727960381b8160038151811061164357fe5b60200260200101818152505090565b60606116666011848463ffffffff612a4716565b90505b92915050565b6000546001600160a01b031681565b60025481565b60035460009060ff16156116c95760405162461bcd60e51b815260040180806020018281038252603c815260200180612ea5603c913960400191505060405180910390fd5b6116d1612968565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561170957600080fd5b505afa15801561171d573d6000803e3d6000fd5b5050600d5460ff16915061177a9050576040805162461bcd60e51b815260206004820152601b60248201527f4d61726b6574206372656174696f6e2069732064697361626c65640000000000604482015290519081900360640190fd5b61178386612b1d565b6117c2576040805162461bcd60e51b815260206004820152600b60248201526a496e76616c6964206b657960a81b604482015290519081900360640190fd5b600a548335906020850135904201811115611824576040805162461bcd60e51b815260206004820152601e60248201527f4d6174757269747920746f6f2066617220696e20746865206675747572650000604482015290519081900360640190fd5b60095460009061183b90839063ffffffff6128b116565b9050600061184e863560208801356128b1565b90508342106118a4576040805162461bcd60e51b815260206004820152601960248201527f456e64206f662062696464696e67206861732070617373656400000000000000604482015290519081900360640190fd5b8284106118f8576040805162461bcd60e51b815260206004820181905260248201527f4d6174757269747920707265646174657320656e64206f662062696464696e67604482015290519081900360640190fd5b6000611902612c51565b6001600160a01b031663130efa50336040518060400160405280600b600001548152602001600b600101548152508e8e8e60405180606001604052808d81526020018c81526020018b8152508e6040518060600160405280600560000154815260200160056001015481526020016005600201548152506040518963ffffffff1660e01b815260040180896001600160a01b03166001600160a01b0316815260200188600260200280838360005b838110156119c85781810151838201526020016119b0565b505050509050018781526020018681526020018515151515815260200184600360200280838360005b83811015611a095781810151838201526020016119f1565b5050505090500183600260200280828437600081840152601f19601f82011690508083019250505082600360200280838360005b83811015611a55578181015183820152602001611a3d565b5050505090500198505050505050505050602060405180830381600087803b158015611a8057600080fd5b505af1158015611a94573d6000803e3d6000fd5b505050506040513d6020811015611aaa57600080fd5b5051604080516303a0c29b60e51b815290519192506001600160a01b0383169163741853609160048082019260009290919082900301818387803b158015611af157600080fd5b505af1158015611b05573d6000803e3d6000fd5b50505050611b1d81600f6129f590919063ffffffff16565b600e54611b30908363ffffffff6128b116565b600e55611b3b612c78565b604080516323b872dd60e01b81523360048201526001600160a01b03848116602483015260448201869052915192909116916323b872dd916064808201926020929091908290030181600087803b158015611b9557600080fd5b505af1158015611ba9573d6000803e3d6000fd5b505050506040513d6020811015611bbf57600080fd5b5050604080516001600160a01b0383168152602081018c9052808201879052606081018690526080810185905290518c9133917fbcd154709bbe69680012cadcd07d57bd4a0ec64a033c2a3e31d2d0fadb38d3a89181900360a00190a39a9950505050505050505050565b611c326126f3565b60006005600101548201905073__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015611c8257600080fd5b505af4158015611c96573d6000803e3d6000fd5b505050506040513d6020811015611cac57600080fd5b50518110611ceb5760405162461bcd60e51b8152600401808060200182810382526021815260200180612ded6021913960400191505060405180910390fd5b80600010611d40576040805162461bcd60e51b815260206004820152601a60248201527f546f74616c20666565206d757374206265206e6f6e7a65726f2e000000000000604482015290519081900360640190fd5b60058290556040805183815290517f7b30e8f8e3de254785fbcb3068449dc18060f1fdb37b02731ecada99a78492c39181900360200190a15050565b60055460065460075483565b60005b81811015611fcb576000838383818110611da157fe5b6040805160048152602481018252602081810180516001600160e01b03166303a0c29b60e51b178152925182516001600160a01b0392909502969096013516955093600093508592859282918083835b60208310611e105780518252601f199092019160209182019101611df1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611e72576040519150601f19603f3d011682016040523d82523d6000602084013e611e77565b606091505b5050905080611fc057600354604080516001600160a01b03610100909304831660248083019190915282518083039091018152604490910182526020810180516001600160e01b0316633be99e6f60e01b1781529151815191936000939088169285929182918083835b60208310611f005780518252601f199092019160209182019101611ee1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611f62576040519150601f19603f3d011682016040523d82523d6000602084013e611f67565b606091505b5050905080611fbd576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742072656275696c6420636163686520666f72206d61726b657400604482015290519081900360640190fd5b50505b505050600101611d8b565b505050565b60115490565b6013546001600160a01b0316331461201f5760405162461bcd60e51b8152600401808060200182810382526025815260200180612e806025913960400191505060405180910390fd5b808061202b5750611fcb565b60008461203957601161203c565b600f5b90506000805b8381101561216a57600086868381811061205857fe5b905060200201356001600160a01b031690506120738161273e565b156120bd576040805162461bcd60e51b815260206004820152601560248201527426b0b935b2ba1030b63932b0b23c9035b737bbb71760591b604482015290519081900360640190fd5b806001600160a01b03166379ba50976040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156120f857600080fd5b505af115801561210c573d6000803e3d6000fd5b5050505061212381856129f590919063ffffffff16565b61215f816001600160a01b031663eef49ee36040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ca57600080fd5b925050600101612042565b50600e5461217e908263ffffffff6128b116565b600e55601354604080516001600160a01b0390921680835260208084018381529284018890527fea7a4e14e72ba7db7e2fd406278900badf50b2ce7d9def39d613cc08054c537b9391928992899290919060608301908590850280828437600083820152604051601f909101601f1916909201829003965090945050505050a1505050505050565b612217600f3363ffffffff61298716565b6122525760405162461bcd60e51b8152600401808060200182810382526022815260200180612e0e6022913960400191505060405180910390fd5b60035460ff16156122945760405162461bcd60e51b815260040180806020018281038252603c815260200180612ea5603c913960400191505060405180910390fd5b61229c612968565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b1580156122d457600080fd5b505afa1580156122e8573d6000803e3d6000fd5b5050600e5461111c925090508263ffffffff6128b116565b6123086126f3565b60088190556040805182815290517f5a2f2eae84f9e787d8159d363a776fa2b61d084686190cdc5a2c1ea833480b099181900360200190a150565b600b54600c5482565b60035460ff161561238e5760405162461bcd60e51b815260040180806020018281038252603c815260200180612ea5603c913960400191505060405180910390fd5b60005b81811015611fcb5760008383838181106123a757fe5b905060200201356001600160a01b03169050806001600160a01b031663c8db233e336040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561241157600080fd5b505af1158015612425573d6000803e3d6000fd5b5050505061243d81601161277090919063ffffffff16565b604080516001600160a01b038316815290517f16e62064e42f5aec62df22ae895ef539f153e0d4ea290e2cc4e0e8f708f2fbbc9181900360200190a150600101612391565b61248a6126f3565b600b8190556040805182815290517fdf7a26ae2e2eb953b81fd76b72fcdc74ebff7c21faa8f8f55323183d9785f52d9181900360200190a150565b6060611666600f848463ffffffff612a4716565b60035460ff161561251b5760405162461bcd60e51b815260040180806020018281038252603c815260200180612ea5603c913960400191505060405180910390fd5b61252c600f8263ffffffff61298716565b612574576040805162461bcd60e51b8152602060048201526014602482015273139bdd08185b881858dd1a5d99481b585c9ad95d60621b604482015290519081900360640190fd5b6000816001600160a01b03166302d05d3f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156125af57600080fd5b505afa1580156125c3573d6000803e3d6000fd5b505050506040513d60208110156125d957600080fd5b50519050336001600160a01b0382161461263a576040805162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d61726b65742063726561746f7200000000000000604482015290519081900360640190fd5b6040805163130cffa560e21b815233600482015290516001600160a01b03841691634c33fe9491602480830192600092919082900301818387803b15801561268157600080fd5b505af1158015612695573d6000803e3d6000fd5b505050506126ad82600f61277090919063ffffffff16565b604080516001600160a01b038416815290517f996fafab197beb99fff6fdc975bb6cf90352f2c733c76ef37c2e27f17d7d424b9181900360200190a15050565b600e5481565b6000546001600160a01b0316331461273c5760405162461bcd60e51b815260040180806020018281038252602f815260200180612e51602f913960400191505060405180910390fd5b565b6000612751600f8363ffffffff61298716565b80612768575061276860118363ffffffff61298716565b90505b919050565b61277a8282612987565b6127c1576040805162461bcd60e51b815260206004820152601360248201527222b632b6b2b73a103737ba1034b71039b2ba1760691b604482015290519081900360640190fd5b6001600160a01b03811660009081526001830160205260409020548254600019018082146128605760008460000182815481106127fa57fe5b60009182526020909120015485546001600160a01b039091169150819086908590811061282357fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b0394851617905592909116815260018601909152604090208290555b835484908061286b57fe5b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b0394909416815260019490940190925250506040812055565b600082820183811015611666576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082821115612962576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006129826b53797374656d53746174757360a01b612c8b565b905090565b815460009061299857506000611669565b6001600160a01b0382166000908152600184016020526040902054801515806129ed5750826001600160a01b0316846000016000815481106129d657fe5b6000918252602090912001546001600160a01b0316145b949350505050565b6129ff8282612987565b6113ec5781546001600160a01b038216600081815260018086016020908152604083208590559084018655858252902090910180546001600160a01b03191690911790555050565b825460609083830190811115612a5b575083545b838111612a78575050604080516000815260208101909152612b16565b604080518583038082526020808202830101909252606090828015612aa7578160200160208202803883390190505b50905060005b82811015612b10578760000187820181548110612ac657fe5b9060005260206000200160009054906101000a90046001600160a01b0316828281518110612af057fe5b6001600160a01b0390921660209283029190910190910152600101612aad565b50925050505b9392505050565b600080612b28612d6f565b9050806001600160a01b031663ac82f608846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015612b6e57600080fd5b505afa158015612b82573d6000803e3d6000fd5b505050506040513d6020811015612b9857600080fd5b505115612c485782631cd554d160e21b1415612bb857600091505061276b565b6000816001600160a01b031663728dec29856040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b158015612bfe57600080fd5b505afa158015612c12573d6000803e3d6000fd5b505050506040513d60a0811015612c2857600080fd5b505190508015612c3d5760009250505061276b565b60019250505061276b565b50600092915050565b60006129827842696e6172794f7074696f6e4d61726b6574466163746f727960381b612c8b565b60006129826814de5b9d1a1cd554d160ba1b5b600081815260046020908152604080832054815170026b4b9b9b4b7339030b2323932b9b99d1607d1b9381019390935260318084018690528251808503909101815260519093019091526001600160a01b03169081612d685760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d2d578181015183820152602001612d15565b50505050905090810190601f168015612d5a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5092915050565b60006129826c45786368616e6765526174657360981b612c8b56fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e65727368697043726561746f7220736b6577206c696d6974206d757374206265206e6f2067726561746572207468616e20312e546f74616c20666565206d757374206265206c657373207468616e20313030252e5065726d6974746564206f6e6c7920666f7220616374697665206d61726b6574732e5065726d6974746564206f6e6c7920666f72206b6e6f776e206d61726b6574732e4f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e4f6e6c79207065726d697474656420666f72206d6967726174696e67206d616e616765722e5468697320616374696f6e2063616e6e6f7420626520706572666f726d6564207768696c652074686520636f6e747261637420697320706175736564526566756e6420666565206d757374206265206e6f2067726561746572207468616e20313030252ea265627a7a72315820020cfc36f9d5dc23de8fcf224831b4dad9b06476a079d24438bbfbcd7e40a9e964736f6c6343000510003243726561746f7220736b6577206c696d6974206d757374206265206e6f2067726561746572207468616e20312e546f74616c20666565206d757374206265206c657373207468616e20313030252e4f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e526566756e6420666565206d757374206265206e6f2067726561746572207468616e20313030252e", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "address", - "name": "_resolver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_maxOraclePriceAge", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_expiryDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maxTimeToMaturity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_creatorCapitalRequirement", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_creatorSkewLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_poolFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_creatorFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_refundFee", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor", - "signature": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "name", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "name": "CacheUpdated", - "type": "event", - "signature": "0x88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "CreatorCapitalRequirementUpdated", - "type": "event", - "signature": "0xdf7a26ae2e2eb953b81fd76b72fcdc74ebff7c21faa8f8f55323183d9785f52d" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "CreatorFeeUpdated", - "type": "event", - "signature": "0x8c14462add32e0ae0fbfcf9e60711ecae573da337dc9127fff98fb7cfb3973b4" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "CreatorSkewLimitUpdated", - "type": "event", - "signature": "0xd39cfbe31b20dbb6d995a675cf5c369555bf8bb908b6efc03873907fe9e133cf" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "ExerciseDurationUpdated", - "type": "event", - "signature": "0xf0a1ff3a67369ec37b38f6cf8dec83acaffd6d00a2dd1e95a12394d4863a0b71" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "ExpiryDurationUpdated", - "type": "event", - "signature": "0xf378a0fd4ad3ffd9d7d50986f16b04acd2dc42691c4f412f34e8eefe883e6652" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketCancelled", - "type": "event", - "signature": "0x996fafab197beb99fff6fdc975bb6cf90352f2c733c76ef37c2e27f17d7d424b" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "oracleKey", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "strikePrice", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "biddingEndDate", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "maturityDate", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "expiryDate", - "type": "uint256" - } - ], - "name": "MarketCreated", - "type": "event", - "signature": "0xbcd154709bbe69680012cadcd07d57bd4a0ec64a033c2a3e31d2d0fadb38d3a8" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "name": "MarketCreationEnabledUpdated", - "type": "event", - "signature": "0xcc590b6309435383b617aaa0cae6aba938f2ee471cfb539201dd7655a23caff9" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketExpired", - "type": "event", - "signature": "0x16e62064e42f5aec62df22ae895ef539f153e0d4ea290e2cc4e0e8f708f2fbbc" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract BinaryOptionMarketManager", - "name": "receivingManager", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract BinaryOptionMarket[]", - "name": "markets", - "type": "address[]" - } - ], - "name": "MarketsMigrated", - "type": "event", - "signature": "0x3e429aa34462b428d3f7277acb67e1c83d80a57faab2a47924369b5060f35679" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract BinaryOptionMarketManager", - "name": "migratingManager", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract BinaryOptionMarket[]", - "name": "markets", - "type": "address[]" - } - ], - "name": "MarketsReceived", - "type": "event", - "signature": "0xea7a4e14e72ba7db7e2fd406278900badf50b2ce7d9def39d613cc08054c537b" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "MaxOraclePriceAgeUpdated", - "type": "event", - "signature": "0x5a2f2eae84f9e787d8159d363a776fa2b61d084686190cdc5a2c1ea833480b09" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "MaxTimeToMaturityUpdated", - "type": "event", - "signature": "0x6de18e808fc4e6cb9c8910cf4bdc188ddbbdab65faecff65dab871720e848489" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event", - "signature": "0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event", - "signature": "0x906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bool", - "name": "isPaused", - "type": "bool" - } - ], - "name": "PauseChanged", - "type": "event", - "signature": "0x8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "PoolFeeUpdated", - "type": "event", - "signature": "0x7b30e8f8e3de254785fbcb3068449dc18060f1fdb37b02731ecada99a78492c3" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "RefundFeeUpdated", - "type": "event", - "signature": "0x01634ac4e9f09be1ef87b8d09e14926870261dcb9a0929d2d6460af6e4c5ad1e" - }, - { - "constant": false, - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x79ba5097" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pageSize", - "type": "uint256" - } - ], - "name": "activeMarkets", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xe73efc9b" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "cancelMarket", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xfe40c470" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bytes32", - "name": "oracleKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "strikePrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "refundsEnabled", - "type": "bool" - }, - { - "internalType": "uint256[2]", - "name": "times", - "type": "uint256[2]" - }, - { - "internalType": "uint256[2]", - "name": "bids", - "type": "uint256[2]" - } - ], - "name": "createMarket", - "outputs": [ - { - "internalType": "contract IBinaryOptionMarket", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x94fcf3c3" - }, - { - "constant": true, - "inputs": [], - "name": "creatorLimits", - "outputs": [ - { - "internalType": "uint256", - "name": "capitalRequirement", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "skewLimit", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xbe5af9fe" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "delta", - "type": "uint256" - } - ], - "name": "decrementTotalDeposited", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x6b3a0984" - }, - { - "constant": true, - "inputs": [], - "name": "durations", - "outputs": [ - { - "internalType": "uint256", - "name": "maxOraclePriceAge", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiryDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimeToMaturity", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x4a41d89d" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address[]", - "name": "markets", - "type": "address[]" - } - ], - "name": "expireMarkets", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xc014fb84" - }, - { - "constant": true, - "inputs": [], - "name": "fees", - "outputs": [ - { - "internalType": "uint256", - "name": "poolFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "creatorFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "refundFee", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x9af1d35a" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "delta", - "type": "uint256" - } - ], - "name": "incrementTotalDeposited", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xaeab5849" - }, - { - "constant": true, - "inputs": [], - "name": "isResolverCached", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x2af64bd3" - }, - { - "constant": true, - "inputs": [], - "name": "lastPauseTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x91b4ded9" - }, - { - "constant": true, - "inputs": [], - "name": "marketCreationEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x64af2d87" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pageSize", - "type": "uint256" - } - ], - "name": "maturedMarkets", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x89c6318d" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "contract BinaryOptionMarketManager", - "name": "receivingManager", - "type": "address" - }, - { - "internalType": "bool", - "name": "active", - "type": "bool" - }, - { - "internalType": "contract BinaryOptionMarket[]", - "name": "marketsToMigrate", - "type": "address[]" - } - ], - "name": "migrateMarkets", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x03ff6018" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x1627540c" - }, - { - "constant": true, - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x53a47bb7" - }, - { - "constant": true, - "inputs": [], - "name": "numActiveMarkets", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x02610c50" - }, - { - "constant": true, - "inputs": [], - "name": "numMaturedMarkets", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xac60c486" - }, - { - "constant": true, - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x8da5cb5b" - }, - { - "constant": true, - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x5c975abb" - }, - { - "constant": false, - "inputs": [], - "name": "rebuildCache", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x74185360" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "contract BinaryOptionMarket[]", - "name": "marketsToSync", - "type": "address[]" - } - ], - "name": "rebuildMarketCaches", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x9b11dc40" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bool", - "name": "active", - "type": "bool" - }, - { - "internalType": "contract BinaryOptionMarket[]", - "name": "marketsToReceive", - "type": "address[]" - } - ], - "name": "receiveMarkets", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xadfd31af" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "resolveMarket", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x7859f410" - }, - { - "constant": true, - "inputs": [], - "name": "resolver", - "outputs": [ - { - "internalType": "contract AddressResolver", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x04f3bcec" - }, - { - "constant": true, - "inputs": [], - "name": "resolverAddressesRequired", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "addresses", - "type": "bytes32[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x899ffef4" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_creatorCapitalRequirement", - "type": "uint256" - } - ], - "name": "setCreatorCapitalRequirement", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xc095daf2" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_creatorFee", - "type": "uint256" - } - ], - "name": "setCreatorFee", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x0dd16fd5" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_creatorSkewLimit", - "type": "uint256" - } - ], - "name": "setCreatorSkewLimit", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x73b7de15" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_expiryDuration", - "type": "uint256" - } - ], - "name": "setExpiryDuration", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x15502840" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "name": "setMarketCreationEnabled", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x39ab4c41" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_maxOraclePriceAge", - "type": "uint256" - } - ], - "name": "setMaxOraclePriceAge", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xbd6a10b8" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_maxTimeToMaturity", - "type": "uint256" - } - ], - "name": "setMaxTimeToMaturity", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x64cf34bd" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "contract BinaryOptionMarketManager", - "name": "manager", - "type": "address" - } - ], - "name": "setMigratingManager", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x1f3f10b0" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bool", - "name": "_paused", - "type": "bool" - } - ], - "name": "setPaused", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x16c38b3c" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_poolFee", - "type": "uint256" - } - ], - "name": "setPoolFee", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x9501dc87" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_refundFee", - "type": "uint256" - } - ], - "name": "setRefundFee", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x36fd711e" - }, - { - "constant": true, - "inputs": [], - "name": "totalDeposited", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xff50abdc" - } - ], - "source": { - "keccak256": "0x25551bb15e313a47f1768788ee7e4bf6c6dfd140a051e25139b995a306e526c6", - "urls": [ - "bzz-raw://4a64a84dce24ace14b7662ecf3f3bd083f4064923d2bdafc8290fd237c35cf73", - "dweb:/ipfs/QmYHjCbQETjmrmZBvju3MjpDBqHEF754jCiTpPRLgfdzme" - ] - }, - "metadata": { - "compiler": { - "version": "0.5.16+commit.9c3226ce" - }, - "language": "Solidity", - "settings": { - "compilationTarget": { - "BinaryOptionMarketManager.sol": "BinaryOptionMarketManager" - }, - "evmVersion": "istanbul", - "libraries": {}, - "optimizer": { - "enabled": true, - "runs": 200 - }, - "remappings": [] - }, - "sources": { - "BinaryOptionMarketManager.sol": { - "keccak256": "0x25551bb15e313a47f1768788ee7e4bf6c6dfd140a051e25139b995a306e526c6", - "urls": [ - "bzz-raw://4a64a84dce24ace14b7662ecf3f3bd083f4064923d2bdafc8290fd237c35cf73", - "dweb:/ipfs/QmYHjCbQETjmrmZBvju3MjpDBqHEF754jCiTpPRLgfdzme" - ] - } - }, - "version": 1 - } - }, - "BinaryOptionMarketData": { - "bytecode": "608060405234801561001057600080fd5b506112f7806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80631216fc7b14610046578063a30c302d1461006f578063dca5f5c31461008f575b600080fd5b610059610054366004610e75565b6100af565b60405161006691906111f1565b60405180910390f35b61008261007d366004610e75565b61047c565b60405161006691906111e2565b6100a261009d366004610e93565b610a61565b60405161006691906111d4565b6100b7610c44565b600080836001600160a01b0316631069143a6040518163ffffffff1660e01b8152600401604080518083038186803b1580156100f257600080fd5b505afa158015610106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061012a9190810190610ecd565b915091506000806000866001600160a01b0316639e3b34bf6040518163ffffffff1660e01b815260040160606040518083038186803b15801561016c57600080fd5b505afa158015610180573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506101a49190810190610e28565b9250925092506000806000896001600160a01b03166398508ecd6040518163ffffffff1660e01b815260040160606040518083038186803b1580156101e857600080fd5b505afa1580156101fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506102209190810190610e28565b92509250925060008060008c6001600160a01b0316639af1d35a6040518163ffffffff1660e01b815260040160606040518083038186803b15801561026457600080fd5b505afa158015610278573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061029c9190810190610e28565b9250925092506102aa610c44565b6040518060c001604052808f6001600160a01b03166302d05d3f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ee57600080fd5b505afa158015610302573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103269190810190610de4565b6001600160a01b0316815260200160405180604001604052808f6001600160a01b031681526020018e6001600160a01b0316815250815260200160405180606001604052808d81526020018c81526020018b815250815260200160405180606001604052808a81526020018981526020018881525081526020016040518060600160405280878152602001868152602001858152508152602001604051806040016040528060008152602001600081525081525090506000808f6001600160a01b031663be5af9fe6040518163ffffffff1660e01b8152600401604080518083038186803b15801561041757600080fd5b505afa15801561042b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061044f9190810190610f57565b60408051808201909152918252602082015260a084015250909c505050505050505050505050505b919050565b610484610ca0565b600080836001600160a01b031663c7a5bdc86040518163ffffffff1660e01b8152600401604080518083038186803b1580156104bf57600080fd5b505afa1580156104d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104f79190810190610f57565b91509150600080856001600160a01b0316633d7a783b6040518163ffffffff1660e01b8152600401604080518083038186803b15801561053657600080fd5b505afa15801561054a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061056e9190810190610f57565b91509150600080876001600160a01b031663d068cdc56040518163ffffffff1660e01b8152600401604080518083038186803b1580156105ad57600080fd5b505afa1580156105c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506105e59190810190610f57565b91509150600080896001600160a01b0316638b0341366040518163ffffffff1660e01b8152600401604080518083038186803b15801561062457600080fd5b505afa158015610638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061065c9190810190610f57565b915091506000808b6001600160a01b031663d3419bf36040518163ffffffff1660e01b8152600401604080518083038186803b15801561069b57600080fd5b505afa1580156106af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506106d39190810190610f57565b9150915060405180610120016040528060405180604001604052808d81526020018c8152508152602001604051806040016040528085815260200184815250815260200160405180604001604052808f6001600160a01b031663eef49ee36040518163ffffffff1660e01b815260040160206040518083038186803b15801561075b57600080fd5b505afa15801561076f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107939190810190610f39565b81526020018f6001600160a01b0316632115e3036040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d157600080fd5b505afa1580156107e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108099190810190610f39565b815250815260200160405180604001604052808f6001600160a01b0316633f6fa6556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085557600080fd5b505afa158015610869573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061088d9190810190610e0a565b151581526020018f6001600160a01b031663ac3791e36040518163ffffffff1660e01b815260040160206040518083038186803b1580156108cd57600080fd5b505afa1580156108e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109059190810190610e0a565b151581525081526020018d6001600160a01b031663b1c9fe6e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561094857600080fd5b505afa15801561095c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109809190810190610efd565b600381111561098b57fe5b81526020018d6001600160a01b031663653721476040518163ffffffff1660e01b815260040160206040518083038186803b1580156109c957600080fd5b505afa1580156109dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a019190810190610f1b565b6001811115610a0c57fe5b81526040805180820182529687526020878101969096528582019690965285518087018752998a5289850198909852848801989098525050815180830190925292815291820152606090910152949350505050565b610a69610d03565b600080846001600160a01b03166329e77b5d856040518263ffffffff1660e01b8152600401610a9891906111c6565b604080518083038186803b158015610aaf57600080fd5b505afa158015610ac3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ae79190810190610f57565b91509150600080866001600160a01b031663408e82af876040518263ffffffff1660e01b8152600401610b1a91906111c6565b604080518083038186803b158015610b3157600080fd5b505afa158015610b45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b699190810190610f57565b91509150600080886001600160a01b0316636392a51f896040518263ffffffff1660e01b8152600401610b9c91906111c6565b604080518083038186803b158015610bb357600080fd5b505afa158015610bc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610beb9190810190610f57565b6040805160a08101825260608101998a5260808101989098529787528751808901895295865260208681019590955284870195909552865180880188529081529283019390935250928201929092529150505b92915050565b6040518060c0016040528060006001600160a01b03168152602001610c67610d16565b8152602001610c74610d2d565b8152602001610c81610d4e565b8152602001610c8e610d2d565b8152602001610c9b610d72565b905290565b604051806101200160405280610cb4610d72565b8152602001610cc1610d72565b8152602001610cce610d72565b8152602001610cdb610d16565b81526020016000815260200160008152602001610cf6610d72565b8152602001610c8e610d72565b6040518060600160405280610cf6610d72565b604080518082019091526000808252602082015290565b60405180606001604052806000815260200160008152602001600081525090565b60405180606001604052806000801916815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b8035610c3e8161126b565b8051610c3e8161126b565b8051610c3e8161127f565b8051610c3e81611288565b8035610c3e81611291565b8051610c3e81611291565b8051610c3e8161129a565b8051610c3e816112a7565b600060208284031215610df657600080fd5b6000610e028484610d97565b949350505050565b600060208284031215610e1c57600080fd5b6000610e028484610da2565b600080600060608486031215610e3d57600080fd5b6000610e498686610dad565b9350506020610e5a86828701610dad565b9250506040610e6b86828701610dad565b9150509250925092565b600060208284031215610e8757600080fd5b6000610e028484610db8565b60008060408385031215610ea657600080fd5b6000610eb28585610db8565b9250506020610ec385828601610d8c565b9150509250929050565b60008060408385031215610ee057600080fd5b6000610eec8585610dc3565b9250506020610ec385828601610dc3565b600060208284031215610f0f57600080fd5b6000610e028484610dce565b600060208284031215610f2d57600080fd5b6000610e028484610dd9565b600060208284031215610f4b57600080fd5b6000610e028484610dad565b60008060408385031215610f6a57600080fd5b6000610f768585610dad565b9250506020610ec385828601610dad565b610f9081611200565b82525050565b610f908161120b565b610f9081611210565b610f9081611213565b610f908161123e565b610f9081611249565b805160c0830190610fd48482611000565b506020820151610fe76040850182611000565b506040820151610ffa6080850182611000565b50505050565b805160408301906110118482610f9f565b506020820151610ffa6020850182610f9f565b805160608301906110358482610f9f565b5060208201516110486020850182610f9f565b506040820151610ffa6040850182610f9f565b805161020083019061106d8482611000565b5060208201516110806040850182611000565b5060408201516110936080850182611000565b5060608201516110a660c08501826111a2565b5060808201516110ba610100850182610fb1565b5060a08201516110ce610120850182610fba565b5060c08201516110e2610140850182611000565b5060e08201516110f6610180850182611000565b50610100820151610ffa6101c0850182611000565b80516101c083019061111d8482610f87565b506020820151611130602085018261117e565b5060408201516111436060850182611024565b50606082015161115660c0850182611024565b50608082015161116a610120850182611024565b5060a0820151610ffa610180850182611000565b8051604083019061118f8482610fa8565b506020820151610ffa6020850182610fa8565b805160408301906111b38482610f96565b506020820151610ffa6020850182610f96565b60208101610c3e8284610f87565b60c08101610c3e8284610fc3565b6102008101610c3e828461105b565b6101c08101610c3e828461110b565b6000610c3e82611232565b151590565b90565b6000610c3e82611200565b8061047781611254565b8061047781611261565b6001600160a01b031690565b6000610c3e8261121e565b6000610c3e82611228565b6004811061125e57fe5b50565b6002811061125e57fe5b61127481611200565b811461125e57600080fd5b6112748161120b565b61127481611210565b61127481611213565b6004811061125e57600080fd5b6002811061125e57600080fdfea365627a7a723158201a6330c1b3b45158c7aef469156860076f8983a4dba2eddc63c6a6b18e813a276c6578706572696d656e74616cf564736f6c63430005100040", - "abi": [ - { - "constant": true, - "inputs": [ - { - "internalType": "contract BinaryOptionMarket", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "getAccountMarketData", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "bids", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "claimable", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "balances", - "type": "tuple" - } - ], - "internalType": "struct BinaryOptionMarketData.AccountData", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xdca5f5c3" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "contract BinaryOptionMarket", - "name": "market", - "type": "address" - } - ], - "name": "getMarketData", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAt", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OraclePriceAndTimestamp", - "name": "oraclePriceAndTimestamp", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarket.Prices", - "name": "prices", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "deposited", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "exercisableDeposits", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.Deposits", - "name": "deposits", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "resolved", - "type": "bool" - }, - { - "internalType": "bool", - "name": "canResolve", - "type": "bool" - } - ], - "internalType": "struct BinaryOptionMarketData.Resolution", - "name": "resolution", - "type": "tuple" - }, - { - "internalType": "enum IBinaryOptionMarket.Phase", - "name": "phase", - "type": "uint8" - }, - { - "internalType": "enum IBinaryOptionMarket.Side", - "name": "result", - "type": "uint8" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "totalBids", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "totalClaimableSupplies", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "totalSupplies", - "type": "tuple" - } - ], - "internalType": "struct BinaryOptionMarketData.MarketData", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xa30c302d" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "contract BinaryOptionMarket", - "name": "market", - "type": "address" - } - ], - "name": "getMarketParameters", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "components": [ - { - "internalType": "contract BinaryOption", - "name": "long", - "type": "address" - }, - { - "internalType": "contract BinaryOption", - "name": "short", - "type": "address" - } - ], - "internalType": "struct BinaryOptionMarket.Options", - "name": "options", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "biddingEnd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maturity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarket.Times", - "name": "times", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "strikePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "finalPrice", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarket.OracleDetails", - "name": "oracleDetails", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "poolFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "creatorFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "refundFee", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketManager.Fees", - "name": "fees", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "capitalRequirement", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "skewLimit", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketManager.CreatorLimits", - "name": "creatorLimits", - "type": "tuple" - } - ], - "internalType": "struct BinaryOptionMarketData.MarketParameters", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x1216fc7b" - } - ] - }, "SynthUtil": { "bytecode": "608060405234801561001057600080fd5b506040516113693803806113698339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b0319909216919091179055611304806100656000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80630120be331461006757806327fe55a6146100a5578063492dbcdd14610146578063a827bf481461022c578063d18ab37614610252578063eade6d2d14610276575b600080fd5b6100936004803603604081101561007d57600080fd5b506001600160a01b0381351690602001356102ce565b60408051918252519081900360200190f35b6100ad61054d565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156100f15781810151838201526020016100d9565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015610130578181015183820152602001610118565b5050505090500194505050505060405180910390f35b61014e6107b9565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b8381101561019657818101518382015260200161017e565b50505050905001848103835286818151815260200191508051906020019060200280838360005b838110156101d55781810151838201526020016101bd565b50505050905001848103825285818151815260200191508051906020019060200280838360005b838110156102145781810151838201526020016101fc565b50505050905001965050505050505060405180910390f35b61014e6004803603602081101561024257600080fd5b50356001600160a01b0316610b32565b61025a610ec9565b604080516001600160a01b039092168252519081900360200190f35b61027e610ed8565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102ba5781810151838201526020016102a2565b505050509050019250505060405180910390f35b6000806102d9611182565b905060006102e561123f565b90506000826001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b15801561032257600080fd5b505afa158015610336573d6000803e3d6000fd5b505050506040513d602081101561034c57600080fd5b5051905060005b81811015610543576000846001600160a01b031663835e119c836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156103a157600080fd5b505afa1580156103b5573d6000803e3d6000fd5b505050506040513d60208110156103cb57600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b038087169263654a60ac929185169163dbd06c85916004808301926020929190829003018186803b15801561041b57600080fd5b505afa15801561042f573d6000803e3d6000fd5b505050506040513d602081101561044557600080fd5b5051604080516370a0823160e01b81526001600160a01b038d811660048301529151918616916370a0823191602480820192602092909190829003018186803b15801561049157600080fd5b505afa1580156104a5573d6000803e3d6000fd5b505050506040513d60208110156104bb57600080fd5b5051604080516001600160e01b031960e086901b16815260048101939093526024830191909152604482018b9052516064808301926020929190829003018186803b15801561050957600080fd5b505afa15801561051d573d6000803e3d6000fd5b505050506040513d602081101561053357600080fd5b5051959095019450600101610353565b5050505092915050565b606080606061055a611182565b6001600160a01b03166372cb051f6040518163ffffffff1660e01b815260040160006040518083038186803b15801561059257600080fd5b505afa1580156105a6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156105cf57600080fd5b81019080805160405193929190846401000000008211156105ef57600080fd5b90830190602082018581111561060457600080fd5b825186602082028301116401000000008211171561062157600080fd5b82525081516020918201928201910280838360005b8381101561064e578181015183820152602001610636565b5050505090500160405250505090508061066661123f565b6001600160a01b031663c2c8a676836040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019060200280838360005b838110156106c45781810151838201526020016106ac565b505050509050019250505060006040518083038186803b1580156106e757600080fd5b505afa1580156106fb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561072457600080fd5b810190808051604051939291908464010000000082111561074457600080fd5b90830190602082018581111561075957600080fd5b825186602082028301116401000000008211171561077657600080fd5b82525081516020918201928201910280838360005b838110156107a357818101518382015260200161078b565b5050505090500160405250505092509250509091565b606080606060006107c8611182565b905060006107d461123f565b90506000826001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b15801561081157600080fd5b505afa158015610825573d6000803e3d6000fd5b505050506040513d602081101561083b57600080fd5b505160408051828152602080840282010190915290915060609082801561086c578160200160208202803883390190505b50905060608260405190808252806020026020018201604052801561089b578160200160208202803883390190505b5090506060836040519080825280602002602001820160405280156108ca578160200160208202803883390190505b50905060005b84811015610b22576000876001600160a01b031663835e119c836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561091e57600080fd5b505afa158015610932573d6000803e3d6000fd5b505050506040513d602081101561094857600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b0383169163dbd06c8591600480820192602092909190829003018186803b15801561098e57600080fd5b505afa1580156109a2573d6000803e3d6000fd5b505050506040513d60208110156109b857600080fd5b505185518690849081106109c857fe5b602002602001018181525050806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0d57600080fd5b505afa158015610a21573d6000803e3d6000fd5b505050506040513d6020811015610a3757600080fd5b50518451859084908110610a4757fe5b602002602001018181525050866001600160a01b031663654a60ac868481518110610a6e57fe5b6020026020010151868581518110610a8257fe5b6020026020010151631cd554d160e21b6040518463ffffffff1660e01b815260040180848152602001838152602001828152602001935050505060206040518083038186803b158015610ad457600080fd5b505afa158015610ae8573d6000803e3d6000fd5b505050506040513d6020811015610afe57600080fd5b50518351849084908110610b0e57fe5b6020908102919091010152506001016108d0565b5091975095509350505050909192565b60608060606000610b41611182565b90506000610b4d61123f565b90506000826001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8a57600080fd5b505afa158015610b9e573d6000803e3d6000fd5b505050506040513d6020811015610bb457600080fd5b5051604080518281526020808402820101909152909150606090828015610be5578160200160208202803883390190505b509050606082604051908082528060200260200182016040528015610c14578160200160208202803883390190505b509050606083604051908082528060200260200182016040528015610c43578160200160208202803883390190505b50905060005b84811015610eb8576000876001600160a01b031663835e119c836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610c9757600080fd5b505afa158015610cab573d6000803e3d6000fd5b505050506040513d6020811015610cc157600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b0383169163dbd06c8591600480820192602092909190829003018186803b158015610d0757600080fd5b505afa158015610d1b573d6000803e3d6000fd5b505050506040513d6020811015610d3157600080fd5b50518551869084908110610d4157fe5b602002602001018181525050806001600160a01b03166370a082318d6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015610da357600080fd5b505afa158015610db7573d6000803e3d6000fd5b505050506040513d6020811015610dcd57600080fd5b50518451859084908110610ddd57fe5b602002602001018181525050866001600160a01b031663654a60ac868481518110610e0457fe5b6020026020010151868581518110610e1857fe5b6020026020010151631cd554d160e21b6040518463ffffffff1660e01b815260040180848152602001838152602001828152602001935050505060206040518083038186803b158015610e6a57600080fd5b505afa158015610e7e573d6000803e3d6000fd5b505050506040513d6020811015610e9457600080fd5b50518351849084908110610ea457fe5b602090810291909101015250600101610c49565b509199909850909650945050505050565b6000546001600160a01b031681565b60606000610ee4611182565b90506000610ef061123f565b90506000826001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2d57600080fd5b505afa158015610f41573d6000803e3d6000fd5b505050506040513d6020811015610f5757600080fd5b5051604080518281526020808402820101909152909150606090828015610f88578160200160208202803883390190505b50905060005b82811015611179576000856001600160a01b031663835e119c836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610fdc57600080fd5b505afa158015610ff0573d6000803e3d6000fd5b505050506040513d602081101561100657600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b038088169263af3aea86929185169163dbd06c85916004808301926020929190829003018186803b15801561105657600080fd5b505afa15801561106a573d6000803e3d6000fd5b505050506040513d602081101561108057600080fd5b5051604080516001600160e01b031960e085901b1681526004810192909252516024808301926020929190829003018186803b1580156110bf57600080fd5b505afa1580156110d3573d6000803e3d6000fd5b505050506040513d60208110156110e957600080fd5b50511561117057806001600160a01b031663dbd06c856040518163ffffffff1660e01b815260040160206040518083038186803b15801561112957600080fd5b505afa15801561113d573d6000803e3d6000fd5b505050506040513d602081101561115357600080fd5b5051835184908490811061116357fe5b6020026020010181815250505b50600101610f8e565b50935050505090565b600080546040805163dacb2d0160e01b8152680a6f2dce8d0cae8d2f60bb1b600482015260248101829052601960448201527f4d697373696e672053796e746865746978206164647265737300000000000000606482015290516001600160a01b039092169163dacb2d0191608480820192602092909190829003018186803b15801561120e57600080fd5b505afa158015611222573d6000803e3d6000fd5b505050506040513d602081101561123857600080fd5b5051905090565b600080546040805163dacb2d0160e01b81526c45786368616e6765526174657360981b600482015260248101829052601d60448201527f4d697373696e672045786368616e676552617465732061646472657373000000606482015290516001600160a01b039092169163dacb2d0191608480820192602092909190829003018186803b15801561120e57600080fdfea265627a7a723158209e7ba686f73798746736e8ff9d170da8215f2ad60eb6b3c4ba5c14e221d4140064736f6c63430005100032", "abi": [ diff --git a/publish/deployed/local/config.json b/publish/deployed/local/config.json index 84cc929d43..ed99972b1b 100644 --- a/publish/deployed/local/config.json +++ b/publish/deployed/local/config.json @@ -14,15 +14,6 @@ "ReadProxyAddressResolver": { "deploy": true }, - "BinaryOptionMarketFactory": { - "deploy": true - }, - "BinaryOptionMarketManager": { - "deploy": true - }, - "BinaryOptionMarketData": { - "deploy": true - }, "CollateralManager": { "deploy": true }, diff --git a/publish/deployed/mainnet/config.json b/publish/deployed/mainnet/config.json index b8b1b97720..fc88fdb6f3 100644 --- a/publish/deployed/mainnet/config.json +++ b/publish/deployed/mainnet/config.json @@ -2,15 +2,6 @@ "AddressResolver": { "deploy": false }, - "BinaryOptionMarketFactory": { - "deploy": false - }, - "BinaryOptionMarketManager": { - "deploy": false - }, - "BinaryOptionMarketData": { - "deploy": false - }, "ReadProxyAddressResolver": { "deploy": false }, diff --git a/publish/deployed/mainnet/deployment.json b/publish/deployed/mainnet/deployment.json index fa22cef6b4..5060b5864e 100644 --- a/publish/deployed/mainnet/deployment.json +++ b/publish/deployed/mainnet/deployment.json @@ -1391,33 +1391,6 @@ "txn": "", "network": "mainnet" }, - "BinaryOptionMarketFactory": { - "name": "BinaryOptionMarketFactory", - "address": "0x211bA925B35b82246a3CCfa3A991a39A840f025C", - "source": "BinaryOptionMarketFactory", - "link": "https://etherscan.io/address/0x211bA925B35b82246a3CCfa3A991a39A840f025C", - "timestamp": "2020-12-24T01:22:35.000Z", - "txn": "https://etherscan.io/tx/0x635127ee42f2fb13d9dc649429ec808fd7d3ce7fea22a0d443a733bae05a9115", - "network": "mainnet" - }, - "BinaryOptionMarketManager": { - "name": "BinaryOptionMarketManager", - "address": "0x915D1c9dF12142B535F6a7437F0196D80bCCC1BD", - "source": "BinaryOptionMarketManager", - "link": "https://etherscan.io/address/0x915D1c9dF12142B535F6a7437F0196D80bCCC1BD", - "timestamp": "2020-12-24T01:22:44.000Z", - "txn": "https://etherscan.io/tx/0x3319269eab7daa8ee61fada085da0a34981948c0c90f235b30f3cd9d419caf22", - "network": "mainnet" - }, - "BinaryOptionMarketData": { - "name": "BinaryOptionMarketData", - "address": "0xe523184876c97945da45998582526cDb6a3dA260", - "source": "BinaryOptionMarketData", - "link": "https://etherscan.io/address/0xe523184876c97945da45998582526cDb6a3dA260", - "timestamp": "2020-08-06T00:13:25.000Z", - "txn": "https://etherscan.io/tx/0x9d17f35dd587d7fd091851688570c1cbab50a96ed5912d6c161b899178e0e3ae", - "network": "mainnet" - }, "SynthUtil": { "name": "SynthUtil", "address": "0x81Aee4EA48f678E172640fB5813cf7A96AFaF6C3", @@ -26254,1782 +26227,6 @@ "version": 1 } }, - "BinaryOptionMarketFactory": { - "bytecode": "608060405234801561001057600080fd5b506040516158493803806158498339818101604052604081101561003357600080fd5b50805160209091015180826001600160a01b038116610099576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a150600280546001600160a01b039092166001600160a01b03199092169190911790555050615725806101246000396000f3fe60806040523480156200001157600080fd5b5060043610620000a05760003560e01c806353a47bb7116200006f57806353a47bb7146200016857806374185360146200017257806379ba5097146200017c578063899ffef414620001865780638da5cb5b14620001e257620000a0565b806304f3bcec14620000a5578063130efa5014620000cb5780631627540c146200011f5780632af64bd3146200014a575b600080fd5b620000af620001ec565b604080516001600160a01b039092168252519081900360200190f35b620000af60048036036101c0811015620000e457600080fd5b506001600160a01b0381351690602081019060608101359060808101359060a081013515159060c081019061012081019061016001620001fb565b62000148600480360360208110156200013757600080fd5b50356001600160a01b03166200036e565b005b62000154620003cc565b604080519115158252519081900360200190f35b620000af620004e2565b62000148620004f1565b62000148620006c4565b6200019062000782565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015620001ce578181015183820152602001620001b4565b505050509050019250505060405180910390f35b620000af620007de565b6002546001600160a01b031681565b60008062000208620007ed565b90506001600160a01b038116331462000268576040805162461bcd60e51b815260206004820152601e60248201527f4f6e6c79207065726d697474656420627920746865206d616e616765722e0000604482015290519081900360640190fd5b808a600260009054906101000a90046001600160a01b03168b8b8b8b8b8b8b604051620002959062000950565b6001600160a01b03808c1682528a8116602083015289166040808301919091526060820190899080828437600083820152601f01601f191690910188815260208101889052861515604082015260609081019150859080828437600083820152601f01601f1916909101905083604080828437600083820152601f01601f19169091019050826060808284376000838201819052604051601f909201601f19169093018190039d509b50909950505050505050505050f0801580156200035f573d6000803e3d6000fd5b509a9950505050505050505050565b620003786200081b565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b60006060620003da62000782565b905060005b8151811015620004d8576000828281518110620003f857fe5b6020908102919091018101516000818152600383526040908190205460025482516321f8a72160e01b81526004810185905292519395506001600160a01b03918216949116926321f8a721926024808201939291829003018186803b1580156200046157600080fd5b505afa15801562000476573d6000803e3d6000fd5b505050506040513d60208110156200048d57600080fd5b50516001600160a01b0316141580620004bb57506000818152600360205260409020546001600160a01b0316155b15620004ce5760009350505050620004df565b50600101620003df565b5060019150505b90565b6001546001600160a01b031681565b6060620004fd62000782565b905060005b8151811015620006c05760008282815181106200051b57fe5b602090810291909101810151600254604080517f5265736f6c766572206d697373696e67207461726765743a2000000000000000818601526039808201859052825180830390910181526059820180845263dacb2d0160e01b9052605d8201858152607d83019384528151609d84015281519597506000966001600160a01b039095169563dacb2d01958995939492939260bd0191908501908083838c5b83811015620005d3578181015183820152602001620005b9565b50505050905090810190601f168015620006015780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b1580156200062057600080fd5b505afa15801562000635573d6000803e3d6000fd5b505050506040513d60208110156200064c57600080fd5b505160008381526003602090815260409182902080546001600160a01b0319166001600160a01b03851690811790915582518681529182015281519293507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68929081900390910190a1505060010162000502565b5050565b6001546001600160a01b031633146200070f5760405162461bcd60e51b81526004018080602001828103825260358152602001806200568d6035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60408051600180825281830190925260609160208083019080388339019050509050782134b730b93ca7b83a34b7b726b0b935b2ba26b0b730b3b2b960391b81600081518110620007cf57fe5b60200260200101818152505090565b6000546001600160a01b031681565b600062000816782134b730b93ca7b83a34b7b726b0b935b2ba26b0b730b3b2b960391b62000868565b905090565b6000546001600160a01b03163314620008665760405162461bcd60e51b815260040180806020018281038252602f815260200180620056c2602f913960400191505060405180910390fd5b565b600081815260036020908152604080832054815170026b4b9b9b4b7339030b2323932b9b99d1607d1b9381019390935260318084018690528251808503909101815260519093019091526001600160a01b03169081620009495760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156200090d578181015183820152602001620008f3565b50505050905090810190601f1680156200093b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5092915050565b614d2e806200095f8339019056fe60806040523480156200001157600080fd5b5060405162004d2e38038062004d2e83398181016040526102008110156200003857600080fd5b5080516020820151604083015160a084015160c085015160e08601519495939492936060810193906101008101906101608101906101a001878a6001600160a01b038116620000ce576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a150600280546001600160a01b03199081166001600160a01b0393841617909155601480546040805180820182528c518082526020808f01519281018390526011919091556012919091558151606080820184528d82528183018d90526000918401829052600b8e9055600c8d9055600d919091558251908101835289518082528a8301518284018190528b85015192909401829052600855600992909255600a919091559216928c169290921760ff60a81b1916600160a81b8715150217909155825190830151620001f982826200047b565b8a6001600160a01b031660008051602062004d0e833981519152600084604051808360018111156200022757fe5b60ff1681526020018281526020019250505060405180910390a28a6001600160a01b031660008051602062004d0e833981519152600183604051808360018111156200026f57fe5b60ff1681526020018281526020019250505060405180910390a26000620002a582846200058260201b620021f71790919060201c565b6013819055845160208087015160408051606081018252848152808401839052818a01519101819052600e849055600f8290556010559293509091906200038490620002fe908490849062000582811b620021f717901c565b73__$60f5066a95a61bfd95691e5518aae05f18$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200034357600080fd5b505af415801562000358573d6000803e3d6000fd5b505050506040513d60208110156200036f57600080fd5b505190620005e6602090811b62002bb317901c565b6015556200039d8585856001600160e01b036200064416565b8d85604051620003ad9062000976565b6001600160a01b0390921682526020820152604080519182900301906000f080158015620003df573d6000803e3d6000fd5b50600480546001600160a01b0319166001600160a01b03929092169190911790556040518e908590620004129062000976565b6001600160a01b0390921682526020820152604080519182900301906000f08015801562000444573d6000803e3d6000fd5b50600580546001600160a01b0319166001600160a01b039290921691909117905550620009849d5050505050505050505050505050565b60006200049782846200058260201b620021f71790919060201c565b9050806011600001541115620004f4576040805162461bcd60e51b815260206004820152601460248201527f496e73756666696369656e74206361706974616c000000000000000000000000604482015290519081900360640190fd5b6012546200050f8483620006be602090811b6200300417901c565b8111158015620005385750620005348284620006be60201b620030041790919060201c565b8111155b6200057c576040805162461bcd60e51b815260206004820152600f60248201526e109a591cc81d1bdbc81cdad95dd959608a1b604482015290519081900360640190fd5b50505050565b600082820183811015620005dd576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b6000828211156200063e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000806200065d8585856001600160e01b03620006f916565b604080518082018252838152602090810183905260068490556007839055815184815290810183905281519395509193507f6546f60f34df611fa42503098acc39d5ab88bc73febe64b3cc14e5a92e3a66a792918290030190a15050505050565b6000620005dd82620006e585670de0b6b3a7640000620007b6602090811b6200305417901c565b6200081460201b620030ad1790919060201c565b60008084158015906200070b57508315155b6200075d576040805162461bcd60e51b815260206004820152601460248201527f42696473206d757374206265206e6f6e7a65726f000000000000000000000000604482015290519081900360640190fd5b600062000773846001600160e01b036200088016565b90506200078f8187620008bb60201b62002e271790919060201c565b620007a98287620008bb60201b62002e271790919060201c565b9250925050935093915050565b600082620007c757506000620005e0565b82820282848281620007d557fe5b0414620005dd5760405162461bcd60e51b815260040180806020018281038252602181526020018062004ced6021913960400191505060405180910390fd5b60008082116200086b576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b60008284816200087757fe5b04949350505050565b601454600090600160a01b900460ff16620008b757620008b160155483620008db60201b620021db1790919060201c565b620005e0565b5090565b6000620005dd8383670de0b6b3a76400006001600160e01b03620008fb16565b6000620005dd8383670de0b6b3a76400006001600160e01b036200093f16565b6000806200092084620006e585600a0288620007b660201b620030541790919060201c565b90506005600a825b06106200093357600a015b600a9004949350505050565b600080600a8304620009608587620007b660201b620030541790919060201c565b816200096857fe5b0490506005600a8262000928565b61114a8062003ba383390190565b61320f80620009946000396000f3fe608060405234801561001057600080fd5b50600436106102485760003560e01c8063851492581161013b578063be5af9fe116100b8578063d3419bf31161007c578063d3419bf31461055c578063dbea363814610564578063e4cfbdbd1461058a578063eef49ee3146105c2578063fd087ee5146105ca57610248565b8063be5af9fe14610516578063c588f5261461051e578063c7a5bdc814610526578063c8db233e1461052e578063d068cdc51461055457610248565b80639af1d35a116100ff5780639af1d35a146104c05780639e3b34bf146104c8578063ac3791e3146104d0578063b1c9fe6e146104d8578063b634bfbc146104f057610248565b8063851492581461042a578063899ffef4146104325780638b0341361461048a5780638da5cb5b1461049257806398508ecd1461049a57610248565b80633dae89eb116101c957806353a47bb71161018d57806353a47bb7146103c05780636392a51f146103c857806365372147146103ee578063741853601461041a57806379ba50971461042257610248565b80633dae89eb1461035c5780633f6fa65514610364578063408e82af1461036c5780634c33fe9414610392578063532f1179146103b857610248565b806327745bae1161021057806327745bae146102e95780632810e1d6146102f157806329e77b5d146102f95780632af64bd3146103385780633d7a783b1461035457610248565b806302d05d3f1461024d57806304f3bcec146102715780631069143a146102795780631627540c146102a75780632115e303146102cf575b600080fd5b6102556105f8565b604080516001600160a01b039092168252519081900360200190f35b610255610607565b610281610616565b604080516001600160a01b03938416815291909216602082015281519081900390910190f35b6102cd600480360360208110156102bd57600080fd5b50356001600160a01b031661062c565b005b6102d7610688565b60408051918252519081900360200190f35b6102cd61069b565b6102cd6106fd565b61031f6004803603602081101561030f57600080fd5b50356001600160a01b0316610ad1565b6040805192835260208301919091528051918290030190f35b610340610ae6565b604080519115158252519081900360200190f35b61031f610bf0565b61031f610cdb565b610340610cee565b61031f6004803603602081101561038257600080fd5b50356001600160a01b0316610cfe565b6102cd600480360360208110156103a857600080fd5b50356001600160a01b0316610d0a565b610340610df4565b610255610e04565b61031f600480360360208110156103de57600080fd5b50356001600160a01b0316610e13565b6103f6610e1f565b6040518082600181111561040657fe5b60ff16815260200191505060405180910390f35b6102cd610e29565b6102cd610ff1565b6102d76110ad565b61043a61139e565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561047657818101518382015260200161045e565b505050509050019250505060405180910390f35b61031f611461565b61025561146c565b6104a261147b565b60408051938452602084019290925282820152519081900360600190f35b6104a2611487565b6104a2611493565b61034061149f565b6104e06114e2565b6040518082600381111561040657fe5b6102d76004803603604081101561050657600080fd5b5060ff8135169060200135611526565b61031f61186d565b61031f611876565b61031f611945565b6102cd6004803603602081101561054457600080fd5b50356001600160a01b0316611950565b61031f6119bd565b61031f611a72565b6102cd6004803603604081101561057a57600080fd5b5060ff8135169060200135611a7b565b6102d7600480360360808110156105a057600080fd5b5060ff8135811691602081013590911690604081013590606001351515611c64565b6102d7611e65565b61031f600480360360608110156105e057600080fd5b5060ff81351690602081013590604001351515611e6b565b6014546001600160a01b031681565b6002546001600160a01b031681565b6004546005546001600160a01b03918216911682565b610634611f5c565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b6000610695601354611fa5565b90505b90565b6106a3611fdc565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b1580156106db57600080fd5b505afa1580156106ef573d6000803e3d6000fd5b505050506106fb611ff6565b565b610705611f5c565b61070d61209e565b61074f576040805162461bcd60e51b815260206004820152600e60248201526d4e6f7420796574206d617475726560901b604482015290519081900360640190fd5b610757611fdc565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561078f57600080fd5b505afa1580156107a3573d6000803e3d6000fd5b505050506107af611ff6565b601454600160a01b900460ff161561080e576040805162461bcd60e51b815260206004820152601760248201527f4d61726b657420616c7265616479207265736f6c766564000000000000000000604482015290519081900360640190fd5b6000806108196120a6565b9150915061082681612134565b610868576040805162461bcd60e51b815260206004820152600e60248201526d5072696365206973207374616c6560901b604482015290519081900360640190fd5b600d8290556014805460ff60a01b1916600160a01b179055600061088a6121c4565b601354600e54919250906000906108a890839063ffffffff6121db16565b600f549091506000906108c290849063ffffffff6121db16565b90506108dc6108d7828463ffffffff6121f716565b612251565b50836001600160a01b031663a9059cbb6108f46122d8565b6001600160a01b031663eb1edd616040518163ffffffff1660e01b815260040160206040518083038186803b15801561092c57600080fd5b505afa158015610940573d6000803e3d6000fd5b505050506040513d602081101561095657600080fd5b5051604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482018690525160448083019260209291908290030181600087803b1580156109a657600080fd5b505af11580156109ba573d6000803e3d6000fd5b505050506040513d60208110156109d057600080fd5b50506014546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810184905290519186169163a9059cbb916044808201926020929091908290030181600087803b158015610a2857600080fd5b505af1158015610a3c573d6000803e3d6000fd5b505050506040513d6020811015610a5257600080fd5b507f5528b7e06f48a519cf814c4e5293ee2737c3f5c28d93e30cca112ac649fdd2359050610a7e6122ed565b8787601354868660405180876001811115610a9557fe5b60ff1681526020810196909652506040808601949094526060850192909252608084015260a0830152519081900360c0019150a1505050505050565b600080610add83612332565b91509150915091565b60006060610af261139e565b905060005b8151811015610be7576000828281518110610b0e57fe5b6020908102919091018101516000818152600383526040908190205460025482516321f8a72160e01b81526004810185905292519395506001600160a01b03918216949116926321f8a721926024808201939291829003018186803b158015610b7657600080fd5b505afa158015610b8a573d6000803e3d6000fd5b505050506040513d6020811015610ba057600080fd5b50516001600160a01b0316141580610bcd57506000818152600360205260409020546001600160a01b0316155b15610bde5760009350505050610698565b50600101610af7565b50600191505090565b6004805460408051636b7f817160e11b8152905160009384936001600160a01b03169263d6ff02e29281830192602092829003018186803b158015610c3457600080fd5b505afa158015610c48573d6000803e3d6000fd5b505050506040513d6020811015610c5e57600080fd5b505160055460408051636b7f817160e11b815290516001600160a01b039092169163d6ff02e291600481810192602092909190829003018186803b158015610ca557600080fd5b505afa158015610cb9573d6000803e3d6000fd5b505050506040513d6020811015610ccf57600080fd5b505190925090505b9091565b600080610ce6612433565b915091509091565b601454600160a01b900460ff1681565b600080610add836126fd565b610d12611f5c565b610d1a6127c8565b15610d5f576040805162461bcd60e51b815260206004820152601060248201526f42696464696e6720696e61637469766560801b604482015290519081900360640190fd5b600080610d6a6127d0565b60145491935091506000908190610d89906001600160a01b0316612332565b9150915060008285148015610d9d57508184145b905080610de3576040805162461bcd60e51b815260206004820152600f60248201526e4e6f742063616e63656c6c61626c6560881b604482015290519081900360640190fd5b610dec86612885565b505050505050565b601454600160a81b900460ff1681565b6001546001600160a01b031681565b600080610add83612a8c565b60006106956122ed565b6060610e3361139e565b905060005b8151811015610fed576000828281518110610e4f57fe5b602090810291909101810151600254604080517f5265736f6c766572206d697373696e67207461726765743a2000000000000000818601526039808201859052825180830390910181526059820180845263dacb2d0160e01b9052605d8201858152607d83019384528151609d84015281519597506000966001600160a01b039095169563dacb2d01958995939492939260bd0191908501908083838c5b83811015610f05578181015183820152602001610eed565b50505050905090810190601f168015610f325780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b158015610f5057600080fd5b505afa158015610f64573d6000803e3d6000fd5b505050506040513d6020811015610f7a57600080fd5b505160008381526003602090815260409182902080546001600160a01b0319166001600160a01b03851690811790915582518681529182015281519293507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68929081900390910190a15050600101610e38565b5050565b6001546001600160a01b0316331461103a5760405162461bcd60e51b815260040180806020018281038252603581526020018061311a6035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b601454600090600160a01b900460ff16611139576110c9612b57565b6001600160a01b0316637859f410306040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561112057600080fd5b505af1158015611134573d6000803e3d6000fd5b505050505b600080611145336126fd565b9150915081600014158061115857508015155b1561116857611165612433565b50505b60008061117433612a8c565b9150915081600014158061118757508015155b6111ce576040805162461bcd60e51b81526020600482015260136024820152724e6f7468696e6720746f20657865726369736560681b604482015290519081900360640190fd5b811561123a576004805460408051630d8acc1560e11b81523393810193909352516001600160a01b0390911691631b15982a91602480830192600092919082900301818387803b15801561122157600080fd5b505af1158015611235573d6000803e3d6000fd5b505050505b80156112a55760055460408051630d8acc1560e11b815233600482015290516001600160a01b0390921691631b15982a9160248082019260009290919082900301818387803b15801561128c57600080fd5b505af11580156112a0573d6000803e3d6000fd5b505050505b60006112b96112b26122ed565b8484612b66565b60408051828152905191925033917fd82b6f69d7477fb41cd83d936de94990cee2fa1a309feeee90101fc0513b6a439181900360200190a280156113955761130081612251565b506113096121c4565b6001600160a01b031663a9059cbb33836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561136857600080fd5b505af115801561137c573d6000803e3d6000fd5b505050506040513d602081101561139257600080fd5b50505b94505050505090565b60408051600480825260a08201909252606091602082016080803883390190505090506b53797374656d53746174757360a01b816000815181106113de57fe5b6020026020010181815250506c45786368616e6765526174657360981b8160018151811061140857fe5b6020026020010181815250506814de5b9d1a1cd554d160ba1b8160028151811061142e57fe5b60200260200101818152505066119959541bdbdb60ca1b8160038151811061145257fe5b60200260200101818152505090565b600080610ce66127d0565b6000546001600160a01b031681565b600b54600c54600d5483565b600e54600f5460105483565b600854600954600a5483565b6000806114aa6120a6565b601454909250600160a01b900460ff1615905080156114cc57506114cc61209e565b80156114dc57506114dc81612134565b91505090565b60006114ec6127c8565b6114f857506000610698565b61150061209e565b61150c57506001610698565b611514612b89565b61152057506002610698565b50600390565b60006115306127c8565b15611575576040805162461bcd60e51b815260206004820152601060248201526f42696464696e6720696e61637469766560801b604482015290519081900360640190fd5b601454600160a81b900460ff166115c6576040805162461bcd60e51b815260206004820152601060248201526f1499599d5b991cc8191a5cd8589b195960821b604482015290519081900360640190fd5b816115d357506000611867565b6014546001600160a01b0316331415611629576000806115f233612332565b9092509050600185600181111561160557fe5b141561160d57905b611626611620838663ffffffff612bb316565b82612c10565b50505b6116be6116b1600e6002015473__$60f5066a95a61bfd95691e5518aae05f18$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b15801561167957600080fd5b505af415801561168d573d6000803e3d6000fd5b505050506040513d60208110156116a357600080fd5b50519063ffffffff612bb316565b839063ffffffff6121db16565b90506116c983612cef565b6001600160a01b031663410085df33846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561172857600080fd5b505af115801561173c573d6000803e3d6000fd5b503392507f9bd0a8ca6625e01a9cee5e86eec7813a8234b41f1ca0c9f15a008d1e1d00ee5f915085905083611777868263ffffffff612bb316565b6040518084600181111561178757fe5b60ff168152602001838152602001828152602001935050505060405180910390a260006117b382612251565b90506117bd6121c4565b6001600160a01b031663a9059cbb33846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561181c57600080fd5b505af1158015611830573d6000803e3d6000fd5b505050506040513d602081101561184657600080fd5b5060009050806118546127d0565b91509150611863828285612d27565b5050505b92915050565b60115460125482565b6014546000908190600160a01b900460ff1615806118ab5750336118a061189b6122ed565b612cef565b6001600160a01b0316145b156118be576118bb601354611fa5565b90505b6004546001600160a01b03163314156118db576006549150610cd7565b6005546001600160a01b03163314156118f8576007549150610cd7565b6040805162461bcd60e51b815260206004820152601760248201527f53656e646572206973206e6f7420616e206f7074696f6e000000000000000000604482015290519081900360640190fd5b600080610ce66120a6565b611958611f5c565b611960612b89565b6119b1576040805162461bcd60e51b815260206004820152601b60248201527f556e65787069726564206f7074696f6e732072656d61696e696e670000000000604482015290519081900360640190fd5b6119ba81612885565b50565b60048054604080516318160ddd60e01b8152905160009384936001600160a01b0316926318160ddd9281830192602092829003018186803b158015611a0157600080fd5b505afa158015611a15573d6000803e3d6000fd5b505050506040513d6020811015611a2b57600080fd5b5051600554604080516318160ddd60e01b815290516001600160a01b03909216916318160ddd91600481810192602092909190829003018186803b158015610ca557600080fd5b60065460075482565b611a836127c8565b15611ac8576040805162461bcd60e51b815260206004820152601060248201526f42696464696e6720696e61637469766560801b604482015290519081900360640190fd5b80611ad257610fed565b611adb82612cef565b6001600160a01b03166359d667a533836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015611b3a57600080fd5b505af1158015611b4e573d6000803e3d6000fd5b50505050336001600160a01b03167f70bd4a33bf447720d717d08f3affb5aecfe4d2ebb8e3dd94539f5313e2447643838360405180836001811115611b8f57fe5b60ff1681526020018281526020019250505060405180910390a26000611bb482612d96565b9050611bbe6121c4565b604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b0392909216916323b872dd916064808201926020929091908290030181600087803b158015611c1657600080fd5b505af1158015611c2a573d6000803e3d6000fd5b505050506040513d6020811015611c4057600080fd5b506000905080611c4e6127d0565b91509150611c5d828285612d27565b5050505050565b600080611c7c601554856121db90919063ffffffff16565b90506000611c8986612cef565b6001600160a01b0316638b0341366040518163ffffffff1660e01b815260040160206040518083038186803b158015611cc157600080fd5b505afa158015611cd5573d6000803e3d6000fd5b505050506040513d6020811015611ceb57600080fd5b505160135460408051630241ebdb60e61b81529051929350909160009173__$60f5066a95a61bfd95691e5518aae05f18$__9163907af6c091600480820192602092909190829003018186803b158015611d4457600080fd5b505af4158015611d58573d6000803e3d6000fd5b505050506040513d6020811015611d6e57600080fd5b5051601054909150600090611d8a90839063ffffffff612bb316565b9050886001811115611d9857fe5b8a6001811115611da457fe5b1415611e0e576000611dbc848763ffffffff6121db16565b90508715611dd85793611dd5868363ffffffff6121db16565b95505b611e01611deb848863ffffffff612bb316565b611df58388612e00565b9063ffffffff612e2716565b9650505050505050611e5d565b6000611e20858763ffffffff612e2716565b90508715611e2a57925b6000611e368286612e00565b905088611e435780611e53565b611e53818463ffffffff612e2716565b9750505050505050505b949350505050565b60135481565b600080600080611e796127d0565b9150915061311785611e8d576121f7611e91565b612bb35b90506000886001811115611ea157fe5b1415611ebc57611eb583888363ffffffff16565b9250611ecd565b611eca82888363ffffffff16565b91505b8515611f3357611f30611f23600e6002015473__$60f5066a95a61bfd95691e5518aae05f18$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b15801561167957600080fd5b889063ffffffff6121db16565b96505b611f4d8383611f486013548b8663ffffffff16565b612e3c565b94509450505050935093915050565b6000546001600160a01b031633146106fb5760405162461bcd60e51b815260040180806020018281038252602f81526020018061314f602f913960400191505060405180910390fd5b601454600090600160a01b900460ff16611fd257601554611fcd90839063ffffffff6121db16565b611fd4565b815b90505b919050565b60006106956b53797374656d53746174757360a01b612ecf565b611ffe612b57565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b15801561203657600080fd5b505afa15801561204a573d6000803e3d6000fd5b505050506040513d602081101561206057600080fd5b5051156106fb5760405162461bcd60e51b815260040180806020018281038252603c81526020018061319f603c913960400191505060405180910390fd5b600954421190565b6000806120b1612fac565b6001600160a01b0316634308a94f600b600001546040518263ffffffff1660e01b815260040180828152602001915050604080518083038186803b1580156120f857600080fd5b505afa15801561210c573d6000803e3d6000fd5b505050506040513d604081101561212257600080fd5b50805160209091015190925090509091565b60008061213f612b57565b6001600160a01b0316634a41d89d6040518163ffffffff1660e01b815260040160606040518083038186803b15801561217757600080fd5b505afa15801561218b573d6000803e3d6000fd5b505050506040513d60608110156121a157600080fd5b505160095490915083906121bb908363ffffffff612bb316565b11159392505050565b60006106956814de5b9d1a1cd554d160ba1b612ecf565b60006121f08383670de0b6b3a7640000612fc7565b9392505050565b6000828201838110156121f0576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b601354600090612267908363ffffffff612bb316565b60138190559050612276612b57565b6001600160a01b0316636b3a0984836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156122bb57600080fd5b505af11580156122cf573d6000803e3d6000fd5b50505050919050565b600061069566119959541bdbdb60ca1b612ecf565b6014546000908190600160a01b900460ff161561230d5750600d54612319565b6123156120a6565b5090505b600c5481101561232a5760016114dc565b600091505090565b60048054604080516308dc30b760e41b81526001600160a01b0385811694820194909452905160009384931691638dc30b70916024808301926020929190829003018186803b15801561238457600080fd5b505afa158015612398573d6000803e3d6000fd5b505050506040513d60208110156123ae57600080fd5b5051600554604080516308dc30b760e41b81526001600160a01b03878116600483015291519190921691638dc30b70916024808301926020929190829003018186803b1580156123fd57600080fd5b505afa158015612411573d6000803e3d6000fd5b505050506040513d602081101561242757600080fd5b50519092509050915091565b60008061243e611fdc565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561247657600080fd5b505afa15801561248a573d6000803e3d6000fd5b50505050612496611ff6565b61249e6127c8565b6124e4576040805162461bcd60e51b815260206004820152601260248201527142696464696e6720696e636f6d706c65746560701b604482015290519081900360640190fd5b60006124f1601354611fa5565b905060006124fd6122ed565b601454909150600160a01b900460ff166000808215806125285750600084600181111561252657fe5b145b156125bc576004805460065460408051632bc43fd960e01b81523394810194909452602484019190915260448301889052516001600160a01b0390911691632bc43fd99160648083019260209291908290030181600087803b15801561258d57600080fd5b505af11580156125a1573d6000803e3d6000fd5b505050506040513d60208110156125b757600080fd5b505191505b8215806125d4575060018460018111156125d257fe5b145b156126665760055460075460408051632bc43fd960e01b8152336004820152602481019290925260448201889052516001600160a01b0390921691632bc43fd9916064808201926020929091908290030181600087803b15801561263757600080fd5b505af115801561264b573d6000803e3d6000fd5b505050506040513d602081101561266157600080fd5b505190505b8115158061267357508015155b6126b7576040805162461bcd60e51b815260206004820152601060248201526f4e6f7468696e6720746f20636c61696d60801b604482015290519081900360640190fd5b6040805183815260208101839052815133927fbbe753caa9bb201dbd1740ee3d61c6d2adf5fa89f30233d732281ae5db6a03d4928290030190a290955093505050509091565b600480546040805163270fb89160e21b81526001600160a01b0385811694820194909452905160009384931691639c3ee244916024808301926020929190829003018186803b15801561274f57600080fd5b505afa158015612763573d6000803e3d6000fd5b505050506040513d602081101561277957600080fd5b50516005546040805163270fb89160e21b81526001600160a01b03878116600483015291519190921691639c3ee244916024808301926020929190829003018186803b1580156123fd57600080fd5b600854421190565b6004805460408051634581a09b60e11b8152905160009384936001600160a01b031692638b0341369281830192602092829003018186803b15801561281457600080fd5b505afa158015612828573d6000803e3d6000fd5b505050506040513d602081101561283e57600080fd5b505160055460408051634581a09b60e11b815290516001600160a01b0390921691638b03413691600481810192602092909190829003018186803b158015610ca557600080fd5b60135480156128995761289781612251565b505b60006128a36121c4565b604080516370a0823160e01b815230600482015290519192506000916001600160a01b038416916370a08231916024808301926020929190829003018186803b1580156128ef57600080fd5b505afa158015612903573d6000803e3d6000fd5b505050506040513d602081101561291957600080fd5b5051905080156129b057816001600160a01b031663a9059cbb85836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561298357600080fd5b505af1158015612997573d6000803e3d6000fd5b505050506040513d60208110156129ad57600080fd5b50505b600480546040805163646d919f60e11b81526001600160a01b03888116948201949094529051929091169163c8db233e9160248082019260009290919082900301818387803b158015612a0257600080fd5b505af1158015612a16573d6000803e3d6000fd5b50506005546040805163646d919f60e11b81526001600160a01b038981166004830152915191909216935063c8db233e9250602480830192600092919082900301818387803b158015612a6857600080fd5b505af1158015612a7c573d6000803e3d6000fd5b50505050836001600160a01b0316ff5b60048054604080516370a0823160e01b81526001600160a01b03858116948201949094529051600093849316916370a08231916024808301926020929190829003018186803b158015612ade57600080fd5b505afa158015612af2573d6000803e3d6000fd5b505050506040513d6020811015612b0857600080fd5b5051600554604080516370a0823160e01b81526001600160a01b038781166004830152915191909216916370a08231916024808301926020929190829003018186803b1580156123fd57600080fd5b6000546001600160a01b031690565b600080846001811115612b7557fe5b1415612b825750816121f0565b5092915050565b601454600090600160a01b900460ff1680156106955750600a544211806106955750506013541590565b600082821115612c0a576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000612c22838363ffffffff6121f716565b9050806011600001541115612c75576040805162461bcd60e51b8152602060048201526014602482015273125b9cdd59999a58da595b9d0818d85c1a5d185b60621b604482015290519081900360640190fd5b601254612c88848363ffffffff61300416565b8111158015612ca65750612ca2838363ffffffff61300416565b8111155b612ce9576040805162461bcd60e51b815260206004820152600f60248201526e109a591cc81d1bdbc81cdad95dd959608a1b604482015290519081900360640190fd5b50505050565b600080826001811115612cfe57fe5b1415612d1657506004546001600160a01b0316611fd7565b50506005546001600160a01b031690565b600080612d35858585612e3c565b604080518082018252838152602090810183905260068490556007839055815184815290810183905281519395509193507f6546f60f34df611fa42503098acc39d5ab88bc73febe64b3cc14e5a92e3a66a792918290030190a15050505050565b601354600090612dac908363ffffffff6121f716565b60138190559050612dbb612b57565b6001600160a01b031663aeab5849836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156122bb57600080fd5b6000818310612e1e57612e19838363ffffffff612bb316565b6121f0565b50600092915050565b60006121f08383670de0b6b3a764000061302e565b6000808415801590612e4d57508315155b612e95576040805162461bcd60e51b815260206004820152601460248201527342696473206d757374206265206e6f6e7a65726f60601b604482015290519081900360640190fd5b6000612ea084611fa5565b9050612eb2868263ffffffff612e2716565b612ec2868363ffffffff612e2716565b9250925050935093915050565b600081815260036020908152604080832054815170026b4b9b9b4b7339030b2323932b9b99d1607d1b9381019390935260318084018690528251808503909101815260519093019091526001600160a01b03169081612b825760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612f71578181015183820152602001612f59565b50505050905090810190601f168015612f9e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b60006106956c45786368616e6765526174657360981b612ecf565b600080600a8304612fde868663ffffffff61305416565b81612fe557fe5b0490506005600a825b0610612ff857600a015b600a9004949350505050565b60006121f08261302285670de0b6b3a764000063ffffffff61305416565b9063ffffffff6130ad16565b6000806130488461302287600a870263ffffffff61305416565b90506005600a82612fee565b60008261306357506000611867565b8282028284828161307057fe5b04146121f05760405162461bcd60e51b815260040180806020018281038252602181526020018061317e6021913960400191505060405180910390fd5b6000808211613103576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b600082848161310e57fe5b04949350505050565bfefe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775468697320616374696f6e2063616e6e6f7420626520706572666f726d6564207768696c652074686520636f6e747261637420697320706175736564a265627a7a72315820fa3a319db20b224bf5a7fcf5735fcda6b3169d4f1c5d8e67a79c3610c5116b3c64736f6c63430005100032608060405234801561001057600080fd5b5060405161114a38038061114a8339818101604052604081101561003357600080fd5b508051602091820151600080546001600160a01b031916331781556001600160a01b0390921682526001909252604090208190556002556110d1806100796000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad5780639c3ee244116100715780639c3ee24414610383578063a9059cbb146103a9578063c8db233e146103d5578063d6ff02e2146103fb578063dd62ed3e1461040357610121565b806370a082311461030357806380f55605146103295780638b0341361461034d5780638dc30b701461035557806395d89b411461037b57610121565b806323b872dd116100f457806323b872dd146102255780632bc43fd91461025b578063313ce5671461028d578063410085df146102ab57806359d667a5146102d757610121565b806306fdde0314610126578063095ea7b3146101a357806318160ddd146101e35780631b15982a146101fd575b600080fd5b61012e610431565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101cf600480360360408110156101b957600080fd5b506001600160a01b03813516906020013561045e565b604080519115158252519081900360200190f35b6101eb6104db565b60408051918252519081900360200190f35b6102236004803603602081101561021357600080fd5b50356001600160a01b03166104e1565b005b6101cf6004803603606081101561023b57600080fd5b506001600160a01b0381358116916020810135909116906040013561060e565b6101eb6004803603606081101561027157600080fd5b506001600160a01b0381351690602081013590604001356106ca565b610295610861565b6040805160ff9092168252519081900360200190f35b610223600480360360408110156102c157600080fd5b506001600160a01b038135169060200135610866565b610223600480360360408110156102ed57600080fd5b506001600160a01b038135169060200135610920565b6101eb6004803603602081101561031957600080fd5b50356001600160a01b03166109ce565b6103316109e0565b604080516001600160a01b039092168252519081900360200190f35b6101eb6109ef565b6101eb6004803603602081101561036b57600080fd5b50356001600160a01b03166109f5565b61012e610a07565b6101eb6004803603602081101561039957600080fd5b50356001600160a01b0316610a27565b6101cf600480360360408110156103bf57600080fd5b506001600160a01b038135169060200135610ad4565b610223600480360360208110156103eb57600080fd5b50356001600160a01b0316610ae1565b6101eb610b42565b6101eb6004803603604081101561041957600080fd5b506001600160a01b0381358116916020013516610bc3565b6040518060400160405280601181526020017029a72c102134b730b93c9027b83a34b7b760791b81525081565b60006001600160a01b03831661047357600080fd5b3360008181526005602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60045481565b6000546001600160a01b03163314610536576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b6001600160a01b0381166000908152600360205260409020548061055a575061060b565b6001600160a01b038216600090815260036020526040812055600454610586908263ffffffff610be016565b6004556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a36040805182815290516001600160a01b038416917f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7919081900360200190a2505b50565b6001600160a01b038316600090815260056020908152604080832033845290915281205480831115610680576040805162461bcd60e51b8152602060048201526016602482015275496e73756666696369656e7420616c6c6f77616e636560501b604482015290519081900360640190fd5b610690818463ffffffff610be016565b6001600160a01b03861660009081526005602090815260408083203384529091529020556106bf858585610c3d565b9150505b9392505050565b600080546001600160a01b03163314610720576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b6001600160a01b03841660009081526001602052604081205490610745828686610e14565b905080610757576000925050506106c3565b60025461076a908363ffffffff610be016565b6002556001600160a01b038616600090815260016020526040812055600454610799908263ffffffff610eb016565b6004556001600160a01b0386166000908152600360205260409020546107c5908263ffffffff610eb016565b6001600160a01b03871660008181526003602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a36040805182815290516001600160a01b038816917fa59f12e354e8cd10bb74c559844c2dd69a5458e31fe56c7594c62ca57480509a919081900360200190a295945050505050565b601281565b6000546001600160a01b031633146108bb576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b6001600160a01b0382166000908152600160205260409020546108ed906108e8908363ffffffff610be016565b610f0a565b6001600160a01b038316600090815260016020526040902055600254610919908263ffffffff610be016565b6002555050565b6000546001600160a01b03163314610975576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b6001600160a01b0382166000908152600160205260409020546109a2906108e8908363ffffffff610eb016565b6001600160a01b038316600090815260016020526040902055600254610919908263ffffffff610eb016565b60036020526000908152604090205481565b6000546001600160a01b031681565b60025481565b60016020526000908152604090205481565b604051806040016040528060048152602001631cd3d41560e21b81525081565b60008054604080516362c47a9360e11b81528151849384936001600160a01b039091169263c588f5269260048083019392829003018186803b158015610a6c57600080fd5b505afa158015610a80573d6000803e3d6000fd5b505050506040513d6040811015610a9657600080fd5b5080516020918201516001600160a01b03871660009081526001909352604090922054909350909150610aca908383610e14565b925050505b919050565b60006106c3338484610c3d565b6000546001600160a01b03163314610b36576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b806001600160a01b0316ff5b60008054604080516362c47a9360e11b8152815184936001600160a01b03169263c588f5269260048082019391829003018186803b158015610b8357600080fd5b505afa158015610b97573d6000803e3d6000fd5b505050506040513d6040811015610bad57600080fd5b50602001519050610bbd81610f67565b91505090565b600560209081526000928352604080842090915290825290205481565b600082821115610c37576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008060009054906101000a90046001600160a01b03166001600160a01b03166327745bae6040518163ffffffff1660e01b815260040160006040518083038186803b158015610c8c57600080fd5b505afa158015610ca0573d6000803e3d6000fd5b505050506001600160a01b03831615801590610cc557506001600160a01b0383163014155b610d08576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b6001600160a01b03841660009081526003602052604090205480831115610d6d576040805162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015290519081900360640190fd5b610d7d818463ffffffff610be016565b6001600160a01b038087166000908152600360205260408082209390935590861681522054610db2908463ffffffff610eb016565b6001600160a01b0380861660008181526003602090815260409182902094909455805187815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3506001949350505050565b600080610e27858563ffffffff610f8e16565b90506000610e3484610f67565b905060025486148015610e4657508515155b80610e4f575080155b15610e5d5791506106c39050565b80821115610ea7576040805162461bcd60e51b8152602060048201526012602482015271737570706c79203c20636c61696d61626c6560701b604482015290519081900360640190fd5b50949350505050565b6000828201838110156106c3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000662386f26fc1000082101580610f20575081155b610f63576040805162461bcd60e51b815260206004820152600f60248201526e42616c616e6365203c2024302e303160881b604482015290519081900360640190fd5b5090565b600454600090808311610f7e576000915050610acf565b6106c3838263ffffffff610be016565b60006106c382610fac85670de0b6b3a764000063ffffffff610fb816565b9063ffffffff61101116565b600082610fc7575060006104d5565b82820282848281610fd457fe5b04146106c35760405162461bcd60e51b815260040180806020018281038252602181526020018061107c6021913960400191505060405180910390fd5b6000808211611067576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b600082848161107257fe5b0494935050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723158209d36c4dc6e88f30ecbfe2d2658ee6038aee82f1193e73bc5e5e4fa0a5342204564736f6c63430005100032536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7770bd4a33bf447720d717d08f3affb5aecfe4d2ebb8e3dd94539f5313e2447643596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6ea265627a7a723158205c35abe02193bdb3b33e2be9b0add96786293058b40d53c20ec9f1ddbc6fdadf64736f6c63430005100032", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "address", - "name": "_resolver", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor", - "signature": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "name", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "name": "CacheUpdated", - "type": "event", - "signature": "0x88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event", - "signature": "0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event", - "signature": "0x906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22" - }, - { - "constant": false, - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x79ba5097" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "creatorLimits", - "type": "uint256[2]" - }, - { - "internalType": "bytes32", - "name": "oracleKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "strikePrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "refundsEnabled", - "type": "bool" - }, - { - "internalType": "uint256[3]", - "name": "times", - "type": "uint256[3]" - }, - { - "internalType": "uint256[2]", - "name": "bids", - "type": "uint256[2]" - }, - { - "internalType": "uint256[3]", - "name": "fees", - "type": "uint256[3]" - } - ], - "name": "createMarket", - "outputs": [ - { - "internalType": "contract BinaryOptionMarket", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x130efa50" - }, - { - "constant": true, - "inputs": [], - "name": "isResolverCached", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x2af64bd3" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x1627540c" - }, - { - "constant": true, - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x53a47bb7" - }, - { - "constant": true, - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x8da5cb5b" - }, - { - "constant": false, - "inputs": [], - "name": "rebuildCache", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x74185360" - }, - { - "constant": true, - "inputs": [], - "name": "resolver", - "outputs": [ - { - "internalType": "contract AddressResolver", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x04f3bcec" - }, - { - "constant": true, - "inputs": [], - "name": "resolverAddressesRequired", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "addresses", - "type": "bytes32[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x899ffef4" - } - ], - "source": { - "keccak256": "0x19c02d5083547f83f7498763553980d79e887fc93fa434da292b66a456443759", - "urls": [ - "bzz-raw://225027c0785bb30c02262866b0a4e0ef2947395876a0d93d64aba33af2c16e80", - "dweb:/ipfs/QmdLMVX9XmB5KCej8xoY6uUJj3UFuY5mqHdrrVbav4pmDL" - ] - }, - "metadata": { - "compiler": { - "version": "0.5.16+commit.9c3226ce" - }, - "language": "Solidity", - "settings": { - "compilationTarget": { - "BinaryOptionMarketFactory.sol": "BinaryOptionMarketFactory" - }, - "evmVersion": "istanbul", - "libraries": {}, - "optimizer": { - "enabled": true, - "runs": 200 - }, - "remappings": [] - }, - "sources": { - "BinaryOptionMarketFactory.sol": { - "keccak256": "0x19c02d5083547f83f7498763553980d79e887fc93fa434da292b66a456443759", - "urls": [ - "bzz-raw://225027c0785bb30c02262866b0a4e0ef2947395876a0d93d64aba33af2c16e80", - "dweb:/ipfs/QmdLMVX9XmB5KCej8xoY6uUJj3UFuY5mqHdrrVbav4pmDL" - ] - } - }, - "version": 1 - } - }, - "BinaryOptionMarketManager": { - "bytecode": "6080604052600d805460ff191660011790553480156200001e57600080fd5b50604051620038d9380380620038d983398181016040526101408110156200004557600080fd5b508051602082015160408301516060840151608085015160a086015160c087015160e08801516101008901516101209099015197989697959694959394929391929091888a6001600160a01b038116620000e6576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a1506000546001600160a01b031662000191576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b600380546001600160a01b0390921661010002610100600160a81b0319909216919091179055600080546001600160a01b03191633179055620001dd876001600160e01b036200029a16565b620001f1886001600160e01b03620002e816565b62000205866001600160e01b036200033616565b62000219856001600160e01b036200038416565b6200022d846001600160e01b03620003d216565b62000241836001600160e01b03620004d316565b62000255826001600160e01b036200063616565b62000269816001600160e01b036200079916565b5050600080546001600160a01b0319166001600160a01b03999099169890981790975550620008e795505050505050565b620002ad6001600160e01b036200089a16565b60098190556040805182815290517ff378a0fd4ad3ffd9d7d50986f16b04acd2dc42691c4f412f34e8eefe883e66529181900360200190a150565b620002fb6001600160e01b036200089a16565b60088190556040805182815290517f5a2f2eae84f9e787d8159d363a776fa2b61d084686190cdc5a2c1ea833480b099181900360200190a150565b620003496001600160e01b036200089a16565b600a8190556040805182815290517f6de18e808fc4e6cb9c8910cf4bdc188ddbbdab65faecff65dab871720e8484899181900360200190a150565b620003976001600160e01b036200089a16565b600b8190556040805182815290517fdf7a26ae2e2eb953b81fd76b72fcdc74ebff7c21faa8f8f55323183d9785f52d9181900360200190a150565b620003e56001600160e01b036200089a16565b73__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200042a57600080fd5b505af41580156200043f573d6000803e3d6000fd5b505050506040513d60208110156200045657600080fd5b5051811115620004985760405162461bcd60e51b815260040180806020018281038252602d81526020018062003834602d913960400191505060405180910390fd5b600c8190556040805182815290517fd39cfbe31b20dbb6d995a675cf5c369555bf8bb908b6efc03873907fe9e133cf9181900360200190a150565b620004e66001600160e01b036200089a16565b60006005600101548201905073__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200053757600080fd5b505af41580156200054c573d6000803e3d6000fd5b505050506040513d60208110156200056357600080fd5b50518110620005a45760405162461bcd60e51b8152600401808060200182810382526021815260200180620038616021913960400191505060405180910390fd5b80600010620005fa576040805162461bcd60e51b815260206004820152601a60248201527f546f74616c20666565206d757374206265206e6f6e7a65726f2e000000000000604482015290519081900360640190fd5b60058290556040805183815290517f7b30e8f8e3de254785fbcb3068449dc18060f1fdb37b02731ecada99a78492c39181900360200190a15050565b620006496001600160e01b036200089a16565b60006005600001548201905073__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200069a57600080fd5b505af4158015620006af573d6000803e3d6000fd5b505050506040513d6020811015620006c657600080fd5b50518110620007075760405162461bcd60e51b8152600401808060200182810382526021815260200180620038616021913960400191505060405180910390fd5b806000106200075d576040805162461bcd60e51b815260206004820152601a60248201527f546f74616c20666565206d757374206265206e6f6e7a65726f2e000000000000604482015290519081900360640190fd5b60068290556040805183815290517f8c14462add32e0ae0fbfcf9e60711ecae573da337dc9127fff98fb7cfb3973b49181900360200190a15050565b620007ac6001600160e01b036200089a16565b73__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015620007f157600080fd5b505af415801562000806573d6000803e3d6000fd5b505050506040513d60208110156200081d57600080fd5b50518111156200085f5760405162461bcd60e51b8152600401808060200182810382526028815260200180620038b16028913960400191505060405180910390fd5b60078190556040805182815290517f01634ac4e9f09be1ef87b8d09e14926870261dcb9a0929d2d6460af6e4c5ad1e9181900360200190a150565b6000546001600160a01b03163314620008e55760405162461bcd60e51b815260040180806020018281038252602f81526020018062003882602f913960400191505060405180910390fd5b565b612f3d80620008f76000396000f3fe608060405234801561001057600080fd5b506004361061023d5760003560e01c80637859f4101161013b578063ac60c486116100b8578063c014fb841161007c578063c014fb84146106fc578063c095daf21461076a578063e73efc9b14610787578063fe40c470146107aa578063ff50abdc146107d05761023d565b8063ac60c48614610622578063adfd31af1461062a578063aeab5849146106a1578063bd6a10b8146106be578063be5af9fe146106db5761023d565b806391b4ded9116100ff57806391b4ded91461055257806394fcf3c31461055a5780639501dc871461058f5780639af1d35a146105ac5780639b11dc40146105b45761023d565b80637859f410146104a157806379ba5097146104c7578063899ffef4146104cf57806389c6318d146105275780638da5cb5b1461054a5761023d565b806336fd711e116101c957806364af2d871161018d57806364af2d871461043a57806364cf34bd146104425780636b3a09841461045f57806373b7de151461047c57806374185360146104995761023d565b806336fd711e146103c857806339ab4c41146103e55780634a41d89d1461040457806353a47bb71461042a5780635c975abb146104325761023d565b8063155028401161021057806315502840146103245780631627540c1461034157806316c38b3c146103675780631f3f10b0146103865780632af64bd3146103ac5761023d565b806302610c501461024257806303ff60181461025c57806304f3bcec146102e35780630dd16fd514610307575b600080fd5b61024a6107d8565b60408051918252519081900360200190f35b6102e16004803603606081101561027257600080fd5b6001600160a01b03823516916020810135151591810190606081016040820135600160201b8111156102a357600080fd5b8201836020820111156102b557600080fd5b803590602001918460208302840111600160201b831117156102d657600080fd5b5090925090506107df565b005b6102eb610ab1565b604080516001600160a01b039092168252519081900360200190f35b6102e16004803603602081101561031d57600080fd5b5035610ac5565b6102e16004803603602081101561033a57600080fd5b5035610c17565b6102e16004803603602081101561035757600080fd5b50356001600160a01b0316610c5a565b6102e16004803603602081101561037d57600080fd5b50351515610cb6565b6102e16004803603602081101561039c57600080fd5b50356001600160a01b0316610d30565b6103b4610d5a565b604080519115158252519081900360200190f35b6102e1600480360360208110156103de57600080fd5b5035610e6a565b6102e1600480360360208110156103fb57600080fd5b50351515610f5b565b61040c610fba565b60408051938452602084019290925282820152519081900360600190f35b6102eb610fc6565b6103b4610fd5565b6103b4610fde565b6102e16004803603602081101561045857600080fd5b5035610fe7565b6102e16004803603602081101561047557600080fd5b503561102a565b6102e16004803603602081101561049257600080fd5b5035611122565b6102e1611213565b6102e1600480360360208110156104b757600080fd5b50356001600160a01b03166113f0565b6102e16114c1565b6104d761157d565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156105135781810151838201526020016104fb565b505050509050019250505060405180910390f35b6104d76004803603604081101561053d57600080fd5b5080359060200135611652565b6102eb61166f565b61024a61167e565b6102eb600480360360e081101561057057600080fd5b508035906020810135906040810135151590606081019060a001611684565b6102e1600480360360208110156105a557600080fd5b5035611c2a565b61040c611d7c565b6102e1600480360360208110156105ca57600080fd5b810190602081018135600160201b8111156105e457600080fd5b8201836020820111156105f657600080fd5b803590602001918460208302840111600160201b8311171561061757600080fd5b509092509050611d88565b61024a611fd0565b6102e16004803603604081101561064057600080fd5b813515159190810190604081016020820135600160201b81111561066357600080fd5b82018360208201111561067557600080fd5b803590602001918460208302840111600160201b8311171561069657600080fd5b509092509050611fd6565b6102e1600480360360208110156106b757600080fd5b5035612206565b6102e1600480360360208110156106d457600080fd5b5035612300565b6106e3612343565b6040805192835260208301919091528051918290030190f35b6102e16004803603602081101561071257600080fd5b810190602081018135600160201b81111561072c57600080fd5b82018360208201111561073e57600080fd5b803590602001918460208302840111600160201b8311171561075f57600080fd5b50909250905061234c565b6102e16004803603602081101561078057600080fd5b5035612482565b6104d76004803603604081101561079d57600080fd5b50803590602001356124c5565b6102e1600480360360208110156107c057600080fd5b50356001600160a01b03166124d9565b61024a6126ed565b600f545b90565b6107e76126f3565b80806107f35750610aab565b600084610801576011610804565b600f5b90506000805b8381101561098257600086868381811061082057fe5b905060200201356001600160a01b0316905061083b8161273e565b61087e576040805162461bcd60e51b815260206004820152600f60248201526e26b0b935b2ba103ab735b737bbb71760891b604482015290519081900360640190fd5b61088e848263ffffffff61277016565b610903816001600160a01b031663eef49ee36040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ca57600080fd5b505afa1580156108de573d6000803e3d6000fd5b505050506040513d60208110156108f457600080fd5b5051849063ffffffff6128b116565b9250806001600160a01b0316631627540c8a6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561095d57600080fd5b505af1158015610971573d6000803e3d6000fd5b50506001909301925061080a915050565b50600e54610996908263ffffffff61290b16565b600e55604080516001600160a01b038916815260208082018381529282018790527f3e429aa34462b428d3f7277acb67e1c83d80a57faab2a47924369b5060f35679928a92899289929060608301908590850280828437600083820152604051601f909101601f1916909201829003965090945050505050a16040805163adfd31af60e01b81528715156004820190815260248201928352604482018790526001600160a01b038a169263adfd31af928a928a928a92606401846020850280828437600081840152601f19601f820116905080830192505050945050505050600060405180830381600087803b158015610a8f57600080fd5b505af1158015610aa3573d6000803e3d6000fd5b505050505050505b50505050565b60035461010090046001600160a01b031681565b610acd6126f3565b60006005600001548201905073__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1d57600080fd5b505af4158015610b31573d6000803e3d6000fd5b505050506040513d6020811015610b4757600080fd5b50518110610b865760405162461bcd60e51b8152600401808060200182810382526021815260200180612ded6021913960400191505060405180910390fd5b80600010610bdb576040805162461bcd60e51b815260206004820152601a60248201527f546f74616c20666565206d757374206265206e6f6e7a65726f2e000000000000604482015290519081900360640190fd5b60068290556040805183815290517f8c14462add32e0ae0fbfcf9e60711ecae573da337dc9127fff98fb7cfb3973b49181900360200190a15050565b610c1f6126f3565b60098190556040805182815290517ff378a0fd4ad3ffd9d7d50986f16b04acd2dc42691c4f412f34e8eefe883e66529181900360200190a150565b610c626126f3565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b610cbe6126f3565b60035460ff1615158115151415610cd457610d2d565b6003805460ff1916821515179081905560ff1615610cf157426002555b6003546040805160ff90921615158252517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec59181900360200190a15b50565b610d386126f3565b601380546001600160a01b0319166001600160a01b0392909216919091179055565b60006060610d6661157d565b905060005b8151811015610e61576000828281518110610d8257fe5b602090810291909101810151600081815260048084526040918290205460035483516321f8a72160e01b815292830185905292519395506001600160a01b039081169461010090930416926321f8a72192602480840193919291829003018186803b158015610df057600080fd5b505afa158015610e04573d6000803e3d6000fd5b505050506040513d6020811015610e1a57600080fd5b50516001600160a01b0316141580610e4757506000818152600460205260409020546001600160a01b0316155b15610e5857600093505050506107dc565b50600101610d6b565b50600191505090565b610e726126f3565b73__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015610eb657600080fd5b505af4158015610eca573d6000803e3d6000fd5b505050506040513d6020811015610ee057600080fd5b5051811115610f205760405162461bcd60e51b8152600401808060200182810382526028815260200180612ee16028913960400191505060405180910390fd5b60078190556040805182815290517f01634ac4e9f09be1ef87b8d09e14926870261dcb9a0929d2d6460af6e4c5ad1e9181900360200190a150565b610f636126f3565b600d5460ff16151581151514610d2d57600d805482151560ff19909116811790915560408051918252517fcc590b6309435383b617aaa0cae6aba938f2ee471cfb539201dd7655a23caff99181900360200190a150565b600854600954600a5483565b6001546001600160a01b031681565b60035460ff1681565b600d5460ff1681565b610fef6126f3565b600a8190556040805182815290517f6de18e808fc4e6cb9c8910cf4bdc188ddbbdab65faecff65dab871720e8484899181900360200190a150565b6110333361273e565b61106e5760405162461bcd60e51b8152600401808060200182810382526021815260200180612e306021913960400191505060405180910390fd5b60035460ff16156110b05760405162461bcd60e51b815260040180806020018281038252603c815260200180612ea5603c913960400191505060405180910390fd5b6110b8612968565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b1580156110f057600080fd5b505afa158015611104573d6000803e3d6000fd5b5050600e5461111c925090508263ffffffff61290b16565b600e5550565b61112a6126f3565b73__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b15801561116e57600080fd5b505af4158015611182573d6000803e3d6000fd5b505050506040513d602081101561119857600080fd5b50518111156111d85760405162461bcd60e51b815260040180806020018281038252602d815260200180612dc0602d913960400191505060405180910390fd5b600c8190556040805182815290517fd39cfbe31b20dbb6d995a675cf5c369555bf8bb908b6efc03873907fe9e133cf9181900360200190a150565b606061121d61157d565b905060005b81518110156113ec57600082828151811061123957fe5b602002602001015190506000600360019054906101000a90046001600160a01b03166001600160a01b031663dacb2d01838460405160200180807f5265736f6c766572206d697373696e67207461726765743a20000000000000008152506019018281526020019150506040516020818303038152906040526040518363ffffffff1660e01b81526004018083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156113045781810151838201526020016112ec565b50505050905090810190601f1680156113315780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b15801561134f57600080fd5b505afa158015611363573d6000803e3d6000fd5b505050506040513d602081101561137957600080fd5b505160008381526004602090815260409182902080546001600160a01b0319166001600160a01b03851690811790915582518681529182015281519293507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68929081900390910190a15050600101611222565b5050565b611401600f8263ffffffff61298716565b611449576040805162461bcd60e51b8152602060048201526014602482015273139bdd08185b881858dd1a5d99481b585c9ad95d60621b604482015290519081900360640190fd5b806001600160a01b0316632810e1d66040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561148457600080fd5b505af1158015611498573d6000803e3d6000fd5b505050506114b081600f61277090919063ffffffff16565b610d2d60118263ffffffff6129f516565b6001546001600160a01b0316331461150a5760405162461bcd60e51b8152600401808060200182810382526035815260200180612d8b6035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60408051600480825260a08201909252606091602082016080803883390190505090506b53797374656d53746174757360a01b816000815181106115bd57fe5b6020026020010181815250506814de5b9d1a1cd554d160ba1b816001815181106115e357fe5b6020026020010181815250506c45786368616e6765526174657360981b8160028151811061160d57fe5b6020026020010181815250507842696e6172794f7074696f6e4d61726b6574466163746f727960381b8160038151811061164357fe5b60200260200101818152505090565b60606116666011848463ffffffff612a4716565b90505b92915050565b6000546001600160a01b031681565b60025481565b60035460009060ff16156116c95760405162461bcd60e51b815260040180806020018281038252603c815260200180612ea5603c913960400191505060405180910390fd5b6116d1612968565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561170957600080fd5b505afa15801561171d573d6000803e3d6000fd5b5050600d5460ff16915061177a9050576040805162461bcd60e51b815260206004820152601b60248201527f4d61726b6574206372656174696f6e2069732064697361626c65640000000000604482015290519081900360640190fd5b61178386612b1d565b6117c2576040805162461bcd60e51b815260206004820152600b60248201526a496e76616c6964206b657960a81b604482015290519081900360640190fd5b600a548335906020850135904201811115611824576040805162461bcd60e51b815260206004820152601e60248201527f4d6174757269747920746f6f2066617220696e20746865206675747572650000604482015290519081900360640190fd5b60095460009061183b90839063ffffffff6128b116565b9050600061184e863560208801356128b1565b90508342106118a4576040805162461bcd60e51b815260206004820152601960248201527f456e64206f662062696464696e67206861732070617373656400000000000000604482015290519081900360640190fd5b8284106118f8576040805162461bcd60e51b815260206004820181905260248201527f4d6174757269747920707265646174657320656e64206f662062696464696e67604482015290519081900360640190fd5b6000611902612c51565b6001600160a01b031663130efa50336040518060400160405280600b600001548152602001600b600101548152508e8e8e60405180606001604052808d81526020018c81526020018b8152508e6040518060600160405280600560000154815260200160056001015481526020016005600201548152506040518963ffffffff1660e01b815260040180896001600160a01b03166001600160a01b0316815260200188600260200280838360005b838110156119c85781810151838201526020016119b0565b505050509050018781526020018681526020018515151515815260200184600360200280838360005b83811015611a095781810151838201526020016119f1565b5050505090500183600260200280828437600081840152601f19601f82011690508083019250505082600360200280838360005b83811015611a55578181015183820152602001611a3d565b5050505090500198505050505050505050602060405180830381600087803b158015611a8057600080fd5b505af1158015611a94573d6000803e3d6000fd5b505050506040513d6020811015611aaa57600080fd5b5051604080516303a0c29b60e51b815290519192506001600160a01b0383169163741853609160048082019260009290919082900301818387803b158015611af157600080fd5b505af1158015611b05573d6000803e3d6000fd5b50505050611b1d81600f6129f590919063ffffffff16565b600e54611b30908363ffffffff6128b116565b600e55611b3b612c78565b604080516323b872dd60e01b81523360048201526001600160a01b03848116602483015260448201869052915192909116916323b872dd916064808201926020929091908290030181600087803b158015611b9557600080fd5b505af1158015611ba9573d6000803e3d6000fd5b505050506040513d6020811015611bbf57600080fd5b5050604080516001600160a01b0383168152602081018c9052808201879052606081018690526080810185905290518c9133917fbcd154709bbe69680012cadcd07d57bd4a0ec64a033c2a3e31d2d0fadb38d3a89181900360a00190a39a9950505050505050505050565b611c326126f3565b60006005600101548201905073__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015611c8257600080fd5b505af4158015611c96573d6000803e3d6000fd5b505050506040513d6020811015611cac57600080fd5b50518110611ceb5760405162461bcd60e51b8152600401808060200182810382526021815260200180612ded6021913960400191505060405180910390fd5b80600010611d40576040805162461bcd60e51b815260206004820152601a60248201527f546f74616c20666565206d757374206265206e6f6e7a65726f2e000000000000604482015290519081900360640190fd5b60058290556040805183815290517f7b30e8f8e3de254785fbcb3068449dc18060f1fdb37b02731ecada99a78492c39181900360200190a15050565b60055460065460075483565b60005b81811015611fcb576000838383818110611da157fe5b6040805160048152602481018252602081810180516001600160e01b03166303a0c29b60e51b178152925182516001600160a01b0392909502969096013516955093600093508592859282918083835b60208310611e105780518252601f199092019160209182019101611df1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611e72576040519150601f19603f3d011682016040523d82523d6000602084013e611e77565b606091505b5050905080611fc057600354604080516001600160a01b03610100909304831660248083019190915282518083039091018152604490910182526020810180516001600160e01b0316633be99e6f60e01b1781529151815191936000939088169285929182918083835b60208310611f005780518252601f199092019160209182019101611ee1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611f62576040519150601f19603f3d011682016040523d82523d6000602084013e611f67565b606091505b5050905080611fbd576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742072656275696c6420636163686520666f72206d61726b657400604482015290519081900360640190fd5b50505b505050600101611d8b565b505050565b60115490565b6013546001600160a01b0316331461201f5760405162461bcd60e51b8152600401808060200182810382526025815260200180612e806025913960400191505060405180910390fd5b808061202b5750611fcb565b60008461203957601161203c565b600f5b90506000805b8381101561216a57600086868381811061205857fe5b905060200201356001600160a01b031690506120738161273e565b156120bd576040805162461bcd60e51b815260206004820152601560248201527426b0b935b2ba1030b63932b0b23c9035b737bbb71760591b604482015290519081900360640190fd5b806001600160a01b03166379ba50976040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156120f857600080fd5b505af115801561210c573d6000803e3d6000fd5b5050505061212381856129f590919063ffffffff16565b61215f816001600160a01b031663eef49ee36040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ca57600080fd5b925050600101612042565b50600e5461217e908263ffffffff6128b116565b600e55601354604080516001600160a01b0390921680835260208084018381529284018890527fea7a4e14e72ba7db7e2fd406278900badf50b2ce7d9def39d613cc08054c537b9391928992899290919060608301908590850280828437600083820152604051601f909101601f1916909201829003965090945050505050a1505050505050565b612217600f3363ffffffff61298716565b6122525760405162461bcd60e51b8152600401808060200182810382526022815260200180612e0e6022913960400191505060405180910390fd5b60035460ff16156122945760405162461bcd60e51b815260040180806020018281038252603c815260200180612ea5603c913960400191505060405180910390fd5b61229c612968565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b1580156122d457600080fd5b505afa1580156122e8573d6000803e3d6000fd5b5050600e5461111c925090508263ffffffff6128b116565b6123086126f3565b60088190556040805182815290517f5a2f2eae84f9e787d8159d363a776fa2b61d084686190cdc5a2c1ea833480b099181900360200190a150565b600b54600c5482565b60035460ff161561238e5760405162461bcd60e51b815260040180806020018281038252603c815260200180612ea5603c913960400191505060405180910390fd5b60005b81811015611fcb5760008383838181106123a757fe5b905060200201356001600160a01b03169050806001600160a01b031663c8db233e336040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561241157600080fd5b505af1158015612425573d6000803e3d6000fd5b5050505061243d81601161277090919063ffffffff16565b604080516001600160a01b038316815290517f16e62064e42f5aec62df22ae895ef539f153e0d4ea290e2cc4e0e8f708f2fbbc9181900360200190a150600101612391565b61248a6126f3565b600b8190556040805182815290517fdf7a26ae2e2eb953b81fd76b72fcdc74ebff7c21faa8f8f55323183d9785f52d9181900360200190a150565b6060611666600f848463ffffffff612a4716565b60035460ff161561251b5760405162461bcd60e51b815260040180806020018281038252603c815260200180612ea5603c913960400191505060405180910390fd5b61252c600f8263ffffffff61298716565b612574576040805162461bcd60e51b8152602060048201526014602482015273139bdd08185b881858dd1a5d99481b585c9ad95d60621b604482015290519081900360640190fd5b6000816001600160a01b03166302d05d3f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156125af57600080fd5b505afa1580156125c3573d6000803e3d6000fd5b505050506040513d60208110156125d957600080fd5b50519050336001600160a01b0382161461263a576040805162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d61726b65742063726561746f7200000000000000604482015290519081900360640190fd5b6040805163130cffa560e21b815233600482015290516001600160a01b03841691634c33fe9491602480830192600092919082900301818387803b15801561268157600080fd5b505af1158015612695573d6000803e3d6000fd5b505050506126ad82600f61277090919063ffffffff16565b604080516001600160a01b038416815290517f996fafab197beb99fff6fdc975bb6cf90352f2c733c76ef37c2e27f17d7d424b9181900360200190a15050565b600e5481565b6000546001600160a01b0316331461273c5760405162461bcd60e51b815260040180806020018281038252602f815260200180612e51602f913960400191505060405180910390fd5b565b6000612751600f8363ffffffff61298716565b80612768575061276860118363ffffffff61298716565b90505b919050565b61277a8282612987565b6127c1576040805162461bcd60e51b815260206004820152601360248201527222b632b6b2b73a103737ba1034b71039b2ba1760691b604482015290519081900360640190fd5b6001600160a01b03811660009081526001830160205260409020548254600019018082146128605760008460000182815481106127fa57fe5b60009182526020909120015485546001600160a01b039091169150819086908590811061282357fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b0394851617905592909116815260018601909152604090208290555b835484908061286b57fe5b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b0394909416815260019490940190925250506040812055565b600082820183811015611666576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082821115612962576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006129826b53797374656d53746174757360a01b612c8b565b905090565b815460009061299857506000611669565b6001600160a01b0382166000908152600184016020526040902054801515806129ed5750826001600160a01b0316846000016000815481106129d657fe5b6000918252602090912001546001600160a01b0316145b949350505050565b6129ff8282612987565b6113ec5781546001600160a01b038216600081815260018086016020908152604083208590559084018655858252902090910180546001600160a01b03191690911790555050565b825460609083830190811115612a5b575083545b838111612a78575050604080516000815260208101909152612b16565b604080518583038082526020808202830101909252606090828015612aa7578160200160208202803883390190505b50905060005b82811015612b10578760000187820181548110612ac657fe5b9060005260206000200160009054906101000a90046001600160a01b0316828281518110612af057fe5b6001600160a01b0390921660209283029190910190910152600101612aad565b50925050505b9392505050565b600080612b28612d6f565b9050806001600160a01b031663ac82f608846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015612b6e57600080fd5b505afa158015612b82573d6000803e3d6000fd5b505050506040513d6020811015612b9857600080fd5b505115612c485782631cd554d160e21b1415612bb857600091505061276b565b6000816001600160a01b031663728dec29856040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b158015612bfe57600080fd5b505afa158015612c12573d6000803e3d6000fd5b505050506040513d60a0811015612c2857600080fd5b505190508015612c3d5760009250505061276b565b60019250505061276b565b50600092915050565b60006129827842696e6172794f7074696f6e4d61726b6574466163746f727960381b612c8b565b60006129826814de5b9d1a1cd554d160ba1b5b600081815260046020908152604080832054815170026b4b9b9b4b7339030b2323932b9b99d1607d1b9381019390935260318084018690528251808503909101815260519093019091526001600160a01b03169081612d685760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d2d578181015183820152602001612d15565b50505050905090810190601f168015612d5a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5092915050565b60006129826c45786368616e6765526174657360981b612c8b56fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e65727368697043726561746f7220736b6577206c696d6974206d757374206265206e6f2067726561746572207468616e20312e546f74616c20666565206d757374206265206c657373207468616e20313030252e5065726d6974746564206f6e6c7920666f7220616374697665206d61726b6574732e5065726d6974746564206f6e6c7920666f72206b6e6f776e206d61726b6574732e4f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e4f6e6c79207065726d697474656420666f72206d6967726174696e67206d616e616765722e5468697320616374696f6e2063616e6e6f7420626520706572666f726d6564207768696c652074686520636f6e747261637420697320706175736564526566756e6420666565206d757374206265206e6f2067726561746572207468616e20313030252ea265627a7a7231582043adbc0bb81423316dbb485df25b3f0930cad64d0326a2b2a36aa5657359e69864736f6c6343000510003243726561746f7220736b6577206c696d6974206d757374206265206e6f2067726561746572207468616e20312e546f74616c20666565206d757374206265206c657373207468616e20313030252e4f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e526566756e6420666565206d757374206265206e6f2067726561746572207468616e20313030252e", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "address", - "name": "_resolver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_maxOraclePriceAge", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_expiryDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maxTimeToMaturity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_creatorCapitalRequirement", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_creatorSkewLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_poolFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_creatorFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_refundFee", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor", - "signature": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "name", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "name": "CacheUpdated", - "type": "event", - "signature": "0x88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "CreatorCapitalRequirementUpdated", - "type": "event", - "signature": "0xdf7a26ae2e2eb953b81fd76b72fcdc74ebff7c21faa8f8f55323183d9785f52d" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "CreatorFeeUpdated", - "type": "event", - "signature": "0x8c14462add32e0ae0fbfcf9e60711ecae573da337dc9127fff98fb7cfb3973b4" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "CreatorSkewLimitUpdated", - "type": "event", - "signature": "0xd39cfbe31b20dbb6d995a675cf5c369555bf8bb908b6efc03873907fe9e133cf" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "ExerciseDurationUpdated", - "type": "event", - "signature": "0xf0a1ff3a67369ec37b38f6cf8dec83acaffd6d00a2dd1e95a12394d4863a0b71" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "ExpiryDurationUpdated", - "type": "event", - "signature": "0xf378a0fd4ad3ffd9d7d50986f16b04acd2dc42691c4f412f34e8eefe883e6652" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketCancelled", - "type": "event", - "signature": "0x996fafab197beb99fff6fdc975bb6cf90352f2c733c76ef37c2e27f17d7d424b" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "oracleKey", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "strikePrice", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "biddingEndDate", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "maturityDate", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "expiryDate", - "type": "uint256" - } - ], - "name": "MarketCreated", - "type": "event", - "signature": "0xbcd154709bbe69680012cadcd07d57bd4a0ec64a033c2a3e31d2d0fadb38d3a8" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "name": "MarketCreationEnabledUpdated", - "type": "event", - "signature": "0xcc590b6309435383b617aaa0cae6aba938f2ee471cfb539201dd7655a23caff9" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketExpired", - "type": "event", - "signature": "0x16e62064e42f5aec62df22ae895ef539f153e0d4ea290e2cc4e0e8f708f2fbbc" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract BinaryOptionMarketManager", - "name": "receivingManager", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract BinaryOptionMarket[]", - "name": "markets", - "type": "address[]" - } - ], - "name": "MarketsMigrated", - "type": "event", - "signature": "0x3e429aa34462b428d3f7277acb67e1c83d80a57faab2a47924369b5060f35679" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract BinaryOptionMarketManager", - "name": "migratingManager", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract BinaryOptionMarket[]", - "name": "markets", - "type": "address[]" - } - ], - "name": "MarketsReceived", - "type": "event", - "signature": "0xea7a4e14e72ba7db7e2fd406278900badf50b2ce7d9def39d613cc08054c537b" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "MaxOraclePriceAgeUpdated", - "type": "event", - "signature": "0x5a2f2eae84f9e787d8159d363a776fa2b61d084686190cdc5a2c1ea833480b09" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "MaxTimeToMaturityUpdated", - "type": "event", - "signature": "0x6de18e808fc4e6cb9c8910cf4bdc188ddbbdab65faecff65dab871720e848489" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event", - "signature": "0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event", - "signature": "0x906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bool", - "name": "isPaused", - "type": "bool" - } - ], - "name": "PauseChanged", - "type": "event", - "signature": "0x8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "PoolFeeUpdated", - "type": "event", - "signature": "0x7b30e8f8e3de254785fbcb3068449dc18060f1fdb37b02731ecada99a78492c3" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "RefundFeeUpdated", - "type": "event", - "signature": "0x01634ac4e9f09be1ef87b8d09e14926870261dcb9a0929d2d6460af6e4c5ad1e" - }, - { - "constant": false, - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x79ba5097" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pageSize", - "type": "uint256" - } - ], - "name": "activeMarkets", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xe73efc9b" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "cancelMarket", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xfe40c470" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bytes32", - "name": "oracleKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "strikePrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "refundsEnabled", - "type": "bool" - }, - { - "internalType": "uint256[2]", - "name": "times", - "type": "uint256[2]" - }, - { - "internalType": "uint256[2]", - "name": "bids", - "type": "uint256[2]" - } - ], - "name": "createMarket", - "outputs": [ - { - "internalType": "contract IBinaryOptionMarket", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x94fcf3c3" - }, - { - "constant": true, - "inputs": [], - "name": "creatorLimits", - "outputs": [ - { - "internalType": "uint256", - "name": "capitalRequirement", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "skewLimit", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xbe5af9fe" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "delta", - "type": "uint256" - } - ], - "name": "decrementTotalDeposited", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x6b3a0984" - }, - { - "constant": true, - "inputs": [], - "name": "durations", - "outputs": [ - { - "internalType": "uint256", - "name": "maxOraclePriceAge", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiryDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimeToMaturity", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x4a41d89d" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address[]", - "name": "markets", - "type": "address[]" - } - ], - "name": "expireMarkets", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xc014fb84" - }, - { - "constant": true, - "inputs": [], - "name": "fees", - "outputs": [ - { - "internalType": "uint256", - "name": "poolFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "creatorFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "refundFee", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x9af1d35a" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "delta", - "type": "uint256" - } - ], - "name": "incrementTotalDeposited", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xaeab5849" - }, - { - "constant": true, - "inputs": [], - "name": "isResolverCached", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x2af64bd3" - }, - { - "constant": true, - "inputs": [], - "name": "lastPauseTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x91b4ded9" - }, - { - "constant": true, - "inputs": [], - "name": "marketCreationEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x64af2d87" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pageSize", - "type": "uint256" - } - ], - "name": "maturedMarkets", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x89c6318d" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "contract BinaryOptionMarketManager", - "name": "receivingManager", - "type": "address" - }, - { - "internalType": "bool", - "name": "active", - "type": "bool" - }, - { - "internalType": "contract BinaryOptionMarket[]", - "name": "marketsToMigrate", - "type": "address[]" - } - ], - "name": "migrateMarkets", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x03ff6018" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x1627540c" - }, - { - "constant": true, - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x53a47bb7" - }, - { - "constant": true, - "inputs": [], - "name": "numActiveMarkets", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x02610c50" - }, - { - "constant": true, - "inputs": [], - "name": "numMaturedMarkets", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xac60c486" - }, - { - "constant": true, - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x8da5cb5b" - }, - { - "constant": true, - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x5c975abb" - }, - { - "constant": false, - "inputs": [], - "name": "rebuildCache", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x74185360" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "contract BinaryOptionMarket[]", - "name": "marketsToSync", - "type": "address[]" - } - ], - "name": "rebuildMarketCaches", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x9b11dc40" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bool", - "name": "active", - "type": "bool" - }, - { - "internalType": "contract BinaryOptionMarket[]", - "name": "marketsToReceive", - "type": "address[]" - } - ], - "name": "receiveMarkets", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xadfd31af" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "resolveMarket", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x7859f410" - }, - { - "constant": true, - "inputs": [], - "name": "resolver", - "outputs": [ - { - "internalType": "contract AddressResolver", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x04f3bcec" - }, - { - "constant": true, - "inputs": [], - "name": "resolverAddressesRequired", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "addresses", - "type": "bytes32[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x899ffef4" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_creatorCapitalRequirement", - "type": "uint256" - } - ], - "name": "setCreatorCapitalRequirement", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xc095daf2" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_creatorFee", - "type": "uint256" - } - ], - "name": "setCreatorFee", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x0dd16fd5" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_creatorSkewLimit", - "type": "uint256" - } - ], - "name": "setCreatorSkewLimit", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x73b7de15" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_expiryDuration", - "type": "uint256" - } - ], - "name": "setExpiryDuration", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x15502840" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "name": "setMarketCreationEnabled", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x39ab4c41" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_maxOraclePriceAge", - "type": "uint256" - } - ], - "name": "setMaxOraclePriceAge", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xbd6a10b8" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_maxTimeToMaturity", - "type": "uint256" - } - ], - "name": "setMaxTimeToMaturity", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x64cf34bd" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "contract BinaryOptionMarketManager", - "name": "manager", - "type": "address" - } - ], - "name": "setMigratingManager", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x1f3f10b0" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bool", - "name": "_paused", - "type": "bool" - } - ], - "name": "setPaused", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x16c38b3c" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_poolFee", - "type": "uint256" - } - ], - "name": "setPoolFee", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x9501dc87" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_refundFee", - "type": "uint256" - } - ], - "name": "setRefundFee", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x36fd711e" - }, - { - "constant": true, - "inputs": [], - "name": "totalDeposited", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xff50abdc" - } - ], - "source": { - "keccak256": "0x2e5c533119e027ff1083ea3845643d65379a51ac6c22e4dca1399f32938f024d", - "urls": [ - "bzz-raw://a953ed712d384414dcbdc31ef7b01fee2a6749c3fc568489fcd94b46c88bb6ad", - "dweb:/ipfs/QmcyYLZV8Upp6WrdHgUNT1C6JGPTUaW8x8MpH9StTGNJvp" - ] - }, - "metadata": { - "compiler": { - "version": "0.5.16+commit.9c3226ce" - }, - "language": "Solidity", - "settings": { - "compilationTarget": { - "BinaryOptionMarketManager.sol": "BinaryOptionMarketManager" - }, - "evmVersion": "istanbul", - "libraries": {}, - "optimizer": { - "enabled": true, - "runs": 200 - }, - "remappings": [] - }, - "sources": { - "BinaryOptionMarketManager.sol": { - "keccak256": "0x2e5c533119e027ff1083ea3845643d65379a51ac6c22e4dca1399f32938f024d", - "urls": [ - "bzz-raw://a953ed712d384414dcbdc31ef7b01fee2a6749c3fc568489fcd94b46c88bb6ad", - "dweb:/ipfs/QmcyYLZV8Upp6WrdHgUNT1C6JGPTUaW8x8MpH9StTGNJvp" - ] - } - }, - "version": 1 - } - }, - "BinaryOptionMarketData": { - "bytecode": "608060405234801561001057600080fd5b506112f7806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80631216fc7b14610046578063a30c302d1461006f578063dca5f5c31461008f575b600080fd5b610059610054366004610e75565b6100af565b60405161006691906111f1565b60405180910390f35b61008261007d366004610e75565b61047c565b60405161006691906111e2565b6100a261009d366004610e93565b610a61565b60405161006691906111d4565b6100b7610c44565b600080836001600160a01b0316631069143a6040518163ffffffff1660e01b8152600401604080518083038186803b1580156100f257600080fd5b505afa158015610106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061012a9190810190610ecd565b915091506000806000866001600160a01b0316639e3b34bf6040518163ffffffff1660e01b815260040160606040518083038186803b15801561016c57600080fd5b505afa158015610180573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506101a49190810190610e28565b9250925092506000806000896001600160a01b03166398508ecd6040518163ffffffff1660e01b815260040160606040518083038186803b1580156101e857600080fd5b505afa1580156101fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506102209190810190610e28565b92509250925060008060008c6001600160a01b0316639af1d35a6040518163ffffffff1660e01b815260040160606040518083038186803b15801561026457600080fd5b505afa158015610278573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061029c9190810190610e28565b9250925092506102aa610c44565b6040518060c001604052808f6001600160a01b03166302d05d3f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ee57600080fd5b505afa158015610302573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103269190810190610de4565b6001600160a01b0316815260200160405180604001604052808f6001600160a01b031681526020018e6001600160a01b0316815250815260200160405180606001604052808d81526020018c81526020018b815250815260200160405180606001604052808a81526020018981526020018881525081526020016040518060600160405280878152602001868152602001858152508152602001604051806040016040528060008152602001600081525081525090506000808f6001600160a01b031663be5af9fe6040518163ffffffff1660e01b8152600401604080518083038186803b15801561041757600080fd5b505afa15801561042b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061044f9190810190610f57565b60408051808201909152918252602082015260a084015250909c505050505050505050505050505b919050565b610484610ca0565b600080836001600160a01b031663c7a5bdc86040518163ffffffff1660e01b8152600401604080518083038186803b1580156104bf57600080fd5b505afa1580156104d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104f79190810190610f57565b91509150600080856001600160a01b0316633d7a783b6040518163ffffffff1660e01b8152600401604080518083038186803b15801561053657600080fd5b505afa15801561054a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061056e9190810190610f57565b91509150600080876001600160a01b031663d068cdc56040518163ffffffff1660e01b8152600401604080518083038186803b1580156105ad57600080fd5b505afa1580156105c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506105e59190810190610f57565b91509150600080896001600160a01b0316638b0341366040518163ffffffff1660e01b8152600401604080518083038186803b15801561062457600080fd5b505afa158015610638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061065c9190810190610f57565b915091506000808b6001600160a01b031663d3419bf36040518163ffffffff1660e01b8152600401604080518083038186803b15801561069b57600080fd5b505afa1580156106af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506106d39190810190610f57565b9150915060405180610120016040528060405180604001604052808d81526020018c8152508152602001604051806040016040528085815260200184815250815260200160405180604001604052808f6001600160a01b031663eef49ee36040518163ffffffff1660e01b815260040160206040518083038186803b15801561075b57600080fd5b505afa15801561076f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107939190810190610f39565b81526020018f6001600160a01b0316632115e3036040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d157600080fd5b505afa1580156107e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108099190810190610f39565b815250815260200160405180604001604052808f6001600160a01b0316633f6fa6556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085557600080fd5b505afa158015610869573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061088d9190810190610e0a565b151581526020018f6001600160a01b031663ac3791e36040518163ffffffff1660e01b815260040160206040518083038186803b1580156108cd57600080fd5b505afa1580156108e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109059190810190610e0a565b151581525081526020018d6001600160a01b031663b1c9fe6e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561094857600080fd5b505afa15801561095c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109809190810190610efd565b600381111561098b57fe5b81526020018d6001600160a01b031663653721476040518163ffffffff1660e01b815260040160206040518083038186803b1580156109c957600080fd5b505afa1580156109dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a019190810190610f1b565b6001811115610a0c57fe5b81526040805180820182529687526020878101969096528582019690965285518087018752998a5289850198909852848801989098525050815180830190925292815291820152606090910152949350505050565b610a69610d03565b600080846001600160a01b03166329e77b5d856040518263ffffffff1660e01b8152600401610a9891906111c6565b604080518083038186803b158015610aaf57600080fd5b505afa158015610ac3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ae79190810190610f57565b91509150600080866001600160a01b031663408e82af876040518263ffffffff1660e01b8152600401610b1a91906111c6565b604080518083038186803b158015610b3157600080fd5b505afa158015610b45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b699190810190610f57565b91509150600080886001600160a01b0316636392a51f896040518263ffffffff1660e01b8152600401610b9c91906111c6565b604080518083038186803b158015610bb357600080fd5b505afa158015610bc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610beb9190810190610f57565b6040805160a08101825260608101998a5260808101989098529787528751808901895295865260208681019590955284870195909552865180880188529081529283019390935250928201929092529150505b92915050565b6040518060c0016040528060006001600160a01b03168152602001610c67610d16565b8152602001610c74610d2d565b8152602001610c81610d4e565b8152602001610c8e610d2d565b8152602001610c9b610d72565b905290565b604051806101200160405280610cb4610d72565b8152602001610cc1610d72565b8152602001610cce610d72565b8152602001610cdb610d16565b81526020016000815260200160008152602001610cf6610d72565b8152602001610c8e610d72565b6040518060600160405280610cf6610d72565b604080518082019091526000808252602082015290565b60405180606001604052806000815260200160008152602001600081525090565b60405180606001604052806000801916815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b8035610c3e8161126b565b8051610c3e8161126b565b8051610c3e8161127f565b8051610c3e81611288565b8035610c3e81611291565b8051610c3e81611291565b8051610c3e8161129a565b8051610c3e816112a7565b600060208284031215610df657600080fd5b6000610e028484610d97565b949350505050565b600060208284031215610e1c57600080fd5b6000610e028484610da2565b600080600060608486031215610e3d57600080fd5b6000610e498686610dad565b9350506020610e5a86828701610dad565b9250506040610e6b86828701610dad565b9150509250925092565b600060208284031215610e8757600080fd5b6000610e028484610db8565b60008060408385031215610ea657600080fd5b6000610eb28585610db8565b9250506020610ec385828601610d8c565b9150509250929050565b60008060408385031215610ee057600080fd5b6000610eec8585610dc3565b9250506020610ec385828601610dc3565b600060208284031215610f0f57600080fd5b6000610e028484610dce565b600060208284031215610f2d57600080fd5b6000610e028484610dd9565b600060208284031215610f4b57600080fd5b6000610e028484610dad565b60008060408385031215610f6a57600080fd5b6000610f768585610dad565b9250506020610ec385828601610dad565b610f9081611200565b82525050565b610f908161120b565b610f9081611210565b610f9081611213565b610f908161123e565b610f9081611249565b805160c0830190610fd48482611000565b506020820151610fe76040850182611000565b506040820151610ffa6080850182611000565b50505050565b805160408301906110118482610f9f565b506020820151610ffa6020850182610f9f565b805160608301906110358482610f9f565b5060208201516110486020850182610f9f565b506040820151610ffa6040850182610f9f565b805161020083019061106d8482611000565b5060208201516110806040850182611000565b5060408201516110936080850182611000565b5060608201516110a660c08501826111a2565b5060808201516110ba610100850182610fb1565b5060a08201516110ce610120850182610fba565b5060c08201516110e2610140850182611000565b5060e08201516110f6610180850182611000565b50610100820151610ffa6101c0850182611000565b80516101c083019061111d8482610f87565b506020820151611130602085018261117e565b5060408201516111436060850182611024565b50606082015161115660c0850182611024565b50608082015161116a610120850182611024565b5060a0820151610ffa610180850182611000565b8051604083019061118f8482610fa8565b506020820151610ffa6020850182610fa8565b805160408301906111b38482610f96565b506020820151610ffa6020850182610f96565b60208101610c3e8284610f87565b60c08101610c3e8284610fc3565b6102008101610c3e828461105b565b6101c08101610c3e828461110b565b6000610c3e82611232565b151590565b90565b6000610c3e82611200565b8061047781611254565b8061047781611261565b6001600160a01b031690565b6000610c3e8261121e565b6000610c3e82611228565b6004811061125e57fe5b50565b6002811061125e57fe5b61127481611200565b811461125e57600080fd5b6112748161120b565b61127481611210565b61127481611213565b6004811061125e57600080fd5b6002811061125e57600080fdfea365627a7a723158201a6330c1b3b45158c7aef469156860076f8983a4dba2eddc63c6a6b18e813a276c6578706572696d656e74616cf564736f6c63430005100040", - "abi": [ - { - "constant": true, - "inputs": [ - { - "internalType": "contract BinaryOptionMarket", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "getAccountMarketData", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "bids", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "claimable", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "balances", - "type": "tuple" - } - ], - "internalType": "struct BinaryOptionMarketData.AccountData", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xdca5f5c3" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "contract BinaryOptionMarket", - "name": "market", - "type": "address" - } - ], - "name": "getMarketData", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAt", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OraclePriceAndTimestamp", - "name": "oraclePriceAndTimestamp", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarket.Prices", - "name": "prices", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "deposited", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "exercisableDeposits", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.Deposits", - "name": "deposits", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "resolved", - "type": "bool" - }, - { - "internalType": "bool", - "name": "canResolve", - "type": "bool" - } - ], - "internalType": "struct BinaryOptionMarketData.Resolution", - "name": "resolution", - "type": "tuple" - }, - { - "internalType": "enum IBinaryOptionMarket.Phase", - "name": "phase", - "type": "uint8" - }, - { - "internalType": "enum IBinaryOptionMarket.Side", - "name": "result", - "type": "uint8" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "totalBids", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "totalClaimableSupplies", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "totalSupplies", - "type": "tuple" - } - ], - "internalType": "struct BinaryOptionMarketData.MarketData", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xa30c302d" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "contract BinaryOptionMarket", - "name": "market", - "type": "address" - } - ], - "name": "getMarketParameters", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "components": [ - { - "internalType": "contract BinaryOption", - "name": "long", - "type": "address" - }, - { - "internalType": "contract BinaryOption", - "name": "short", - "type": "address" - } - ], - "internalType": "struct BinaryOptionMarket.Options", - "name": "options", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "biddingEnd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maturity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarket.Times", - "name": "times", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "strikePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "finalPrice", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarket.OracleDetails", - "name": "oracleDetails", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "poolFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "creatorFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "refundFee", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketManager.Fees", - "name": "fees", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "capitalRequirement", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "skewLimit", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketManager.CreatorLimits", - "name": "creatorLimits", - "type": "tuple" - } - ], - "internalType": "struct BinaryOptionMarketData.MarketParameters", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x1216fc7b" - } - ] - }, "SynthUtil": { "bytecode": "608060405234801561001057600080fd5b506040516113693803806113698339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b0319909216919091179055611304806100656000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80630120be331461006757806327fe55a6146100a5578063492dbcdd14610146578063a827bf481461022c578063d18ab37614610252578063eade6d2d14610276575b600080fd5b6100936004803603604081101561007d57600080fd5b506001600160a01b0381351690602001356102ce565b60408051918252519081900360200190f35b6100ad61054d565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156100f15781810151838201526020016100d9565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015610130578181015183820152602001610118565b5050505090500194505050505060405180910390f35b61014e6107b9565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b8381101561019657818101518382015260200161017e565b50505050905001848103835286818151815260200191508051906020019060200280838360005b838110156101d55781810151838201526020016101bd565b50505050905001848103825285818151815260200191508051906020019060200280838360005b838110156102145781810151838201526020016101fc565b50505050905001965050505050505060405180910390f35b61014e6004803603602081101561024257600080fd5b50356001600160a01b0316610b32565b61025a610ec9565b604080516001600160a01b039092168252519081900360200190f35b61027e610ed8565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102ba5781810151838201526020016102a2565b505050509050019250505060405180910390f35b6000806102d9611182565b905060006102e561123f565b90506000826001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b15801561032257600080fd5b505afa158015610336573d6000803e3d6000fd5b505050506040513d602081101561034c57600080fd5b5051905060005b81811015610543576000846001600160a01b031663835e119c836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156103a157600080fd5b505afa1580156103b5573d6000803e3d6000fd5b505050506040513d60208110156103cb57600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b038087169263654a60ac929185169163dbd06c85916004808301926020929190829003018186803b15801561041b57600080fd5b505afa15801561042f573d6000803e3d6000fd5b505050506040513d602081101561044557600080fd5b5051604080516370a0823160e01b81526001600160a01b038d811660048301529151918616916370a0823191602480820192602092909190829003018186803b15801561049157600080fd5b505afa1580156104a5573d6000803e3d6000fd5b505050506040513d60208110156104bb57600080fd5b5051604080516001600160e01b031960e086901b16815260048101939093526024830191909152604482018b9052516064808301926020929190829003018186803b15801561050957600080fd5b505afa15801561051d573d6000803e3d6000fd5b505050506040513d602081101561053357600080fd5b5051959095019450600101610353565b5050505092915050565b606080606061055a611182565b6001600160a01b03166372cb051f6040518163ffffffff1660e01b815260040160006040518083038186803b15801561059257600080fd5b505afa1580156105a6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156105cf57600080fd5b81019080805160405193929190846401000000008211156105ef57600080fd5b90830190602082018581111561060457600080fd5b825186602082028301116401000000008211171561062157600080fd5b82525081516020918201928201910280838360005b8381101561064e578181015183820152602001610636565b5050505090500160405250505090508061066661123f565b6001600160a01b031663c2c8a676836040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019060200280838360005b838110156106c45781810151838201526020016106ac565b505050509050019250505060006040518083038186803b1580156106e757600080fd5b505afa1580156106fb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561072457600080fd5b810190808051604051939291908464010000000082111561074457600080fd5b90830190602082018581111561075957600080fd5b825186602082028301116401000000008211171561077657600080fd5b82525081516020918201928201910280838360005b838110156107a357818101518382015260200161078b565b5050505090500160405250505092509250509091565b606080606060006107c8611182565b905060006107d461123f565b90506000826001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b15801561081157600080fd5b505afa158015610825573d6000803e3d6000fd5b505050506040513d602081101561083b57600080fd5b505160408051828152602080840282010190915290915060609082801561086c578160200160208202803883390190505b50905060608260405190808252806020026020018201604052801561089b578160200160208202803883390190505b5090506060836040519080825280602002602001820160405280156108ca578160200160208202803883390190505b50905060005b84811015610b22576000876001600160a01b031663835e119c836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561091e57600080fd5b505afa158015610932573d6000803e3d6000fd5b505050506040513d602081101561094857600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b0383169163dbd06c8591600480820192602092909190829003018186803b15801561098e57600080fd5b505afa1580156109a2573d6000803e3d6000fd5b505050506040513d60208110156109b857600080fd5b505185518690849081106109c857fe5b602002602001018181525050806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0d57600080fd5b505afa158015610a21573d6000803e3d6000fd5b505050506040513d6020811015610a3757600080fd5b50518451859084908110610a4757fe5b602002602001018181525050866001600160a01b031663654a60ac868481518110610a6e57fe5b6020026020010151868581518110610a8257fe5b6020026020010151631cd554d160e21b6040518463ffffffff1660e01b815260040180848152602001838152602001828152602001935050505060206040518083038186803b158015610ad457600080fd5b505afa158015610ae8573d6000803e3d6000fd5b505050506040513d6020811015610afe57600080fd5b50518351849084908110610b0e57fe5b6020908102919091010152506001016108d0565b5091975095509350505050909192565b60608060606000610b41611182565b90506000610b4d61123f565b90506000826001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8a57600080fd5b505afa158015610b9e573d6000803e3d6000fd5b505050506040513d6020811015610bb457600080fd5b5051604080518281526020808402820101909152909150606090828015610be5578160200160208202803883390190505b509050606082604051908082528060200260200182016040528015610c14578160200160208202803883390190505b509050606083604051908082528060200260200182016040528015610c43578160200160208202803883390190505b50905060005b84811015610eb8576000876001600160a01b031663835e119c836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610c9757600080fd5b505afa158015610cab573d6000803e3d6000fd5b505050506040513d6020811015610cc157600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b0383169163dbd06c8591600480820192602092909190829003018186803b158015610d0757600080fd5b505afa158015610d1b573d6000803e3d6000fd5b505050506040513d6020811015610d3157600080fd5b50518551869084908110610d4157fe5b602002602001018181525050806001600160a01b03166370a082318d6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015610da357600080fd5b505afa158015610db7573d6000803e3d6000fd5b505050506040513d6020811015610dcd57600080fd5b50518451859084908110610ddd57fe5b602002602001018181525050866001600160a01b031663654a60ac868481518110610e0457fe5b6020026020010151868581518110610e1857fe5b6020026020010151631cd554d160e21b6040518463ffffffff1660e01b815260040180848152602001838152602001828152602001935050505060206040518083038186803b158015610e6a57600080fd5b505afa158015610e7e573d6000803e3d6000fd5b505050506040513d6020811015610e9457600080fd5b50518351849084908110610ea457fe5b602090810291909101015250600101610c49565b509199909850909650945050505050565b6000546001600160a01b031681565b60606000610ee4611182565b90506000610ef061123f565b90506000826001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2d57600080fd5b505afa158015610f41573d6000803e3d6000fd5b505050506040513d6020811015610f5757600080fd5b5051604080518281526020808402820101909152909150606090828015610f88578160200160208202803883390190505b50905060005b82811015611179576000856001600160a01b031663835e119c836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610fdc57600080fd5b505afa158015610ff0573d6000803e3d6000fd5b505050506040513d602081101561100657600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b038088169263af3aea86929185169163dbd06c85916004808301926020929190829003018186803b15801561105657600080fd5b505afa15801561106a573d6000803e3d6000fd5b505050506040513d602081101561108057600080fd5b5051604080516001600160e01b031960e085901b1681526004810192909252516024808301926020929190829003018186803b1580156110bf57600080fd5b505afa1580156110d3573d6000803e3d6000fd5b505050506040513d60208110156110e957600080fd5b50511561117057806001600160a01b031663dbd06c856040518163ffffffff1660e01b815260040160206040518083038186803b15801561112957600080fd5b505afa15801561113d573d6000803e3d6000fd5b505050506040513d602081101561115357600080fd5b5051835184908490811061116357fe5b6020026020010181815250505b50600101610f8e565b50935050505090565b600080546040805163dacb2d0160e01b8152680a6f2dce8d0cae8d2f60bb1b600482015260248101829052601960448201527f4d697373696e672053796e746865746978206164647265737300000000000000606482015290516001600160a01b039092169163dacb2d0191608480820192602092909190829003018186803b15801561120e57600080fd5b505afa158015611222573d6000803e3d6000fd5b505050506040513d602081101561123857600080fd5b5051905090565b600080546040805163dacb2d0160e01b81526c45786368616e6765526174657360981b600482015260248101829052601d60448201527f4d697373696e672045786368616e676552617465732061646472657373000000606482015290516001600160a01b039092169163dacb2d0191608480820192602092909190829003018186803b15801561120e57600080fdfea265627a7a723158209e7ba686f73798746736e8ff9d170da8215f2ad60eb6b3c4ba5c14e221d4140064736f6c63430005100032", "abi": [ diff --git a/publish/deployed/rinkeby/config.json b/publish/deployed/rinkeby/config.json index 35aa61093a..ec908e247b 100644 --- a/publish/deployed/rinkeby/config.json +++ b/publish/deployed/rinkeby/config.json @@ -2,15 +2,6 @@ "AddressResolver": { "deploy": false }, - "BinaryOptionMarketFactory": { - "deploy": false - }, - "BinaryOptionMarketManager": { - "deploy": false - }, - "BinaryOptionMarketData": { - "deploy": false - }, "CollateralManager": { "deploy": false }, diff --git a/publish/deployed/rinkeby/deployment.json b/publish/deployed/rinkeby/deployment.json index fe770670b8..d594247528 100644 --- a/publish/deployed/rinkeby/deployment.json +++ b/publish/deployed/rinkeby/deployment.json @@ -1359,33 +1359,6 @@ "txn": "https://rinkeby.etherscan.io/tx/0x7c1104a8662f213fae30648a62219dfc9f358c63c586db40ddc1280ee3337f95", "network": "rinkeby" }, - "BinaryOptionMarketFactory": { - "name": "BinaryOptionMarketFactory", - "address": "0xAa5be8E9f74786F15512AF816d7Ef42f5c53628C", - "source": "BinaryOptionMarketFactory", - "link": "https://rinkeby.etherscan.io/address/0xAa5be8E9f74786F15512AF816d7Ef42f5c53628C", - "timestamp": "2020-12-22T21:18:15.000Z", - "txn": "https://rinkeby.etherscan.io/tx/0xf387e369a8d84ed373a78a38dd74a62d469246d379d3112212d8adcef981712b", - "network": "rinkeby" - }, - "BinaryOptionMarketManager": { - "name": "BinaryOptionMarketManager", - "address": "0x35295c6E4993373fA1fBB9cf32f6A07905a2456B", - "source": "BinaryOptionMarketManager", - "link": "https://rinkeby.etherscan.io/address/0x35295c6E4993373fA1fBB9cf32f6A07905a2456B", - "timestamp": "2020-12-22T21:18:30.000Z", - "txn": "https://rinkeby.etherscan.io/tx/0x238f721b74e7002287bba96132f37754c1fea01eeaf7e117dc131509f8d97646", - "network": "rinkeby" - }, - "BinaryOptionMarketData": { - "name": "BinaryOptionMarketData", - "address": "0x87a0dc569076b00E2866eA9673C1007d4362300f", - "source": "BinaryOptionMarketData", - "link": "https://rinkeby.etherscan.io/address/0x87a0dc569076b00E2866eA9673C1007d4362300f", - "timestamp": "2020-08-05T23:39:59.000Z", - "txn": "https://rinkeby.etherscan.io/tx/0x44059c9bcb5d3220f660559fc0f09410d5dfc09cff2f3d4833f4e59bea0c5671", - "network": "rinkeby" - }, "SynthUtil": { "name": "SynthUtil", "address": "0xdb6315F68dce5aF7D26a5055B3E94d0c59C1a62A", @@ -20588,1782 +20561,6 @@ "version": 1 } }, - "BinaryOptionMarketFactory": { - "bytecode": "608060405234801561001057600080fd5b506040516158493803806158498339818101604052604081101561003357600080fd5b50805160209091015180826001600160a01b038116610099576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a150600280546001600160a01b039092166001600160a01b03199092169190911790555050615725806101246000396000f3fe60806040523480156200001157600080fd5b5060043610620000a05760003560e01c806353a47bb7116200006f57806353a47bb7146200016857806374185360146200017257806379ba5097146200017c578063899ffef414620001865780638da5cb5b14620001e257620000a0565b806304f3bcec14620000a5578063130efa5014620000cb5780631627540c146200011f5780632af64bd3146200014a575b600080fd5b620000af620001ec565b604080516001600160a01b039092168252519081900360200190f35b620000af60048036036101c0811015620000e457600080fd5b506001600160a01b0381351690602081019060608101359060808101359060a081013515159060c081019061012081019061016001620001fb565b62000148600480360360208110156200013757600080fd5b50356001600160a01b03166200036e565b005b62000154620003cc565b604080519115158252519081900360200190f35b620000af620004e2565b62000148620004f1565b62000148620006c4565b6200019062000782565b60408051602080825283518183015283519192839290830191858101910280838360005b83811015620001ce578181015183820152602001620001b4565b505050509050019250505060405180910390f35b620000af620007de565b6002546001600160a01b031681565b60008062000208620007ed565b90506001600160a01b038116331462000268576040805162461bcd60e51b815260206004820152601e60248201527f4f6e6c79207065726d697474656420627920746865206d616e616765722e0000604482015290519081900360640190fd5b808a600260009054906101000a90046001600160a01b03168b8b8b8b8b8b8b604051620002959062000950565b6001600160a01b03808c1682528a8116602083015289166040808301919091526060820190899080828437600083820152601f01601f191690910188815260208101889052861515604082015260609081019150859080828437600083820152601f01601f1916909101905083604080828437600083820152601f01601f19169091019050826060808284376000838201819052604051601f909201601f19169093018190039d509b50909950505050505050505050f0801580156200035f573d6000803e3d6000fd5b509a9950505050505050505050565b620003786200081b565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b60006060620003da62000782565b905060005b8151811015620004d8576000828281518110620003f857fe5b6020908102919091018101516000818152600383526040908190205460025482516321f8a72160e01b81526004810185905292519395506001600160a01b03918216949116926321f8a721926024808201939291829003018186803b1580156200046157600080fd5b505afa15801562000476573d6000803e3d6000fd5b505050506040513d60208110156200048d57600080fd5b50516001600160a01b0316141580620004bb57506000818152600360205260409020546001600160a01b0316155b15620004ce5760009350505050620004df565b50600101620003df565b5060019150505b90565b6001546001600160a01b031681565b6060620004fd62000782565b905060005b8151811015620006c05760008282815181106200051b57fe5b602090810291909101810151600254604080517f5265736f6c766572206d697373696e67207461726765743a2000000000000000818601526039808201859052825180830390910181526059820180845263dacb2d0160e01b9052605d8201858152607d83019384528151609d84015281519597506000966001600160a01b039095169563dacb2d01958995939492939260bd0191908501908083838c5b83811015620005d3578181015183820152602001620005b9565b50505050905090810190601f168015620006015780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b1580156200062057600080fd5b505afa15801562000635573d6000803e3d6000fd5b505050506040513d60208110156200064c57600080fd5b505160008381526003602090815260409182902080546001600160a01b0319166001600160a01b03851690811790915582518681529182015281519293507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68929081900390910190a1505060010162000502565b5050565b6001546001600160a01b031633146200070f5760405162461bcd60e51b81526004018080602001828103825260358152602001806200568d6035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60408051600180825281830190925260609160208083019080388339019050509050782134b730b93ca7b83a34b7b726b0b935b2ba26b0b730b3b2b960391b81600081518110620007cf57fe5b60200260200101818152505090565b6000546001600160a01b031681565b600062000816782134b730b93ca7b83a34b7b726b0b935b2ba26b0b730b3b2b960391b62000868565b905090565b6000546001600160a01b03163314620008665760405162461bcd60e51b815260040180806020018281038252602f815260200180620056c2602f913960400191505060405180910390fd5b565b600081815260036020908152604080832054815170026b4b9b9b4b7339030b2323932b9b99d1607d1b9381019390935260318084018690528251808503909101815260519093019091526001600160a01b03169081620009495760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156200090d578181015183820152602001620008f3565b50505050905090810190601f1680156200093b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5092915050565b614d2e806200095f8339019056fe60806040523480156200001157600080fd5b5060405162004d2e38038062004d2e83398181016040526102008110156200003857600080fd5b5080516020820151604083015160a084015160c085015160e08601519495939492936060810193906101008101906101608101906101a001878a6001600160a01b038116620000ce576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a150600280546001600160a01b03199081166001600160a01b0393841617909155601480546040805180820182528c518082526020808f01519281018390526011919091556012919091558151606080820184528d82528183018d90526000918401829052600b8e9055600c8d9055600d919091558251908101835289518082528a8301518284018190528b85015192909401829052600855600992909255600a919091559216928c169290921760ff60a81b1916600160a81b8715150217909155825190830151620001f982826200047b565b8a6001600160a01b031660008051602062004d0e833981519152600084604051808360018111156200022757fe5b60ff1681526020018281526020019250505060405180910390a28a6001600160a01b031660008051602062004d0e833981519152600183604051808360018111156200026f57fe5b60ff1681526020018281526020019250505060405180910390a26000620002a582846200058260201b620021f71790919060201c565b6013819055845160208087015160408051606081018252848152808401839052818a01519101819052600e849055600f8290556010559293509091906200038490620002fe908490849062000582811b620021f717901c565b73__$60f5066a95a61bfd95691e5518aae05f18$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200034357600080fd5b505af415801562000358573d6000803e3d6000fd5b505050506040513d60208110156200036f57600080fd5b505190620005e6602090811b62002bb317901c565b6015556200039d8585856001600160e01b036200064416565b8d85604051620003ad9062000976565b6001600160a01b0390921682526020820152604080519182900301906000f080158015620003df573d6000803e3d6000fd5b50600480546001600160a01b0319166001600160a01b03929092169190911790556040518e908590620004129062000976565b6001600160a01b0390921682526020820152604080519182900301906000f08015801562000444573d6000803e3d6000fd5b50600580546001600160a01b0319166001600160a01b039290921691909117905550620009849d5050505050505050505050505050565b60006200049782846200058260201b620021f71790919060201c565b9050806011600001541115620004f4576040805162461bcd60e51b815260206004820152601460248201527f496e73756666696369656e74206361706974616c000000000000000000000000604482015290519081900360640190fd5b6012546200050f8483620006be602090811b6200300417901c565b8111158015620005385750620005348284620006be60201b620030041790919060201c565b8111155b6200057c576040805162461bcd60e51b815260206004820152600f60248201526e109a591cc81d1bdbc81cdad95dd959608a1b604482015290519081900360640190fd5b50505050565b600082820183811015620005dd576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b6000828211156200063e576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000806200065d8585856001600160e01b03620006f916565b604080518082018252838152602090810183905260068490556007839055815184815290810183905281519395509193507f6546f60f34df611fa42503098acc39d5ab88bc73febe64b3cc14e5a92e3a66a792918290030190a15050505050565b6000620005dd82620006e585670de0b6b3a7640000620007b6602090811b6200305417901c565b6200081460201b620030ad1790919060201c565b60008084158015906200070b57508315155b6200075d576040805162461bcd60e51b815260206004820152601460248201527f42696473206d757374206265206e6f6e7a65726f000000000000000000000000604482015290519081900360640190fd5b600062000773846001600160e01b036200088016565b90506200078f8187620008bb60201b62002e271790919060201c565b620007a98287620008bb60201b62002e271790919060201c565b9250925050935093915050565b600082620007c757506000620005e0565b82820282848281620007d557fe5b0414620005dd5760405162461bcd60e51b815260040180806020018281038252602181526020018062004ced6021913960400191505060405180910390fd5b60008082116200086b576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b60008284816200087757fe5b04949350505050565b601454600090600160a01b900460ff16620008b757620008b160155483620008db60201b620021db1790919060201c565b620005e0565b5090565b6000620005dd8383670de0b6b3a76400006001600160e01b03620008fb16565b6000620005dd8383670de0b6b3a76400006001600160e01b036200093f16565b6000806200092084620006e585600a0288620007b660201b620030541790919060201c565b90506005600a825b06106200093357600a015b600a9004949350505050565b600080600a8304620009608587620007b660201b620030541790919060201c565b816200096857fe5b0490506005600a8262000928565b61114a8062003ba383390190565b61320f80620009946000396000f3fe608060405234801561001057600080fd5b50600436106102485760003560e01c8063851492581161013b578063be5af9fe116100b8578063d3419bf31161007c578063d3419bf31461055c578063dbea363814610564578063e4cfbdbd1461058a578063eef49ee3146105c2578063fd087ee5146105ca57610248565b8063be5af9fe14610516578063c588f5261461051e578063c7a5bdc814610526578063c8db233e1461052e578063d068cdc51461055457610248565b80639af1d35a116100ff5780639af1d35a146104c05780639e3b34bf146104c8578063ac3791e3146104d0578063b1c9fe6e146104d8578063b634bfbc146104f057610248565b8063851492581461042a578063899ffef4146104325780638b0341361461048a5780638da5cb5b1461049257806398508ecd1461049a57610248565b80633dae89eb116101c957806353a47bb71161018d57806353a47bb7146103c05780636392a51f146103c857806365372147146103ee578063741853601461041a57806379ba50971461042257610248565b80633dae89eb1461035c5780633f6fa65514610364578063408e82af1461036c5780634c33fe9414610392578063532f1179146103b857610248565b806327745bae1161021057806327745bae146102e95780632810e1d6146102f157806329e77b5d146102f95780632af64bd3146103385780633d7a783b1461035457610248565b806302d05d3f1461024d57806304f3bcec146102715780631069143a146102795780631627540c146102a75780632115e303146102cf575b600080fd5b6102556105f8565b604080516001600160a01b039092168252519081900360200190f35b610255610607565b610281610616565b604080516001600160a01b03938416815291909216602082015281519081900390910190f35b6102cd600480360360208110156102bd57600080fd5b50356001600160a01b031661062c565b005b6102d7610688565b60408051918252519081900360200190f35b6102cd61069b565b6102cd6106fd565b61031f6004803603602081101561030f57600080fd5b50356001600160a01b0316610ad1565b6040805192835260208301919091528051918290030190f35b610340610ae6565b604080519115158252519081900360200190f35b61031f610bf0565b61031f610cdb565b610340610cee565b61031f6004803603602081101561038257600080fd5b50356001600160a01b0316610cfe565b6102cd600480360360208110156103a857600080fd5b50356001600160a01b0316610d0a565b610340610df4565b610255610e04565b61031f600480360360208110156103de57600080fd5b50356001600160a01b0316610e13565b6103f6610e1f565b6040518082600181111561040657fe5b60ff16815260200191505060405180910390f35b6102cd610e29565b6102cd610ff1565b6102d76110ad565b61043a61139e565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561047657818101518382015260200161045e565b505050509050019250505060405180910390f35b61031f611461565b61025561146c565b6104a261147b565b60408051938452602084019290925282820152519081900360600190f35b6104a2611487565b6104a2611493565b61034061149f565b6104e06114e2565b6040518082600381111561040657fe5b6102d76004803603604081101561050657600080fd5b5060ff8135169060200135611526565b61031f61186d565b61031f611876565b61031f611945565b6102cd6004803603602081101561054457600080fd5b50356001600160a01b0316611950565b61031f6119bd565b61031f611a72565b6102cd6004803603604081101561057a57600080fd5b5060ff8135169060200135611a7b565b6102d7600480360360808110156105a057600080fd5b5060ff8135811691602081013590911690604081013590606001351515611c64565b6102d7611e65565b61031f600480360360608110156105e057600080fd5b5060ff81351690602081013590604001351515611e6b565b6014546001600160a01b031681565b6002546001600160a01b031681565b6004546005546001600160a01b03918216911682565b610634611f5c565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b6000610695601354611fa5565b90505b90565b6106a3611fdc565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b1580156106db57600080fd5b505afa1580156106ef573d6000803e3d6000fd5b505050506106fb611ff6565b565b610705611f5c565b61070d61209e565b61074f576040805162461bcd60e51b815260206004820152600e60248201526d4e6f7420796574206d617475726560901b604482015290519081900360640190fd5b610757611fdc565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561078f57600080fd5b505afa1580156107a3573d6000803e3d6000fd5b505050506107af611ff6565b601454600160a01b900460ff161561080e576040805162461bcd60e51b815260206004820152601760248201527f4d61726b657420616c7265616479207265736f6c766564000000000000000000604482015290519081900360640190fd5b6000806108196120a6565b9150915061082681612134565b610868576040805162461bcd60e51b815260206004820152600e60248201526d5072696365206973207374616c6560901b604482015290519081900360640190fd5b600d8290556014805460ff60a01b1916600160a01b179055600061088a6121c4565b601354600e54919250906000906108a890839063ffffffff6121db16565b600f549091506000906108c290849063ffffffff6121db16565b90506108dc6108d7828463ffffffff6121f716565b612251565b50836001600160a01b031663a9059cbb6108f46122d8565b6001600160a01b031663eb1edd616040518163ffffffff1660e01b815260040160206040518083038186803b15801561092c57600080fd5b505afa158015610940573d6000803e3d6000fd5b505050506040513d602081101561095657600080fd5b5051604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482018690525160448083019260209291908290030181600087803b1580156109a657600080fd5b505af11580156109ba573d6000803e3d6000fd5b505050506040513d60208110156109d057600080fd5b50506014546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810184905290519186169163a9059cbb916044808201926020929091908290030181600087803b158015610a2857600080fd5b505af1158015610a3c573d6000803e3d6000fd5b505050506040513d6020811015610a5257600080fd5b507f5528b7e06f48a519cf814c4e5293ee2737c3f5c28d93e30cca112ac649fdd2359050610a7e6122ed565b8787601354868660405180876001811115610a9557fe5b60ff1681526020810196909652506040808601949094526060850192909252608084015260a0830152519081900360c0019150a1505050505050565b600080610add83612332565b91509150915091565b60006060610af261139e565b905060005b8151811015610be7576000828281518110610b0e57fe5b6020908102919091018101516000818152600383526040908190205460025482516321f8a72160e01b81526004810185905292519395506001600160a01b03918216949116926321f8a721926024808201939291829003018186803b158015610b7657600080fd5b505afa158015610b8a573d6000803e3d6000fd5b505050506040513d6020811015610ba057600080fd5b50516001600160a01b0316141580610bcd57506000818152600360205260409020546001600160a01b0316155b15610bde5760009350505050610698565b50600101610af7565b50600191505090565b6004805460408051636b7f817160e11b8152905160009384936001600160a01b03169263d6ff02e29281830192602092829003018186803b158015610c3457600080fd5b505afa158015610c48573d6000803e3d6000fd5b505050506040513d6020811015610c5e57600080fd5b505160055460408051636b7f817160e11b815290516001600160a01b039092169163d6ff02e291600481810192602092909190829003018186803b158015610ca557600080fd5b505afa158015610cb9573d6000803e3d6000fd5b505050506040513d6020811015610ccf57600080fd5b505190925090505b9091565b600080610ce6612433565b915091509091565b601454600160a01b900460ff1681565b600080610add836126fd565b610d12611f5c565b610d1a6127c8565b15610d5f576040805162461bcd60e51b815260206004820152601060248201526f42696464696e6720696e61637469766560801b604482015290519081900360640190fd5b600080610d6a6127d0565b60145491935091506000908190610d89906001600160a01b0316612332565b9150915060008285148015610d9d57508184145b905080610de3576040805162461bcd60e51b815260206004820152600f60248201526e4e6f742063616e63656c6c61626c6560881b604482015290519081900360640190fd5b610dec86612885565b505050505050565b601454600160a81b900460ff1681565b6001546001600160a01b031681565b600080610add83612a8c565b60006106956122ed565b6060610e3361139e565b905060005b8151811015610fed576000828281518110610e4f57fe5b602090810291909101810151600254604080517f5265736f6c766572206d697373696e67207461726765743a2000000000000000818601526039808201859052825180830390910181526059820180845263dacb2d0160e01b9052605d8201858152607d83019384528151609d84015281519597506000966001600160a01b039095169563dacb2d01958995939492939260bd0191908501908083838c5b83811015610f05578181015183820152602001610eed565b50505050905090810190601f168015610f325780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b158015610f5057600080fd5b505afa158015610f64573d6000803e3d6000fd5b505050506040513d6020811015610f7a57600080fd5b505160008381526003602090815260409182902080546001600160a01b0319166001600160a01b03851690811790915582518681529182015281519293507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68929081900390910190a15050600101610e38565b5050565b6001546001600160a01b0316331461103a5760405162461bcd60e51b815260040180806020018281038252603581526020018061311a6035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b601454600090600160a01b900460ff16611139576110c9612b57565b6001600160a01b0316637859f410306040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561112057600080fd5b505af1158015611134573d6000803e3d6000fd5b505050505b600080611145336126fd565b9150915081600014158061115857508015155b1561116857611165612433565b50505b60008061117433612a8c565b9150915081600014158061118757508015155b6111ce576040805162461bcd60e51b81526020600482015260136024820152724e6f7468696e6720746f20657865726369736560681b604482015290519081900360640190fd5b811561123a576004805460408051630d8acc1560e11b81523393810193909352516001600160a01b0390911691631b15982a91602480830192600092919082900301818387803b15801561122157600080fd5b505af1158015611235573d6000803e3d6000fd5b505050505b80156112a55760055460408051630d8acc1560e11b815233600482015290516001600160a01b0390921691631b15982a9160248082019260009290919082900301818387803b15801561128c57600080fd5b505af11580156112a0573d6000803e3d6000fd5b505050505b60006112b96112b26122ed565b8484612b66565b60408051828152905191925033917fd82b6f69d7477fb41cd83d936de94990cee2fa1a309feeee90101fc0513b6a439181900360200190a280156113955761130081612251565b506113096121c4565b6001600160a01b031663a9059cbb33836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561136857600080fd5b505af115801561137c573d6000803e3d6000fd5b505050506040513d602081101561139257600080fd5b50505b94505050505090565b60408051600480825260a08201909252606091602082016080803883390190505090506b53797374656d53746174757360a01b816000815181106113de57fe5b6020026020010181815250506c45786368616e6765526174657360981b8160018151811061140857fe5b6020026020010181815250506814de5b9d1a1cd554d160ba1b8160028151811061142e57fe5b60200260200101818152505066119959541bdbdb60ca1b8160038151811061145257fe5b60200260200101818152505090565b600080610ce66127d0565b6000546001600160a01b031681565b600b54600c54600d5483565b600e54600f5460105483565b600854600954600a5483565b6000806114aa6120a6565b601454909250600160a01b900460ff1615905080156114cc57506114cc61209e565b80156114dc57506114dc81612134565b91505090565b60006114ec6127c8565b6114f857506000610698565b61150061209e565b61150c57506001610698565b611514612b89565b61152057506002610698565b50600390565b60006115306127c8565b15611575576040805162461bcd60e51b815260206004820152601060248201526f42696464696e6720696e61637469766560801b604482015290519081900360640190fd5b601454600160a81b900460ff166115c6576040805162461bcd60e51b815260206004820152601060248201526f1499599d5b991cc8191a5cd8589b195960821b604482015290519081900360640190fd5b816115d357506000611867565b6014546001600160a01b0316331415611629576000806115f233612332565b9092509050600185600181111561160557fe5b141561160d57905b611626611620838663ffffffff612bb316565b82612c10565b50505b6116be6116b1600e6002015473__$60f5066a95a61bfd95691e5518aae05f18$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b15801561167957600080fd5b505af415801561168d573d6000803e3d6000fd5b505050506040513d60208110156116a357600080fd5b50519063ffffffff612bb316565b839063ffffffff6121db16565b90506116c983612cef565b6001600160a01b031663410085df33846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561172857600080fd5b505af115801561173c573d6000803e3d6000fd5b503392507f9bd0a8ca6625e01a9cee5e86eec7813a8234b41f1ca0c9f15a008d1e1d00ee5f915085905083611777868263ffffffff612bb316565b6040518084600181111561178757fe5b60ff168152602001838152602001828152602001935050505060405180910390a260006117b382612251565b90506117bd6121c4565b6001600160a01b031663a9059cbb33846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561181c57600080fd5b505af1158015611830573d6000803e3d6000fd5b505050506040513d602081101561184657600080fd5b5060009050806118546127d0565b91509150611863828285612d27565b5050505b92915050565b60115460125482565b6014546000908190600160a01b900460ff1615806118ab5750336118a061189b6122ed565b612cef565b6001600160a01b0316145b156118be576118bb601354611fa5565b90505b6004546001600160a01b03163314156118db576006549150610cd7565b6005546001600160a01b03163314156118f8576007549150610cd7565b6040805162461bcd60e51b815260206004820152601760248201527f53656e646572206973206e6f7420616e206f7074696f6e000000000000000000604482015290519081900360640190fd5b600080610ce66120a6565b611958611f5c565b611960612b89565b6119b1576040805162461bcd60e51b815260206004820152601b60248201527f556e65787069726564206f7074696f6e732072656d61696e696e670000000000604482015290519081900360640190fd5b6119ba81612885565b50565b60048054604080516318160ddd60e01b8152905160009384936001600160a01b0316926318160ddd9281830192602092829003018186803b158015611a0157600080fd5b505afa158015611a15573d6000803e3d6000fd5b505050506040513d6020811015611a2b57600080fd5b5051600554604080516318160ddd60e01b815290516001600160a01b03909216916318160ddd91600481810192602092909190829003018186803b158015610ca557600080fd5b60065460075482565b611a836127c8565b15611ac8576040805162461bcd60e51b815260206004820152601060248201526f42696464696e6720696e61637469766560801b604482015290519081900360640190fd5b80611ad257610fed565b611adb82612cef565b6001600160a01b03166359d667a533836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015611b3a57600080fd5b505af1158015611b4e573d6000803e3d6000fd5b50505050336001600160a01b03167f70bd4a33bf447720d717d08f3affb5aecfe4d2ebb8e3dd94539f5313e2447643838360405180836001811115611b8f57fe5b60ff1681526020018281526020019250505060405180910390a26000611bb482612d96565b9050611bbe6121c4565b604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b0392909216916323b872dd916064808201926020929091908290030181600087803b158015611c1657600080fd5b505af1158015611c2a573d6000803e3d6000fd5b505050506040513d6020811015611c4057600080fd5b506000905080611c4e6127d0565b91509150611c5d828285612d27565b5050505050565b600080611c7c601554856121db90919063ffffffff16565b90506000611c8986612cef565b6001600160a01b0316638b0341366040518163ffffffff1660e01b815260040160206040518083038186803b158015611cc157600080fd5b505afa158015611cd5573d6000803e3d6000fd5b505050506040513d6020811015611ceb57600080fd5b505160135460408051630241ebdb60e61b81529051929350909160009173__$60f5066a95a61bfd95691e5518aae05f18$__9163907af6c091600480820192602092909190829003018186803b158015611d4457600080fd5b505af4158015611d58573d6000803e3d6000fd5b505050506040513d6020811015611d6e57600080fd5b5051601054909150600090611d8a90839063ffffffff612bb316565b9050886001811115611d9857fe5b8a6001811115611da457fe5b1415611e0e576000611dbc848763ffffffff6121db16565b90508715611dd85793611dd5868363ffffffff6121db16565b95505b611e01611deb848863ffffffff612bb316565b611df58388612e00565b9063ffffffff612e2716565b9650505050505050611e5d565b6000611e20858763ffffffff612e2716565b90508715611e2a57925b6000611e368286612e00565b905088611e435780611e53565b611e53818463ffffffff612e2716565b9750505050505050505b949350505050565b60135481565b600080600080611e796127d0565b9150915061311785611e8d576121f7611e91565b612bb35b90506000886001811115611ea157fe5b1415611ebc57611eb583888363ffffffff16565b9250611ecd565b611eca82888363ffffffff16565b91505b8515611f3357611f30611f23600e6002015473__$60f5066a95a61bfd95691e5518aae05f18$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b15801561167957600080fd5b889063ffffffff6121db16565b96505b611f4d8383611f486013548b8663ffffffff16565b612e3c565b94509450505050935093915050565b6000546001600160a01b031633146106fb5760405162461bcd60e51b815260040180806020018281038252602f81526020018061314f602f913960400191505060405180910390fd5b601454600090600160a01b900460ff16611fd257601554611fcd90839063ffffffff6121db16565b611fd4565b815b90505b919050565b60006106956b53797374656d53746174757360a01b612ecf565b611ffe612b57565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b15801561203657600080fd5b505afa15801561204a573d6000803e3d6000fd5b505050506040513d602081101561206057600080fd5b5051156106fb5760405162461bcd60e51b815260040180806020018281038252603c81526020018061319f603c913960400191505060405180910390fd5b600954421190565b6000806120b1612fac565b6001600160a01b0316634308a94f600b600001546040518263ffffffff1660e01b815260040180828152602001915050604080518083038186803b1580156120f857600080fd5b505afa15801561210c573d6000803e3d6000fd5b505050506040513d604081101561212257600080fd5b50805160209091015190925090509091565b60008061213f612b57565b6001600160a01b0316634a41d89d6040518163ffffffff1660e01b815260040160606040518083038186803b15801561217757600080fd5b505afa15801561218b573d6000803e3d6000fd5b505050506040513d60608110156121a157600080fd5b505160095490915083906121bb908363ffffffff612bb316565b11159392505050565b60006106956814de5b9d1a1cd554d160ba1b612ecf565b60006121f08383670de0b6b3a7640000612fc7565b9392505050565b6000828201838110156121f0576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b601354600090612267908363ffffffff612bb316565b60138190559050612276612b57565b6001600160a01b0316636b3a0984836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156122bb57600080fd5b505af11580156122cf573d6000803e3d6000fd5b50505050919050565b600061069566119959541bdbdb60ca1b612ecf565b6014546000908190600160a01b900460ff161561230d5750600d54612319565b6123156120a6565b5090505b600c5481101561232a5760016114dc565b600091505090565b60048054604080516308dc30b760e41b81526001600160a01b0385811694820194909452905160009384931691638dc30b70916024808301926020929190829003018186803b15801561238457600080fd5b505afa158015612398573d6000803e3d6000fd5b505050506040513d60208110156123ae57600080fd5b5051600554604080516308dc30b760e41b81526001600160a01b03878116600483015291519190921691638dc30b70916024808301926020929190829003018186803b1580156123fd57600080fd5b505afa158015612411573d6000803e3d6000fd5b505050506040513d602081101561242757600080fd5b50519092509050915091565b60008061243e611fdc565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561247657600080fd5b505afa15801561248a573d6000803e3d6000fd5b50505050612496611ff6565b61249e6127c8565b6124e4576040805162461bcd60e51b815260206004820152601260248201527142696464696e6720696e636f6d706c65746560701b604482015290519081900360640190fd5b60006124f1601354611fa5565b905060006124fd6122ed565b601454909150600160a01b900460ff166000808215806125285750600084600181111561252657fe5b145b156125bc576004805460065460408051632bc43fd960e01b81523394810194909452602484019190915260448301889052516001600160a01b0390911691632bc43fd99160648083019260209291908290030181600087803b15801561258d57600080fd5b505af11580156125a1573d6000803e3d6000fd5b505050506040513d60208110156125b757600080fd5b505191505b8215806125d4575060018460018111156125d257fe5b145b156126665760055460075460408051632bc43fd960e01b8152336004820152602481019290925260448201889052516001600160a01b0390921691632bc43fd9916064808201926020929091908290030181600087803b15801561263757600080fd5b505af115801561264b573d6000803e3d6000fd5b505050506040513d602081101561266157600080fd5b505190505b8115158061267357508015155b6126b7576040805162461bcd60e51b815260206004820152601060248201526f4e6f7468696e6720746f20636c61696d60801b604482015290519081900360640190fd5b6040805183815260208101839052815133927fbbe753caa9bb201dbd1740ee3d61c6d2adf5fa89f30233d732281ae5db6a03d4928290030190a290955093505050509091565b600480546040805163270fb89160e21b81526001600160a01b0385811694820194909452905160009384931691639c3ee244916024808301926020929190829003018186803b15801561274f57600080fd5b505afa158015612763573d6000803e3d6000fd5b505050506040513d602081101561277957600080fd5b50516005546040805163270fb89160e21b81526001600160a01b03878116600483015291519190921691639c3ee244916024808301926020929190829003018186803b1580156123fd57600080fd5b600854421190565b6004805460408051634581a09b60e11b8152905160009384936001600160a01b031692638b0341369281830192602092829003018186803b15801561281457600080fd5b505afa158015612828573d6000803e3d6000fd5b505050506040513d602081101561283e57600080fd5b505160055460408051634581a09b60e11b815290516001600160a01b0390921691638b03413691600481810192602092909190829003018186803b158015610ca557600080fd5b60135480156128995761289781612251565b505b60006128a36121c4565b604080516370a0823160e01b815230600482015290519192506000916001600160a01b038416916370a08231916024808301926020929190829003018186803b1580156128ef57600080fd5b505afa158015612903573d6000803e3d6000fd5b505050506040513d602081101561291957600080fd5b5051905080156129b057816001600160a01b031663a9059cbb85836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561298357600080fd5b505af1158015612997573d6000803e3d6000fd5b505050506040513d60208110156129ad57600080fd5b50505b600480546040805163646d919f60e11b81526001600160a01b03888116948201949094529051929091169163c8db233e9160248082019260009290919082900301818387803b158015612a0257600080fd5b505af1158015612a16573d6000803e3d6000fd5b50506005546040805163646d919f60e11b81526001600160a01b038981166004830152915191909216935063c8db233e9250602480830192600092919082900301818387803b158015612a6857600080fd5b505af1158015612a7c573d6000803e3d6000fd5b50505050836001600160a01b0316ff5b60048054604080516370a0823160e01b81526001600160a01b03858116948201949094529051600093849316916370a08231916024808301926020929190829003018186803b158015612ade57600080fd5b505afa158015612af2573d6000803e3d6000fd5b505050506040513d6020811015612b0857600080fd5b5051600554604080516370a0823160e01b81526001600160a01b038781166004830152915191909216916370a08231916024808301926020929190829003018186803b1580156123fd57600080fd5b6000546001600160a01b031690565b600080846001811115612b7557fe5b1415612b825750816121f0565b5092915050565b601454600090600160a01b900460ff1680156106955750600a544211806106955750506013541590565b600082821115612c0a576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000612c22838363ffffffff6121f716565b9050806011600001541115612c75576040805162461bcd60e51b8152602060048201526014602482015273125b9cdd59999a58da595b9d0818d85c1a5d185b60621b604482015290519081900360640190fd5b601254612c88848363ffffffff61300416565b8111158015612ca65750612ca2838363ffffffff61300416565b8111155b612ce9576040805162461bcd60e51b815260206004820152600f60248201526e109a591cc81d1bdbc81cdad95dd959608a1b604482015290519081900360640190fd5b50505050565b600080826001811115612cfe57fe5b1415612d1657506004546001600160a01b0316611fd7565b50506005546001600160a01b031690565b600080612d35858585612e3c565b604080518082018252838152602090810183905260068490556007839055815184815290810183905281519395509193507f6546f60f34df611fa42503098acc39d5ab88bc73febe64b3cc14e5a92e3a66a792918290030190a15050505050565b601354600090612dac908363ffffffff6121f716565b60138190559050612dbb612b57565b6001600160a01b031663aeab5849836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156122bb57600080fd5b6000818310612e1e57612e19838363ffffffff612bb316565b6121f0565b50600092915050565b60006121f08383670de0b6b3a764000061302e565b6000808415801590612e4d57508315155b612e95576040805162461bcd60e51b815260206004820152601460248201527342696473206d757374206265206e6f6e7a65726f60601b604482015290519081900360640190fd5b6000612ea084611fa5565b9050612eb2868263ffffffff612e2716565b612ec2868363ffffffff612e2716565b9250925050935093915050565b600081815260036020908152604080832054815170026b4b9b9b4b7339030b2323932b9b99d1607d1b9381019390935260318084018690528251808503909101815260519093019091526001600160a01b03169081612b825760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612f71578181015183820152602001612f59565b50505050905090810190601f168015612f9e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b60006106956c45786368616e6765526174657360981b612ecf565b600080600a8304612fde868663ffffffff61305416565b81612fe557fe5b0490506005600a825b0610612ff857600a015b600a9004949350505050565b60006121f08261302285670de0b6b3a764000063ffffffff61305416565b9063ffffffff6130ad16565b6000806130488461302287600a870263ffffffff61305416565b90506005600a82612fee565b60008261306357506000611867565b8282028284828161307057fe5b04146121f05760405162461bcd60e51b815260040180806020018281038252602181526020018061317e6021913960400191505060405180910390fd5b6000808211613103576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b600082848161310e57fe5b04949350505050565bfefe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775468697320616374696f6e2063616e6e6f7420626520706572666f726d6564207768696c652074686520636f6e747261637420697320706175736564a265627a7a723158203cdc0f6a4f960a244d3aaf162a409c098389893e232ea6472dcb391f9d5a928464736f6c63430005100032608060405234801561001057600080fd5b5060405161114a38038061114a8339818101604052604081101561003357600080fd5b508051602091820151600080546001600160a01b031916331781556001600160a01b0390921682526001909252604090208190556002556110d1806100796000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad5780639c3ee244116100715780639c3ee24414610383578063a9059cbb146103a9578063c8db233e146103d5578063d6ff02e2146103fb578063dd62ed3e1461040357610121565b806370a082311461030357806380f55605146103295780638b0341361461034d5780638dc30b701461035557806395d89b411461037b57610121565b806323b872dd116100f457806323b872dd146102255780632bc43fd91461025b578063313ce5671461028d578063410085df146102ab57806359d667a5146102d757610121565b806306fdde0314610126578063095ea7b3146101a357806318160ddd146101e35780631b15982a146101fd575b600080fd5b61012e610431565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101cf600480360360408110156101b957600080fd5b506001600160a01b03813516906020013561045e565b604080519115158252519081900360200190f35b6101eb6104db565b60408051918252519081900360200190f35b6102236004803603602081101561021357600080fd5b50356001600160a01b03166104e1565b005b6101cf6004803603606081101561023b57600080fd5b506001600160a01b0381358116916020810135909116906040013561060e565b6101eb6004803603606081101561027157600080fd5b506001600160a01b0381351690602081013590604001356106ca565b610295610861565b6040805160ff9092168252519081900360200190f35b610223600480360360408110156102c157600080fd5b506001600160a01b038135169060200135610866565b610223600480360360408110156102ed57600080fd5b506001600160a01b038135169060200135610920565b6101eb6004803603602081101561031957600080fd5b50356001600160a01b03166109ce565b6103316109e0565b604080516001600160a01b039092168252519081900360200190f35b6101eb6109ef565b6101eb6004803603602081101561036b57600080fd5b50356001600160a01b03166109f5565b61012e610a07565b6101eb6004803603602081101561039957600080fd5b50356001600160a01b0316610a27565b6101cf600480360360408110156103bf57600080fd5b506001600160a01b038135169060200135610ad4565b610223600480360360208110156103eb57600080fd5b50356001600160a01b0316610ae1565b6101eb610b42565b6101eb6004803603604081101561041957600080fd5b506001600160a01b0381358116916020013516610bc3565b6040518060400160405280601181526020017029a72c102134b730b93c9027b83a34b7b760791b81525081565b60006001600160a01b03831661047357600080fd5b3360008181526005602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60045481565b6000546001600160a01b03163314610536576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b6001600160a01b0381166000908152600360205260409020548061055a575061060b565b6001600160a01b038216600090815260036020526040812055600454610586908263ffffffff610be016565b6004556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a36040805182815290516001600160a01b038416917f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7919081900360200190a2505b50565b6001600160a01b038316600090815260056020908152604080832033845290915281205480831115610680576040805162461bcd60e51b8152602060048201526016602482015275496e73756666696369656e7420616c6c6f77616e636560501b604482015290519081900360640190fd5b610690818463ffffffff610be016565b6001600160a01b03861660009081526005602090815260408083203384529091529020556106bf858585610c3d565b9150505b9392505050565b600080546001600160a01b03163314610720576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b6001600160a01b03841660009081526001602052604081205490610745828686610e14565b905080610757576000925050506106c3565b60025461076a908363ffffffff610be016565b6002556001600160a01b038616600090815260016020526040812055600454610799908263ffffffff610eb016565b6004556001600160a01b0386166000908152600360205260409020546107c5908263ffffffff610eb016565b6001600160a01b03871660008181526003602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a36040805182815290516001600160a01b038816917fa59f12e354e8cd10bb74c559844c2dd69a5458e31fe56c7594c62ca57480509a919081900360200190a295945050505050565b601281565b6000546001600160a01b031633146108bb576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b6001600160a01b0382166000908152600160205260409020546108ed906108e8908363ffffffff610be016565b610f0a565b6001600160a01b038316600090815260016020526040902055600254610919908263ffffffff610be016565b6002555050565b6000546001600160a01b03163314610975576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b6001600160a01b0382166000908152600160205260409020546109a2906108e8908363ffffffff610eb016565b6001600160a01b038316600090815260016020526040902055600254610919908263ffffffff610eb016565b60036020526000908152604090205481565b6000546001600160a01b031681565b60025481565b60016020526000908152604090205481565b604051806040016040528060048152602001631cd3d41560e21b81525081565b60008054604080516362c47a9360e11b81528151849384936001600160a01b039091169263c588f5269260048083019392829003018186803b158015610a6c57600080fd5b505afa158015610a80573d6000803e3d6000fd5b505050506040513d6040811015610a9657600080fd5b5080516020918201516001600160a01b03871660009081526001909352604090922054909350909150610aca908383610e14565b925050505b919050565b60006106c3338484610c3d565b6000546001600160a01b03163314610b36576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b806001600160a01b0316ff5b60008054604080516362c47a9360e11b8152815184936001600160a01b03169263c588f5269260048082019391829003018186803b158015610b8357600080fd5b505afa158015610b97573d6000803e3d6000fd5b505050506040513d6040811015610bad57600080fd5b50602001519050610bbd81610f67565b91505090565b600560209081526000928352604080842090915290825290205481565b600082821115610c37576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008060009054906101000a90046001600160a01b03166001600160a01b03166327745bae6040518163ffffffff1660e01b815260040160006040518083038186803b158015610c8c57600080fd5b505afa158015610ca0573d6000803e3d6000fd5b505050506001600160a01b03831615801590610cc557506001600160a01b0383163014155b610d08576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b6001600160a01b03841660009081526003602052604090205480831115610d6d576040805162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015290519081900360640190fd5b610d7d818463ffffffff610be016565b6001600160a01b038087166000908152600360205260408082209390935590861681522054610db2908463ffffffff610eb016565b6001600160a01b0380861660008181526003602090815260409182902094909455805187815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3506001949350505050565b600080610e27858563ffffffff610f8e16565b90506000610e3484610f67565b905060025486148015610e4657508515155b80610e4f575080155b15610e5d5791506106c39050565b80821115610ea7576040805162461bcd60e51b8152602060048201526012602482015271737570706c79203c20636c61696d61626c6560701b604482015290519081900360640190fd5b50949350505050565b6000828201838110156106c3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000662386f26fc1000082101580610f20575081155b610f63576040805162461bcd60e51b815260206004820152600f60248201526e42616c616e6365203c2024302e303160881b604482015290519081900360640190fd5b5090565b600454600090808311610f7e576000915050610acf565b6106c3838263ffffffff610be016565b60006106c382610fac85670de0b6b3a764000063ffffffff610fb816565b9063ffffffff61101116565b600082610fc7575060006104d5565b82820282848281610fd457fe5b04146106c35760405162461bcd60e51b815260040180806020018281038252602181526020018061107c6021913960400191505060405180910390fd5b6000808211611067576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b600082848161107257fe5b0494935050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723158205d090c4ad5e2cf2be86a9a54ad3efeb79f51d7ce904dce7c2f29cc801656731f64736f6c63430005100032536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7770bd4a33bf447720d717d08f3affb5aecfe4d2ebb8e3dd94539f5313e2447643596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6ea265627a7a72315820b93aeb12684444bf79dbc1b5964c0ba412118f88ff93a3af632d18f62a233b3464736f6c63430005100032", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "address", - "name": "_resolver", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor", - "signature": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "name", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "name": "CacheUpdated", - "type": "event", - "signature": "0x88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event", - "signature": "0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event", - "signature": "0x906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22" - }, - { - "constant": false, - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x79ba5097" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "creatorLimits", - "type": "uint256[2]" - }, - { - "internalType": "bytes32", - "name": "oracleKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "strikePrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "refundsEnabled", - "type": "bool" - }, - { - "internalType": "uint256[3]", - "name": "times", - "type": "uint256[3]" - }, - { - "internalType": "uint256[2]", - "name": "bids", - "type": "uint256[2]" - }, - { - "internalType": "uint256[3]", - "name": "fees", - "type": "uint256[3]" - } - ], - "name": "createMarket", - "outputs": [ - { - "internalType": "contract BinaryOptionMarket", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x130efa50" - }, - { - "constant": true, - "inputs": [], - "name": "isResolverCached", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x2af64bd3" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x1627540c" - }, - { - "constant": true, - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x53a47bb7" - }, - { - "constant": true, - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x8da5cb5b" - }, - { - "constant": false, - "inputs": [], - "name": "rebuildCache", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x74185360" - }, - { - "constant": true, - "inputs": [], - "name": "resolver", - "outputs": [ - { - "internalType": "contract AddressResolver", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x04f3bcec" - }, - { - "constant": true, - "inputs": [], - "name": "resolverAddressesRequired", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "addresses", - "type": "bytes32[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x899ffef4" - } - ], - "source": { - "keccak256": "0x5d2ba3c7638d20ed2e1243dab07bb5319536c92f1547b28768303ec4c25d3d33", - "urls": [ - "bzz-raw://cb6c2aa25c44628fe9c7ee2be48dc903e994eb97378af642df7573ac6ba3cdc5", - "dweb:/ipfs/QmSHQ3r9jBKsw7Moat6JyCaGPcoLAVc8gAPgSbfBC7Rwi9" - ] - }, - "metadata": { - "compiler": { - "version": "0.5.16+commit.9c3226ce" - }, - "language": "Solidity", - "settings": { - "compilationTarget": { - "BinaryOptionMarketFactory.sol": "BinaryOptionMarketFactory" - }, - "evmVersion": "istanbul", - "libraries": {}, - "optimizer": { - "enabled": true, - "runs": 200 - }, - "remappings": [] - }, - "sources": { - "BinaryOptionMarketFactory.sol": { - "keccak256": "0x5d2ba3c7638d20ed2e1243dab07bb5319536c92f1547b28768303ec4c25d3d33", - "urls": [ - "bzz-raw://cb6c2aa25c44628fe9c7ee2be48dc903e994eb97378af642df7573ac6ba3cdc5", - "dweb:/ipfs/QmSHQ3r9jBKsw7Moat6JyCaGPcoLAVc8gAPgSbfBC7Rwi9" - ] - } - }, - "version": 1 - } - }, - "BinaryOptionMarketManager": { - "bytecode": "6080604052600d805460ff191660011790553480156200001e57600080fd5b50604051620038d9380380620038d983398181016040526101408110156200004557600080fd5b508051602082015160408301516060840151608085015160a086015160c087015160e08801516101008901516101209099015197989697959694959394929391929091888a6001600160a01b038116620000e6576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a1506000546001600160a01b031662000191576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b600380546001600160a01b0390921661010002610100600160a81b0319909216919091179055600080546001600160a01b03191633179055620001dd876001600160e01b036200029a16565b620001f1886001600160e01b03620002e816565b62000205866001600160e01b036200033616565b62000219856001600160e01b036200038416565b6200022d846001600160e01b03620003d216565b62000241836001600160e01b03620004d316565b62000255826001600160e01b036200063616565b62000269816001600160e01b036200079916565b5050600080546001600160a01b0319166001600160a01b03999099169890981790975550620008e795505050505050565b620002ad6001600160e01b036200089a16565b60098190556040805182815290517ff378a0fd4ad3ffd9d7d50986f16b04acd2dc42691c4f412f34e8eefe883e66529181900360200190a150565b620002fb6001600160e01b036200089a16565b60088190556040805182815290517f5a2f2eae84f9e787d8159d363a776fa2b61d084686190cdc5a2c1ea833480b099181900360200190a150565b620003496001600160e01b036200089a16565b600a8190556040805182815290517f6de18e808fc4e6cb9c8910cf4bdc188ddbbdab65faecff65dab871720e8484899181900360200190a150565b620003976001600160e01b036200089a16565b600b8190556040805182815290517fdf7a26ae2e2eb953b81fd76b72fcdc74ebff7c21faa8f8f55323183d9785f52d9181900360200190a150565b620003e56001600160e01b036200089a16565b73__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200042a57600080fd5b505af41580156200043f573d6000803e3d6000fd5b505050506040513d60208110156200045657600080fd5b5051811115620004985760405162461bcd60e51b815260040180806020018281038252602d81526020018062003834602d913960400191505060405180910390fd5b600c8190556040805182815290517fd39cfbe31b20dbb6d995a675cf5c369555bf8bb908b6efc03873907fe9e133cf9181900360200190a150565b620004e66001600160e01b036200089a16565b60006005600101548201905073__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200053757600080fd5b505af41580156200054c573d6000803e3d6000fd5b505050506040513d60208110156200056357600080fd5b50518110620005a45760405162461bcd60e51b8152600401808060200182810382526021815260200180620038616021913960400191505060405180910390fd5b80600010620005fa576040805162461bcd60e51b815260206004820152601a60248201527f546f74616c20666565206d757374206265206e6f6e7a65726f2e000000000000604482015290519081900360640190fd5b60058290556040805183815290517f7b30e8f8e3de254785fbcb3068449dc18060f1fdb37b02731ecada99a78492c39181900360200190a15050565b620006496001600160e01b036200089a16565b60006005600001548201905073__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200069a57600080fd5b505af4158015620006af573d6000803e3d6000fd5b505050506040513d6020811015620006c657600080fd5b50518110620007075760405162461bcd60e51b8152600401808060200182810382526021815260200180620038616021913960400191505060405180910390fd5b806000106200075d576040805162461bcd60e51b815260206004820152601a60248201527f546f74616c20666565206d757374206265206e6f6e7a65726f2e000000000000604482015290519081900360640190fd5b60068290556040805183815290517f8c14462add32e0ae0fbfcf9e60711ecae573da337dc9127fff98fb7cfb3973b49181900360200190a15050565b620007ac6001600160e01b036200089a16565b73__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015620007f157600080fd5b505af415801562000806573d6000803e3d6000fd5b505050506040513d60208110156200081d57600080fd5b50518111156200085f5760405162461bcd60e51b8152600401808060200182810382526028815260200180620038b16028913960400191505060405180910390fd5b60078190556040805182815290517f01634ac4e9f09be1ef87b8d09e14926870261dcb9a0929d2d6460af6e4c5ad1e9181900360200190a150565b6000546001600160a01b03163314620008e55760405162461bcd60e51b815260040180806020018281038252602f81526020018062003882602f913960400191505060405180910390fd5b565b612f3d80620008f76000396000f3fe608060405234801561001057600080fd5b506004361061023d5760003560e01c80637859f4101161013b578063ac60c486116100b8578063c014fb841161007c578063c014fb84146106fc578063c095daf21461076a578063e73efc9b14610787578063fe40c470146107aa578063ff50abdc146107d05761023d565b8063ac60c48614610622578063adfd31af1461062a578063aeab5849146106a1578063bd6a10b8146106be578063be5af9fe146106db5761023d565b806391b4ded9116100ff57806391b4ded91461055257806394fcf3c31461055a5780639501dc871461058f5780639af1d35a146105ac5780639b11dc40146105b45761023d565b80637859f410146104a157806379ba5097146104c7578063899ffef4146104cf57806389c6318d146105275780638da5cb5b1461054a5761023d565b806336fd711e116101c957806364af2d871161018d57806364af2d871461043a57806364cf34bd146104425780636b3a09841461045f57806373b7de151461047c57806374185360146104995761023d565b806336fd711e146103c857806339ab4c41146103e55780634a41d89d1461040457806353a47bb71461042a5780635c975abb146104325761023d565b8063155028401161021057806315502840146103245780631627540c1461034157806316c38b3c146103675780631f3f10b0146103865780632af64bd3146103ac5761023d565b806302610c501461024257806303ff60181461025c57806304f3bcec146102e35780630dd16fd514610307575b600080fd5b61024a6107d8565b60408051918252519081900360200190f35b6102e16004803603606081101561027257600080fd5b6001600160a01b03823516916020810135151591810190606081016040820135600160201b8111156102a357600080fd5b8201836020820111156102b557600080fd5b803590602001918460208302840111600160201b831117156102d657600080fd5b5090925090506107df565b005b6102eb610ab1565b604080516001600160a01b039092168252519081900360200190f35b6102e16004803603602081101561031d57600080fd5b5035610ac5565b6102e16004803603602081101561033a57600080fd5b5035610c17565b6102e16004803603602081101561035757600080fd5b50356001600160a01b0316610c5a565b6102e16004803603602081101561037d57600080fd5b50351515610cb6565b6102e16004803603602081101561039c57600080fd5b50356001600160a01b0316610d30565b6103b4610d5a565b604080519115158252519081900360200190f35b6102e1600480360360208110156103de57600080fd5b5035610e6a565b6102e1600480360360208110156103fb57600080fd5b50351515610f5b565b61040c610fba565b60408051938452602084019290925282820152519081900360600190f35b6102eb610fc6565b6103b4610fd5565b6103b4610fde565b6102e16004803603602081101561045857600080fd5b5035610fe7565b6102e16004803603602081101561047557600080fd5b503561102a565b6102e16004803603602081101561049257600080fd5b5035611122565b6102e1611213565b6102e1600480360360208110156104b757600080fd5b50356001600160a01b03166113f0565b6102e16114c1565b6104d761157d565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156105135781810151838201526020016104fb565b505050509050019250505060405180910390f35b6104d76004803603604081101561053d57600080fd5b5080359060200135611652565b6102eb61166f565b61024a61167e565b6102eb600480360360e081101561057057600080fd5b508035906020810135906040810135151590606081019060a001611684565b6102e1600480360360208110156105a557600080fd5b5035611c2a565b61040c611d7c565b6102e1600480360360208110156105ca57600080fd5b810190602081018135600160201b8111156105e457600080fd5b8201836020820111156105f657600080fd5b803590602001918460208302840111600160201b8311171561061757600080fd5b509092509050611d88565b61024a611fd0565b6102e16004803603604081101561064057600080fd5b813515159190810190604081016020820135600160201b81111561066357600080fd5b82018360208201111561067557600080fd5b803590602001918460208302840111600160201b8311171561069657600080fd5b509092509050611fd6565b6102e1600480360360208110156106b757600080fd5b5035612206565b6102e1600480360360208110156106d457600080fd5b5035612300565b6106e3612343565b6040805192835260208301919091528051918290030190f35b6102e16004803603602081101561071257600080fd5b810190602081018135600160201b81111561072c57600080fd5b82018360208201111561073e57600080fd5b803590602001918460208302840111600160201b8311171561075f57600080fd5b50909250905061234c565b6102e16004803603602081101561078057600080fd5b5035612482565b6104d76004803603604081101561079d57600080fd5b50803590602001356124c5565b6102e1600480360360208110156107c057600080fd5b50356001600160a01b03166124d9565b61024a6126ed565b600f545b90565b6107e76126f3565b80806107f35750610aab565b600084610801576011610804565b600f5b90506000805b8381101561098257600086868381811061082057fe5b905060200201356001600160a01b0316905061083b8161273e565b61087e576040805162461bcd60e51b815260206004820152600f60248201526e26b0b935b2ba103ab735b737bbb71760891b604482015290519081900360640190fd5b61088e848263ffffffff61277016565b610903816001600160a01b031663eef49ee36040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ca57600080fd5b505afa1580156108de573d6000803e3d6000fd5b505050506040513d60208110156108f457600080fd5b5051849063ffffffff6128b116565b9250806001600160a01b0316631627540c8a6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561095d57600080fd5b505af1158015610971573d6000803e3d6000fd5b50506001909301925061080a915050565b50600e54610996908263ffffffff61290b16565b600e55604080516001600160a01b038916815260208082018381529282018790527f3e429aa34462b428d3f7277acb67e1c83d80a57faab2a47924369b5060f35679928a92899289929060608301908590850280828437600083820152604051601f909101601f1916909201829003965090945050505050a16040805163adfd31af60e01b81528715156004820190815260248201928352604482018790526001600160a01b038a169263adfd31af928a928a928a92606401846020850280828437600081840152601f19601f820116905080830192505050945050505050600060405180830381600087803b158015610a8f57600080fd5b505af1158015610aa3573d6000803e3d6000fd5b505050505050505b50505050565b60035461010090046001600160a01b031681565b610acd6126f3565b60006005600001548201905073__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015610b1d57600080fd5b505af4158015610b31573d6000803e3d6000fd5b505050506040513d6020811015610b4757600080fd5b50518110610b865760405162461bcd60e51b8152600401808060200182810382526021815260200180612ded6021913960400191505060405180910390fd5b80600010610bdb576040805162461bcd60e51b815260206004820152601a60248201527f546f74616c20666565206d757374206265206e6f6e7a65726f2e000000000000604482015290519081900360640190fd5b60068290556040805183815290517f8c14462add32e0ae0fbfcf9e60711ecae573da337dc9127fff98fb7cfb3973b49181900360200190a15050565b610c1f6126f3565b60098190556040805182815290517ff378a0fd4ad3ffd9d7d50986f16b04acd2dc42691c4f412f34e8eefe883e66529181900360200190a150565b610c626126f3565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b610cbe6126f3565b60035460ff1615158115151415610cd457610d2d565b6003805460ff1916821515179081905560ff1615610cf157426002555b6003546040805160ff90921615158252517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec59181900360200190a15b50565b610d386126f3565b601380546001600160a01b0319166001600160a01b0392909216919091179055565b60006060610d6661157d565b905060005b8151811015610e61576000828281518110610d8257fe5b602090810291909101810151600081815260048084526040918290205460035483516321f8a72160e01b815292830185905292519395506001600160a01b039081169461010090930416926321f8a72192602480840193919291829003018186803b158015610df057600080fd5b505afa158015610e04573d6000803e3d6000fd5b505050506040513d6020811015610e1a57600080fd5b50516001600160a01b0316141580610e4757506000818152600460205260409020546001600160a01b0316155b15610e5857600093505050506107dc565b50600101610d6b565b50600191505090565b610e726126f3565b73__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015610eb657600080fd5b505af4158015610eca573d6000803e3d6000fd5b505050506040513d6020811015610ee057600080fd5b5051811115610f205760405162461bcd60e51b8152600401808060200182810382526028815260200180612ee16028913960400191505060405180910390fd5b60078190556040805182815290517f01634ac4e9f09be1ef87b8d09e14926870261dcb9a0929d2d6460af6e4c5ad1e9181900360200190a150565b610f636126f3565b600d5460ff16151581151514610d2d57600d805482151560ff19909116811790915560408051918252517fcc590b6309435383b617aaa0cae6aba938f2ee471cfb539201dd7655a23caff99181900360200190a150565b600854600954600a5483565b6001546001600160a01b031681565b60035460ff1681565b600d5460ff1681565b610fef6126f3565b600a8190556040805182815290517f6de18e808fc4e6cb9c8910cf4bdc188ddbbdab65faecff65dab871720e8484899181900360200190a150565b6110333361273e565b61106e5760405162461bcd60e51b8152600401808060200182810382526021815260200180612e306021913960400191505060405180910390fd5b60035460ff16156110b05760405162461bcd60e51b815260040180806020018281038252603c815260200180612ea5603c913960400191505060405180910390fd5b6110b8612968565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b1580156110f057600080fd5b505afa158015611104573d6000803e3d6000fd5b5050600e5461111c925090508263ffffffff61290b16565b600e5550565b61112a6126f3565b73__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b15801561116e57600080fd5b505af4158015611182573d6000803e3d6000fd5b505050506040513d602081101561119857600080fd5b50518111156111d85760405162461bcd60e51b815260040180806020018281038252602d815260200180612dc0602d913960400191505060405180910390fd5b600c8190556040805182815290517fd39cfbe31b20dbb6d995a675cf5c369555bf8bb908b6efc03873907fe9e133cf9181900360200190a150565b606061121d61157d565b905060005b81518110156113ec57600082828151811061123957fe5b602002602001015190506000600360019054906101000a90046001600160a01b03166001600160a01b031663dacb2d01838460405160200180807f5265736f6c766572206d697373696e67207461726765743a20000000000000008152506019018281526020019150506040516020818303038152906040526040518363ffffffff1660e01b81526004018083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156113045781810151838201526020016112ec565b50505050905090810190601f1680156113315780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b15801561134f57600080fd5b505afa158015611363573d6000803e3d6000fd5b505050506040513d602081101561137957600080fd5b505160008381526004602090815260409182902080546001600160a01b0319166001600160a01b03851690811790915582518681529182015281519293507f88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68929081900390910190a15050600101611222565b5050565b611401600f8263ffffffff61298716565b611449576040805162461bcd60e51b8152602060048201526014602482015273139bdd08185b881858dd1a5d99481b585c9ad95d60621b604482015290519081900360640190fd5b806001600160a01b0316632810e1d66040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561148457600080fd5b505af1158015611498573d6000803e3d6000fd5b505050506114b081600f61277090919063ffffffff16565b610d2d60118263ffffffff6129f516565b6001546001600160a01b0316331461150a5760405162461bcd60e51b8152600401808060200182810382526035815260200180612d8b6035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60408051600480825260a08201909252606091602082016080803883390190505090506b53797374656d53746174757360a01b816000815181106115bd57fe5b6020026020010181815250506814de5b9d1a1cd554d160ba1b816001815181106115e357fe5b6020026020010181815250506c45786368616e6765526174657360981b8160028151811061160d57fe5b6020026020010181815250507842696e6172794f7074696f6e4d61726b6574466163746f727960381b8160038151811061164357fe5b60200260200101818152505090565b60606116666011848463ffffffff612a4716565b90505b92915050565b6000546001600160a01b031681565b60025481565b60035460009060ff16156116c95760405162461bcd60e51b815260040180806020018281038252603c815260200180612ea5603c913960400191505060405180910390fd5b6116d1612968565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561170957600080fd5b505afa15801561171d573d6000803e3d6000fd5b5050600d5460ff16915061177a9050576040805162461bcd60e51b815260206004820152601b60248201527f4d61726b6574206372656174696f6e2069732064697361626c65640000000000604482015290519081900360640190fd5b61178386612b1d565b6117c2576040805162461bcd60e51b815260206004820152600b60248201526a496e76616c6964206b657960a81b604482015290519081900360640190fd5b600a548335906020850135904201811115611824576040805162461bcd60e51b815260206004820152601e60248201527f4d6174757269747920746f6f2066617220696e20746865206675747572650000604482015290519081900360640190fd5b60095460009061183b90839063ffffffff6128b116565b9050600061184e863560208801356128b1565b90508342106118a4576040805162461bcd60e51b815260206004820152601960248201527f456e64206f662062696464696e67206861732070617373656400000000000000604482015290519081900360640190fd5b8284106118f8576040805162461bcd60e51b815260206004820181905260248201527f4d6174757269747920707265646174657320656e64206f662062696464696e67604482015290519081900360640190fd5b6000611902612c51565b6001600160a01b031663130efa50336040518060400160405280600b600001548152602001600b600101548152508e8e8e60405180606001604052808d81526020018c81526020018b8152508e6040518060600160405280600560000154815260200160056001015481526020016005600201548152506040518963ffffffff1660e01b815260040180896001600160a01b03166001600160a01b0316815260200188600260200280838360005b838110156119c85781810151838201526020016119b0565b505050509050018781526020018681526020018515151515815260200184600360200280838360005b83811015611a095781810151838201526020016119f1565b5050505090500183600260200280828437600081840152601f19601f82011690508083019250505082600360200280838360005b83811015611a55578181015183820152602001611a3d565b5050505090500198505050505050505050602060405180830381600087803b158015611a8057600080fd5b505af1158015611a94573d6000803e3d6000fd5b505050506040513d6020811015611aaa57600080fd5b5051604080516303a0c29b60e51b815290519192506001600160a01b0383169163741853609160048082019260009290919082900301818387803b158015611af157600080fd5b505af1158015611b05573d6000803e3d6000fd5b50505050611b1d81600f6129f590919063ffffffff16565b600e54611b30908363ffffffff6128b116565b600e55611b3b612c78565b604080516323b872dd60e01b81523360048201526001600160a01b03848116602483015260448201869052915192909116916323b872dd916064808201926020929091908290030181600087803b158015611b9557600080fd5b505af1158015611ba9573d6000803e3d6000fd5b505050506040513d6020811015611bbf57600080fd5b5050604080516001600160a01b0383168152602081018c9052808201879052606081018690526080810185905290518c9133917fbcd154709bbe69680012cadcd07d57bd4a0ec64a033c2a3e31d2d0fadb38d3a89181900360a00190a39a9950505050505050505050565b611c326126f3565b60006005600101548201905073__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015611c8257600080fd5b505af4158015611c96573d6000803e3d6000fd5b505050506040513d6020811015611cac57600080fd5b50518110611ceb5760405162461bcd60e51b8152600401808060200182810382526021815260200180612ded6021913960400191505060405180910390fd5b80600010611d40576040805162461bcd60e51b815260206004820152601a60248201527f546f74616c20666565206d757374206265206e6f6e7a65726f2e000000000000604482015290519081900360640190fd5b60058290556040805183815290517f7b30e8f8e3de254785fbcb3068449dc18060f1fdb37b02731ecada99a78492c39181900360200190a15050565b60055460065460075483565b60005b81811015611fcb576000838383818110611da157fe5b6040805160048152602481018252602081810180516001600160e01b03166303a0c29b60e51b178152925182516001600160a01b0392909502969096013516955093600093508592859282918083835b60208310611e105780518252601f199092019160209182019101611df1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611e72576040519150601f19603f3d011682016040523d82523d6000602084013e611e77565b606091505b5050905080611fc057600354604080516001600160a01b03610100909304831660248083019190915282518083039091018152604490910182526020810180516001600160e01b0316633be99e6f60e01b1781529151815191936000939088169285929182918083835b60208310611f005780518252601f199092019160209182019101611ee1565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611f62576040519150601f19603f3d011682016040523d82523d6000602084013e611f67565b606091505b5050905080611fbd576040805162461bcd60e51b815260206004820152601f60248201527f43616e6e6f742072656275696c6420636163686520666f72206d61726b657400604482015290519081900360640190fd5b50505b505050600101611d8b565b505050565b60115490565b6013546001600160a01b0316331461201f5760405162461bcd60e51b8152600401808060200182810382526025815260200180612e806025913960400191505060405180910390fd5b808061202b5750611fcb565b60008461203957601161203c565b600f5b90506000805b8381101561216a57600086868381811061205857fe5b905060200201356001600160a01b031690506120738161273e565b156120bd576040805162461bcd60e51b815260206004820152601560248201527426b0b935b2ba1030b63932b0b23c9035b737bbb71760591b604482015290519081900360640190fd5b806001600160a01b03166379ba50976040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156120f857600080fd5b505af115801561210c573d6000803e3d6000fd5b5050505061212381856129f590919063ffffffff16565b61215f816001600160a01b031663eef49ee36040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ca57600080fd5b925050600101612042565b50600e5461217e908263ffffffff6128b116565b600e55601354604080516001600160a01b0390921680835260208084018381529284018890527fea7a4e14e72ba7db7e2fd406278900badf50b2ce7d9def39d613cc08054c537b9391928992899290919060608301908590850280828437600083820152604051601f909101601f1916909201829003965090945050505050a1505050505050565b612217600f3363ffffffff61298716565b6122525760405162461bcd60e51b8152600401808060200182810382526022815260200180612e0e6022913960400191505060405180910390fd5b60035460ff16156122945760405162461bcd60e51b815260040180806020018281038252603c815260200180612ea5603c913960400191505060405180910390fd5b61229c612968565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b1580156122d457600080fd5b505afa1580156122e8573d6000803e3d6000fd5b5050600e5461111c925090508263ffffffff6128b116565b6123086126f3565b60088190556040805182815290517f5a2f2eae84f9e787d8159d363a776fa2b61d084686190cdc5a2c1ea833480b099181900360200190a150565b600b54600c5482565b60035460ff161561238e5760405162461bcd60e51b815260040180806020018281038252603c815260200180612ea5603c913960400191505060405180910390fd5b60005b81811015611fcb5760008383838181106123a757fe5b905060200201356001600160a01b03169050806001600160a01b031663c8db233e336040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561241157600080fd5b505af1158015612425573d6000803e3d6000fd5b5050505061243d81601161277090919063ffffffff16565b604080516001600160a01b038316815290517f16e62064e42f5aec62df22ae895ef539f153e0d4ea290e2cc4e0e8f708f2fbbc9181900360200190a150600101612391565b61248a6126f3565b600b8190556040805182815290517fdf7a26ae2e2eb953b81fd76b72fcdc74ebff7c21faa8f8f55323183d9785f52d9181900360200190a150565b6060611666600f848463ffffffff612a4716565b60035460ff161561251b5760405162461bcd60e51b815260040180806020018281038252603c815260200180612ea5603c913960400191505060405180910390fd5b61252c600f8263ffffffff61298716565b612574576040805162461bcd60e51b8152602060048201526014602482015273139bdd08185b881858dd1a5d99481b585c9ad95d60621b604482015290519081900360640190fd5b6000816001600160a01b03166302d05d3f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156125af57600080fd5b505afa1580156125c3573d6000803e3d6000fd5b505050506040513d60208110156125d957600080fd5b50519050336001600160a01b0382161461263a576040805162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d61726b65742063726561746f7200000000000000604482015290519081900360640190fd5b6040805163130cffa560e21b815233600482015290516001600160a01b03841691634c33fe9491602480830192600092919082900301818387803b15801561268157600080fd5b505af1158015612695573d6000803e3d6000fd5b505050506126ad82600f61277090919063ffffffff16565b604080516001600160a01b038416815290517f996fafab197beb99fff6fdc975bb6cf90352f2c733c76ef37c2e27f17d7d424b9181900360200190a15050565b600e5481565b6000546001600160a01b0316331461273c5760405162461bcd60e51b815260040180806020018281038252602f815260200180612e51602f913960400191505060405180910390fd5b565b6000612751600f8363ffffffff61298716565b80612768575061276860118363ffffffff61298716565b90505b919050565b61277a8282612987565b6127c1576040805162461bcd60e51b815260206004820152601360248201527222b632b6b2b73a103737ba1034b71039b2ba1760691b604482015290519081900360640190fd5b6001600160a01b03811660009081526001830160205260409020548254600019018082146128605760008460000182815481106127fa57fe5b60009182526020909120015485546001600160a01b039091169150819086908590811061282357fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b0394851617905592909116815260018601909152604090208290555b835484908061286b57fe5b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b0394909416815260019490940190925250506040812055565b600082820183811015611666576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082821115612962576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006129826b53797374656d53746174757360a01b612c8b565b905090565b815460009061299857506000611669565b6001600160a01b0382166000908152600184016020526040902054801515806129ed5750826001600160a01b0316846000016000815481106129d657fe5b6000918252602090912001546001600160a01b0316145b949350505050565b6129ff8282612987565b6113ec5781546001600160a01b038216600081815260018086016020908152604083208590559084018655858252902090910180546001600160a01b03191690911790555050565b825460609083830190811115612a5b575083545b838111612a78575050604080516000815260208101909152612b16565b604080518583038082526020808202830101909252606090828015612aa7578160200160208202803883390190505b50905060005b82811015612b10578760000187820181548110612ac657fe5b9060005260206000200160009054906101000a90046001600160a01b0316828281518110612af057fe5b6001600160a01b0390921660209283029190910190910152600101612aad565b50925050505b9392505050565b600080612b28612d6f565b9050806001600160a01b031663ac82f608846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015612b6e57600080fd5b505afa158015612b82573d6000803e3d6000fd5b505050506040513d6020811015612b9857600080fd5b505115612c485782631cd554d160e21b1415612bb857600091505061276b565b6000816001600160a01b031663728dec29856040518263ffffffff1660e01b81526004018082815260200191505060a06040518083038186803b158015612bfe57600080fd5b505afa158015612c12573d6000803e3d6000fd5b505050506040513d60a0811015612c2857600080fd5b505190508015612c3d5760009250505061276b565b60019250505061276b565b50600092915050565b60006129827842696e6172794f7074696f6e4d61726b6574466163746f727960381b612c8b565b60006129826814de5b9d1a1cd554d160ba1b5b600081815260046020908152604080832054815170026b4b9b9b4b7339030b2323932b9b99d1607d1b9381019390935260318084018690528251808503909101815260519093019091526001600160a01b03169081612d685760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d2d578181015183820152602001612d15565b50505050905090810190601f168015612d5a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5092915050565b60006129826c45786368616e6765526174657360981b612c8b56fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e65727368697043726561746f7220736b6577206c696d6974206d757374206265206e6f2067726561746572207468616e20312e546f74616c20666565206d757374206265206c657373207468616e20313030252e5065726d6974746564206f6e6c7920666f7220616374697665206d61726b6574732e5065726d6974746564206f6e6c7920666f72206b6e6f776e206d61726b6574732e4f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e4f6e6c79207065726d697474656420666f72206d6967726174696e67206d616e616765722e5468697320616374696f6e2063616e6e6f7420626520706572666f726d6564207768696c652074686520636f6e747261637420697320706175736564526566756e6420666565206d757374206265206e6f2067726561746572207468616e20313030252ea265627a7a72315820020cfc36f9d5dc23de8fcf224831b4dad9b06476a079d24438bbfbcd7e40a9e964736f6c6343000510003243726561746f7220736b6577206c696d6974206d757374206265206e6f2067726561746572207468616e20312e546f74616c20666565206d757374206265206c657373207468616e20313030252e4f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e526566756e6420666565206d757374206265206e6f2067726561746572207468616e20313030252e", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "address", - "name": "_resolver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_maxOraclePriceAge", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_expiryDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maxTimeToMaturity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_creatorCapitalRequirement", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_creatorSkewLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_poolFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_creatorFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_refundFee", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor", - "signature": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "name", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "name": "CacheUpdated", - "type": "event", - "signature": "0x88a93678a3692f6789d9546fc621bf7234b101ddb7d4fe479455112831b8aa68" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "CreatorCapitalRequirementUpdated", - "type": "event", - "signature": "0xdf7a26ae2e2eb953b81fd76b72fcdc74ebff7c21faa8f8f55323183d9785f52d" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "CreatorFeeUpdated", - "type": "event", - "signature": "0x8c14462add32e0ae0fbfcf9e60711ecae573da337dc9127fff98fb7cfb3973b4" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "CreatorSkewLimitUpdated", - "type": "event", - "signature": "0xd39cfbe31b20dbb6d995a675cf5c369555bf8bb908b6efc03873907fe9e133cf" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "ExerciseDurationUpdated", - "type": "event", - "signature": "0xf0a1ff3a67369ec37b38f6cf8dec83acaffd6d00a2dd1e95a12394d4863a0b71" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "ExpiryDurationUpdated", - "type": "event", - "signature": "0xf378a0fd4ad3ffd9d7d50986f16b04acd2dc42691c4f412f34e8eefe883e6652" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketCancelled", - "type": "event", - "signature": "0x996fafab197beb99fff6fdc975bb6cf90352f2c733c76ef37c2e27f17d7d424b" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "oracleKey", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "strikePrice", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "biddingEndDate", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "maturityDate", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "expiryDate", - "type": "uint256" - } - ], - "name": "MarketCreated", - "type": "event", - "signature": "0xbcd154709bbe69680012cadcd07d57bd4a0ec64a033c2a3e31d2d0fadb38d3a8" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "name": "MarketCreationEnabledUpdated", - "type": "event", - "signature": "0xcc590b6309435383b617aaa0cae6aba938f2ee471cfb539201dd7655a23caff9" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketExpired", - "type": "event", - "signature": "0x16e62064e42f5aec62df22ae895ef539f153e0d4ea290e2cc4e0e8f708f2fbbc" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract BinaryOptionMarketManager", - "name": "receivingManager", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract BinaryOptionMarket[]", - "name": "markets", - "type": "address[]" - } - ], - "name": "MarketsMigrated", - "type": "event", - "signature": "0x3e429aa34462b428d3f7277acb67e1c83d80a57faab2a47924369b5060f35679" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract BinaryOptionMarketManager", - "name": "migratingManager", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract BinaryOptionMarket[]", - "name": "markets", - "type": "address[]" - } - ], - "name": "MarketsReceived", - "type": "event", - "signature": "0xea7a4e14e72ba7db7e2fd406278900badf50b2ce7d9def39d613cc08054c537b" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "MaxOraclePriceAgeUpdated", - "type": "event", - "signature": "0x5a2f2eae84f9e787d8159d363a776fa2b61d084686190cdc5a2c1ea833480b09" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "MaxTimeToMaturityUpdated", - "type": "event", - "signature": "0x6de18e808fc4e6cb9c8910cf4bdc188ddbbdab65faecff65dab871720e848489" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event", - "signature": "0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event", - "signature": "0x906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bool", - "name": "isPaused", - "type": "bool" - } - ], - "name": "PauseChanged", - "type": "event", - "signature": "0x8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "PoolFeeUpdated", - "type": "event", - "signature": "0x7b30e8f8e3de254785fbcb3068449dc18060f1fdb37b02731ecada99a78492c3" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "RefundFeeUpdated", - "type": "event", - "signature": "0x01634ac4e9f09be1ef87b8d09e14926870261dcb9a0929d2d6460af6e4c5ad1e" - }, - { - "constant": false, - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x79ba5097" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pageSize", - "type": "uint256" - } - ], - "name": "activeMarkets", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xe73efc9b" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "cancelMarket", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xfe40c470" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bytes32", - "name": "oracleKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "strikePrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "refundsEnabled", - "type": "bool" - }, - { - "internalType": "uint256[2]", - "name": "times", - "type": "uint256[2]" - }, - { - "internalType": "uint256[2]", - "name": "bids", - "type": "uint256[2]" - } - ], - "name": "createMarket", - "outputs": [ - { - "internalType": "contract IBinaryOptionMarket", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x94fcf3c3" - }, - { - "constant": true, - "inputs": [], - "name": "creatorLimits", - "outputs": [ - { - "internalType": "uint256", - "name": "capitalRequirement", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "skewLimit", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xbe5af9fe" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "delta", - "type": "uint256" - } - ], - "name": "decrementTotalDeposited", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x6b3a0984" - }, - { - "constant": true, - "inputs": [], - "name": "durations", - "outputs": [ - { - "internalType": "uint256", - "name": "maxOraclePriceAge", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiryDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimeToMaturity", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x4a41d89d" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address[]", - "name": "markets", - "type": "address[]" - } - ], - "name": "expireMarkets", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xc014fb84" - }, - { - "constant": true, - "inputs": [], - "name": "fees", - "outputs": [ - { - "internalType": "uint256", - "name": "poolFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "creatorFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "refundFee", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x9af1d35a" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "delta", - "type": "uint256" - } - ], - "name": "incrementTotalDeposited", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xaeab5849" - }, - { - "constant": true, - "inputs": [], - "name": "isResolverCached", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x2af64bd3" - }, - { - "constant": true, - "inputs": [], - "name": "lastPauseTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x91b4ded9" - }, - { - "constant": true, - "inputs": [], - "name": "marketCreationEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x64af2d87" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pageSize", - "type": "uint256" - } - ], - "name": "maturedMarkets", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x89c6318d" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "contract BinaryOptionMarketManager", - "name": "receivingManager", - "type": "address" - }, - { - "internalType": "bool", - "name": "active", - "type": "bool" - }, - { - "internalType": "contract BinaryOptionMarket[]", - "name": "marketsToMigrate", - "type": "address[]" - } - ], - "name": "migrateMarkets", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x03ff6018" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x1627540c" - }, - { - "constant": true, - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x53a47bb7" - }, - { - "constant": true, - "inputs": [], - "name": "numActiveMarkets", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x02610c50" - }, - { - "constant": true, - "inputs": [], - "name": "numMaturedMarkets", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xac60c486" - }, - { - "constant": true, - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x8da5cb5b" - }, - { - "constant": true, - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x5c975abb" - }, - { - "constant": false, - "inputs": [], - "name": "rebuildCache", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x74185360" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "contract BinaryOptionMarket[]", - "name": "marketsToSync", - "type": "address[]" - } - ], - "name": "rebuildMarketCaches", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x9b11dc40" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bool", - "name": "active", - "type": "bool" - }, - { - "internalType": "contract BinaryOptionMarket[]", - "name": "marketsToReceive", - "type": "address[]" - } - ], - "name": "receiveMarkets", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xadfd31af" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "resolveMarket", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x7859f410" - }, - { - "constant": true, - "inputs": [], - "name": "resolver", - "outputs": [ - { - "internalType": "contract AddressResolver", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x04f3bcec" - }, - { - "constant": true, - "inputs": [], - "name": "resolverAddressesRequired", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "addresses", - "type": "bytes32[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x899ffef4" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_creatorCapitalRequirement", - "type": "uint256" - } - ], - "name": "setCreatorCapitalRequirement", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xc095daf2" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_creatorFee", - "type": "uint256" - } - ], - "name": "setCreatorFee", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x0dd16fd5" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_creatorSkewLimit", - "type": "uint256" - } - ], - "name": "setCreatorSkewLimit", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x73b7de15" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_expiryDuration", - "type": "uint256" - } - ], - "name": "setExpiryDuration", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x15502840" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "name": "setMarketCreationEnabled", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x39ab4c41" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_maxOraclePriceAge", - "type": "uint256" - } - ], - "name": "setMaxOraclePriceAge", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xbd6a10b8" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_maxTimeToMaturity", - "type": "uint256" - } - ], - "name": "setMaxTimeToMaturity", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x64cf34bd" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "contract BinaryOptionMarketManager", - "name": "manager", - "type": "address" - } - ], - "name": "setMigratingManager", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x1f3f10b0" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bool", - "name": "_paused", - "type": "bool" - } - ], - "name": "setPaused", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x16c38b3c" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_poolFee", - "type": "uint256" - } - ], - "name": "setPoolFee", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x9501dc87" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_refundFee", - "type": "uint256" - } - ], - "name": "setRefundFee", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x36fd711e" - }, - { - "constant": true, - "inputs": [], - "name": "totalDeposited", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xff50abdc" - } - ], - "source": { - "keccak256": "0x25551bb15e313a47f1768788ee7e4bf6c6dfd140a051e25139b995a306e526c6", - "urls": [ - "bzz-raw://4a64a84dce24ace14b7662ecf3f3bd083f4064923d2bdafc8290fd237c35cf73", - "dweb:/ipfs/QmYHjCbQETjmrmZBvju3MjpDBqHEF754jCiTpPRLgfdzme" - ] - }, - "metadata": { - "compiler": { - "version": "0.5.16+commit.9c3226ce" - }, - "language": "Solidity", - "settings": { - "compilationTarget": { - "BinaryOptionMarketManager.sol": "BinaryOptionMarketManager" - }, - "evmVersion": "istanbul", - "libraries": {}, - "optimizer": { - "enabled": true, - "runs": 200 - }, - "remappings": [] - }, - "sources": { - "BinaryOptionMarketManager.sol": { - "keccak256": "0x25551bb15e313a47f1768788ee7e4bf6c6dfd140a051e25139b995a306e526c6", - "urls": [ - "bzz-raw://4a64a84dce24ace14b7662ecf3f3bd083f4064923d2bdafc8290fd237c35cf73", - "dweb:/ipfs/QmYHjCbQETjmrmZBvju3MjpDBqHEF754jCiTpPRLgfdzme" - ] - } - }, - "version": 1 - } - }, - "BinaryOptionMarketData": { - "bytecode": "608060405234801561001057600080fd5b506112f7806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80631216fc7b14610046578063a30c302d1461006f578063dca5f5c31461008f575b600080fd5b610059610054366004610e75565b6100af565b60405161006691906111f1565b60405180910390f35b61008261007d366004610e75565b61047c565b60405161006691906111e2565b6100a261009d366004610e93565b610a61565b60405161006691906111d4565b6100b7610c44565b600080836001600160a01b0316631069143a6040518163ffffffff1660e01b8152600401604080518083038186803b1580156100f257600080fd5b505afa158015610106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061012a9190810190610ecd565b915091506000806000866001600160a01b0316639e3b34bf6040518163ffffffff1660e01b815260040160606040518083038186803b15801561016c57600080fd5b505afa158015610180573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506101a49190810190610e28565b9250925092506000806000896001600160a01b03166398508ecd6040518163ffffffff1660e01b815260040160606040518083038186803b1580156101e857600080fd5b505afa1580156101fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506102209190810190610e28565b92509250925060008060008c6001600160a01b0316639af1d35a6040518163ffffffff1660e01b815260040160606040518083038186803b15801561026457600080fd5b505afa158015610278573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061029c9190810190610e28565b9250925092506102aa610c44565b6040518060c001604052808f6001600160a01b03166302d05d3f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ee57600080fd5b505afa158015610302573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103269190810190610de4565b6001600160a01b0316815260200160405180604001604052808f6001600160a01b031681526020018e6001600160a01b0316815250815260200160405180606001604052808d81526020018c81526020018b815250815260200160405180606001604052808a81526020018981526020018881525081526020016040518060600160405280878152602001868152602001858152508152602001604051806040016040528060008152602001600081525081525090506000808f6001600160a01b031663be5af9fe6040518163ffffffff1660e01b8152600401604080518083038186803b15801561041757600080fd5b505afa15801561042b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061044f9190810190610f57565b60408051808201909152918252602082015260a084015250909c505050505050505050505050505b919050565b610484610ca0565b600080836001600160a01b031663c7a5bdc86040518163ffffffff1660e01b8152600401604080518083038186803b1580156104bf57600080fd5b505afa1580156104d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104f79190810190610f57565b91509150600080856001600160a01b0316633d7a783b6040518163ffffffff1660e01b8152600401604080518083038186803b15801561053657600080fd5b505afa15801561054a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061056e9190810190610f57565b91509150600080876001600160a01b031663d068cdc56040518163ffffffff1660e01b8152600401604080518083038186803b1580156105ad57600080fd5b505afa1580156105c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506105e59190810190610f57565b91509150600080896001600160a01b0316638b0341366040518163ffffffff1660e01b8152600401604080518083038186803b15801561062457600080fd5b505afa158015610638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061065c9190810190610f57565b915091506000808b6001600160a01b031663d3419bf36040518163ffffffff1660e01b8152600401604080518083038186803b15801561069b57600080fd5b505afa1580156106af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506106d39190810190610f57565b9150915060405180610120016040528060405180604001604052808d81526020018c8152508152602001604051806040016040528085815260200184815250815260200160405180604001604052808f6001600160a01b031663eef49ee36040518163ffffffff1660e01b815260040160206040518083038186803b15801561075b57600080fd5b505afa15801561076f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107939190810190610f39565b81526020018f6001600160a01b0316632115e3036040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d157600080fd5b505afa1580156107e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108099190810190610f39565b815250815260200160405180604001604052808f6001600160a01b0316633f6fa6556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085557600080fd5b505afa158015610869573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061088d9190810190610e0a565b151581526020018f6001600160a01b031663ac3791e36040518163ffffffff1660e01b815260040160206040518083038186803b1580156108cd57600080fd5b505afa1580156108e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109059190810190610e0a565b151581525081526020018d6001600160a01b031663b1c9fe6e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561094857600080fd5b505afa15801561095c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109809190810190610efd565b600381111561098b57fe5b81526020018d6001600160a01b031663653721476040518163ffffffff1660e01b815260040160206040518083038186803b1580156109c957600080fd5b505afa1580156109dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a019190810190610f1b565b6001811115610a0c57fe5b81526040805180820182529687526020878101969096528582019690965285518087018752998a5289850198909852848801989098525050815180830190925292815291820152606090910152949350505050565b610a69610d03565b600080846001600160a01b03166329e77b5d856040518263ffffffff1660e01b8152600401610a9891906111c6565b604080518083038186803b158015610aaf57600080fd5b505afa158015610ac3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ae79190810190610f57565b91509150600080866001600160a01b031663408e82af876040518263ffffffff1660e01b8152600401610b1a91906111c6565b604080518083038186803b158015610b3157600080fd5b505afa158015610b45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b699190810190610f57565b91509150600080886001600160a01b0316636392a51f896040518263ffffffff1660e01b8152600401610b9c91906111c6565b604080518083038186803b158015610bb357600080fd5b505afa158015610bc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610beb9190810190610f57565b6040805160a08101825260608101998a5260808101989098529787528751808901895295865260208681019590955284870195909552865180880188529081529283019390935250928201929092529150505b92915050565b6040518060c0016040528060006001600160a01b03168152602001610c67610d16565b8152602001610c74610d2d565b8152602001610c81610d4e565b8152602001610c8e610d2d565b8152602001610c9b610d72565b905290565b604051806101200160405280610cb4610d72565b8152602001610cc1610d72565b8152602001610cce610d72565b8152602001610cdb610d16565b81526020016000815260200160008152602001610cf6610d72565b8152602001610c8e610d72565b6040518060600160405280610cf6610d72565b604080518082019091526000808252602082015290565b60405180606001604052806000815260200160008152602001600081525090565b60405180606001604052806000801916815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b8035610c3e8161126b565b8051610c3e8161126b565b8051610c3e8161127f565b8051610c3e81611288565b8035610c3e81611291565b8051610c3e81611291565b8051610c3e8161129a565b8051610c3e816112a7565b600060208284031215610df657600080fd5b6000610e028484610d97565b949350505050565b600060208284031215610e1c57600080fd5b6000610e028484610da2565b600080600060608486031215610e3d57600080fd5b6000610e498686610dad565b9350506020610e5a86828701610dad565b9250506040610e6b86828701610dad565b9150509250925092565b600060208284031215610e8757600080fd5b6000610e028484610db8565b60008060408385031215610ea657600080fd5b6000610eb28585610db8565b9250506020610ec385828601610d8c565b9150509250929050565b60008060408385031215610ee057600080fd5b6000610eec8585610dc3565b9250506020610ec385828601610dc3565b600060208284031215610f0f57600080fd5b6000610e028484610dce565b600060208284031215610f2d57600080fd5b6000610e028484610dd9565b600060208284031215610f4b57600080fd5b6000610e028484610dad565b60008060408385031215610f6a57600080fd5b6000610f768585610dad565b9250506020610ec385828601610dad565b610f9081611200565b82525050565b610f908161120b565b610f9081611210565b610f9081611213565b610f908161123e565b610f9081611249565b805160c0830190610fd48482611000565b506020820151610fe76040850182611000565b506040820151610ffa6080850182611000565b50505050565b805160408301906110118482610f9f565b506020820151610ffa6020850182610f9f565b805160608301906110358482610f9f565b5060208201516110486020850182610f9f565b506040820151610ffa6040850182610f9f565b805161020083019061106d8482611000565b5060208201516110806040850182611000565b5060408201516110936080850182611000565b5060608201516110a660c08501826111a2565b5060808201516110ba610100850182610fb1565b5060a08201516110ce610120850182610fba565b5060c08201516110e2610140850182611000565b5060e08201516110f6610180850182611000565b50610100820151610ffa6101c0850182611000565b80516101c083019061111d8482610f87565b506020820151611130602085018261117e565b5060408201516111436060850182611024565b50606082015161115660c0850182611024565b50608082015161116a610120850182611024565b5060a0820151610ffa610180850182611000565b8051604083019061118f8482610fa8565b506020820151610ffa6020850182610fa8565b805160408301906111b38482610f96565b506020820151610ffa6020850182610f96565b60208101610c3e8284610f87565b60c08101610c3e8284610fc3565b6102008101610c3e828461105b565b6101c08101610c3e828461110b565b6000610c3e82611232565b151590565b90565b6000610c3e82611200565b8061047781611254565b8061047781611261565b6001600160a01b031690565b6000610c3e8261121e565b6000610c3e82611228565b6004811061125e57fe5b50565b6002811061125e57fe5b61127481611200565b811461125e57600080fd5b6112748161120b565b61127481611210565b61127481611213565b6004811061125e57600080fd5b6002811061125e57600080fdfea365627a7a723158201a6330c1b3b45158c7aef469156860076f8983a4dba2eddc63c6a6b18e813a276c6578706572696d656e74616cf564736f6c63430005100040", - "abi": [ - { - "constant": true, - "inputs": [ - { - "internalType": "contract BinaryOptionMarket", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "getAccountMarketData", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "bids", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "claimable", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "balances", - "type": "tuple" - } - ], - "internalType": "struct BinaryOptionMarketData.AccountData", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xdca5f5c3" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "contract BinaryOptionMarket", - "name": "market", - "type": "address" - } - ], - "name": "getMarketData", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAt", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OraclePriceAndTimestamp", - "name": "oraclePriceAndTimestamp", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarket.Prices", - "name": "prices", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "deposited", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "exercisableDeposits", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.Deposits", - "name": "deposits", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "resolved", - "type": "bool" - }, - { - "internalType": "bool", - "name": "canResolve", - "type": "bool" - } - ], - "internalType": "struct BinaryOptionMarketData.Resolution", - "name": "resolution", - "type": "tuple" - }, - { - "internalType": "enum IBinaryOptionMarket.Phase", - "name": "phase", - "type": "uint8" - }, - { - "internalType": "enum IBinaryOptionMarket.Side", - "name": "result", - "type": "uint8" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "totalBids", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "totalClaimableSupplies", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "totalSupplies", - "type": "tuple" - } - ], - "internalType": "struct BinaryOptionMarketData.MarketData", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xa30c302d" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "contract BinaryOptionMarket", - "name": "market", - "type": "address" - } - ], - "name": "getMarketParameters", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "components": [ - { - "internalType": "contract BinaryOption", - "name": "long", - "type": "address" - }, - { - "internalType": "contract BinaryOption", - "name": "short", - "type": "address" - } - ], - "internalType": "struct BinaryOptionMarket.Options", - "name": "options", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "biddingEnd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maturity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarket.Times", - "name": "times", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "strikePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "finalPrice", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarket.OracleDetails", - "name": "oracleDetails", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "poolFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "creatorFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "refundFee", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketManager.Fees", - "name": "fees", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "capitalRequirement", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "skewLimit", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketManager.CreatorLimits", - "name": "creatorLimits", - "type": "tuple" - } - ], - "internalType": "struct BinaryOptionMarketData.MarketParameters", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x1216fc7b" - } - ] - }, "SynthUtil": { "bytecode": "608060405234801561001057600080fd5b506040516113693803806113698339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b0319909216919091179055611304806100656000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80630120be331461006757806327fe55a6146100a5578063492dbcdd14610146578063a827bf481461022c578063d18ab37614610252578063eade6d2d14610276575b600080fd5b6100936004803603604081101561007d57600080fd5b506001600160a01b0381351690602001356102ce565b60408051918252519081900360200190f35b6100ad61054d565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156100f15781810151838201526020016100d9565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015610130578181015183820152602001610118565b5050505090500194505050505060405180910390f35b61014e6107b9565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b8381101561019657818101518382015260200161017e565b50505050905001848103835286818151815260200191508051906020019060200280838360005b838110156101d55781810151838201526020016101bd565b50505050905001848103825285818151815260200191508051906020019060200280838360005b838110156102145781810151838201526020016101fc565b50505050905001965050505050505060405180910390f35b61014e6004803603602081101561024257600080fd5b50356001600160a01b0316610b32565b61025a610ec9565b604080516001600160a01b039092168252519081900360200190f35b61027e610ed8565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102ba5781810151838201526020016102a2565b505050509050019250505060405180910390f35b6000806102d9611182565b905060006102e561123f565b90506000826001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b15801561032257600080fd5b505afa158015610336573d6000803e3d6000fd5b505050506040513d602081101561034c57600080fd5b5051905060005b81811015610543576000846001600160a01b031663835e119c836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156103a157600080fd5b505afa1580156103b5573d6000803e3d6000fd5b505050506040513d60208110156103cb57600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b038087169263654a60ac929185169163dbd06c85916004808301926020929190829003018186803b15801561041b57600080fd5b505afa15801561042f573d6000803e3d6000fd5b505050506040513d602081101561044557600080fd5b5051604080516370a0823160e01b81526001600160a01b038d811660048301529151918616916370a0823191602480820192602092909190829003018186803b15801561049157600080fd5b505afa1580156104a5573d6000803e3d6000fd5b505050506040513d60208110156104bb57600080fd5b5051604080516001600160e01b031960e086901b16815260048101939093526024830191909152604482018b9052516064808301926020929190829003018186803b15801561050957600080fd5b505afa15801561051d573d6000803e3d6000fd5b505050506040513d602081101561053357600080fd5b5051959095019450600101610353565b5050505092915050565b606080606061055a611182565b6001600160a01b03166372cb051f6040518163ffffffff1660e01b815260040160006040518083038186803b15801561059257600080fd5b505afa1580156105a6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156105cf57600080fd5b81019080805160405193929190846401000000008211156105ef57600080fd5b90830190602082018581111561060457600080fd5b825186602082028301116401000000008211171561062157600080fd5b82525081516020918201928201910280838360005b8381101561064e578181015183820152602001610636565b5050505090500160405250505090508061066661123f565b6001600160a01b031663c2c8a676836040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019060200280838360005b838110156106c45781810151838201526020016106ac565b505050509050019250505060006040518083038186803b1580156106e757600080fd5b505afa1580156106fb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561072457600080fd5b810190808051604051939291908464010000000082111561074457600080fd5b90830190602082018581111561075957600080fd5b825186602082028301116401000000008211171561077657600080fd5b82525081516020918201928201910280838360005b838110156107a357818101518382015260200161078b565b5050505090500160405250505092509250509091565b606080606060006107c8611182565b905060006107d461123f565b90506000826001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b15801561081157600080fd5b505afa158015610825573d6000803e3d6000fd5b505050506040513d602081101561083b57600080fd5b505160408051828152602080840282010190915290915060609082801561086c578160200160208202803883390190505b50905060608260405190808252806020026020018201604052801561089b578160200160208202803883390190505b5090506060836040519080825280602002602001820160405280156108ca578160200160208202803883390190505b50905060005b84811015610b22576000876001600160a01b031663835e119c836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561091e57600080fd5b505afa158015610932573d6000803e3d6000fd5b505050506040513d602081101561094857600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b0383169163dbd06c8591600480820192602092909190829003018186803b15801561098e57600080fd5b505afa1580156109a2573d6000803e3d6000fd5b505050506040513d60208110156109b857600080fd5b505185518690849081106109c857fe5b602002602001018181525050806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0d57600080fd5b505afa158015610a21573d6000803e3d6000fd5b505050506040513d6020811015610a3757600080fd5b50518451859084908110610a4757fe5b602002602001018181525050866001600160a01b031663654a60ac868481518110610a6e57fe5b6020026020010151868581518110610a8257fe5b6020026020010151631cd554d160e21b6040518463ffffffff1660e01b815260040180848152602001838152602001828152602001935050505060206040518083038186803b158015610ad457600080fd5b505afa158015610ae8573d6000803e3d6000fd5b505050506040513d6020811015610afe57600080fd5b50518351849084908110610b0e57fe5b6020908102919091010152506001016108d0565b5091975095509350505050909192565b60608060606000610b41611182565b90506000610b4d61123f565b90506000826001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8a57600080fd5b505afa158015610b9e573d6000803e3d6000fd5b505050506040513d6020811015610bb457600080fd5b5051604080518281526020808402820101909152909150606090828015610be5578160200160208202803883390190505b509050606082604051908082528060200260200182016040528015610c14578160200160208202803883390190505b509050606083604051908082528060200260200182016040528015610c43578160200160208202803883390190505b50905060005b84811015610eb8576000876001600160a01b031663835e119c836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610c9757600080fd5b505afa158015610cab573d6000803e3d6000fd5b505050506040513d6020811015610cc157600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b0383169163dbd06c8591600480820192602092909190829003018186803b158015610d0757600080fd5b505afa158015610d1b573d6000803e3d6000fd5b505050506040513d6020811015610d3157600080fd5b50518551869084908110610d4157fe5b602002602001018181525050806001600160a01b03166370a082318d6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015610da357600080fd5b505afa158015610db7573d6000803e3d6000fd5b505050506040513d6020811015610dcd57600080fd5b50518451859084908110610ddd57fe5b602002602001018181525050866001600160a01b031663654a60ac868481518110610e0457fe5b6020026020010151868581518110610e1857fe5b6020026020010151631cd554d160e21b6040518463ffffffff1660e01b815260040180848152602001838152602001828152602001935050505060206040518083038186803b158015610e6a57600080fd5b505afa158015610e7e573d6000803e3d6000fd5b505050506040513d6020811015610e9457600080fd5b50518351849084908110610ea457fe5b602090810291909101015250600101610c49565b509199909850909650945050505050565b6000546001600160a01b031681565b60606000610ee4611182565b90506000610ef061123f565b90506000826001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2d57600080fd5b505afa158015610f41573d6000803e3d6000fd5b505050506040513d6020811015610f5757600080fd5b5051604080518281526020808402820101909152909150606090828015610f88578160200160208202803883390190505b50905060005b82811015611179576000856001600160a01b031663835e119c836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610fdc57600080fd5b505afa158015610ff0573d6000803e3d6000fd5b505050506040513d602081101561100657600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b038088169263af3aea86929185169163dbd06c85916004808301926020929190829003018186803b15801561105657600080fd5b505afa15801561106a573d6000803e3d6000fd5b505050506040513d602081101561108057600080fd5b5051604080516001600160e01b031960e085901b1681526004810192909252516024808301926020929190829003018186803b1580156110bf57600080fd5b505afa1580156110d3573d6000803e3d6000fd5b505050506040513d60208110156110e957600080fd5b50511561117057806001600160a01b031663dbd06c856040518163ffffffff1660e01b815260040160206040518083038186803b15801561112957600080fd5b505afa15801561113d573d6000803e3d6000fd5b505050506040513d602081101561115357600080fd5b5051835184908490811061116357fe5b6020026020010181815250505b50600101610f8e565b50935050505090565b600080546040805163dacb2d0160e01b8152680a6f2dce8d0cae8d2f60bb1b600482015260248101829052601960448201527f4d697373696e672053796e746865746978206164647265737300000000000000606482015290516001600160a01b039092169163dacb2d0191608480820192602092909190829003018186803b15801561120e57600080fd5b505afa158015611222573d6000803e3d6000fd5b505050506040513d602081101561123857600080fd5b5051905090565b600080546040805163dacb2d0160e01b81526c45786368616e6765526174657360981b600482015260248101829052601d60448201527f4d697373696e672045786368616e676552617465732061646472657373000000606482015290516001600160a01b039092169163dacb2d0191608480820192602092909190829003018186803b15801561120e57600080fdfea265627a7a723158209e7ba686f73798746736e8ff9d170da8215f2ad60eb6b3c4ba5c14e221d4140064736f6c63430005100032", "abi": [ diff --git a/publish/deployed/ropsten/config.json b/publish/deployed/ropsten/config.json index fc1fc7c8db..681c125176 100644 --- a/publish/deployed/ropsten/config.json +++ b/publish/deployed/ropsten/config.json @@ -2,15 +2,6 @@ "AddressResolver": { "deploy": false }, - "BinaryOptionMarketFactory": { - "deploy": false - }, - "BinaryOptionMarketManager": { - "deploy": false - }, - "BinaryOptionMarketData": { - "deploy": false - }, "ReadProxyAddressResolver": { "deploy": false }, diff --git a/publish/deployed/ropsten/deployment.json b/publish/deployed/ropsten/deployment.json index a4582a9545..497e57aebd 100644 --- a/publish/deployed/ropsten/deployment.json +++ b/publish/deployed/ropsten/deployment.json @@ -1413,33 +1413,6 @@ "txn": "", "network": "ropsten" }, - "BinaryOptionMarketFactory": { - "name": "BinaryOptionMarketFactory", - "address": "0x760AfB8367E72199C236388dd51DbB94de1BB20B", - "source": "BinaryOptionMarketFactory", - "link": "https://ropsten.etherscan.io/address/0x760AfB8367E72199C236388dd51DbB94de1BB20B", - "timestamp": "2020-07-20T01:33:20.880Z", - "txn": "", - "network": "ropsten" - }, - "BinaryOptionMarketManager": { - "name": "BinaryOptionMarketManager", - "address": "0xC2D6cCfCDAB5Be09F15320FD2d642f374f89bC20", - "source": "BinaryOptionMarketManager", - "link": "https://ropsten.etherscan.io/address/0xC2D6cCfCDAB5Be09F15320FD2d642f374f89bC20", - "timestamp": "2020-07-20T01:33:43.461Z", - "txn": "", - "network": "ropsten" - }, - "BinaryOptionMarketData": { - "name": "BinaryOptionMarketData", - "address": "0x5926EcE7b7Ff779ADe5f324E899338F7Dd7f3092", - "source": "BinaryOptionMarketData", - "link": "https://ropsten.etherscan.io/address/0x5926EcE7b7Ff779ADe5f324E899338F7Dd7f3092", - "timestamp": "2020-08-05T23:47:11.000Z", - "txn": "https://ropsten.etherscan.io/tx/0x5d5a5599f589a3e7ceb958efdd95c0372472aa111167a078a117dbf9da13c1b0", - "network": "ropsten" - }, "SynthUtil": { "name": "SynthUtil", "address": "0x121448bCc076Cd44Aee6C501B19D4e1a81d0f102", @@ -21085,2095 +21058,6 @@ "version": 1 } }, - "BinaryOptionMarketFactory": { - "bytecode": "60a06040527f42696e6172794f7074696f6e4d61726b65744d616e616765720000000000000060809081526200003a906007906001620002ef565b503480156200004857600080fd5b506040516200622338038062006223833981810160405260408110156200006e57600080fd5b50805160209091015160408051610300810191829052829160079060189082845b8154815260200190600101908083116200008f57508793505050506001600160a01b03811662000106576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a1506000546001600160a01b0316620001b1576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b60005460038054610100600160a81b0319166101006001600160a01b0390931692830217905560408051918252517fd5da63a0b864b315bc04128dedbc93888c8529ee6cf47ce664dc204339228c53916020908290030190a16000546001600160a01b03166200025c576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b60005b6018811015620002c45760008282601881106200027857fe5b602002015114620002b55760068282601881106200029257fe5b6020908102919091015182546001810184556000938452919092200155620002bb565b620002c4565b6001016200025f565b5050600480546001600160a01b0319166001600160a01b039290921691909117905550620003529050565b826018810192821562000320579160200282015b828111156200032057825182559160200191906001019062000303565b506200032e92915062000332565b5090565b6200034f91905b808211156200032e576000815560010162000339565b90565b615ec180620003626000396000f3fe60806040523480156200001157600080fd5b50600436106200013c5760003560e01c806379ba509711620000bd578063b8225dec116200007b578063b8225dec1462000312578063bd32aa44146200031c578063c58aaae61462000326578063c6c9d8281462000330578063e3235c911462000350576200013c565b806379ba509714620002a55780638da5cb5b14620002af5780639cb8a26a14620002b9578063a461fc8214620002c3578063ab49848c14620002cd576200013c565b806320714f88116200010b57806320714f8814620002025780633278c960146200022b5780633be99e6f146200023557806353a47bb7146200025e578063631e14441462000268576200013c565b806304f3bcec1462000141578063130efa5014620001675780631627540c14620001bb57806317c70de414620001e6575b600080fd5b6200014b6200035a565b604080516001600160a01b039092168252519081900360200190f35b6200014b60048036036101c08110156200018057600080fd5b506001600160a01b0381351690602081019060608101359060808101359060a081013515159060c08101906101208101906101600162000369565b620001e460048036036020811015620001d357600080fd5b50356001600160a01b0316620004ba565b005b620001f062000559565b60408051918252519081900360200190f35b620001e4600480360360208110156200021a57600080fd5b50356001600160a01b03166200055f565b620001e462000662565b620001e4600480360360208110156200024d57600080fd5b50356001600160a01b0316620006e7565b6200014b6200085a565b62000291600480360360208110156200028057600080fd5b50356001600160a01b031662000869565b604080519115158252519081900360200190f35b620001e462000992565b6200014b62000a50565b620001e462000a5f565b620001f062000bb5565b620002d762000bbc565b604051808261030080838360005b83811015620002ff578181015183820152602001620002e5565b5050505090500191505060405180910390f35b6200029162000c0c565b620001e462000c15565b6200014b62000ca9565b620001f0600480360360208110156200034857600080fd5b503562000cbd565b620001f062000cdc565b6004546001600160a01b031681565b6000806200037662000ce1565b90506001600160a01b0381163314620003d6576040805162461bcd60e51b815260206004820152601e60248201527f4f6e6c79207065726d697474656420627920746865206d616e616765722e0000604482015290519081900360640190fd5b808a8a8a8a8a8a8a8a604051620003ed9062000ddb565b6001600160a01b03808b16825289166020820152604080820190899080828437600083820152601f01601f191690910188815260208101889052861515604082015260609081019150859080828437600083820152601f01601f1916909101905083604080828437600083820152601f01601f19169091019050826060808284376000838201819052604051601f909201601f19169093018190039c509a509098505050505050505050f080158015620004ab573d6000803e3d6000fd5b509a9950505050505050505050565b6000546001600160a01b03163314620005055760405162461bcd60e51b815260040180806020018281038252602f81526020018062005e5e602f913960400191505060405180910390fd5b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b60025481565b6000546001600160a01b03163314620005aa5760405162461bcd60e51b815260040180806020018281038252602f81526020018062005e5e602f913960400191505060405180910390fd5b6001600160a01b03811662000606576040805162461bcd60e51b815260206004820152601c60248201527f42656e6566696369617279206d757374206e6f74206265207a65726f00000000604482015290519081900360640190fd5b600380546001600160a01b0383166101008102610100600160a81b03199092169190911790915560408051918252517fd5da63a0b864b315bc04128dedbc93888c8529ee6cf47ce664dc204339228c539181900360200190a150565b6000546001600160a01b03163314620006ad5760405162461bcd60e51b815260040180806020018281038252602f81526020018062005e5e602f913960400191505060405180910390fd5b600060028190556003805460ff191690556040517f6adcc7125002935e0aa31697538ebbd65cfddf20431eb6ecdcfc3e238bfd082c9190a1565b6000546001600160a01b03163314620007325760405162461bcd60e51b815260040180806020018281038252602f81526020018062005e5e602f913960400191505060405180910390fd5b600480546001600160a01b0319166001600160a01b03831617905560005b60065481101562000856576000600682815481106200076b57fe5b60009182526020918290200154600480546040805163dacb2d0160e01b815292830184905260248301819052601760448401527f5265736f6c766572206d697373696e67207461726765740000000000000000006064840152519294506001600160a01b03169263dacb2d0192608480840193829003018186803b158015620007f357600080fd5b505afa15801562000808573d6000803e3d6000fd5b505050506040513d60208110156200081f57600080fd5b505160009182526005602052604090912080546001600160a01b0319166001600160a01b0390921691909117905560010162000750565b5050565b6001546001600160a01b031681565b6004546000906001600160a01b038381169116146200088b575060006200098d565b60005b6006548110156200098757600060068281548110620008a957fe5b600091825260208083209091015480835260058252604092839020546004805485516321f8a72160e01b815291820184905294519295506001600160a01b0391821694909116926321f8a72192602480840193829003018186803b1580156200091157600080fd5b505afa15801562000926573d6000803e3d6000fd5b505050506040513d60208110156200093d57600080fd5b50516001600160a01b03161415806200096b57506000818152600560205260409020546001600160a01b0316155b156200097d576000925050506200098d565b506001016200088e565b50600190505b919050565b6001546001600160a01b03163314620009dd5760405162461bcd60e51b815260040180806020018281038252603581526020018062005e006035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b031681565b6000546001600160a01b0316331462000aaa5760405162461bcd60e51b815260040180806020018281038252602f81526020018062005e5e602f913960400191505060405180910390fd5b60035460ff1662000b02576040805162461bcd60e51b815260206004820152601f60248201527f53656c66204465737472756374206e6f742079657420696e6974696174656400604482015290519081900360640190fd5b426224ea00600254011062000b5e576040805162461bcd60e51b815260206004820152601b60248201527f53656c662064657374727563742064656c6179206e6f74206d65740000000000604482015290519081900360640190fd5b600354604080516101009092046001600160a01b03168252517f8a09e1677ced846cb537dc2b172043bd05a1a81ad7e0033a7ef8ba762df990b7916020908290030190a160035461010090046001600160a01b0316ff5b6224ea0081565b62000bc662000de9565b60005b60065481101562000c08576006818154811062000be257fe5b906000526020600020015482826018811062000bfa57fe5b602002015260010162000bc9565b5090565b60035460ff1681565b6000546001600160a01b0316331462000c605760405162461bcd60e51b815260040180806020018281038252602f81526020018062005e5e602f913960400191505060405180910390fd5b426002556003805460ff19166001179055604080516224ea00815290517fcbd94ca75b8dc45c9d80c77e851670e78843c0d75180cb81db3e2158228fa9a69181900360200190a1565b60035461010090046001600160a01b031681565b6006818154811062000ccb57fe5b600091825260209091200154905081565b601881565b600062000d287f42696e6172794f7074696f6e4d61726b65744d616e616765720000000000000060405180606001604052806029815260200162005e356029913962000d2d565b905090565b6000828152600560205260408120546001600160a01b0316828162000dd35760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101562000d9757818101518382015260200162000d7d565b50505050905090810190601f16801562000dc55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509392505050565b614ff78062000e0983390190565b604051806103000160405280601890602082028038833950919291505056fe6101006040526b53797374656d53746174757360a01b60809081526c45786368616e6765526174657360981b60a0526814de5b9d1a1cd554d160ba1b60c05266119959541bdbdb60ca1b60e0526200005c90601790600462000ab3565b503480156200006a57600080fd5b5060405162004ff738038062004ff783398181016040526101e08110156200009157600080fd5b5080516020820151608083015160a084015160c0850151604080516103008101808352969795969186019560e0810192610140820192610180909201918a9160179060189082845b815481526020019060010190808311620000d957508e93505050506001600160a01b03811662000150576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a1506000546001600160a01b0316620001fb576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b60005b6018811015620002635760008282601881106200021757fe5b602002015114620002545760048282601881106200023157fe5b60209081029190910151825460018101845560009384529190922001556200025a565b62000263565b600101620001fe565b5050600280546001600160a01b03199081166001600160a01b0393841617909155601580546040805180820182528c518082526020808f01519281018390526012919091556013919091558151606080820184528d82528183018d90526000918401829052600c8e9055600d8d9055600e919091558251908101835289518082528a8301518284018190528b85015192909401829052600955600a92909255600b919091559216928b169290921760ff60a81b1916600160a81b8715150217909155825190830151620003378282620005b8565b896001600160a01b031660008051602062004fd7833981519152600084604051808360018111156200036557fe5b60ff1681526020018281526020019250505060405180910390a2896001600160a01b031660008051602062004fd783398151915260018360405180836001811115620003ad57fe5b60ff1681526020018281526020019250505060405180910390a26000620003e38284620006bf60201b620022e11790919060201c565b6014819055845160208087015160408051606081018252848152808401839052818a01519101819052600f8490556010829055601155929350909190620004c2906200043c9084908490620006bf811b620022e117901c565b73__$60f5066a95a61bfd95691e5518aae05f18$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200048157600080fd5b505af415801562000496573d6000803e3d6000fd5b505050506040513d6020811015620004ad57600080fd5b50519062000723602090811b62002cc617901c565b601655620004db8585856001600160e01b036200078116565b8c85604051620004eb9062000af2565b6001600160a01b0390921682526020820152604080519182900301906000f0801580156200051d573d6000803e3d6000fd5b50600580546001600160a01b0319166001600160a01b03929092169190911790556040518d908590620005509062000af2565b6001600160a01b0390921682526020820152604080519182900301906000f08015801562000582573d6000803e3d6000fd5b50600680546001600160a01b0319166001600160a01b03929092169190911790555062000b209c50505050505050505050505050565b6000620005d48284620006bf60201b620022e11790919060201c565b905080601260000154111562000631576040805162461bcd60e51b815260206004820152601460248201527f496e73756666696369656e74206361706974616c000000000000000000000000604482015290519081900360640190fd5b6013546200064c8483620007fb602090811b6200311217901c565b8111158015620006755750620006718284620007fb60201b620031121790919060201c565b8111155b620006b9576040805162461bcd60e51b815260206004820152600f60248201526e109a591cc81d1bdbc81cdad95dd959608a1b604482015290519081900360640190fd5b50505050565b6000828201838110156200071a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b90505b92915050565b6000828211156200077b576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000806200079a8585856001600160e01b036200083616565b604080518082018252838152602090810183905260078490556008839055815184815290810183905281519395509193507f6546f60f34df611fa42503098acc39d5ab88bc73febe64b3cc14e5a92e3a66a792918290030190a15050505050565b60006200071a826200082285670de0b6b3a7640000620008f3602090811b6200316217901c565b6200095160201b620031bb1790919060201c565b60008084158015906200084857508315155b6200089a576040805162461bcd60e51b815260206004820152601460248201527f42696473206d757374206265206e6f6e7a65726f000000000000000000000000604482015290519081900360640190fd5b6000620008b0846001600160e01b03620009bd16565b9050620008cc8187620009f860201b62002f3a1790919060201c565b620008e68287620009f860201b62002f3a1790919060201c565b9250925050935093915050565b60008262000904575060006200071d565b828202828482816200091257fe5b04146200071a5760405162461bcd60e51b815260040180806020018281038252602181526020018062004fb66021913960400191505060405180910390fd5b6000808211620009a8576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b6000828481620009b457fe5b04949350505050565b601554600090600160a01b900460ff16620009f457620009ee6016548362000a1860201b620022c51790919060201c565b6200071d565b5090565b60006200071a8383670de0b6b3a76400006001600160e01b0362000a3816565b60006200071a8383670de0b6b3a76400006001600160e01b0362000a7c16565b60008062000a5d846200082285600a0288620008f360201b620031621790919060201c565b90506005600a825b061062000a7057600a015b600a9004949350505050565b600080600a830462000a9d8587620008f360201b620031621790919060201c565b8162000aa557fe5b0490506005600a8262000a65565b826018810192821562000ae4579160200282015b8281111562000ae457825182559160200191906001019062000ac7565b50620009f492915062000b00565b61114a8062003e6c83390190565b62000b1d91905b80821115620009f4576000815560010162000b07565b90565b61333c8062000b306000396000f3fe608060405234801561001057600080fd5b506004361061025e5760003560e01c80638b03413611610146578063c588f526116100c3578063d3419bf311610087578063d3419bf3146105b4578063dbea3638146105bc578063e3235c91146105e2578063e4cfbdbd146105ea578063eef49ee314610622578063fd087ee51461062a5761025e565b8063c588f52614610559578063c6c9d82814610561578063c7a5bdc81461057e578063c8db233e14610586578063d068cdc5146105ac5761025e565b8063ab49848c1161010a578063ab49848c146104ca578063ac3791e31461050b578063b1c9fe6e14610513578063b634bfbc1461052b578063be5af9fe146105515761025e565b80638b034136146104845780638da5cb5b1461048c57806398508ecd146104945780639af1d35a146104ba5780639e3b34bf146104c25761025e565b80633dae89eb116101df57806353a47bb7116101a357806353a47bb7146103f4578063631e1444146103fc5780636392a51f14610422578063653721471461044857806379ba509714610474578063851492581461047c5761025e565b80633dae89eb1461037c5780633f6fa65514610384578063408e82af146103a05780634c33fe94146103c6578063532f1179146103ec5761025e565b806327745bae1161022657806327745bae146102ff5780632810e1d61461030757806329e77b5d1461030f5780633be99e6f1461034e5780633d7a783b146103745761025e565b806302d05d3f1461026357806304f3bcec146102875780631069143a1461028f5780631627540c146102bd5780632115e303146102e5575b600080fd5b61026b610658565b604080516001600160a01b039092168252519081900360200190f35b61026b610667565b610297610676565b604080516001600160a01b03938416815291909216602082015281519081900390910190f35b6102e3600480360360208110156102d357600080fd5b50356001600160a01b031661068c565b005b6102ed610729565b60408051918252519081900360200190f35b6102e361073c565b6102e361079e565b6103356004803603602081101561032557600080fd5b50356001600160a01b0316610bb3565b6040805192835260208301919091528051918290030190f35b6102e36004803603602081101561036457600080fd5b50356001600160a01b0316610bc8565b610335610d36565b610335610e31565b61038c610e44565b604080519115158252519081900360200190f35b610335600480360360208110156103b657600080fd5b50356001600160a01b0316610e54565b6102e3600480360360208110156103dc57600080fd5b50356001600160a01b0316610e60565b61038c610f8b565b61026b610f9b565b61038c6004803603602081101561041257600080fd5b50356001600160a01b0316610faa565b6103356004803603602081101561043857600080fd5b50356001600160a01b03166110c7565b6104506110d3565b6040518082600181111561046057fe5b60ff16815260200191505060405180910390f35b6102e36110dd565b6102ed611199565b610335611489565b61026b611494565b61049c6114a3565b60408051938452602084019290925282820152519081900360600190f35b61049c6114af565b61049c6114bb565b6104d26114c7565b604051808261030080838360005b838110156104f85781810151838201526020016104e0565b5050505090500191505060405180910390f35b61038c611511565b61051b611554565b6040518082600381111561046057fe5b6102ed6004803603604081101561054157600080fd5b5060ff8135169060200135611598565b6103356118df565b6103356118e8565b6102ed6004803603602081101561057757600080fd5b50356119b7565b6103356119d5565b6102e36004803603602081101561059c57600080fd5b50356001600160a01b03166119e0565b610335611a8e565b610335611b53565b6102e3600480360360408110156105d257600080fd5b5060ff8135169060200135611b5c565b6102ed611d45565b6102ed6004803603608081101561060057600080fd5b5060ff8135811691602081013590911690604081013590606001351515611d4a565b6102ed611f4b565b6103356004803603606081101561064057600080fd5b5060ff81351690602081013590604001351515611f51565b6015546001600160a01b031681565b6002546001600160a01b031681565b6005546006546001600160a01b03918216911682565b6000546001600160a01b031633146106d55760405162461bcd60e51b815260040180806020018281038252602f81526020018061327c602f913960400191505060405180910390fd5b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b6000610736601454612042565b90505b90565b61074461206f565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561077c57600080fd5b505afa158015610790573d6000803e3d6000fd5b5050505061079c6120b6565b565b6000546001600160a01b031633146107e75760405162461bcd60e51b815260040180806020018281038252602f81526020018061327c602f913960400191505060405180910390fd5b6107ef61215e565b610831576040805162461bcd60e51b815260206004820152600e60248201526d4e6f7420796574206d617475726560901b604482015290519081900360640190fd5b61083961206f565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561087157600080fd5b505afa158015610885573d6000803e3d6000fd5b505050506108916120b6565b601554600160a01b900460ff16156108f0576040805162461bcd60e51b815260206004820152601760248201527f4d61726b657420616c7265616479207265736f6c766564000000000000000000604482015290519081900360640190fd5b6000806108fb612166565b91509150610908816121f4565b61094a576040805162461bcd60e51b815260206004820152600e60248201526d5072696365206973207374616c6560901b604482015290519081900360640190fd5b600e8290556015805460ff60a01b1916600160a01b179055600061096c612284565b601454600f549192509060009061098a90839063ffffffff6122c516565b6010549091506000906109a490849063ffffffff6122c516565b90506109be6109b9828463ffffffff6122e116565b61233b565b50836001600160a01b031663a9059cbb6109d66123c2565b6001600160a01b031663eb1edd616040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0e57600080fd5b505afa158015610a22573d6000803e3d6000fd5b505050506040513d6020811015610a3857600080fd5b5051604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152602482018690525160448083019260209291908290030181600087803b158015610a8857600080fd5b505af1158015610a9c573d6000803e3d6000fd5b505050506040513d6020811015610ab257600080fd5b50506015546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810184905290519186169163a9059cbb916044808201926020929091908290030181600087803b158015610b0a57600080fd5b505af1158015610b1e573d6000803e3d6000fd5b505050506040513d6020811015610b3457600080fd5b507f5528b7e06f48a519cf814c4e5293ee2737c3f5c28d93e30cca112ac649fdd2359050610b606123ff565b8787601454868660405180876001811115610b7757fe5b60ff1681526020810196909652506040808601949094526060850192909252608084015260a0830152519081900360c0019150a1505050505050565b600080610bbf83612444565b91509150915091565b6000546001600160a01b03163314610c115760405162461bcd60e51b815260040180806020018281038252602f81526020018061327c602f913960400191505060405180910390fd5b600280546001600160a01b0319166001600160a01b03831617905560005b600454811015610d3257600060048281548110610c4857fe5b600091825260209182902001546002546040805163dacb2d0160e01b81526004810184905260248101829052601760448201527f5265736f6c766572206d697373696e6720746172676574000000000000000000606482015290519294506001600160a01b039091169263dacb2d0192608480840193829003018186803b158015610cd257600080fd5b505afa158015610ce6573d6000803e3d6000fd5b505050506040513d6020811015610cfc57600080fd5b505160009182526003602052604090912080546001600160a01b0319166001600160a01b03909216919091179055600101610c2f565b5050565b600080600560000160009054906101000a90046001600160a01b03166001600160a01b031663d6ff02e26040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8a57600080fd5b505afa158015610d9e573d6000803e3d6000fd5b505050506040513d6020811015610db457600080fd5b505160065460408051636b7f817160e11b815290516001600160a01b039092169163d6ff02e291600480820192602092909190829003018186803b158015610dfb57600080fd5b505afa158015610e0f573d6000803e3d6000fd5b505050506040513d6020811015610e2557600080fd5b505190925090505b9091565b600080610e3c612542565b915091509091565b601554600160a01b900460ff1681565b600080610bbf8361280a565b6000546001600160a01b03163314610ea95760405162461bcd60e51b815260040180806020018281038252602f81526020018061327c602f913960400191505060405180910390fd5b610eb16128d2565b15610ef6576040805162461bcd60e51b815260206004820152601060248201526f42696464696e6720696e61637469766560801b604482015290519081900360640190fd5b600080610f016128da565b60155491935091506000908190610f20906001600160a01b0316612444565b9150915060008285148015610f3457508184145b905080610f7a576040805162461bcd60e51b815260206004820152600f60248201526e4e6f742063616e63656c6c61626c6560881b604482015290519081900360640190fd5b610f838661299f565b505050505050565b601554600160a81b900460ff1681565b6001546001600160a01b031681565b6002546000906001600160a01b03838116911614610fca575060006110c2565b60005b6004548110156110bc57600060048281548110610fe657fe5b6000918252602080832090910154808352600382526040928390205460025484516321f8a72160e01b81526004810184905294519295506001600160a01b03918216949116926321f8a72192602480840193829003018186803b15801561104c57600080fd5b505afa158015611060573d6000803e3d6000fd5b505050506040513d602081101561107657600080fd5b50516001600160a01b03161415806110a357506000818152600360205260409020546001600160a01b0316155b156110b3576000925050506110c2565b50600101610fcd565b50600190505b919050565b600080610bbf83612ba2565b60006107366123ff565b6001546001600160a01b031633146111265760405162461bcd60e51b81526004018080602001828103825260358152602001806132476035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b601554600090600160a01b900460ff16611225576111b5612c6a565b6001600160a01b0316637859f410306040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561120c57600080fd5b505af1158015611220573d6000803e3d6000fd5b505050505b6000806112313361280a565b9150915081600014158061124457508015155b1561125457611251612542565b50505b60008061126033612ba2565b9150915081600014158061127357508015155b6112ba576040805162461bcd60e51b81526020600482015260136024820152724e6f7468696e6720746f20657865726369736560681b604482015290519081900360640190fd5b81156113255760055460408051630d8acc1560e11b815233600482015290516001600160a01b0390921691631b15982a9160248082019260009290919082900301818387803b15801561130c57600080fd5b505af1158015611320573d6000803e3d6000fd5b505050505b80156113905760065460408051630d8acc1560e11b815233600482015290516001600160a01b0390921691631b15982a9160248082019260009290919082900301818387803b15801561137757600080fd5b505af115801561138b573d6000803e3d6000fd5b505050505b60006113a461139d6123ff565b8484612c79565b60408051828152905191925033917fd82b6f69d7477fb41cd83d936de94990cee2fa1a309feeee90101fc0513b6a439181900360200190a28015611480576113eb8161233b565b506113f4612284565b6001600160a01b031663a9059cbb33836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561145357600080fd5b505af1158015611467573d6000803e3d6000fd5b505050506040513d602081101561147d57600080fd5b50505b94505050505090565b600080610e3c6128da565b6000546001600160a01b031681565b600c54600d54600e5483565b600f5460105460115483565b600954600a54600b5483565b6114cf613225565b60005b60045481101561150d57600481815481106114e957fe5b906000526020600020015482826018811061150057fe5b60200201526001016114d2565b5090565b60008061151c612166565b601554909250600160a01b900460ff16159050801561153e575061153e61215e565b801561154e575061154e816121f4565b91505090565b600061155e6128d2565b61156a57506000610739565b61157261215e565b61157e57506001610739565b611586612c9c565b61159257506002610739565b50600390565b60006115a26128d2565b156115e7576040805162461bcd60e51b815260206004820152601060248201526f42696464696e6720696e61637469766560801b604482015290519081900360640190fd5b601554600160a81b900460ff16611638576040805162461bcd60e51b815260206004820152601060248201526f1499599d5b991cc8191a5cd8589b195960821b604482015290519081900360640190fd5b81611645575060006118d9565b6015546001600160a01b031633141561169b5760008061166433612444565b9092509050600185600181111561167757fe5b141561167f57905b611698611692838663ffffffff612cc616565b82612d23565b50505b611730611723600f6002015473__$60f5066a95a61bfd95691e5518aae05f18$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156116eb57600080fd5b505af41580156116ff573d6000803e3d6000fd5b505050506040513d602081101561171557600080fd5b50519063ffffffff612cc616565b839063ffffffff6122c516565b905061173b83612e02565b6001600160a01b031663410085df33846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561179a57600080fd5b505af11580156117ae573d6000803e3d6000fd5b503392507f9bd0a8ca6625e01a9cee5e86eec7813a8234b41f1ca0c9f15a008d1e1d00ee5f9150859050836117e9868263ffffffff612cc616565b604051808460018111156117f957fe5b60ff168152602001838152602001828152602001935050505060405180910390a260006118258261233b565b905061182f612284565b6001600160a01b031663a9059cbb33846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561188e57600080fd5b505af11580156118a2573d6000803e3d6000fd5b505050506040513d60208110156118b857600080fd5b5060009050806118c66128da565b915091506118d5828285612e3a565b5050505b92915050565b60125460135482565b6015546000908190600160a01b900460ff16158061191d57503361191261190d6123ff565b612e02565b6001600160a01b0316145b156119305761192d601454612042565b90505b6005546001600160a01b031633141561194d576007549150610e2d565b6006546001600160a01b031633141561196a576008549150610e2d565b6040805162461bcd60e51b815260206004820152601760248201527f53656e646572206973206e6f7420616e206f7074696f6e000000000000000000604482015290519081900360640190fd5b600481815481106119c457fe5b600091825260209091200154905081565b600080610e3c612166565b6000546001600160a01b03163314611a295760405162461bcd60e51b815260040180806020018281038252602f81526020018061327c602f913960400191505060405180910390fd5b611a31612c9c565b611a82576040805162461bcd60e51b815260206004820152601b60248201527f556e65787069726564206f7074696f6e732072656d61696e696e670000000000604482015290519081900360640190fd5b611a8b8161299f565b50565b600080600560000160009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015611ae257600080fd5b505afa158015611af6573d6000803e3d6000fd5b505050506040513d6020811015611b0c57600080fd5b5051600654604080516318160ddd60e01b815290516001600160a01b03909216916318160ddd91600480820192602092909190829003018186803b158015610dfb57600080fd5b60075460085482565b611b646128d2565b15611ba9576040805162461bcd60e51b815260206004820152601060248201526f42696464696e6720696e61637469766560801b604482015290519081900360640190fd5b80611bb357610d32565b611bbc82612e02565b6001600160a01b03166359d667a533836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015611c1b57600080fd5b505af1158015611c2f573d6000803e3d6000fd5b50505050336001600160a01b03167f70bd4a33bf447720d717d08f3affb5aecfe4d2ebb8e3dd94539f5313e2447643838360405180836001811115611c7057fe5b60ff1681526020018281526020019250505060405180910390a26000611c9582612ea9565b9050611c9f612284565b604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b0392909216916323b872dd916064808201926020929091908290030181600087803b158015611cf757600080fd5b505af1158015611d0b573d6000803e3d6000fd5b505050506040513d6020811015611d2157600080fd5b506000905080611d2f6128da565b91509150611d3e828285612e3a565b5050505050565b601881565b600080611d62601654856122c590919063ffffffff16565b90506000611d6f86612e02565b6001600160a01b0316638b0341366040518163ffffffff1660e01b815260040160206040518083038186803b158015611da757600080fd5b505afa158015611dbb573d6000803e3d6000fd5b505050506040513d6020811015611dd157600080fd5b505160145460408051630241ebdb60e61b81529051929350909160009173__$60f5066a95a61bfd95691e5518aae05f18$__9163907af6c091600480820192602092909190829003018186803b158015611e2a57600080fd5b505af4158015611e3e573d6000803e3d6000fd5b505050506040513d6020811015611e5457600080fd5b5051601154909150600090611e7090839063ffffffff612cc616565b9050886001811115611e7e57fe5b8a6001811115611e8a57fe5b1415611ef4576000611ea2848763ffffffff6122c516565b90508715611ebe5793611ebb868363ffffffff6122c516565b95505b611ee7611ed1848863ffffffff612cc616565b611edb8388612f13565b9063ffffffff612f3a16565b9650505050505050611f43565b6000611f06858763ffffffff612f3a16565b90508715611f1057925b6000611f1c8286612f13565b905088611f295780611f39565b611f39818463ffffffff612f3a16565b9750505050505050505b949350505050565b60145481565b600080600080611f5f6128da565b9150915061324485611f73576122e1611f77565b612cc65b90506000886001811115611f8757fe5b1415611fa257611f9b83888363ffffffff16565b9250611fb3565b611fb082888363ffffffff16565b91505b851561201957612016612009600f6002015473__$60f5066a95a61bfd95691e5518aae05f18$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156116eb57600080fd5b889063ffffffff6122c516565b96505b612033838361202e6014548b8663ffffffff16565b612f4f565b94509450505050935093915050565b601554600090600160a01b900460ff1661150d5760165461206a90839063ffffffff6122c516565b6118d9565b60006107366b53797374656d53746174757360a01b604051806040016040528060148152602001734d697373696e672053797374656d53746174757360601b815250612fe2565b6120be612c6a565b6001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b1580156120f657600080fd5b505afa15801561210a573d6000803e3d6000fd5b505050506040513d602081101561212057600080fd5b50511561079c5760405162461bcd60e51b815260040180806020018281038252603c8152602001806132cc603c913960400191505060405180910390fd5b600a54421190565b60008061217161308c565b6001600160a01b0316634308a94f600c600001546040518263ffffffff1660e01b815260040180828152602001915050604080518083038186803b1580156121b857600080fd5b505afa1580156121cc573d6000803e3d6000fd5b505050506040513d60408110156121e257600080fd5b50805160209091015190925090509091565b6000806121ff612c6a565b6001600160a01b0316634a41d89d6040518163ffffffff1660e01b815260040160606040518083038186803b15801561223757600080fd5b505afa15801561224b573d6000803e3d6000fd5b505050506040513d606081101561226157600080fd5b5051600a54909150839061227b908363ffffffff612cc616565b11159392505050565b60006107366814de5b9d1a1cd554d160ba1b60405180604001604052806011815260200170135a5cdcda5b99c814de5b9d1a1cd554d1607a1b815250612fe2565b60006122da8383670de0b6b3a76400006130d5565b9392505050565b6000828201838110156122da576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b601454600090612351908363ffffffff612cc616565b60148190559050612360612c6a565b6001600160a01b0316636b3a0984836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156123a557600080fd5b505af11580156123b9573d6000803e3d6000fd5b50505050919050565b600061073666119959541bdbdb60ca1b6040518060400160405280600f81526020016e135a5cdcda5b99c8119959541bdbdb608a1b815250612fe2565b6015546000908190600160a01b900460ff161561241f5750600e5461242b565b612427612166565b5090505b600d5481101561243c57600161154e565b600091505090565b600554604080516308dc30b760e41b81526001600160a01b038481166004830152915160009384931691638dc30b70916024808301926020929190829003018186803b15801561249357600080fd5b505afa1580156124a7573d6000803e3d6000fd5b505050506040513d60208110156124bd57600080fd5b5051600654604080516308dc30b760e41b81526001600160a01b03878116600483015291519190921691638dc30b70916024808301926020929190829003018186803b15801561250c57600080fd5b505afa158015612520573d6000803e3d6000fd5b505050506040513d602081101561253657600080fd5b50519092509050915091565b60008061254d61206f565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b15801561258557600080fd5b505afa158015612599573d6000803e3d6000fd5b505050506125a56120b6565b6125ad6128d2565b6125f3576040805162461bcd60e51b815260206004820152601260248201527142696464696e6720696e636f6d706c65746560701b604482015290519081900360640190fd5b6000612600601454612042565b9050600061260c6123ff565b601554909150600160a01b900460ff166000808215806126375750600084600181111561263557fe5b145b156126c95760055460075460408051632bc43fd960e01b8152336004820152602481019290925260448201889052516001600160a01b0390921691632bc43fd9916064808201926020929091908290030181600087803b15801561269a57600080fd5b505af11580156126ae573d6000803e3d6000fd5b505050506040513d60208110156126c457600080fd5b505191505b8215806126e1575060018460018111156126df57fe5b145b156127735760065460085460408051632bc43fd960e01b8152336004820152602481019290925260448201889052516001600160a01b0390921691632bc43fd9916064808201926020929091908290030181600087803b15801561274457600080fd5b505af1158015612758573d6000803e3d6000fd5b505050506040513d602081101561276e57600080fd5b505190505b8115158061278057508015155b6127c4576040805162461bcd60e51b815260206004820152601060248201526f4e6f7468696e6720746f20636c61696d60801b604482015290519081900360640190fd5b6040805183815260208101839052815133927fbbe753caa9bb201dbd1740ee3d61c6d2adf5fa89f30233d732281ae5db6a03d4928290030190a290955093505050509091565b6005546040805163270fb89160e21b81526001600160a01b038481166004830152915160009384931691639c3ee244916024808301926020929190829003018186803b15801561285957600080fd5b505afa15801561286d573d6000803e3d6000fd5b505050506040513d602081101561288357600080fd5b50516006546040805163270fb89160e21b81526001600160a01b03878116600483015291519190921691639c3ee244916024808301926020929190829003018186803b15801561250c57600080fd5b600954421190565b600080600560000160009054906101000a90046001600160a01b03166001600160a01b0316638b0341366040518163ffffffff1660e01b815260040160206040518083038186803b15801561292e57600080fd5b505afa158015612942573d6000803e3d6000fd5b505050506040513d602081101561295857600080fd5b505160065460408051634581a09b60e11b815290516001600160a01b0390921691638b03413691600480820192602092909190829003018186803b158015610dfb57600080fd5b60145480156129b3576129b18161233b565b505b60006129bd612284565b604080516370a0823160e01b815230600482015290519192506000916001600160a01b038416916370a08231916024808301926020929190829003018186803b158015612a0957600080fd5b505afa158015612a1d573d6000803e3d6000fd5b505050506040513d6020811015612a3357600080fd5b505190508015612aca57816001600160a01b031663a9059cbb85836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015612a9d57600080fd5b505af1158015612ab1573d6000803e3d6000fd5b505050506040513d6020811015612ac757600080fd5b50505b6005546040805163646d919f60e11b81526001600160a01b0387811660048301529151919092169163c8db233e91602480830192600092919082900301818387803b158015612b1857600080fd5b505af1158015612b2c573d6000803e3d6000fd5b50506006546040805163646d919f60e11b81526001600160a01b038981166004830152915191909216935063c8db233e9250602480830192600092919082900301818387803b158015612b7e57600080fd5b505af1158015612b92573d6000803e3d6000fd5b50505050836001600160a01b0316ff5b600554604080516370a0823160e01b81526001600160a01b0384811660048301529151600093849316916370a08231916024808301926020929190829003018186803b158015612bf157600080fd5b505afa158015612c05573d6000803e3d6000fd5b505050506040513d6020811015612c1b57600080fd5b5051600654604080516370a0823160e01b81526001600160a01b038781166004830152915191909216916370a08231916024808301926020929190829003018186803b15801561250c57600080fd5b6000546001600160a01b031690565b600080846001811115612c8857fe5b1415612c955750816122da565b5092915050565b601554600090600160a01b900460ff1680156107365750600b544211806107365750506014541590565b600082821115612d1d576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000612d35838363ffffffff6122e116565b9050806012600001541115612d88576040805162461bcd60e51b8152602060048201526014602482015273125b9cdd59999a58da595b9d0818d85c1a5d185b60621b604482015290519081900360640190fd5b601354612d9b848363ffffffff61311216565b8111158015612db95750612db5838363ffffffff61311216565b8111155b612dfc576040805162461bcd60e51b815260206004820152600f60248201526e109a591cc81d1bdbc81cdad95dd959608a1b604482015290519081900360640190fd5b50505050565b600080826001811115612e1157fe5b1415612e2957506005546001600160a01b03166110c2565b50506006546001600160a01b031690565b600080612e48858585612f4f565b604080518082018252838152602090810183905260078490556008839055815184815290810183905281519395509193507f6546f60f34df611fa42503098acc39d5ab88bc73febe64b3cc14e5a92e3a66a792918290030190a15050505050565b601454600090612ebf908363ffffffff6122e116565b60148190559050612ece612c6a565b6001600160a01b031663aeab5849836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156123a557600080fd5b6000818310612f3157612f2c838363ffffffff612cc616565b6122da565b50600092915050565b60006122da8383670de0b6b3a764000061313c565b6000808415801590612f6057508315155b612fa8576040805162461bcd60e51b815260206004820152601460248201527342696473206d757374206265206e6f6e7a65726f60601b604482015290519081900360640190fd5b6000612fb384612042565b9050612fc5868263ffffffff612f3a16565b612fd5868363ffffffff612f3a16565b9250925050935093915050565b6000828152600360205260408120546001600160a01b031682816130845760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613049578181015183820152602001613031565b50505050905090810190601f1680156130765780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509392505050565b60006107366c45786368616e6765526174657360981b604051806040016040528060158152602001744d697373696e672045786368616e6765526174657360581b815250612fe2565b600080600a83046130ec868663ffffffff61316216565b816130f357fe5b0490506005600a825b061061310657600a015b600a9004949350505050565b60006122da8261313085670de0b6b3a764000063ffffffff61316216565b9063ffffffff6131bb16565b6000806131568461313087600a870263ffffffff61316216565b90506005600a826130fc565b600082613171575060006118d9565b8282028284828161317e57fe5b04146122da5760405162461bcd60e51b81526004018080602001828103825260218152602001806132ab6021913960400191505060405180910390fd5b6000808211613211576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b600082848161321c57fe5b04949350505050565b6040518061030001604052806018906020820280388339509192915050565bfefe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775468697320616374696f6e2063616e6e6f7420626520706572666f726d6564207768696c652074686520636f6e747261637420697320706175736564a265627a7a72315820fbb555aba9bf878b051947cc26f4db8772217926fd752e17307e648478dae68064736f6c63430005100032608060405234801561001057600080fd5b5060405161114a38038061114a8339818101604052604081101561003357600080fd5b508051602091820151600080546001600160a01b031916331781556001600160a01b0390921682526001909252604090208190556002556110d1806100796000396000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad5780639c3ee244116100715780639c3ee24414610383578063a9059cbb146103a9578063c8db233e146103d5578063d6ff02e2146103fb578063dd62ed3e1461040357610121565b806370a082311461030357806380f55605146103295780638b0341361461034d5780638dc30b701461035557806395d89b411461037b57610121565b806323b872dd116100f457806323b872dd146102255780632bc43fd91461025b578063313ce5671461028d578063410085df146102ab57806359d667a5146102d757610121565b806306fdde0314610126578063095ea7b3146101a357806318160ddd146101e35780631b15982a146101fd575b600080fd5b61012e610431565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101cf600480360360408110156101b957600080fd5b506001600160a01b03813516906020013561045e565b604080519115158252519081900360200190f35b6101eb6104db565b60408051918252519081900360200190f35b6102236004803603602081101561021357600080fd5b50356001600160a01b03166104e1565b005b6101cf6004803603606081101561023b57600080fd5b506001600160a01b0381358116916020810135909116906040013561060e565b6101eb6004803603606081101561027157600080fd5b506001600160a01b0381351690602081013590604001356106ca565b610295610861565b6040805160ff9092168252519081900360200190f35b610223600480360360408110156102c157600080fd5b506001600160a01b038135169060200135610866565b610223600480360360408110156102ed57600080fd5b506001600160a01b038135169060200135610920565b6101eb6004803603602081101561031957600080fd5b50356001600160a01b03166109ce565b6103316109e0565b604080516001600160a01b039092168252519081900360200190f35b6101eb6109ef565b6101eb6004803603602081101561036b57600080fd5b50356001600160a01b03166109f5565b61012e610a07565b6101eb6004803603602081101561039957600080fd5b50356001600160a01b0316610a27565b6101cf600480360360408110156103bf57600080fd5b506001600160a01b038135169060200135610ad4565b610223600480360360208110156103eb57600080fd5b50356001600160a01b0316610ae1565b6101eb610b42565b6101eb6004803603604081101561041957600080fd5b506001600160a01b0381358116916020013516610bc3565b6040518060400160405280601181526020017029a72c102134b730b93c9027b83a34b7b760791b81525081565b60006001600160a01b03831661047357600080fd5b3360008181526005602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60045481565b6000546001600160a01b03163314610536576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b6001600160a01b0381166000908152600360205260409020548061055a575061060b565b6001600160a01b038216600090815260036020526040812055600454610586908263ffffffff610be016565b6004556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a36040805182815290516001600160a01b038416917f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df7919081900360200190a2505b50565b6001600160a01b038316600090815260056020908152604080832033845290915281205480831115610680576040805162461bcd60e51b8152602060048201526016602482015275496e73756666696369656e7420616c6c6f77616e636560501b604482015290519081900360640190fd5b610690818463ffffffff610be016565b6001600160a01b03861660009081526005602090815260408083203384529091529020556106bf858585610c3d565b9150505b9392505050565b600080546001600160a01b03163314610720576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b6001600160a01b03841660009081526001602052604081205490610745828686610e14565b905080610757576000925050506106c3565b60025461076a908363ffffffff610be016565b6002556001600160a01b038616600090815260016020526040812055600454610799908263ffffffff610eb016565b6004556001600160a01b0386166000908152600360205260409020546107c5908263ffffffff610eb016565b6001600160a01b03871660008181526003602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a36040805182815290516001600160a01b038816917fa59f12e354e8cd10bb74c559844c2dd69a5458e31fe56c7594c62ca57480509a919081900360200190a295945050505050565b601281565b6000546001600160a01b031633146108bb576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b6001600160a01b0382166000908152600160205260409020546108ed906108e8908363ffffffff610be016565b610f0a565b6001600160a01b038316600090815260016020526040902055600254610919908263ffffffff610be016565b6002555050565b6000546001600160a01b03163314610975576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b6001600160a01b0382166000908152600160205260409020546109a2906108e8908363ffffffff610eb016565b6001600160a01b038316600090815260016020526040902055600254610919908263ffffffff610eb016565b60036020526000908152604090205481565b6000546001600160a01b031681565b60025481565b60016020526000908152604090205481565b604051806040016040528060048152602001631cd3d41560e21b81525081565b60008054604080516362c47a9360e11b81528151849384936001600160a01b039091169263c588f5269260048083019392829003018186803b158015610a6c57600080fd5b505afa158015610a80573d6000803e3d6000fd5b505050506040513d6040811015610a9657600080fd5b5080516020918201516001600160a01b03871660009081526001909352604090922054909350909150610aca908383610e14565b925050505b919050565b60006106c3338484610c3d565b6000546001600160a01b03163314610b36576040805162461bcd60e51b815260206004820152601360248201527213db9b1e481b585c9ad95d08185b1b1bddd959606a1b604482015290519081900360640190fd5b806001600160a01b0316ff5b60008054604080516362c47a9360e11b8152815184936001600160a01b03169263c588f5269260048082019391829003018186803b158015610b8357600080fd5b505afa158015610b97573d6000803e3d6000fd5b505050506040513d6040811015610bad57600080fd5b50602001519050610bbd81610f67565b91505090565b600560209081526000928352604080842090915290825290205481565b600082821115610c37576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008060009054906101000a90046001600160a01b03166001600160a01b03166327745bae6040518163ffffffff1660e01b815260040160006040518083038186803b158015610c8c57600080fd5b505afa158015610ca0573d6000803e3d6000fd5b505050506001600160a01b03831615801590610cc557506001600160a01b0383163014155b610d08576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b6001600160a01b03841660009081526003602052604090205480831115610d6d576040805162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b604482015290519081900360640190fd5b610d7d818463ffffffff610be016565b6001600160a01b038087166000908152600360205260408082209390935590861681522054610db2908463ffffffff610eb016565b6001600160a01b0380861660008181526003602090815260409182902094909455805187815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3506001949350505050565b600080610e27858563ffffffff610f8e16565b90506000610e3484610f67565b905060025486148015610e4657508515155b80610e4f575080155b15610e5d5791506106c39050565b80821115610ea7576040805162461bcd60e51b8152602060048201526012602482015271737570706c79203c20636c61696d61626c6560701b604482015290519081900360640190fd5b50949350505050565b6000828201838110156106c3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000662386f26fc1000082101580610f20575081155b610f63576040805162461bcd60e51b815260206004820152600f60248201526e42616c616e6365203c2024302e303160881b604482015290519081900360640190fd5b5090565b600454600090808311610f7e576000915050610acf565b6106c3838263ffffffff610be016565b60006106c382610fac85670de0b6b3a764000063ffffffff610fb816565b9063ffffffff61101116565b600082610fc7575060006104d5565b82820282848281610fd457fe5b04146106c35760405162461bcd60e51b815260040180806020018281038252602181526020018061107c6021913960400191505060405180910390fd5b6000808211611067576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b600082848161107257fe5b0494935050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a7231582002c2b776e7cc82f53b88b40e8dc9d3de25365d70832fbf7cb0cf2c2b0f12cb8064736f6c63430005100032536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7770bd4a33bf447720d717d08f3affb5aecfe4d2ebb8e3dd94539f5313e2447643596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704d697373696e672042696e6172794f7074696f6e4d61726b65744d616e6167657220616464726573734f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6ea265627a7a72315820cf5724fd0da0df74cceb0e74e91139c850674d7d2e5c554880d05474661f407164736f6c63430005100032", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "address", - "name": "_resolver", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor", - "signature": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event", - "signature": "0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event", - "signature": "0x906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newBeneficiary", - "type": "address" - } - ], - "name": "SelfDestructBeneficiaryUpdated", - "type": "event", - "signature": "0xd5da63a0b864b315bc04128dedbc93888c8529ee6cf47ce664dc204339228c53" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "selfDestructDelay", - "type": "uint256" - } - ], - "name": "SelfDestructInitiated", - "type": "event", - "signature": "0xcbd94ca75b8dc45c9d80c77e851670e78843c0d75180cb81db3e2158228fa9a6" - }, - { - "anonymous": false, - "inputs": [], - "name": "SelfDestructTerminated", - "type": "event", - "signature": "0x6adcc7125002935e0aa31697538ebbd65cfddf20431eb6ecdcfc3e238bfd082c" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "beneficiary", - "type": "address" - } - ], - "name": "SelfDestructed", - "type": "event", - "signature": "0x8a09e1677ced846cb537dc2b172043bd05a1a81ad7e0033a7ef8ba762df990b7" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_ADDRESSES_FROM_RESOLVER", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xe3235c91" - }, - { - "constant": true, - "inputs": [], - "name": "SELFDESTRUCT_DELAY", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xa461fc82" - }, - { - "constant": false, - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x79ba5097" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "creatorLimits", - "type": "uint256[2]" - }, - { - "internalType": "bytes32", - "name": "oracleKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "strikePrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "refundsEnabled", - "type": "bool" - }, - { - "internalType": "uint256[3]", - "name": "times", - "type": "uint256[3]" - }, - { - "internalType": "uint256[2]", - "name": "bids", - "type": "uint256[2]" - }, - { - "internalType": "uint256[3]", - "name": "fees", - "type": "uint256[3]" - } - ], - "name": "createMarket", - "outputs": [ - { - "internalType": "contract BinaryOptionMarket", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x130efa50" - }, - { - "constant": true, - "inputs": [], - "name": "getResolverAddressesRequired", - "outputs": [ - { - "internalType": "bytes32[24]", - "name": "addressesRequired", - "type": "bytes32[24]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xab49848c" - }, - { - "constant": false, - "inputs": [], - "name": "initiateSelfDestruct", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xbd32aa44" - }, - { - "constant": true, - "inputs": [], - "name": "initiationTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x17c70de4" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "contract AddressResolver", - "name": "_resolver", - "type": "address" - } - ], - "name": "isResolverCached", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x631e1444" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x1627540c" - }, - { - "constant": true, - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x53a47bb7" - }, - { - "constant": true, - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x8da5cb5b" - }, - { - "constant": true, - "inputs": [], - "name": "resolver", - "outputs": [ - { - "internalType": "contract AddressResolver", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x04f3bcec" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "resolverAddressesRequired", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xc6c9d828" - }, - { - "constant": false, - "inputs": [], - "name": "selfDestruct", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x9cb8a26a" - }, - { - "constant": true, - "inputs": [], - "name": "selfDestructBeneficiary", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xc58aaae6" - }, - { - "constant": true, - "inputs": [], - "name": "selfDestructInitiated", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xb8225dec" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "contract AddressResolver", - "name": "_resolver", - "type": "address" - } - ], - "name": "setResolverAndSyncCache", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x3be99e6f" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address payable", - "name": "_beneficiary", - "type": "address" - } - ], - "name": "setSelfDestructBeneficiary", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x20714f88" - }, - { - "constant": false, - "inputs": [], - "name": "terminateSelfDestruct", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x3278c960" - } - ] - }, - "BinaryOptionMarketManager": { - "bytecode": "6011805460ff191660011790556101006040526b53797374656d53746174757360a01b60809081526814de5b9d1a1cd554d160ba1b60a0526c45786368616e6765526174657360981b60c0527f42696e6172794f7074696f6e4d61726b6574466163746f72790000000000000060e0526200007f90601890600462000c53565b503480156200008d57600080fd5b5060405162004350380380620043508339818101604052610140811015620000b457600080fd5b50805160208201516040808401516060850151608086015160a087015160c088015160e08901516101008a0151610120909a01518751610300810198899052999a989996989597949693959294919390918a9190601890819081845b8154815260200190600101908083116200011057508f93505050506001600160a01b03811662000187576040805162461bcd60e51b815260206004820152601960248201527f4f776e657220616464726573732063616e6e6f74206265203000000000000000604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b038316908117825560408051928352602083019190915280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a1506000546001600160a01b031662000232576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b6000546001600160a01b031662000284576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b60005460058054610100600160a81b0319166101006001600160a01b0390931692830217905560408051918252517fd5da63a0b864b315bc04128dedbc93888c8529ee6cf47ce664dc204339228c53916020908290030190a16000546001600160a01b03166200032f576040805162461bcd60e51b815260206004820152601160248201527013dddb995c881b5d5cdd081899481cd95d607a1b604482015290519081900360640190fd5b60005b6018811015620003975760008282601881106200034b57fe5b602002015114620003885760088282601881106200036557fe5b60209081029190910151825460018101845560009384529190922001556200038e565b62000397565b60010162000332565b5050600680546001600160a01b039092166001600160a01b03199283161790556000805490911633179055620003d6876001600160e01b036200049316565b620003ea886001600160e01b036200051916565b620003fe866001600160e01b036200059f16565b62000412856001600160e01b036200062516565b62000426846001600160e01b03620006ab16565b6200043a836001600160e01b03620007e416565b6200044e826001600160e01b036200097f16565b62000462816001600160e01b0362000b1a16565b5050600080546001600160a01b0319166001600160a01b0399909916989098179097555062000cb695505050505050565b6000546001600160a01b03163314620004de5760405162461bcd60e51b815260040180806020018281038252602f815260200180620042f9602f913960400191505060405180910390fd5b600d8190556040805182815290517ff378a0fd4ad3ffd9d7d50986f16b04acd2dc42691c4f412f34e8eefe883e66529181900360200190a150565b6000546001600160a01b03163314620005645760405162461bcd60e51b815260040180806020018281038252602f815260200180620042f9602f913960400191505060405180910390fd5b600c8190556040805182815290517f5a2f2eae84f9e787d8159d363a776fa2b61d084686190cdc5a2c1ea833480b099181900360200190a150565b6000546001600160a01b03163314620005ea5760405162461bcd60e51b815260040180806020018281038252602f815260200180620042f9602f913960400191505060405180910390fd5b600e8190556040805182815290517f6de18e808fc4e6cb9c8910cf4bdc188ddbbdab65faecff65dab871720e8484899181900360200190a150565b6000546001600160a01b03163314620006705760405162461bcd60e51b815260040180806020018281038252602f815260200180620042f9602f913960400191505060405180910390fd5b600f8190556040805182815290517fdf7a26ae2e2eb953b81fd76b72fcdc74ebff7c21faa8f8f55323183d9785f52d9181900360200190a150565b6000546001600160a01b03163314620006f65760405162461bcd60e51b815260040180806020018281038252602f815260200180620042f9602f913960400191505060405180910390fd5b73__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200073b57600080fd5b505af415801562000750573d6000803e3d6000fd5b505050506040513d60208110156200076757600080fd5b5051811115620007a95760405162461bcd60e51b815260040180806020018281038252602d815260200180620042ab602d913960400191505060405180910390fd5b60108190556040805182815290517fd39cfbe31b20dbb6d995a675cf5c369555bf8bb908b6efc03873907fe9e133cf9181900360200190a150565b6000546001600160a01b031633146200082f5760405162461bcd60e51b815260040180806020018281038252602f815260200180620042f9602f913960400191505060405180910390fd5b60006009600101548201905073__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b1580156200088057600080fd5b505af415801562000895573d6000803e3d6000fd5b505050506040513d6020811015620008ac57600080fd5b50518110620008ed5760405162461bcd60e51b8152600401808060200182810382526021815260200180620042d86021913960400191505060405180910390fd5b8060001062000943576040805162461bcd60e51b815260206004820152601a60248201527f546f74616c20666565206d757374206265206e6f6e7a65726f2e000000000000604482015290519081900360640190fd5b60098290556040805183815290517f7b30e8f8e3de254785fbcb3068449dc18060f1fdb37b02731ecada99a78492c39181900360200190a15050565b6000546001600160a01b03163314620009ca5760405162461bcd60e51b815260040180806020018281038252602f815260200180620042f9602f913960400191505060405180910390fd5b60006009600001548201905073__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b15801562000a1b57600080fd5b505af415801562000a30573d6000803e3d6000fd5b505050506040513d602081101562000a4757600080fd5b5051811062000a885760405162461bcd60e51b8152600401808060200182810382526021815260200180620042d86021913960400191505060405180910390fd5b8060001062000ade576040805162461bcd60e51b815260206004820152601a60248201527f546f74616c20666565206d757374206265206e6f6e7a65726f2e000000000000604482015290519081900360640190fd5b600a8290556040805183815290517f8c14462add32e0ae0fbfcf9e60711ecae573da337dc9127fff98fb7cfb3973b49181900360200190a15050565b6000546001600160a01b0316331462000b655760405162461bcd60e51b815260040180806020018281038252602f815260200180620042f9602f913960400191505060405180910390fd5b73__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b15801562000baa57600080fd5b505af415801562000bbf573d6000803e3d6000fd5b505050506040513d602081101562000bd657600080fd5b505181111562000c185760405162461bcd60e51b8152600401808060200182810382526028815260200180620043286028913960400191505060405180910390fd5b600b8190556040805182815290517f01634ac4e9f09be1ef87b8d09e14926870261dcb9a0929d2d6460af6e4c5ad1e9181900360200190a150565b826018810192821562000c84579160200282015b8281111562000c8457825182559160200191906001019062000c67565b5062000c9292915062000c96565b5090565b62000cb391905b8082111562000c92576000815560010162000c9d565b90565b6135e58062000cc66000396000f3fe608060405234801561001057600080fd5b50600436106102bb5760003560e01c806379ba509711610182578063aeab5849116100e9578063c095daf2116100a2578063e3235c911161007c578063e3235c9114610905578063e73efc9b1461090d578063fe40c47014610930578063ff50abdc14610956576102bb565b8063c095daf2146108c3578063c58aaae6146108e0578063c6c9d828146108e8576102bb565b8063aeab5849146107ea578063b8225dec14610807578063bd32aa441461080f578063bd6a10b814610817578063be5af9fe14610834578063c014fb8414610855576102bb565b80639af1d35a1161013b5780639af1d35a146107125780639cb8a26a1461071a578063a461fc8214610722578063ab49848c1461072a578063ac60c4861461076b578063adfd31af14610773576102bb565b806379ba50971461063557806389c6318d1461063d5780638da5cb5b146106b057806391b4ded9146106b857806394fcf3c3146106c05780639501dc87146106f5576102bb565b806339ab4c4111610226578063631e1444116101df578063631e14441461058a57806364af2d87146105b057806364cf34bd146105b85780636b3a0984146105d557806373b7de15146105f25780637859f4101461060f576102bb565b806339ab4c411461047d5780633be99e6f1461049c5780634a41d89d146104c257806353a47bb7146104e8578063543d6c74146104f05780635c975abb1461056e576102bb565b806316c38b3c1161027857806316c38b3c146103e557806317c70de4146104045780631f3f10b01461040c57806320714f88146104325780633278c9601461045857806336fd711e14610460576102bb565b806302610c50146102c057806303ff6018146102da57806304f3bcec146103615780630dd16fd51461038557806315502840146103a25780631627540c146103bf575b600080fd5b6102c861095e565b60408051918252519081900360200190f35b61035f600480360360608110156102f057600080fd5b6001600160a01b03823516916020810135151591810190606081016040820135600160201b81111561032157600080fd5b82018360208201111561033357600080fd5b803590602001918460208302840111600160201b8311171561035457600080fd5b509092509050610964565b005b610369610c77565b604080516001600160a01b039092168252519081900360200190f35b61035f6004803603602081101561039b57600080fd5b5035610c86565b61035f600480360360208110156103b857600080fd5b5035610e19565b61035f600480360360208110156103d557600080fd5b50356001600160a01b0316610e9d565b61035f600480360360208110156103fb57600080fd5b50351515610f3a565b6102c8610ff5565b61035f6004803603602081101561042257600080fd5b50356001600160a01b0316610ffb565b61035f6004803603602081101561044857600080fd5b50356001600160a01b0316611066565b61035f611166565b61035f6004803603602081101561047657600080fd5b50356111e9565b61035f6004803603602081101561049357600080fd5b5035151561131b565b61035f600480360360208110156104b257600080fd5b50356001600160a01b03166113bb565b6104ca611529565b60408051938452602084019290925282820152519081900360600190f35b610369611535565b61035f6004803603604081101561050657600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561053057600080fd5b82018360208201111561054257600080fd5b803590602001918460208302840111600160201b8311171561056357600080fd5b509092509050611544565b61057661162f565b604080519115158252519081900360200190f35b610576600480360360208110156105a057600080fd5b50356001600160a01b0316611638565b610576611755565b61035f600480360360208110156105ce57600080fd5b503561175e565b61035f600480360360208110156105eb57600080fd5b50356117e2565b61035f6004803603602081101561060857600080fd5b50356118da565b61035f6004803603602081101561062557600080fd5b50356001600160a01b0316611a0c565b61035f611add565b6106606004803603604081101561065357600080fd5b5080359060200135611b99565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561069c578181015183820152602001610684565b505050509050019250505060405180910390f35b610369611bb6565b6102c8611bc5565b610369600480360360e08110156106d657600080fd5b508035906020810135906040810135151590606081019060a001611bcb565b61035f6004803603602081101561070b57600080fd5b503561217d565b6104ca612310565b61035f61231c565b6102c861246e565b610732612475565b604051808261030080838360005b83811015610758578181015183820152602001610740565b5050505090500191505060405180910390f35b6102c86124bf565b61035f6004803603604081101561078957600080fd5b813515159190810190604081016020820135600160201b8111156107ac57600080fd5b8201836020820111156107be57600080fd5b803590602001918460208302840111600160201b831117156107df57600080fd5b5090925090506124c5565b61035f6004803603602081101561080057600080fd5b50356126f6565b6105766127f0565b61035f6127f9565b61035f6004803603602081101561082d57600080fd5b503561288b565b61083c61290f565b6040805192835260208301919091528051918290030190f35b61035f6004803603602081101561086b57600080fd5b810190602081018135600160201b81111561088557600080fd5b82018360208201111561089757600080fd5b803590602001918460208302840111600160201b831117156108b857600080fd5b509092509050612918565b61035f600480360360208110156108d957600080fd5b5035612a4e565b610369612ad2565b6102c8600480360360208110156108fe57600080fd5b5035612ae6565b6102c8612b04565b6106606004803603604081101561092357600080fd5b5080359060200135612b09565b61035f6004803603602081101561094657600080fd5b50356001600160a01b0316612b1d565b6102c8612d31565b60135490565b6000546001600160a01b031633146109ad5760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b80806109b95750610c71565b6000846109c75760156109ca565b60135b90506000805b83811015610b485760008686838181106109e657fe5b905060200201356001600160a01b03169050610a0181612d37565b610a44576040805162461bcd60e51b815260206004820152600f60248201526e26b0b935b2ba103ab735b737bbb71760891b604482015290519081900360640190fd5b610a54848263ffffffff612d6116565b610ac9816001600160a01b031663eef49ee36040518163ffffffff1660e01b815260040160206040518083038186803b158015610a9057600080fd5b505afa158015610aa4573d6000803e3d6000fd5b505050506040513d6020811015610aba57600080fd5b5051849063ffffffff612ea316565b9250806001600160a01b0316631627540c8a6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b158015610b2357600080fd5b505af1158015610b37573d6000803e3d6000fd5b5050600190930192506109d0915050565b50601254610b5c908263ffffffff612efd16565b601255604080516001600160a01b038916815260208082018381529282018790527f3e429aa34462b428d3f7277acb67e1c83d80a57faab2a47924369b5060f35679928a92899289929060608301908590850280828437600083820152604051601f909101601f1916909201829003965090945050505050a16040805163adfd31af60e01b81528715156004820190815260248201928352604482018790526001600160a01b038a169263adfd31af928a928a928a92606401846020850280828437600081840152601f19601f820116905080830192505050945050505050600060405180830381600087803b158015610c5557600080fd5b505af1158015610c69573d6000803e3d6000fd5b505050505050505b50505050565b6006546001600160a01b031681565b6000546001600160a01b03163314610ccf5760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b60006009600001548201905073__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1f57600080fd5b505af4158015610d33573d6000803e3d6000fd5b505050506040513d6020811015610d4957600080fd5b50518110610d885760405162461bcd60e51b815260040180806020018281038252602181526020018061346c6021913960400191505060405180910390fd5b80600010610ddd576040805162461bcd60e51b815260206004820152601a60248201527f546f74616c20666565206d757374206265206e6f6e7a65726f2e000000000000604482015290519081900360640190fd5b600a8290556040805183815290517f8c14462add32e0ae0fbfcf9e60711ecae573da337dc9127fff98fb7cfb3973b49181900360200190a15050565b6000546001600160a01b03163314610e625760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b600d8190556040805182815290517ff378a0fd4ad3ffd9d7d50986f16b04acd2dc42691c4f412f34e8eefe883e66529181900360200190a150565b6000546001600160a01b03163314610ee65760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b6000546001600160a01b03163314610f835760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b60035460ff1615158115151415610f9957610ff2565b6003805460ff1916821515179081905560ff1615610fb657426002555b6003546040805160ff90921615158252517f8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec59181900360200190a15b50565b60045481565b6000546001600160a01b031633146110445760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b601780546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146110af5760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b6001600160a01b03811661110a576040805162461bcd60e51b815260206004820152601c60248201527f42656e6566696369617279206d757374206e6f74206265207a65726f00000000604482015290519081900360640190fd5b600580546001600160a01b0383166101008102610100600160a81b03199092169190911790915560408051918252517fd5da63a0b864b315bc04128dedbc93888c8529ee6cf47ce664dc204339228c539181900360200190a150565b6000546001600160a01b031633146111af5760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b600060048190556005805460ff191690556040517f6adcc7125002935e0aa31697538ebbd65cfddf20431eb6ecdcfc3e238bfd082c9190a1565b6000546001600160a01b031633146112325760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b73__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b15801561127657600080fd5b505af415801561128a573d6000803e3d6000fd5b505050506040513d60208110156112a057600080fd5b50518111156112e05760405162461bcd60e51b81526004018080602001828103825260288152602001806135896028913960400191505060405180910390fd5b600b8190556040805182815290517f01634ac4e9f09be1ef87b8d09e14926870261dcb9a0929d2d6460af6e4c5ad1e9181900360200190a150565b6000546001600160a01b031633146113645760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b60115460ff16151581151514610ff2576011805482151560ff19909116811790915560408051918252517fcc590b6309435383b617aaa0cae6aba938f2ee471cfb539201dd7655a23caff99181900360200190a150565b6000546001600160a01b031633146114045760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b600680546001600160a01b0319166001600160a01b03831617905560005b6008548110156115255760006008828154811061143b57fe5b600091825260209182902001546006546040805163dacb2d0160e01b81526004810184905260248101829052601760448201527f5265736f6c766572206d697373696e6720746172676574000000000000000000606482015290519294506001600160a01b039091169263dacb2d0192608480840193829003018186803b1580156114c557600080fd5b505afa1580156114d9573d6000803e3d6000fd5b505050506040513d60208110156114ef57600080fd5b505160009182526007602052604090912080546001600160a01b0319166001600160a01b03909216919091179055600101611422565b5050565b600c54600d54600e5483565b6001546001600160a01b031681565b6000546001600160a01b0316331461158d5760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b60005b81811015610c71578282828181106115a457fe5b905060200201356001600160a01b03166001600160a01b0316633be99e6f856040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b15801561160b57600080fd5b505af115801561161f573d6000803e3d6000fd5b5050600190920191506115909050565b60035460ff1681565b6006546000906001600160a01b0383811691161461165857506000611750565b60005b60085481101561174a5760006008828154811061167457fe5b6000918252602080832090910154808352600782526040928390205460065484516321f8a72160e01b81526004810184905294519295506001600160a01b03918216949116926321f8a72192602480840193829003018186803b1580156116da57600080fd5b505afa1580156116ee573d6000803e3d6000fd5b505050506040513d602081101561170457600080fd5b50516001600160a01b031614158061173157506000818152600760205260409020546001600160a01b0316155b1561174157600092505050611750565b5060010161165b565b50600190505b919050565b60115460ff1681565b6000546001600160a01b031633146117a75760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b600e8190556040805182815290517f6de18e808fc4e6cb9c8910cf4bdc188ddbbdab65faecff65dab871720e8484899181900360200190a150565b6117eb33612d37565b6118265760405162461bcd60e51b81526004018080602001828103825260218152602001806134af6021913960400191505060405180910390fd5b60035460ff16156118685760405162461bcd60e51b815260040180806020018281038252603c815260200180613524603c913960400191505060405180910390fd5b611870612f5a565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b1580156118a857600080fd5b505afa1580156118bc573d6000803e3d6000fd5b50506012546118d4925090508263ffffffff612efd16565b60125550565b6000546001600160a01b031633146119235760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b73__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b15801561196757600080fd5b505af415801561197b573d6000803e3d6000fd5b505050506040513d602081101561199157600080fd5b50518111156119d15760405162461bcd60e51b815260040180806020018281038252602d81526020018061343f602d913960400191505060405180910390fd5b60108190556040805182815290517fd39cfbe31b20dbb6d995a675cf5c369555bf8bb908b6efc03873907fe9e133cf9181900360200190a150565b611a1d60138263ffffffff612faf16565b611a65576040805162461bcd60e51b8152602060048201526014602482015273139bdd08185b881858dd1a5d99481b585c9ad95d60621b604482015290519081900360640190fd5b806001600160a01b0316632810e1d66040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611aa057600080fd5b505af1158015611ab4573d6000803e3d6000fd5b50505050611acc816013612d6190919063ffffffff16565b610ff260158263ffffffff61301d16565b6001546001600160a01b03163314611b265760405162461bcd60e51b815260040180806020018281038252603581526020018061340a6035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6060611bad6015848463ffffffff61306016565b90505b92915050565b6000546001600160a01b031681565b60025481565b60035460009060ff1615611c105760405162461bcd60e51b815260040180806020018281038252603c815260200180613524603c913960400191505060405180910390fd5b611c18612f5a565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b158015611c5057600080fd5b505afa158015611c64573d6000803e3d6000fd5b505060115460ff169150611cc19050576040805162461bcd60e51b815260206004820152601b60248201527f4d61726b6574206372656174696f6e2069732064697361626c65640000000000604482015290519081900360640190fd5b611cca86613136565b611d09576040805162461bcd60e51b815260206004820152600b60248201526a496e76616c6964206b657960a81b604482015290519081900360640190fd5b600e548335906020850135904201811115611d6b576040805162461bcd60e51b815260206004820152601e60248201527f4d6174757269747920746f6f2066617220696e20746865206675747572650000604482015290519081900360640190fd5b600d54600090611d8290839063ffffffff612ea316565b90506000611d9586356020880135612ea3565b9050834210611deb576040805162461bcd60e51b815260206004820152601960248201527f456e64206f662062696464696e67206861732070617373656400000000000000604482015290519081900360640190fd5b828410611e3f576040805162461bcd60e51b815260206004820181905260248201527f4d6174757269747920707265646174657320656e64206f662062696464696e67604482015290519081900360640190fd5b6000611e4961326a565b6001600160a01b031663130efa50336040518060400160405280600f600001548152602001600f600101548152508e8e8e60405180606001604052808d81526020018c81526020018b8152508e6040518060600160405280600960000154815260200160096001015481526020016009600201548152506040518963ffffffff1660e01b815260040180896001600160a01b03166001600160a01b0316815260200188600260200280838360005b83811015611f0f578181015183820152602001611ef7565b505050509050018781526020018681526020018515151515815260200184600360200280838360005b83811015611f50578181015183820152602001611f38565b5050505090500183600260200280828437600081840152601f19601f82011690508083019250505082600360200280838360005b83811015611f9c578181015183820152602001611f84565b5050505090500198505050505050505050602060405180830381600087803b158015611fc757600080fd5b505af1158015611fdb573d6000803e3d6000fd5b505050506040513d6020811015611ff157600080fd5b505160065460408051633be99e6f60e01b81526001600160a01b039283166004820152905192935090831691633be99e6f9160248082019260009290919082900301818387803b15801561204457600080fd5b505af1158015612058573d6000803e3d6000fd5b5050505061207081601361301d90919063ffffffff16565b601254612083908363ffffffff612ea316565b60125561208e6132ae565b604080516323b872dd60e01b81523360048201526001600160a01b03848116602483015260448201869052915192909116916323b872dd916064808201926020929091908290030181600087803b1580156120e857600080fd5b505af11580156120fc573d6000803e3d6000fd5b505050506040513d602081101561211257600080fd5b5050604080516001600160a01b0383168152602081018c9052808201879052606081018690526080810185905290518c9133917fbcd154709bbe69680012cadcd07d57bd4a0ec64a033c2a3e31d2d0fadb38d3a89181900360a00190a39a9950505050505050505050565b6000546001600160a01b031633146121c65760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b60006009600101548201905073__$981eaff4516d951b878b1a7f17446065b3$__63907af6c06040518163ffffffff1660e01b815260040160206040518083038186803b15801561221657600080fd5b505af415801561222a573d6000803e3d6000fd5b505050506040513d602081101561224057600080fd5b5051811061227f5760405162461bcd60e51b815260040180806020018281038252602181526020018061346c6021913960400191505060405180910390fd5b806000106122d4576040805162461bcd60e51b815260206004820152601a60248201527f546f74616c20666565206d757374206265206e6f6e7a65726f2e000000000000604482015290519081900360640190fd5b60098290556040805183815290517f7b30e8f8e3de254785fbcb3068449dc18060f1fdb37b02731ecada99a78492c39181900360200190a15050565b600954600a54600b5483565b6000546001600160a01b031633146123655760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b60055460ff166123bc576040805162461bcd60e51b815260206004820152601f60248201527f53656c66204465737472756374206e6f742079657420696e6974696174656400604482015290519081900360640190fd5b426224ea006004540110612417576040805162461bcd60e51b815260206004820152601b60248201527f53656c662064657374727563742064656c6179206e6f74206d65740000000000604482015290519081900360640190fd5b600554604080516101009092046001600160a01b03168252517f8a09e1677ced846cb537dc2b172043bd05a1a81ad7e0033a7ef8ba762df990b7916020908290030190a160055461010090046001600160a01b0316ff5b6224ea0081565b61247d6133ea565b60005b6008548110156124bb576008818154811061249757fe5b90600052602060002001548282601881106124ae57fe5b6020020152600101612480565b5090565b60155490565b6017546001600160a01b0316331461250e5760405162461bcd60e51b81526004018080602001828103825260258152602001806134ff6025913960400191505060405180910390fd5b808061251a57506126f1565b60008461252857601561252b565b60135b90506000805b8381101561265957600086868381811061254757fe5b905060200201356001600160a01b0316905061256281612d37565b156125ac576040805162461bcd60e51b815260206004820152601560248201527426b0b935b2ba1030b63932b0b23c9035b737bbb71760591b604482015290519081900360640190fd5b806001600160a01b03166379ba50976040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156125e757600080fd5b505af11580156125fb573d6000803e3d6000fd5b50505050612612818561301d90919063ffffffff16565b61264e816001600160a01b031663eef49ee36040518163ffffffff1660e01b815260040160206040518083038186803b158015610a9057600080fd5b925050600101612531565b5060125461266d908263ffffffff612ea316565b601255601754604080516001600160a01b0390921680835260208084018381529284018890527fea7a4e14e72ba7db7e2fd406278900badf50b2ce7d9def39d613cc08054c537b9391928992899290919060608301908590850280828437600083820152604051601f909101601f1916909201829003965090945050505050a15050505b505050565b61270760133363ffffffff612faf16565b6127425760405162461bcd60e51b815260040180806020018281038252602281526020018061348d6022913960400191505060405180910390fd5b60035460ff16156127845760405162461bcd60e51b815260040180806020018281038252603c815260200180613524603c913960400191505060405180910390fd5b61278c612f5a565b6001600160a01b031663086dabd16040518163ffffffff1660e01b815260040160006040518083038186803b1580156127c457600080fd5b505afa1580156127d8573d6000803e3d6000fd5b50506012546118d4925090508263ffffffff612ea316565b60055460ff1681565b6000546001600160a01b031633146128425760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b426004556005805460ff19166001179055604080516224ea00815290517fcbd94ca75b8dc45c9d80c77e851670e78843c0d75180cb81db3e2158228fa9a69181900360200190a1565b6000546001600160a01b031633146128d45760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b600c8190556040805182815290517f5a2f2eae84f9e787d8159d363a776fa2b61d084686190cdc5a2c1ea833480b099181900360200190a150565b600f5460105482565b60035460ff161561295a5760405162461bcd60e51b815260040180806020018281038252603c815260200180613524603c913960400191505060405180910390fd5b60005b818110156126f157600083838381811061297357fe5b905060200201356001600160a01b03169050806001600160a01b031663c8db233e336040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b1580156129dd57600080fd5b505af11580156129f1573d6000803e3d6000fd5b50505050612a09816015612d6190919063ffffffff16565b604080516001600160a01b038316815290517f16e62064e42f5aec62df22ae895ef539f153e0d4ea290e2cc4e0e8f708f2fbbc9181900360200190a15060010161295d565b6000546001600160a01b03163314612a975760405162461bcd60e51b815260040180806020018281038252602f8152602001806134d0602f913960400191505060405180910390fd5b600f8190556040805182815290517fdf7a26ae2e2eb953b81fd76b72fcdc74ebff7c21faa8f8f55323183d9785f52d9181900360200190a150565b60055461010090046001600160a01b031681565b60088181548110612af357fe5b600091825260209091200154905081565b601881565b6060611bad6013848463ffffffff61306016565b60035460ff1615612b5f5760405162461bcd60e51b815260040180806020018281038252603c815260200180613524603c913960400191505060405180910390fd5b612b7060138263ffffffff612faf16565b612bb8576040805162461bcd60e51b8152602060048201526014602482015273139bdd08185b881858dd1a5d99481b585c9ad95d60621b604482015290519081900360640190fd5b6000816001600160a01b03166302d05d3f6040518163ffffffff1660e01b815260040160206040518083038186803b158015612bf357600080fd5b505afa158015612c07573d6000803e3d6000fd5b505050506040513d6020811015612c1d57600080fd5b50519050336001600160a01b03821614612c7e576040805162461bcd60e51b815260206004820152601960248201527f53656e646572206e6f74206d61726b65742063726561746f7200000000000000604482015290519081900360640190fd5b6040805163130cffa560e21b815233600482015290516001600160a01b03841691634c33fe9491602480830192600092919082900301818387803b158015612cc557600080fd5b505af1158015612cd9573d6000803e3d6000fd5b50505050612cf1826013612d6190919063ffffffff16565b604080516001600160a01b038416815290517f996fafab197beb99fff6fdc975bb6cf90352f2c733c76ef37c2e27f17d7d424b9181900360200190a15050565b60125481565b6000612d4a60138363ffffffff612faf16565b80611bb05750611bb060158363ffffffff612faf16565b612d6b8282612faf565b612db3576040805162461bcd60e51b815260206004820152601460248201527322b632b6b2b73a103737ba1034b7103634b9ba1760611b604482015290519081900360640190fd5b6001600160a01b0381166000908152600183016020526040902054825460001901808214612e52576000846000018281548110612dec57fe5b60009182526020909120015485546001600160a01b0390911691508190869085908110612e1557fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b0394851617905592909116815260018601909152604090208290555b8354849080612e5d57fe5b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b0394909416815260019490940190925250506040812055565b600082820183811015611bad576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082821115612f54576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b6000612faa6b53797374656d53746174757360a01b6040518060400160405280601c81526020017f4d697373696e672053797374656d5374617475732061646472657373000000008152506132f7565b905090565b8154600090612fc057506000611bb0565b6001600160a01b0382166000908152600184016020526040902054801515806130155750826001600160a01b031684600001600081548110612ffe57fe5b6000918252602090912001546001600160a01b0316145b949350505050565b81546001600160a01b03909116600081815260018085016020908152604083208590559084018555938152929092200180546001600160a01b0319169091179055565b825460609083830190811115613074575083545b83811161309157505060408051600081526020810190915261312f565b6040805185830380825260208082028301019092526060908280156130c0578160200160208202803883390190505b50905060005b828110156131295787600001878201815481106130df57fe5b9060005260206000200160009054906101000a90046001600160a01b031682828151811061310957fe5b6001600160a01b03909216602092830291909101909101526001016130c6565b50925050505b9392505050565b6000806131416133a1565b9050806001600160a01b031663ac82f608846040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561318757600080fd5b505afa15801561319b573d6000803e3d6000fd5b505050506040513d60208110156131b157600080fd5b5051156132615782631cd554d160e21b14156131d1576000915050611750565b6000816001600160a01b031663728dec29856040518263ffffffff1660e01b81526004018082815260200191505060806040518083038186803b15801561321757600080fd5b505afa15801561322b573d6000803e3d6000fd5b505050506040513d608081101561324157600080fd5b50519050801561325657600092505050611750565b600192505050611750565b50600092915050565b6000612faa7f42696e6172794f7074696f6e4d61726b6574466163746f727900000000000000604051806060016040528060298152602001613560602991396132f7565b6000612faa6814de5b9d1a1cd554d160ba1b6040518060400160405280601981526020017f4d697373696e672053796e7468735553442061646472657373000000000000008152505b6000828152600760205260408120546001600160a01b031682816133995760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561335e578181015183820152602001613346565b50505050905090810190601f16801561338b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509392505050565b6000612faa6c45786368616e6765526174657360981b604051806040016040528060158152602001744d697373696e672045786368616e6765526174657360581b8152506132f7565b604051806103000160405280601890602082028038833950919291505056fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e65727368697043726561746f7220736b6577206c696d6974206d757374206265206e6f2067726561746572207468616e20312e546f74616c20666565206d757374206265206c657373207468616e20313030252e5065726d6974746564206f6e6c7920666f7220616374697665206d61726b6574732e5065726d6974746564206f6e6c7920666f72206b6e6f776e206d61726b6574732e4f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e4f6e6c79207065726d697474656420666f72206d6967726174696e67206d616e616765722e5468697320616374696f6e2063616e6e6f7420626520706572666f726d6564207768696c652074686520636f6e7472616374206973207061757365644d697373696e672042696e6172794f7074696f6e4d61726b6574466163746f72792061646472657373526566756e6420666565206d757374206265206e6f2067726561746572207468616e20313030252ea265627a7a723158208c6f2d5c104e7d0f7eabee5658bc77bb767f6feff5010f95ff782e5b5e584fd464736f6c6343000510003243726561746f7220736b6577206c696d6974206d757374206265206e6f2067726561746572207468616e20312e546f74616c20666565206d757374206265206c657373207468616e20313030252e4f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6e526566756e6420666565206d757374206265206e6f2067726561746572207468616e20313030252e", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - }, - { - "internalType": "address", - "name": "_resolver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_maxOraclePriceAge", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_expiryDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_maxTimeToMaturity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_creatorCapitalRequirement", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_creatorSkewLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_poolFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_creatorFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "_refundFee", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "constructor", - "signature": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "CreatorCapitalRequirementUpdated", - "type": "event", - "signature": "0xdf7a26ae2e2eb953b81fd76b72fcdc74ebff7c21faa8f8f55323183d9785f52d" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "CreatorFeeUpdated", - "type": "event", - "signature": "0x8c14462add32e0ae0fbfcf9e60711ecae573da337dc9127fff98fb7cfb3973b4" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "CreatorSkewLimitUpdated", - "type": "event", - "signature": "0xd39cfbe31b20dbb6d995a675cf5c369555bf8bb908b6efc03873907fe9e133cf" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "ExerciseDurationUpdated", - "type": "event", - "signature": "0xf0a1ff3a67369ec37b38f6cf8dec83acaffd6d00a2dd1e95a12394d4863a0b71" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "ExpiryDurationUpdated", - "type": "event", - "signature": "0xf378a0fd4ad3ffd9d7d50986f16b04acd2dc42691c4f412f34e8eefe883e6652" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketCancelled", - "type": "event", - "signature": "0x996fafab197beb99fff6fdc975bb6cf90352f2c733c76ef37c2e27f17d7d424b" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "oracleKey", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "strikePrice", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "biddingEndDate", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "maturityDate", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "expiryDate", - "type": "uint256" - } - ], - "name": "MarketCreated", - "type": "event", - "signature": "0xbcd154709bbe69680012cadcd07d57bd4a0ec64a033c2a3e31d2d0fadb38d3a8" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "name": "MarketCreationEnabledUpdated", - "type": "event", - "signature": "0xcc590b6309435383b617aaa0cae6aba938f2ee471cfb539201dd7655a23caff9" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "MarketExpired", - "type": "event", - "signature": "0x16e62064e42f5aec62df22ae895ef539f153e0d4ea290e2cc4e0e8f708f2fbbc" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract BinaryOptionMarketManager", - "name": "receivingManager", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract BinaryOptionMarket[]", - "name": "markets", - "type": "address[]" - } - ], - "name": "MarketsMigrated", - "type": "event", - "signature": "0x3e429aa34462b428d3f7277acb67e1c83d80a57faab2a47924369b5060f35679" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "contract BinaryOptionMarketManager", - "name": "migratingManager", - "type": "address" - }, - { - "indexed": false, - "internalType": "contract BinaryOptionMarket[]", - "name": "markets", - "type": "address[]" - } - ], - "name": "MarketsReceived", - "type": "event", - "signature": "0xea7a4e14e72ba7db7e2fd406278900badf50b2ce7d9def39d613cc08054c537b" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "MaxOraclePriceAgeUpdated", - "type": "event", - "signature": "0x5a2f2eae84f9e787d8159d363a776fa2b61d084686190cdc5a2c1ea833480b09" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "duration", - "type": "uint256" - } - ], - "name": "MaxTimeToMaturityUpdated", - "type": "event", - "signature": "0x6de18e808fc4e6cb9c8910cf4bdc188ddbbdab65faecff65dab871720e848489" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerChanged", - "type": "event", - "signature": "0xb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnerNominated", - "type": "event", - "signature": "0x906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce22" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bool", - "name": "isPaused", - "type": "bool" - } - ], - "name": "PauseChanged", - "type": "event", - "signature": "0x8fb6c181ee25a520cf3dd6565006ef91229fcfe5a989566c2a3b8c115570cec5" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "PoolFeeUpdated", - "type": "event", - "signature": "0x7b30e8f8e3de254785fbcb3068449dc18060f1fdb37b02731ecada99a78492c3" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "fee", - "type": "uint256" - } - ], - "name": "RefundFeeUpdated", - "type": "event", - "signature": "0x01634ac4e9f09be1ef87b8d09e14926870261dcb9a0929d2d6460af6e4c5ad1e" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newBeneficiary", - "type": "address" - } - ], - "name": "SelfDestructBeneficiaryUpdated", - "type": "event", - "signature": "0xd5da63a0b864b315bc04128dedbc93888c8529ee6cf47ce664dc204339228c53" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "selfDestructDelay", - "type": "uint256" - } - ], - "name": "SelfDestructInitiated", - "type": "event", - "signature": "0xcbd94ca75b8dc45c9d80c77e851670e78843c0d75180cb81db3e2158228fa9a6" - }, - { - "anonymous": false, - "inputs": [], - "name": "SelfDestructTerminated", - "type": "event", - "signature": "0x6adcc7125002935e0aa31697538ebbd65cfddf20431eb6ecdcfc3e238bfd082c" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "beneficiary", - "type": "address" - } - ], - "name": "SelfDestructed", - "type": "event", - "signature": "0x8a09e1677ced846cb537dc2b172043bd05a1a81ad7e0033a7ef8ba762df990b7" - }, - { - "constant": true, - "inputs": [], - "name": "MAX_ADDRESSES_FROM_RESOLVER", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xe3235c91" - }, - { - "constant": true, - "inputs": [], - "name": "SELFDESTRUCT_DELAY", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xa461fc82" - }, - { - "constant": false, - "inputs": [], - "name": "acceptOwnership", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x79ba5097" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pageSize", - "type": "uint256" - } - ], - "name": "activeMarkets", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xe73efc9b" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "cancelMarket", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xfe40c470" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bytes32", - "name": "oracleKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "strikePrice", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "refundsEnabled", - "type": "bool" - }, - { - "internalType": "uint256[2]", - "name": "times", - "type": "uint256[2]" - }, - { - "internalType": "uint256[2]", - "name": "bids", - "type": "uint256[2]" - } - ], - "name": "createMarket", - "outputs": [ - { - "internalType": "contract IBinaryOptionMarket", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x94fcf3c3" - }, - { - "constant": true, - "inputs": [], - "name": "creatorLimits", - "outputs": [ - { - "internalType": "uint256", - "name": "capitalRequirement", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "skewLimit", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xbe5af9fe" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "delta", - "type": "uint256" - } - ], - "name": "decrementTotalDeposited", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x6b3a0984" - }, - { - "constant": true, - "inputs": [], - "name": "durations", - "outputs": [ - { - "internalType": "uint256", - "name": "maxOraclePriceAge", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiryDuration", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimeToMaturity", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x4a41d89d" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address[]", - "name": "markets", - "type": "address[]" - } - ], - "name": "expireMarkets", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xc014fb84" - }, - { - "constant": true, - "inputs": [], - "name": "fees", - "outputs": [ - { - "internalType": "uint256", - "name": "poolFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "creatorFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "refundFee", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x9af1d35a" - }, - { - "constant": true, - "inputs": [], - "name": "getResolverAddressesRequired", - "outputs": [ - { - "internalType": "bytes32[24]", - "name": "addressesRequired", - "type": "bytes32[24]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xab49848c" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "delta", - "type": "uint256" - } - ], - "name": "incrementTotalDeposited", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xaeab5849" - }, - { - "constant": false, - "inputs": [], - "name": "initiateSelfDestruct", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xbd32aa44" - }, - { - "constant": true, - "inputs": [], - "name": "initiationTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x17c70de4" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "contract AddressResolver", - "name": "_resolver", - "type": "address" - } - ], - "name": "isResolverCached", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x631e1444" - }, - { - "constant": true, - "inputs": [], - "name": "lastPauseTime", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x91b4ded9" - }, - { - "constant": true, - "inputs": [], - "name": "marketCreationEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x64af2d87" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "uint256", - "name": "index", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "pageSize", - "type": "uint256" - } - ], - "name": "maturedMarkets", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x89c6318d" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "contract BinaryOptionMarketManager", - "name": "receivingManager", - "type": "address" - }, - { - "internalType": "bool", - "name": "active", - "type": "bool" - }, - { - "internalType": "contract BinaryOptionMarket[]", - "name": "marketsToMigrate", - "type": "address[]" - } - ], - "name": "migrateMarkets", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x03ff6018" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "_owner", - "type": "address" - } - ], - "name": "nominateNewOwner", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x1627540c" - }, - { - "constant": true, - "inputs": [], - "name": "nominatedOwner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x53a47bb7" - }, - { - "constant": true, - "inputs": [], - "name": "numActiveMarkets", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x02610c50" - }, - { - "constant": true, - "inputs": [], - "name": "numMaturedMarkets", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xac60c486" - }, - { - "constant": true, - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x8da5cb5b" - }, - { - "constant": true, - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x5c975abb" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bool", - "name": "active", - "type": "bool" - }, - { - "internalType": "contract BinaryOptionMarket[]", - "name": "marketsToReceive", - "type": "address[]" - } - ], - "name": "receiveMarkets", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xadfd31af" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "resolveMarket", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x7859f410" - }, - { - "constant": true, - "inputs": [], - "name": "resolver", - "outputs": [ - { - "internalType": "contract AddressResolver", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x04f3bcec" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "resolverAddressesRequired", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xc6c9d828" - }, - { - "constant": false, - "inputs": [], - "name": "selfDestruct", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x9cb8a26a" - }, - { - "constant": true, - "inputs": [], - "name": "selfDestructBeneficiary", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xc58aaae6" - }, - { - "constant": true, - "inputs": [], - "name": "selfDestructInitiated", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xb8225dec" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_creatorCapitalRequirement", - "type": "uint256" - } - ], - "name": "setCreatorCapitalRequirement", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xc095daf2" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_creatorFee", - "type": "uint256" - } - ], - "name": "setCreatorFee", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x0dd16fd5" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_creatorSkewLimit", - "type": "uint256" - } - ], - "name": "setCreatorSkewLimit", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x73b7de15" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_expiryDuration", - "type": "uint256" - } - ], - "name": "setExpiryDuration", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x15502840" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bool", - "name": "enabled", - "type": "bool" - } - ], - "name": "setMarketCreationEnabled", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x39ab4c41" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_maxOraclePriceAge", - "type": "uint256" - } - ], - "name": "setMaxOraclePriceAge", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0xbd6a10b8" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_maxTimeToMaturity", - "type": "uint256" - } - ], - "name": "setMaxTimeToMaturity", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x64cf34bd" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "contract BinaryOptionMarketManager", - "name": "manager", - "type": "address" - } - ], - "name": "setMigratingManager", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x1f3f10b0" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "bool", - "name": "_paused", - "type": "bool" - } - ], - "name": "setPaused", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x16c38b3c" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_poolFee", - "type": "uint256" - } - ], - "name": "setPoolFee", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x9501dc87" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "uint256", - "name": "_refundFee", - "type": "uint256" - } - ], - "name": "setRefundFee", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x36fd711e" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "contract AddressResolver", - "name": "_resolver", - "type": "address" - } - ], - "name": "setResolverAndSyncCache", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x3be99e6f" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "contract AddressResolver", - "name": "_resolver", - "type": "address" - }, - { - "internalType": "contract BinaryOptionMarket[]", - "name": "marketsToSync", - "type": "address[]" - } - ], - "name": "setResolverAndSyncCacheOnMarkets", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x543d6c74" - }, - { - "constant": false, - "inputs": [ - { - "internalType": "address payable", - "name": "_beneficiary", - "type": "address" - } - ], - "name": "setSelfDestructBeneficiary", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x20714f88" - }, - { - "constant": false, - "inputs": [], - "name": "terminateSelfDestruct", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function", - "signature": "0x3278c960" - }, - { - "constant": true, - "inputs": [], - "name": "totalDeposited", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xff50abdc" - } - ] - }, - "BinaryOptionMarketData": { - "bytecode": "608060405234801561001057600080fd5b506112f7806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80631216fc7b14610046578063a30c302d1461006f578063dca5f5c31461008f575b600080fd5b610059610054366004610e75565b6100af565b60405161006691906111f1565b60405180910390f35b61008261007d366004610e75565b61047c565b60405161006691906111e2565b6100a261009d366004610e93565b610a61565b60405161006691906111d4565b6100b7610c44565b600080836001600160a01b0316631069143a6040518163ffffffff1660e01b8152600401604080518083038186803b1580156100f257600080fd5b505afa158015610106573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061012a9190810190610ecd565b915091506000806000866001600160a01b0316639e3b34bf6040518163ffffffff1660e01b815260040160606040518083038186803b15801561016c57600080fd5b505afa158015610180573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506101a49190810190610e28565b9250925092506000806000896001600160a01b03166398508ecd6040518163ffffffff1660e01b815260040160606040518083038186803b1580156101e857600080fd5b505afa1580156101fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506102209190810190610e28565b92509250925060008060008c6001600160a01b0316639af1d35a6040518163ffffffff1660e01b815260040160606040518083038186803b15801561026457600080fd5b505afa158015610278573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061029c9190810190610e28565b9250925092506102aa610c44565b6040518060c001604052808f6001600160a01b03166302d05d3f6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102ee57600080fd5b505afa158015610302573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506103269190810190610de4565b6001600160a01b0316815260200160405180604001604052808f6001600160a01b031681526020018e6001600160a01b0316815250815260200160405180606001604052808d81526020018c81526020018b815250815260200160405180606001604052808a81526020018981526020018881525081526020016040518060600160405280878152602001868152602001858152508152602001604051806040016040528060008152602001600081525081525090506000808f6001600160a01b031663be5af9fe6040518163ffffffff1660e01b8152600401604080518083038186803b15801561041757600080fd5b505afa15801561042b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061044f9190810190610f57565b60408051808201909152918252602082015260a084015250909c505050505050505050505050505b919050565b610484610ca0565b600080836001600160a01b031663c7a5bdc86040518163ffffffff1660e01b8152600401604080518083038186803b1580156104bf57600080fd5b505afa1580156104d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506104f79190810190610f57565b91509150600080856001600160a01b0316633d7a783b6040518163ffffffff1660e01b8152600401604080518083038186803b15801561053657600080fd5b505afa15801561054a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061056e9190810190610f57565b91509150600080876001600160a01b031663d068cdc56040518163ffffffff1660e01b8152600401604080518083038186803b1580156105ad57600080fd5b505afa1580156105c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506105e59190810190610f57565b91509150600080896001600160a01b0316638b0341366040518163ffffffff1660e01b8152600401604080518083038186803b15801561062457600080fd5b505afa158015610638573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061065c9190810190610f57565b915091506000808b6001600160a01b031663d3419bf36040518163ffffffff1660e01b8152600401604080518083038186803b15801561069b57600080fd5b505afa1580156106af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506106d39190810190610f57565b9150915060405180610120016040528060405180604001604052808d81526020018c8152508152602001604051806040016040528085815260200184815250815260200160405180604001604052808f6001600160a01b031663eef49ee36040518163ffffffff1660e01b815260040160206040518083038186803b15801561075b57600080fd5b505afa15801561076f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506107939190810190610f39565b81526020018f6001600160a01b0316632115e3036040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d157600080fd5b505afa1580156107e5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506108099190810190610f39565b815250815260200160405180604001604052808f6001600160a01b0316633f6fa6556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085557600080fd5b505afa158015610869573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061088d9190810190610e0a565b151581526020018f6001600160a01b031663ac3791e36040518163ffffffff1660e01b815260040160206040518083038186803b1580156108cd57600080fd5b505afa1580156108e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109059190810190610e0a565b151581525081526020018d6001600160a01b031663b1c9fe6e6040518163ffffffff1660e01b815260040160206040518083038186803b15801561094857600080fd5b505afa15801561095c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506109809190810190610efd565b600381111561098b57fe5b81526020018d6001600160a01b031663653721476040518163ffffffff1660e01b815260040160206040518083038186803b1580156109c957600080fd5b505afa1580156109dd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a019190810190610f1b565b6001811115610a0c57fe5b81526040805180820182529687526020878101969096528582019690965285518087018752998a5289850198909852848801989098525050815180830190925292815291820152606090910152949350505050565b610a69610d03565b600080846001600160a01b03166329e77b5d856040518263ffffffff1660e01b8152600401610a9891906111c6565b604080518083038186803b158015610aaf57600080fd5b505afa158015610ac3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610ae79190810190610f57565b91509150600080866001600160a01b031663408e82af876040518263ffffffff1660e01b8152600401610b1a91906111c6565b604080518083038186803b158015610b3157600080fd5b505afa158015610b45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b699190810190610f57565b91509150600080886001600160a01b0316636392a51f896040518263ffffffff1660e01b8152600401610b9c91906111c6565b604080518083038186803b158015610bb357600080fd5b505afa158015610bc7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610beb9190810190610f57565b6040805160a08101825260608101998a5260808101989098529787528751808901895295865260208681019590955284870195909552865180880188529081529283019390935250928201929092529150505b92915050565b6040518060c0016040528060006001600160a01b03168152602001610c67610d16565b8152602001610c74610d2d565b8152602001610c81610d4e565b8152602001610c8e610d2d565b8152602001610c9b610d72565b905290565b604051806101200160405280610cb4610d72565b8152602001610cc1610d72565b8152602001610cce610d72565b8152602001610cdb610d16565b81526020016000815260200160008152602001610cf6610d72565b8152602001610c8e610d72565b6040518060600160405280610cf6610d72565b604080518082019091526000808252602082015290565b60405180606001604052806000815260200160008152602001600081525090565b60405180606001604052806000801916815260200160008152602001600081525090565b604051806040016040528060008152602001600081525090565b8035610c3e8161126b565b8051610c3e8161126b565b8051610c3e8161127f565b8051610c3e81611288565b8035610c3e81611291565b8051610c3e81611291565b8051610c3e8161129a565b8051610c3e816112a7565b600060208284031215610df657600080fd5b6000610e028484610d97565b949350505050565b600060208284031215610e1c57600080fd5b6000610e028484610da2565b600080600060608486031215610e3d57600080fd5b6000610e498686610dad565b9350506020610e5a86828701610dad565b9250506040610e6b86828701610dad565b9150509250925092565b600060208284031215610e8757600080fd5b6000610e028484610db8565b60008060408385031215610ea657600080fd5b6000610eb28585610db8565b9250506020610ec385828601610d8c565b9150509250929050565b60008060408385031215610ee057600080fd5b6000610eec8585610dc3565b9250506020610ec385828601610dc3565b600060208284031215610f0f57600080fd5b6000610e028484610dce565b600060208284031215610f2d57600080fd5b6000610e028484610dd9565b600060208284031215610f4b57600080fd5b6000610e028484610dad565b60008060408385031215610f6a57600080fd5b6000610f768585610dad565b9250506020610ec385828601610dad565b610f9081611200565b82525050565b610f908161120b565b610f9081611210565b610f9081611213565b610f908161123e565b610f9081611249565b805160c0830190610fd48482611000565b506020820151610fe76040850182611000565b506040820151610ffa6080850182611000565b50505050565b805160408301906110118482610f9f565b506020820151610ffa6020850182610f9f565b805160608301906110358482610f9f565b5060208201516110486020850182610f9f565b506040820151610ffa6040850182610f9f565b805161020083019061106d8482611000565b5060208201516110806040850182611000565b5060408201516110936080850182611000565b5060608201516110a660c08501826111a2565b5060808201516110ba610100850182610fb1565b5060a08201516110ce610120850182610fba565b5060c08201516110e2610140850182611000565b5060e08201516110f6610180850182611000565b50610100820151610ffa6101c0850182611000565b80516101c083019061111d8482610f87565b506020820151611130602085018261117e565b5060408201516111436060850182611024565b50606082015161115660c0850182611024565b50608082015161116a610120850182611024565b5060a0820151610ffa610180850182611000565b8051604083019061118f8482610fa8565b506020820151610ffa6020850182610fa8565b805160408301906111b38482610f96565b506020820151610ffa6020850182610f96565b60208101610c3e8284610f87565b60c08101610c3e8284610fc3565b6102008101610c3e828461105b565b6101c08101610c3e828461110b565b6000610c3e82611232565b151590565b90565b6000610c3e82611200565b8061047781611254565b8061047781611261565b6001600160a01b031690565b6000610c3e8261121e565b6000610c3e82611228565b6004811061125e57fe5b50565b6002811061125e57fe5b61127481611200565b811461125e57600080fd5b6112748161120b565b61127481611210565b61127481611213565b6004811061125e57600080fd5b6002811061125e57600080fdfea365627a7a723158201a6330c1b3b45158c7aef469156860076f8983a4dba2eddc63c6a6b18e813a276c6578706572696d656e74616cf564736f6c63430005100040", - "abi": [ - { - "constant": true, - "inputs": [ - { - "internalType": "contract BinaryOptionMarket", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "getAccountMarketData", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "bids", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "claimable", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "balances", - "type": "tuple" - } - ], - "internalType": "struct BinaryOptionMarketData.AccountData", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xdca5f5c3" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "contract BinaryOptionMarket", - "name": "market", - "type": "address" - } - ], - "name": "getMarketData", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "price", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAt", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OraclePriceAndTimestamp", - "name": "oraclePriceAndTimestamp", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarket.Prices", - "name": "prices", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "deposited", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "exercisableDeposits", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.Deposits", - "name": "deposits", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "resolved", - "type": "bool" - }, - { - "internalType": "bool", - "name": "canResolve", - "type": "bool" - } - ], - "internalType": "struct BinaryOptionMarketData.Resolution", - "name": "resolution", - "type": "tuple" - }, - { - "internalType": "enum IBinaryOptionMarket.Phase", - "name": "phase", - "type": "uint8" - }, - { - "internalType": "enum IBinaryOptionMarket.Side", - "name": "result", - "type": "uint8" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "totalBids", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "totalClaimableSupplies", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "long", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "short", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketData.OptionValues", - "name": "totalSupplies", - "type": "tuple" - } - ], - "internalType": "struct BinaryOptionMarketData.MarketData", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0xa30c302d" - }, - { - "constant": true, - "inputs": [ - { - "internalType": "contract BinaryOptionMarket", - "name": "market", - "type": "address" - } - ], - "name": "getMarketParameters", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "creator", - "type": "address" - }, - { - "components": [ - { - "internalType": "contract BinaryOption", - "name": "long", - "type": "address" - }, - { - "internalType": "contract BinaryOption", - "name": "short", - "type": "address" - } - ], - "internalType": "struct BinaryOptionMarket.Options", - "name": "options", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "biddingEnd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maturity", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expiry", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarket.Times", - "name": "times", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "strikePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "finalPrice", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarket.OracleDetails", - "name": "oracleDetails", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "poolFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "creatorFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "refundFee", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketManager.Fees", - "name": "fees", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "capitalRequirement", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "skewLimit", - "type": "uint256" - } - ], - "internalType": "struct BinaryOptionMarketManager.CreatorLimits", - "name": "creatorLimits", - "type": "tuple" - } - ], - "internalType": "struct BinaryOptionMarketData.MarketParameters", - "name": "", - "type": "tuple" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function", - "signature": "0x1216fc7b" - } - ] - }, "SynthUtil": { "bytecode": "608060405234801561001057600080fd5b506040516113693803806113698339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b0319909216919091179055611304806100656000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80630120be331461006757806327fe55a6146100a5578063492dbcdd14610146578063a827bf481461022c578063d18ab37614610252578063eade6d2d14610276575b600080fd5b6100936004803603604081101561007d57600080fd5b506001600160a01b0381351690602001356102ce565b60408051918252519081900360200190f35b6100ad61054d565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156100f15781810151838201526020016100d9565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015610130578181015183820152602001610118565b5050505090500194505050505060405180910390f35b61014e6107b9565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b8381101561019657818101518382015260200161017e565b50505050905001848103835286818151815260200191508051906020019060200280838360005b838110156101d55781810151838201526020016101bd565b50505050905001848103825285818151815260200191508051906020019060200280838360005b838110156102145781810151838201526020016101fc565b50505050905001965050505050505060405180910390f35b61014e6004803603602081101561024257600080fd5b50356001600160a01b0316610b32565b61025a610ec9565b604080516001600160a01b039092168252519081900360200190f35b61027e610ed8565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102ba5781810151838201526020016102a2565b505050509050019250505060405180910390f35b6000806102d9611182565b905060006102e561123f565b90506000826001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b15801561032257600080fd5b505afa158015610336573d6000803e3d6000fd5b505050506040513d602081101561034c57600080fd5b5051905060005b81811015610543576000846001600160a01b031663835e119c836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156103a157600080fd5b505afa1580156103b5573d6000803e3d6000fd5b505050506040513d60208110156103cb57600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b038087169263654a60ac929185169163dbd06c85916004808301926020929190829003018186803b15801561041b57600080fd5b505afa15801561042f573d6000803e3d6000fd5b505050506040513d602081101561044557600080fd5b5051604080516370a0823160e01b81526001600160a01b038d811660048301529151918616916370a0823191602480820192602092909190829003018186803b15801561049157600080fd5b505afa1580156104a5573d6000803e3d6000fd5b505050506040513d60208110156104bb57600080fd5b5051604080516001600160e01b031960e086901b16815260048101939093526024830191909152604482018b9052516064808301926020929190829003018186803b15801561050957600080fd5b505afa15801561051d573d6000803e3d6000fd5b505050506040513d602081101561053357600080fd5b5051959095019450600101610353565b5050505092915050565b606080606061055a611182565b6001600160a01b03166372cb051f6040518163ffffffff1660e01b815260040160006040518083038186803b15801561059257600080fd5b505afa1580156105a6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405260208110156105cf57600080fd5b81019080805160405193929190846401000000008211156105ef57600080fd5b90830190602082018581111561060457600080fd5b825186602082028301116401000000008211171561062157600080fd5b82525081516020918201928201910280838360005b8381101561064e578181015183820152602001610636565b5050505090500160405250505090508061066661123f565b6001600160a01b031663c2c8a676836040518263ffffffff1660e01b81526004018080602001828103825283818151815260200191508051906020019060200280838360005b838110156106c45781810151838201526020016106ac565b505050509050019250505060006040518083038186803b1580156106e757600080fd5b505afa1580156106fb573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561072457600080fd5b810190808051604051939291908464010000000082111561074457600080fd5b90830190602082018581111561075957600080fd5b825186602082028301116401000000008211171561077657600080fd5b82525081516020918201928201910280838360005b838110156107a357818101518382015260200161078b565b5050505090500160405250505092509250509091565b606080606060006107c8611182565b905060006107d461123f565b90506000826001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b15801561081157600080fd5b505afa158015610825573d6000803e3d6000fd5b505050506040513d602081101561083b57600080fd5b505160408051828152602080840282010190915290915060609082801561086c578160200160208202803883390190505b50905060608260405190808252806020026020018201604052801561089b578160200160208202803883390190505b5090506060836040519080825280602002602001820160405280156108ca578160200160208202803883390190505b50905060005b84811015610b22576000876001600160a01b031663835e119c836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b15801561091e57600080fd5b505afa158015610932573d6000803e3d6000fd5b505050506040513d602081101561094857600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b0383169163dbd06c8591600480820192602092909190829003018186803b15801561098e57600080fd5b505afa1580156109a2573d6000803e3d6000fd5b505050506040513d60208110156109b857600080fd5b505185518690849081106109c857fe5b602002602001018181525050806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0d57600080fd5b505afa158015610a21573d6000803e3d6000fd5b505050506040513d6020811015610a3757600080fd5b50518451859084908110610a4757fe5b602002602001018181525050866001600160a01b031663654a60ac868481518110610a6e57fe5b6020026020010151868581518110610a8257fe5b6020026020010151631cd554d160e21b6040518463ffffffff1660e01b815260040180848152602001838152602001828152602001935050505060206040518083038186803b158015610ad457600080fd5b505afa158015610ae8573d6000803e3d6000fd5b505050506040513d6020811015610afe57600080fd5b50518351849084908110610b0e57fe5b6020908102919091010152506001016108d0565b5091975095509350505050909192565b60608060606000610b41611182565b90506000610b4d61123f565b90506000826001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b158015610b8a57600080fd5b505afa158015610b9e573d6000803e3d6000fd5b505050506040513d6020811015610bb457600080fd5b5051604080518281526020808402820101909152909150606090828015610be5578160200160208202803883390190505b509050606082604051908082528060200260200182016040528015610c14578160200160208202803883390190505b509050606083604051908082528060200260200182016040528015610c43578160200160208202803883390190505b50905060005b84811015610eb8576000876001600160a01b031663835e119c836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610c9757600080fd5b505afa158015610cab573d6000803e3d6000fd5b505050506040513d6020811015610cc157600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b0383169163dbd06c8591600480820192602092909190829003018186803b158015610d0757600080fd5b505afa158015610d1b573d6000803e3d6000fd5b505050506040513d6020811015610d3157600080fd5b50518551869084908110610d4157fe5b602002602001018181525050806001600160a01b03166370a082318d6040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b158015610da357600080fd5b505afa158015610db7573d6000803e3d6000fd5b505050506040513d6020811015610dcd57600080fd5b50518451859084908110610ddd57fe5b602002602001018181525050866001600160a01b031663654a60ac868481518110610e0457fe5b6020026020010151868581518110610e1857fe5b6020026020010151631cd554d160e21b6040518463ffffffff1660e01b815260040180848152602001838152602001828152602001935050505060206040518083038186803b158015610e6a57600080fd5b505afa158015610e7e573d6000803e3d6000fd5b505050506040513d6020811015610e9457600080fd5b50518351849084908110610ea457fe5b602090810291909101015250600101610c49565b509199909850909650945050505050565b6000546001600160a01b031681565b60606000610ee4611182565b90506000610ef061123f565b90506000826001600160a01b031663dbf633406040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2d57600080fd5b505afa158015610f41573d6000803e3d6000fd5b505050506040513d6020811015610f5757600080fd5b5051604080518281526020808402820101909152909150606090828015610f88578160200160208202803883390190505b50905060005b82811015611179576000856001600160a01b031663835e119c836040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610fdc57600080fd5b505afa158015610ff0573d6000803e3d6000fd5b505050506040513d602081101561100657600080fd5b50516040805163dbd06c8560e01b815290519192506001600160a01b038088169263af3aea86929185169163dbd06c85916004808301926020929190829003018186803b15801561105657600080fd5b505afa15801561106a573d6000803e3d6000fd5b505050506040513d602081101561108057600080fd5b5051604080516001600160e01b031960e085901b1681526004810192909252516024808301926020929190829003018186803b1580156110bf57600080fd5b505afa1580156110d3573d6000803e3d6000fd5b505050506040513d60208110156110e957600080fd5b50511561117057806001600160a01b031663dbd06c856040518163ffffffff1660e01b815260040160206040518083038186803b15801561112957600080fd5b505afa15801561113d573d6000803e3d6000fd5b505050506040513d602081101561115357600080fd5b5051835184908490811061116357fe5b6020026020010181815250505b50600101610f8e565b50935050505090565b600080546040805163dacb2d0160e01b8152680a6f2dce8d0cae8d2f60bb1b600482015260248101829052601960448201527f4d697373696e672053796e746865746978206164647265737300000000000000606482015290516001600160a01b039092169163dacb2d0191608480820192602092909190829003018186803b15801561120e57600080fd5b505afa158015611222573d6000803e3d6000fd5b505050506040513d602081101561123857600080fd5b5051905090565b600080546040805163dacb2d0160e01b81526c45786368616e6765526174657360981b600482015260248101829052601d60448201527f4d697373696e672045786368616e676552617465732061646472657373000000606482015290516001600160a01b039092169163dacb2d0191608480820192602092909190829003018186803b15801561120e57600080fdfea265627a7a723158209e7ba686f73798746736e8ff9d170da8215f2ad60eb6b3c4ba5c14e221d4140064736f6c63430005100032", "abi": [ diff --git a/publish/index.js b/publish/index.js index 81dc5be5fd..1a5c17468f 100644 --- a/publish/index.js +++ b/publish/index.js @@ -13,7 +13,6 @@ require('./src/commands/deploy').cmd(program); require('./src/commands/extract-staking-balances').cmd(program); require('./src/commands/finalize-release').cmd(program); require('./src/commands/import-fee-periods').cmd(program); -require('./src/commands/migrate-binary-option-markets').cmd(program); require('./src/commands/nominate').cmd(program); require('./src/commands/owner').cmd(program); require('./src/commands/persist-tokens').cmd(program); diff --git a/publish/ovm-ignore.json b/publish/ovm-ignore.json index 5e5fbdebd3..021c4766ee 100644 --- a/publish/ovm-ignore.json +++ b/publish/ovm-ignore.json @@ -1,18 +1,10 @@ [ - "BinaryOption", - "BinaryOptionMarket", - "BinaryOptionMarketData", - "BinaryOptionMarketFactory", - "BinaryOptionMarketManager", "Collateral", "CollateralErc20", "CollateralEth", "CollateralShort", "ExchangerWithVirtualSynth", "FakeTradingRewards", - "MockBinaryOptionMarket", - "MockBinaryOptionMarketManager", - "TestableBinaryOptionMarket", "Synthetix", "NativeEtherWrapper", "WETH" diff --git a/publish/src/commands/deploy/deploy-binary-options.js b/publish/src/commands/deploy/deploy-binary-options.js deleted file mode 100644 index 34efc6ee7b..0000000000 --- a/publish/src/commands/deploy/deploy-binary-options.js +++ /dev/null @@ -1,49 +0,0 @@ -'use strict'; - -const { gray } = require('chalk'); - -const { - utils: { parseUnits }, -} = require('ethers'); - -module.exports = async ({ account, addressOf, deployer }) => { - // ---------------- - // Binary option market factory and manager setup - // ---------------- - - console.log(gray(`\n------ DEPLOY BINARY OPTIONS ------\n`)); - - const { ReadProxyAddressResolver } = deployer.deployedContracts; - - await deployer.deployContract({ - name: 'BinaryOptionMarketFactory', - args: [account, addressOf(ReadProxyAddressResolver)], - deps: ['AddressResolver'], - }); - - const day = 24 * 60 * 60; - const maxOraclePriceAge = 120 * 60; // Price updates are accepted from up to two hours before maturity to allow for delayed chainlink heartbeats. - const expiryDuration = 26 * 7 * day; // Six months to exercise options before the market is destructible. - const maxTimeToMaturity = 730 * day; // Markets may not be deployed more than two years in the future. - const creatorCapitalRequirement = parseUnits('1000').toString(); // 1000 sUSD is required to create a new market. - const creatorSkewLimit = parseUnits('0.05').toString(); // Market creators must leave 5% or more of their position on either side. - const poolFee = parseUnits('0.008').toString(); // 0.8% of the market's value goes to the pool in the end. - const creatorFee = parseUnits('0.002').toString(); // 0.2% of the market's value goes to the creator. - const refundFee = parseUnits('0.05').toString(); // 5% of a bid stays in the pot if it is refunded. - await deployer.deployContract({ - name: 'BinaryOptionMarketManager', - args: [ - account, - addressOf(ReadProxyAddressResolver), - maxOraclePriceAge, - expiryDuration, - maxTimeToMaturity, - creatorCapitalRequirement, - creatorSkewLimit, - poolFee, - creatorFee, - refundFee, - ], - deps: ['AddressResolver'], - }); -}; diff --git a/publish/src/commands/deploy/deploy-dapp-utils.js b/publish/src/commands/deploy/deploy-dapp-utils.js index 67d2b944db..b1903ca8ef 100644 --- a/publish/src/commands/deploy/deploy-dapp-utils.js +++ b/publish/src/commands/deploy/deploy-dapp-utils.js @@ -17,8 +17,4 @@ module.exports = async ({ account, addressOf, deployer }) => { name: 'DappMaintenance', args: [account], }); - - await deployer.deployContract({ - name: 'BinaryOptionMarketData', - }); }; diff --git a/publish/src/commands/deploy/index.js b/publish/src/commands/deploy/index.js index c52f83f241..5161236556 100644 --- a/publish/src/commands/deploy/index.js +++ b/publish/src/commands/deploy/index.js @@ -34,7 +34,6 @@ const deployCore = require('./deploy-core'); const deploySynths = require('./deploy-synths'); const deployLoans = require('./deploy-loans'); const deployDappUtils = require('./deploy-dapp-utils.js'); -const deployBinaryOptions = require('./deploy-binary-options'); const importAddresses = require('./import-addresses'); const rebuildResolverCaches = require('./rebuild-resolver-caches'); const configureLegacySettings = require('./configure-legacy-settings'); @@ -315,12 +314,6 @@ const deploy = async ({ useOvm, }); - await deployBinaryOptions({ - account, - addressOf, - deployer, - }); - await deployDappUtils({ account, addressOf, diff --git a/publish/src/commands/deploy/rebuild-resolver-caches.js b/publish/src/commands/deploy/rebuild-resolver-caches.js index 42d3575a65..82c957f915 100644 --- a/publish/src/commands/deploy/rebuild-resolver-caches.js +++ b/publish/src/commands/deploy/rebuild-resolver-caches.js @@ -18,11 +18,7 @@ module.exports = async ({ runStep, useOvm, }) => { - const { - AddressResolver, - BinaryOptionMarketManager, - ReadProxyAddressResolver, - } = deployer.deployedContracts; + const { AddressResolver, ReadProxyAddressResolver } = deployer.deployedContracts; // Legacy contracts. if (network === 'mainnet' && !useOvm) { @@ -204,138 +200,6 @@ module.exports = async ({ } } - // Now do binary option market cache rebuilding - if (BinaryOptionMarketManager) { - console.log(gray('Checking all binary option markets have rebuilt caches')); - let binaryOptionMarkets = []; - // now grab all possible binary option markets to rebuild caches as well - const binaryOptionsFetchPageSize = 100; - for (const marketType of ['Active', 'Matured']) { - const numBinaryOptionMarkets = Number( - await BinaryOptionMarketManager[`num${marketType}Markets`]() - ); - console.log( - gray('Found'), - yellow(numBinaryOptionMarkets), - gray(marketType, 'binary option markets') - ); - - if (numBinaryOptionMarkets > binaryOptionsFetchPageSize) { - console.log( - redBright( - '⚠⚠⚠ Warning: cannot fetch all', - marketType, - 'binary option markets as there are', - numBinaryOptionMarkets, - 'which is more than page size of', - binaryOptionsFetchPageSize - ) - ); - } else { - // fetch the list of markets - const marketAddresses = await BinaryOptionMarketManager[ - `${marketType.toLowerCase()}Markets` - ](0, binaryOptionsFetchPageSize); - - // wrap them in a contract via the deployer - const markets = marketAddresses.map( - binaryOptionMarket => - new ethers.Contract( - binaryOptionMarket, - compiled['BinaryOptionMarket'].abi, - deployer.provider - ) - ); - - binaryOptionMarkets = binaryOptionMarkets.concat(markets); - } - } - - // now figure out which binary option markets need their caches rebuilt - const binaryOptionMarketsToRebuildCacheOn = []; - for (const market of binaryOptionMarkets) { - try { - const isCached = await market.isResolverCached(); - if (!isCached) { - binaryOptionMarketsToRebuildCacheOn.push(addressOf(market)); - } - console.log( - gray('Binary option market'), - yellow(addressOf(market)), - gray('is newer and cache status'), - yellow(isCached) - ); - } catch (err) { - // the challenge being that some used an older MixinResolver API - const oldBinaryOptionMarketABI = [ - { - constant: true, - inputs: [ - { - internalType: 'contract AddressResolver', - name: '_resolver', - type: 'address', - }, - ], - name: 'isResolverCached', - outputs: [ - { - internalType: 'bool', - name: '', - type: 'bool', - }, - ], - payable: false, - stateMutability: 'view', - type: 'function', - signature: '0x631e1444', - }, - ]; - - const oldBinaryOptionMarket = new ethers.Contract( - addressOf(market), - oldBinaryOptionMarketABI, - deployer.provider - ); - - const isCached = await oldBinaryOptionMarket.isResolverCached( - addressOf(ReadProxyAddressResolver) - ); - if (!isCached) { - binaryOptionMarketsToRebuildCacheOn.push(addressOf(market)); - } - - console.log( - gray('Binary option market'), - yellow(addressOf(market)), - gray('is older and cache status'), - yellow(isCached) - ); - } - } - - console.log( - gray('In total'), - yellow(binaryOptionMarketsToRebuildCacheOn.length), - gray('binary option markets need their caches rebuilt') - ); - - const addressesChunkSize = useOvm ? 7 : 20; - let binaryOptionBatchCounter = 1; - for (let i = 0; i < binaryOptionMarketsToRebuildCacheOn.length; i += addressesChunkSize) { - const chunk = binaryOptionMarketsToRebuildCacheOn.slice(i, i + addressesChunkSize); - await runStep({ - gasLimit: 7e6, - contract: `BinaryOptionMarketManager`, - target: BinaryOptionMarketManager, - publiclyCallable: true, // does not require owner - write: 'rebuildMarketCaches', - writeArg: [chunk], - comment: `Rebuild the caches of existing Binary Option Markets - batch ${binaryOptionBatchCounter++}`, - }); - } - } - // Now perform a sync of legacy contracts that have not been replaced in Shaula (v2.35.x) // EtherCollateral, EtherCollateralsUSD console.log(gray('Checking all legacy contracts with setResolverAndSyncCache() are rebuilt...')); diff --git a/publish/src/commands/migrate-binary-option-markets.js b/publish/src/commands/migrate-binary-option-markets.js deleted file mode 100644 index cc7245b837..0000000000 --- a/publish/src/commands/migrate-binary-option-markets.js +++ /dev/null @@ -1,336 +0,0 @@ -'use strict'; - -const ethers = require('ethers'); -const { red, gray, green, yellow } = require('chalk'); - -const { - constants: { CONFIG_FILENAME, DEPLOYMENT_FILENAME }, -} = require('../../..'); - -const DEFAULTS = { - gasPrice: '1', - gasLimit: 2.0e6, // 1.5m - network: 'kovan', - chunkSize: 15, -}; - -const { - ensureNetwork, - ensureDeploymentPath, - getDeploymentPathForNetwork, - loadAndCheckRequiredSources, - loadConnections, - confirmAction, - stringify, -} = require('../util'); - -const migrateBinaryOptionMarkets = async ({ - deploymentPath, - network = DEFAULTS.network, - gasPrice = DEFAULTS.gasPrice, - gasLimit = DEFAULTS.gasLimit, - chunkSize = DEFAULTS.chunkSize, - sourceContractAddress, - targetContractAddress, - privateKey, - yes, -}) => { - ensureNetwork(network); - deploymentPath = deploymentPath || getDeploymentPathForNetwork({ network }); - ensureDeploymentPath(deploymentPath); - - const { deployment } = loadAndCheckRequiredSources({ - deploymentPath, - network, - }); - - const { providerUrl, privateKey: envPrivateKey, explorerLinkPrefix } = loadConnections({ - network, - }); - - // allow local deployments to use the private key passed as a CLI option - if (network !== 'local' || !privateKey) { - privateKey = envPrivateKey; - } - - const provider = new ethers.providers.JsonRpcProvider(providerUrl); - const wallet = new ethers.Wallet(privateKey, provider); - - console.log(gray(`Using account with public key ${yellow(wallet.address)}`)); - - const { address: resolverAddress } = deployment.targets['AddressResolver']; - console.log(gray(`Using AddressResolver at ${yellow(resolverAddress)}.`)); - console.log(gray(`Gas Price: ${yellow(gasPrice)} gwei`)); - - const { source } = deployment.targets['BinaryOptionMarketManager']; - - if (!ethers.utils.isAddress(sourceContractAddress)) { - throw Error( - 'Invalid address detected for source (please check your inputs): ', - sourceContractAddress - ); - } - if (!ethers.utils.isAddress(targetContractAddress)) { - throw Error( - 'Invalid address detected for target (please check your inputs): ', - targetContractAddress - ); - } - - const { abi } = deployment.sources[source]; - if (sourceContractAddress.toLowerCase() === targetContractAddress.toLowerCase()) { - throw Error('Cannot use the same address as the source and the target. Check your inputs.'); - } else { - console.log( - gray(`Migrating from source BinaryOptionMarketManager at: ${yellow(sourceContractAddress)}`) - ); - console.log( - gray(`Receiving into target BinaryOptionMarketManager at: ${yellow(targetContractAddress)}`) - ); - } - const sourceContract = new ethers.Contract(sourceContractAddress, abi, wallet); - const targetContract = new ethers.Contract(targetContractAddress, abi, wallet); - - const numActiveMarkets = parseInt(await sourceContract.numActiveMarkets()); - const numMaturedMarkets = parseInt(await sourceContract.numMaturedMarkets()); - - console.log( - gray( - `Found ${yellow(numActiveMarkets)} active markets and ${yellow( - numMaturedMarkets - )} matured markets. Fetching...` - ) - ); - - const activeMarkets = []; - const maturedMarkets = []; - const fetchChunkSize = 100; - - for (let i = 0; i < numActiveMarkets; i += fetchChunkSize) { - activeMarkets.push(...(await sourceContract.activeMarkets(i, i + fetchChunkSize))); - } - - if (activeMarkets.length !== numActiveMarkets) { - throw Error( - `Number of active markets fetched does not match expected. (${activeMarkets.length} != ${numActiveMarkets})` - ); - } - - for (let i = 0; i < numMaturedMarkets; i += fetchChunkSize) { - maturedMarkets.push(...(await sourceContract.maturedMarkets(i, i + fetchChunkSize))); - } - - if (maturedMarkets.length !== numMaturedMarkets) { - throw Error( - `Number of active markets fetched does not match expected. (${maturedMarkets.length} != ${numMaturedMarkets})` - ); - } - - console.log(gray('The active markets to migrate:')); - console.log(gray(stringify(activeMarkets))); - console.log(gray('The matured markets to migrate:')); - console.log(gray(stringify(maturedMarkets))); - - console.log( - gray( - `Setting the migrating manager in ${yellow(targetContractAddress)} to ${yellow( - sourceContractAddress - )}.` - ) - ); - - if (!yes) { - try { - await confirmAction( - yellow(`Attempt to set the migrating manager on the receiving manager (y/n) ?`) - ); - } catch (err) { - console.log(gray('Operation cancelled')); - return; - } - } - - console.log( - yellow(`Attempting action BinaryOptionMarket.setMigratingManager(${sourceContractAddress})`) - ); - const tx = await targetContract.setMigratingManager(sourceContractAddress, { - gasLimit: ethers.BigNumber.from(gasLimit), - gasPrice: ethers.utils.parseUnits(gasPrice, 'gwei'), - }); - const { transactionHash } = await tx.wait(); - - console.log( - green( - `Successfully set migrating manager with transaction: ${explorerLinkPrefix}/tx/${transactionHash}` - ) - ); - - console.log(gray(`Migration will be attempted in batches of ${yellow(chunkSize)}.`)); - - console.log( - gray( - `Beginning migration of active markets from ${yellow(targetContractAddress)} to ${yellow( - sourceContractAddress - )}.` - ) - ); - for (let i = 0; i < activeMarkets.length; i += chunkSize) { - console.log(yellow('Migrate the following active markets?')); - const chunk = activeMarkets.slice(i, i + chunkSize); - console.log(yellow(stringify(chunk))); - - if (!yes) { - try { - await confirmAction( - yellow(`Do you want to continue importing these ${chunk.length} active markets (y/n) ?`) - ); - } catch (err) { - console.log(gray('Operation cancelled')); - return; - } - } - - console.log( - gray( - `Attempting to invoke BinaryOptionMarketManager.rebuildMarketCaches(${stringify(chunk)}).` - ) - ); - let tx = await sourceContract.rebuildMarketCaches(chunk, { - gasLimit: ethers.BigNumber.from(gasLimit), - gasPrice: ethers.utils.parseUnits(gasPrice, 'gwei'), - }); - let result = await tx.wait(); - - console.log( - green( - `Successfully synchronised markets with transaction: ${explorerLinkPrefix}/tx/${result.transactionHash}` - ) - ); - - console.log( - gray( - `Attempting to invoke BinaryOptionMarketManager.migrateMarkets(${targetContractAddress}, true, ${stringify( - chunk - )}).` - ) - ); - tx = await sourceContract.migrateMarkets(targetContractAddress, true, chunk, { - gasLimit: ethers.BigNumber.from(gasLimit), - gasPrice: ethers.utils.parseUnits(gasPrice, 'gwei'), - }); - result = await tx.wait(); - console.log( - green( - `Successfully migrated markets with transaction: ${explorerLinkPrefix}/tx/${result.transactionHash}` - ) - ); - } - - console.log( - gray( - `Beginning migration of matured markets from ${yellow(targetContractAddress)} to ${yellow( - sourceContractAddress - )}.` - ) - ); - for (let i = 0; i < maturedMarkets.length; i += chunkSize) { - console.log(yellow('Migrate the following markets?')); - - const chunk = maturedMarkets.slice(i, i + chunkSize); - console.log(yellow(stringify(chunk))); - - if (!yes) { - try { - await confirmAction( - yellow(`Do you want to continue importing these ${chunk.length} matured markets (y/n) ?`) - ); - } catch (err) { - console.log(gray('Operation cancelled')); - return; - } - } - - console.log( - gray( - `Attempting to invoke BinaryOptionMarketManager.rebuildMarketCaches(${stringify(chunk)}).` - ) - ); - let tx = await sourceContract.rebuildMarketCaches(chunk, { - gasLimit: ethers.BigNumber.from(gasLimit), - gasPrice: ethers.utils.parseUnits(gasPrice, 'gwei'), - }); - let result = await tx.wait(); - console.log( - green( - `Successfully synchronised markets with transaction: ${explorerLinkPrefix}/tx/${result.transactionHash}` - ) - ); - console.log( - gray( - `Attempting to invoke BinaryOptionMarketManager.migrateMarkets(${targetContractAddress}, false, ${stringify( - chunk - )}).` - ) - ); - tx = await sourceContract.migrateMarkets(targetContractAddress, false, chunk, { - gasLimit: ethers.BigNumber.from(gasLimit), - gasPrice: ethers.utils.parseUnits(gasPrice, 'gwei'), - }); - result = await tx.wait(); - console.log( - green( - `Successfully migrated markets with transaction: ${explorerLinkPrefix}/tx/${result.transactionHash}` - ) - ); - } - - console.log(gray('Action complete.')); -}; - -module.exports = { - migrateBinaryOptionMarkets, - cmd: program => - program - .command('migrate-binary-option-markets') - .description('Migrate binary option markets') - .option( - '-d, --deployment-path ', - `Path to a folder that has your input configuration file (${CONFIG_FILENAME}) and where your ${DEPLOYMENT_FILENAME} files will go` - ) - .option('-g, --gas-price ', 'Gas price in GWEI', DEFAULTS.gasPrice) - .option('-l, --gas-limit ', 'Gas limit', parseInt, DEFAULTS.gasLimit) - .option( - '-s, --source-contract-address ', - 'The Binary Option Market Manager source contract address' - ) - .option( - '-t, --target-contract-address ', - 'The Binary Option Market Manager target contract address' - ) - .option( - '-c, --chunk-size ', - 'The number of markets to migrate per chunk', - DEFAULTS.chunkSize - ) - .option( - '-n, --network ', - 'The network to run off.', - x => x.toLowerCase(), - DEFAULTS.network - ) - .option( - '-v, --private-key [value]', - 'The private key to deploy with (only works in local mode, otherwise set in .env).' - ) - .option('-y, --yes', 'Dont prompt, just reply yes.') - - .action(async (...args) => { - try { - await migrateBinaryOptionMarkets(...args); - } catch (err) { - // show pretty errors for CLI users - console.error(red(err)); - process.exitCode = 1; - } - }), -}; diff --git a/test/contracts/BinaryOption.js b/test/contracts/BinaryOption.js deleted file mode 100644 index 0825f84a74..0000000000 --- a/test/contracts/BinaryOption.js +++ /dev/null @@ -1,651 +0,0 @@ -'use strict'; - -const { artifacts, contract, web3 } = require('hardhat'); -const { toBN } = web3.utils; - -const { assert, addSnapshotBeforeRestoreAfterEach } = require('./common'); -const { fastForward, toUnit } = require('../utils')(); - -const { ensureOnlyExpectedMutativeFunctions, onlyGivenAddressCanInvoke } = require('./helpers'); - -let MockBinaryOptionMarket; -let BinaryOption; - -const ZERO_ADDRESS = '0x' + '0'.repeat(40); - -contract('BinaryOption', accounts => { - const [account, bidder, recipient] = accounts; - - const biddingTime = 100; - const initialBid = toUnit(5); - - let market, option; - - before(async () => { - MockBinaryOptionMarket = artifacts.require('MockBinaryOptionMarket'); - BinaryOption = artifacts.require('BinaryOption'); - - market = await MockBinaryOptionMarket.new(); - await Promise.all([ - market.setSenderPrice(toUnit(0.5)), - market.setDeposited(initialBid.mul(toBN(2))), // Simulate a bid on the other side of the market. - market.deployOption(bidder, initialBid), - ]); - option = await BinaryOption.at(await market.binaryOption()); - }); - - addSnapshotBeforeRestoreAfterEach(); - - async function assertAllPromises(promises, expected, assertion, assertionName) { - if (promises.length !== expected.length) { - throw new Error('Promise and expected result arrays differ in length.'); - } - - const nameString = assertionName ? `'${assertionName}' ` : ''; - const results = await Promise.all(promises); - results.forEach((r, i) => - assertion(r, expected[i], `Assertion ${nameString}at index ${i} failed.`) - ); - } - - async function assertAllBnEqual(promises, expected) { - return assertAllPromises(promises, expected, assert.bnEqual, 'bnEqual'); - } - - describe('Basic Parameters', () => { - it('Static parameters are set properly', async () => { - assert.equal(await option.name(), 'SNX Binary Option'); - assert.equal(await option.symbol(), 'sOPT'); - assert.bnEqual(await option.decimals(), toBN(18)); - assert.equal(await option.market(), market.address); - }); - - it('Initial bid details are recorded properly', async () => { - assert.bnEqual(await option.bidOf(bidder), initialBid); - assert.bnEqual(await option.totalBids(), initialBid); - }); - - it('Only expected functions are mutative', async () => { - ensureOnlyExpectedMutativeFunctions({ - abi: option.abi, - expected: [ - 'bid', - 'refund', - 'claim', - 'exercise', - 'expire', - 'transfer', - 'transferFrom', - 'approve', - ], - }); - }); - }); - - describe('Bids', () => { - it('Can place bids during bidding.', async () => { - await market.bid(bidder, toUnit(1)); - assert.bnEqual(await option.bidOf(bidder), initialBid.add(toUnit(1))); - }); - - it('Zero bids are idempotent.', async () => { - await market.bid(bidder, toUnit(0)); - assert.bnEqual(await option.bidOf(bidder), initialBid); - }); - - it('Bids less than one cent fail.', async () => { - await assert.revert(market.bid(recipient, toUnit(0.0099)), 'Balance < $0.01'); - }); - - it('Bids properly update totals.', async () => { - // Existing bidder bids. - const newBid = toUnit(1); - let newSupply = initialBid.add(newBid); - let newClaimable = newSupply.mul(toBN(2)); - await market.bid(bidder, newBid); - - await assertAllBnEqual( - [ - option.bidOf(bidder), - option.totalBids(), - option.balanceOf(bidder), - option.totalSupply(), - option.totalClaimableSupply(), - ], - [newSupply, newSupply, toUnit(0), toUnit(0), newClaimable] - ); - - // New bidder bids. - newSupply = newSupply.add(newBid); - newClaimable = newSupply.mul(toBN(2)); - await market.bid(recipient, newBid); - - await assertAllBnEqual( - [ - option.bidOf(recipient), - option.totalBids(), - option.balanceOf(recipient), - option.totalSupply(), - option.totalClaimableSupply(), - ], - [newBid, newSupply, toUnit(0), toUnit(0), newClaimable] - ); - }); - - it('Bids cannot be sent other than from the market.', async () => { - await onlyGivenAddressCanInvoke({ - fnc: option.bid, - args: [bidder, toUnit(1)], - accounts, - skipPassCheck: true, - reason: 'Only market allowed', - }); - }); - }); - - describe('Refunds', () => { - it('Can process refunds during bidding.', async () => { - await market.bid(bidder, toUnit(1)); - await market.refund(bidder, toUnit(1)); - assert.bnEqual(await option.bidOf(bidder), initialBid); - }); - - it('Zero refunds are idempotent.', async () => { - await market.refund(bidder, toUnit(0)); - assert.bnEqual(await option.bidOf(bidder), initialBid); - }); - - it("Rejects refunds larger than the wallet's bid balance.", async () => { - await market.bid(recipient, toUnit(1)); - await assert.revert(market.refund(recipient, toUnit(2)), 'SafeMath: subtraction overflow'); - }); - - it('Refunds resulting in a balance less than one cent fail.', async () => { - await assert.revert(market.refund(bidder, initialBid.sub(toUnit(0.0099))), 'Balance < $0.01'); - }); - - it('Refunds properly update totals and price.', async () => { - // Partial refund. - const refund = toUnit(1); - const newSupply = initialBid.sub(refund); - const newClaimable = newSupply.mul(toBN(2)); - - await market.refund(bidder, refund); - await assertAllBnEqual( - [ - option.bidOf(bidder), - option.totalBids(), - option.balanceOf(bidder), - option.totalSupply(), - option.totalClaimableSupply(), - ], - [newSupply, newSupply, toBN(0), toBN(0), newClaimable] - ); - - // Refund remaining funds. - await market.refund(bidder, newSupply); - await assertAllBnEqual( - [ - option.bidOf(bidder), - option.totalBids(), - option.balanceOf(bidder), - option.totalSupply(), - option.totalClaimableSupply(), - ], - [toBN(0), toBN(0), toBN(0), toBN(0), toBN(0)] - ); - }); - - it('Refunds cannot be sent other than from the market.', async () => { - await onlyGivenAddressCanInvoke({ - fnc: option.refund, - args: [bidder, toUnit(1)], - accounts, - skipPassCheck: true, - reason: 'Only market allowed', - }); - }); - }); - - describe('Claiming Options', () => { - it('Options can be claimed.', async () => { - await fastForward(biddingTime * 2); - - const optionsOwed = await option.claimableBalanceOf(bidder); - await market.claimOptions({ from: bidder }); - assert.bnEqual(await option.balanceOf(bidder), optionsOwed); - - // Ensure that users with no bids can't claim anything. - await market.claimOptions({ from: account }); - assert.bnEqual(await option.balanceOf(account), toBN(0)); - }); - - it('Options can only be claimed from the market.', async () => { - const { price, _deposited } = await market.senderPriceAndExercisableDeposits(); - - await onlyGivenAddressCanInvoke({ - fnc: option.claim, - args: [bidder, price, _deposited], - accounts, - skipPassCheck: true, - reason: 'Only market allowed', - }); - }); - - it('Claiming options properly updates totals.', async () => { - await fastForward(biddingTime * 2); - - await market.bid(recipient, initialBid); - // And we will assume some mysterious other person bid on the other side to keep the price balanced. - await market.setDeposited(initialBid.mul(toBN(4))); - - const halfClaimable = initialBid.mul(toBN(2)); - const claimable = initialBid.mul(toBN(4)); - - await assertAllBnEqual( - [ - option.bidOf(bidder), - option.totalBids(), - option.claimableBalanceOf(bidder), - option.claimableBalanceOf(recipient), - option.totalClaimableSupply(), - option.balanceOf(bidder), - option.balanceOf(recipient), - option.totalSupply(), - ], - [ - initialBid, - initialBid.mul(toBN(2)), - halfClaimable, - halfClaimable, - claimable, - toBN(0), - toBN(0), - toBN(0), - ] - ); - - await market.claimOptions({ from: bidder }); - - await assertAllBnEqual( - [ - option.bidOf(bidder), - option.totalBids(), - option.claimableBalanceOf(bidder), - option.claimableBalanceOf(recipient), - option.totalClaimableSupply(), - option.balanceOf(bidder), - option.balanceOf(recipient), - option.totalSupply(), - ], - [ - toBN(0), - initialBid, - toBN(0), - halfClaimable, - halfClaimable, - halfClaimable, - toBN(0), - halfClaimable, - ] - ); - }); - - it('Claiming options correctly emits events.', async () => { - await fastForward(biddingTime * 2); - const tx = await market.claimOptions({ from: bidder }); - const logs = BinaryOption.decodeLogs(tx.receipt.rawLogs); - - assert.eventEqual(logs[0], 'Transfer', { - from: ZERO_ADDRESS, - to: bidder, - value: initialBid.mul(toBN(2)), - }); - - assert.eventEqual(logs[1], 'Issued', { - account: bidder, - value: initialBid.mul(toBN(2)), - }); - }); - - it('Claims operate correctly if options have been transferred into an account already.', async () => { - await market.bid(recipient, initialBid); - await fastForward(biddingTime * 2); - await market.claimOptions({ from: recipient }); - option.transfer(bidder, initialBid.mul(toBN(2)), { from: recipient }); - await market.claimOptions({ from: bidder }); - assert.bnEqual(await option.balanceOf(bidder), initialBid.mul(toBN(4))); - }); - - it('Options owed is correctly computed.', async () => { - const owed = initialBid.mul(toBN(2)); - - await assertAllBnEqual( - [option.claimableBalanceOf(bidder), option.totalClaimableSupply()], - [owed, owed] - ); - }); - - it('No options are owed if the supply is zero.', async () => { - await market.setDeposited(toBN(0)); - - await assertAllBnEqual( - [option.claimableBalanceOf(bidder), option.totalClaimableSupply()], - [toBN(0), toBN(0)] - ); - }); - - it('Options claimable properly handles subtracted rounding dust for the last claimant.', async () => { - const dust = toBN(10); - - // Two bidders - await market.bid(recipient, initialBid); - - // Subtract a bit of rounding dust from the total deposits. - const depositedMinusDust = initialBid.mul(toBN(4)).sub(dust); - await market.setDeposited(depositedMinusDust); - - // Total claimable equals the deposited quantity. - assert.bnEqual(await option.totalClaimableSupply(), depositedMinusDust); - - // The recipient can claim their full quantity. - assert.bnEqual(await option.claimableBalanceOf(recipient), initialBid.mul(toBN(2))); - await market.claimOptions({ from: recipient }); - - // But the last bidder eats the loss due to dust. - assert.bnEqual(await option.totalClaimableSupply(), initialBid.mul(toBN(2)).sub(dust)); - assert.bnEqual(await option.claimableBalanceOf(bidder), initialBid.mul(toBN(2)).sub(dust)); - - await market.claimOptions({ from: bidder }); - assert.bnEqual(await option.totalClaimableSupply(), toBN(0)); - assert.bnEqual(await option.balanceOf(bidder), initialBid.mul(toBN(2)).sub(dust)); - }); - - it('Options claimable properly handles subtracted rounding dust if previous claimants exercise first.', async () => { - const dust = toBN(10); - - // Two bidders - await market.bid(recipient, initialBid); - - // Subtract a bit of rounding dust from the total deposits. - const depositedMinusDust = initialBid.mul(toBN(4)).sub(dust); - await market.setDeposited(depositedMinusDust); - - // Total claimable equals the deposited quantity. - assert.bnEqual(await option.totalClaimableSupply(), depositedMinusDust); - - // The recipient can claim their full quantity. - assert.bnEqual(await option.claimableBalanceOf(recipient), initialBid.mul(toBN(2))); - await market.claimOptions({ from: recipient }); - await market.exerciseOptions({ from: recipient }); - - // But the last bidder eats the loss due to dust. - assert.bnEqual(await option.totalClaimableSupply(), initialBid.mul(toBN(2)).sub(dust)); - assert.bnEqual(await option.claimableBalanceOf(bidder), initialBid.mul(toBN(2)).sub(dust)); - - await market.claimOptions({ from: bidder }); - assert.bnEqual(await option.totalClaimableSupply(), toBN(0)); - assert.bnEqual(await option.balanceOf(bidder), initialBid.mul(toBN(2)).sub(dust)); - }); - - it('Options claimable properly handles added rounding dust for the last claimant.', async () => { - const dust = toBN(10); - - // Two bidders - await market.bid(recipient, initialBid); - - // Add a bit of rounding dust from the total deposits. - const depositedPlusDust = initialBid.mul(toBN(4)).add(dust); - await market.setDeposited(depositedPlusDust); - - // Total claimable equals the deposited quantity. - assert.bnEqual(await option.totalClaimableSupply(), depositedPlusDust); - - // The recipient can claim their full quantity. - assert.bnEqual(await option.claimableBalanceOf(recipient), initialBid.mul(toBN(2))); - await market.claimOptions({ from: recipient }); - await market.exerciseOptions({ from: recipient }); - - // But the last bidder gets the extra dust. - assert.bnEqual(await option.totalClaimableSupply(), initialBid.mul(toBN(2)).add(dust)); - assert.bnEqual(await option.claimableBalanceOf(bidder), initialBid.mul(toBN(2)).add(dust)); - - await market.claimOptions({ from: bidder }); - assert.bnEqual(await option.totalClaimableSupply(), toBN(0)); - assert.bnEqual(await option.balanceOf(bidder), initialBid.mul(toBN(2)).add(dust)); - }); - - it('Option claiming fails when claimable balance is higher than the remaining supply.', async () => { - // Two bidders - await market.bid(recipient, toUnit(0.5)); - // Ensure there's insufficient balance. - await market.setDeposited(toUnit(1)); - await assert.revert(option.claimableBalanceOf(bidder), 'supply < claimable'); - await assert.revert(market.claimOptions({ from: bidder }), 'supply < claimable'); - }); - }); - - describe('Transfers', () => { - it('Can transfer tokens.', async () => { - await fastForward(biddingTime * 2); - await market.claimOptions({ from: bidder }); - await option.transfer(recipient, toUnit(1), { from: bidder }); - }); - - it('Transfers properly update balances', async () => { - // Transfer partial quantity. - await fastForward(biddingTime * 2); - const claimableOptions = await option.claimableBalanceOf(bidder); - const half = claimableOptions.div(toBN(2)); - await market.claimOptions({ from: bidder }); - await option.transfer(recipient, half, { from: bidder }); - - // Check that balances have updated properly. - await assertAllBnEqual( - [option.balanceOf(bidder), option.balanceOf(recipient)], - [initialBid, initialBid] - ); - - // Transfer full balance. - await option.transfer(bidder, half, { from: recipient }); - await assertAllBnEqual( - [option.balanceOf(bidder), option.balanceOf(recipient), option.totalSupply()], - [initialBid.mul(toBN(2)), toBN(0), initialBid.mul(toBN(2))] - ); - }); - - it('Transfers properly emit events', async () => { - // Transfer partial quantity. - await fastForward(biddingTime * 2); - await market.claimOptions({ from: bidder }); - const tx = await option.transfer(recipient, toUnit(2.5), { from: bidder }); - - assert.eventEqual(tx.logs[0], 'Transfer', { - from: bidder, - to: recipient, - value: toUnit(2.5), - }); - }); - - it('Cannot transfer on insufficient balance', async () => { - await fastForward(biddingTime * 2); - await market.claimOptions({ from: bidder }); - await assert.revert( - option.transfer(recipient, toUnit(1000), { from: bidder }), - 'Insufficient balance' - ); - }); - - it('Approvals properly update allowance values', async () => { - await option.approve(recipient, toUnit(10), { from: bidder }); - assert.bnEqual(await option.allowance(bidder, recipient), toUnit(10)); - }); - - it('Approvals properly emit events', async () => { - const tx = await option.approve(recipient, toUnit(10), { from: bidder }); - - assert.eventEqual(tx.logs[0], 'Approval', { - owner: bidder, - spender: recipient, - value: toUnit(10), - }); - }); - - it('Can transferFrom tokens.', async () => { - await fastForward(biddingTime * 2); - await market.claimOptions({ from: bidder }); - - await option.approve(recipient, toUnit(10), { from: bidder }); - await option.transferFrom(bidder, recipient, toUnit(1), { from: recipient }); - }); - - it('transferFrom properly updates balances', async () => { - // Transfer partial quantity. - await fastForward(biddingTime * 2); - const claimableOptions = await option.claimableBalanceOf(bidder); - const half = claimableOptions.div(toBN(2)); - await market.claimOptions({ from: bidder }); - - await option.approve(recipient, toUnit(100), { from: bidder }); - await option.transferFrom(bidder, recipient, half, { from: recipient }); - - // Check that balances have updated properly. - await assertAllBnEqual( - [option.balanceOf(bidder), option.balanceOf(recipient)], - [initialBid, initialBid] - ); - - // Transfer full balance. - await option.transferFrom(bidder, recipient, half, { from: recipient }); - await assertAllBnEqual( - [option.balanceOf(bidder), option.balanceOf(recipient), option.totalSupply()], - [toBN(0), initialBid.mul(toBN(2)), initialBid.mul(toBN(2))] - ); - }); - - it('Cannot transferFrom on insufficient balance', async () => { - await fastForward(biddingTime * 2); - await market.claimOptions({ from: bidder }); - - await option.approve(recipient, toUnit(1000), { from: bidder }); - await assert.revert( - option.transferFrom(bidder, recipient, toUnit(1000), { from: recipient }), - 'Insufficient balance' - ); - }); - - it('Cannot transferFrom on insufficient allowance', async () => { - await fastForward(biddingTime * 2); - await market.claimOptions({ from: bidder }); - - await option.approve(recipient, toUnit(0.1), { from: bidder }); - await assert.revert( - option.transferFrom(bidder, recipient, toUnit(1), { from: recipient }), - 'Insufficient allowance' - ); - }); - - it('transferFrom properly emits events', async () => { - // Transfer partial quantity. - await fastForward(biddingTime * 2); - await market.claimOptions({ from: bidder }); - await option.approve(recipient, toUnit(100), { from: bidder }); - const tx = await option.transferFrom(bidder, recipient, toUnit(2.5), { from: recipient }); - - assert.eventEqual(tx.logs[0], 'Transfer', { - from: bidder, - to: recipient, - value: toUnit(2.5), - }); - }); - - it('Transfers and approvals cannot go to invalid addresses.', async () => { - await assert.revert(option.transfer(ZERO_ADDRESS, toBN(0)), 'Invalid address'); - await assert.revert( - option.transferFrom(ZERO_ADDRESS, ZERO_ADDRESS, toBN(0)), - 'Invalid address' - ); - await assert.revert(option.approve(ZERO_ADDRESS, toBN(100))); - }); - }); - - describe('Exercising Options', () => { - it('Exercising options updates balances properly', async () => { - await fastForward(biddingTime * 2); - - await market.bid(recipient, initialBid); - // And we will assume some mysterious other person bid on the other side to keep the price balanced. - await market.setDeposited(initialBid.mul(toBN(4))); - - const optionsOwed = await option.claimableBalanceOf(bidder); - await market.claimOptions({ from: bidder }); - const [totalSupply, totalClaimable] = await Promise.all([ - option.totalSupply(), - option.totalClaimableSupply(), - ]); - - await market.exerciseOptions({ from: bidder }); - await assertAllBnEqual( - [option.balanceOf(bidder), option.totalSupply(), option.totalClaimableSupply()], - [toBN(0), totalSupply.sub(optionsOwed), totalClaimable] - ); - }); - - it('Exercising options with no balance does nothing.', async () => { - await fastForward(biddingTime * 2); - const totalSupply = await option.totalSupply(); - await market.claimOptions({ from: account }); - const tx = await market.exerciseOptions({ from: account }); - assertAllBnEqual([option.balanceOf(account), option.totalSupply()], [toBN(0), totalSupply]); - assert.equal(tx.logs.length, 0); - assert.equal(tx.receipt.rawLogs.length, 0); - }); - - it('Exercising options emits the proper events.', async () => { - await fastForward(biddingTime * 2); - const optionsOwed = await option.claimableBalanceOf(bidder); - await market.claimOptions({ from: bidder }); - const tx = await market.exerciseOptions({ from: bidder }); - - const logs = BinaryOption.decodeLogs(tx.receipt.rawLogs); - assert.eventEqual(logs[0], 'Transfer', { - from: bidder, - to: ZERO_ADDRESS, - value: optionsOwed, - }); - - assert.eventEqual(logs[1], 'Burned', { - account: bidder, - value: optionsOwed, - }); - }); - - it('Options can only be exercised from the market.', async () => { - await onlyGivenAddressCanInvoke({ - fnc: option.exercise, - args: [bidder], - accounts, - skipPassCheck: true, - reason: 'Only market allowed', - }); - }); - }); - - describe('Destruction', () => { - it('Binary option can be destroyed', async () => { - const address = option.address; - await market.expireOption(bidder); - assert.equal(await web3.eth.getCode(address), '0x'); - }); - - it('Binary option can only be destroyed by its parent market', async () => { - await onlyGivenAddressCanInvoke({ - fnc: option.expire, - args: [bidder], - accounts, - skipPassCheck: true, - reason: 'Only market allowed', - }); - }); - }); -}); diff --git a/test/contracts/BinaryOptionMarket.js b/test/contracts/BinaryOptionMarket.js deleted file mode 100644 index 394c55494c..0000000000 --- a/test/contracts/BinaryOptionMarket.js +++ /dev/null @@ -1,2580 +0,0 @@ -'use strict'; - -const { artifacts, contract, web3 } = require('hardhat'); -const { toBN } = web3.utils; - -const { assert, addSnapshotBeforeRestoreAfterEach } = require('./common'); -const { - currentTime, - fastForward, - toUnit, - multiplyDecimalRound, - divideDecimalRound, -} = require('../utils')(); -const { toBytes32 } = require('../..'); -const { setupAllContracts, setupContract, mockGenericContractFnc } = require('./setup'); -const { - setStatus, - ensureOnlyExpectedMutativeFunctions, - onlyGivenAddressCanInvoke, - getDecodedLogs, - decodedEventEqual, - getEventByName, -} = require('./helpers'); - -let MockBinaryOptionMarketManager; -let TestableBinaryOptionMarket; -let BinaryOptionMarket; -let BinaryOption; -let SafeDecimalMath; -let Synth; - -// All inputs should be BNs. -const computePrices = (longs, shorts, debt, fee) => { - const totalOptions = multiplyDecimalRound(debt, toUnit(1).sub(fee)); - return { - long: divideDecimalRound(longs, totalOptions), - short: divideDecimalRound(shorts, totalOptions), - }; -}; - -contract('BinaryOptionMarket', accounts => { - const [initialBidder, newBidder, pauper] = accounts; - - const ZERO_ADDRESS = '0x' + '0'.repeat(40); - - const sUSDQty = toUnit(10000); - - const capitalRequirement = toUnit(2); - const skewLimit = toUnit(0.05); - const oneDay = 60 * 60 * 24; - const maxOraclePriceAge = 61 * 60; - const expiryDuration = 26 * 7 * 24 * 60 * 60; - const biddingTime = oneDay; - const timeToMaturity = oneDay * 7; - const initialLongBid = toUnit(10); - const initialShortBid = toUnit(5); - const initialStrikePrice = toUnit(100); - const initialPoolFee = toUnit(0.008); - const initialCreatorFee = toUnit(0.002); - const initialRefundFee = toUnit(0.02); - const totalInitialFee = initialPoolFee.add(initialCreatorFee); - const sAUDKey = toBytes32('sAUD'); - - let creationTime; - - let systemStatus, - manager, - managerMock, - market, - exchangeRates, - addressResolver, - feePool, - sUSDSynth, - sUSDProxy, - oracle, - long, - short; - - const Phase = { - Bidding: toBN(0), - Trading: toBN(1), - Maturity: toBN(2), - Expiry: toBN(3), - }; - - const Side = { - Long: toBN(0), - Short: toBN(1), - }; - - const deployMarket = async ({ - resolver, - endOfBidding, - maturity, - expiry, - oracleKey, - strikePrice, - refundsEnabled, - longBid, - shortBid, - poolFee, - creatorFee, - refundFee, - creator, - }) => { - return setupContract({ - accounts, - contract: 'TestableBinaryOptionMarket', - args: [ - accounts[0], - creator, - resolver, - [capitalRequirement, skewLimit], - oracleKey, - strikePrice, - refundsEnabled, - [endOfBidding, maturity, expiry], - [longBid, shortBid], - [poolFee, creatorFee, refundFee], - ], - }); - }; - - const setupNewMarket = async () => { - ({ - SystemStatus: systemStatus, - BinaryOptionMarketManager: manager, - AddressResolver: addressResolver, - ExchangeRates: exchangeRates, - FeePool: feePool, - SynthsUSD: sUSDSynth, - } = await setupAllContracts({ - accounts, - synths: ['sUSD'], - contracts: [ - 'BinaryOptionMarketManager', - 'AddressResolver', - 'ExchangeRates', - 'FeePool', - 'Synthetix', - ], - })); - - oracle = await exchangeRates.oracle(); - await exchangeRates.updateRates([sAUDKey], [toUnit(5)], await currentTime(), { - from: oracle, - }); - - sUSDProxy = await sUSDSynth.proxy(); - - await Promise.all([ - sUSDSynth.issue(initialBidder, sUSDQty), - sUSDSynth.approve(manager.address, sUSDQty, { from: initialBidder }), - sUSDSynth.issue(newBidder, sUSDQty), - sUSDSynth.approve(manager.address, sUSDQty, { from: newBidder }), - ]); - - creationTime = await currentTime(); - const tx = await manager.createMarket( - sAUDKey, - initialStrikePrice, - true, - [creationTime + biddingTime, creationTime + timeToMaturity], - [initialLongBid, initialShortBid], - { from: initialBidder } - ); - - market = await BinaryOptionMarket.at(getEventByName({ tx, name: 'MarketCreated' }).args.market); - const options = await market.options(); - long = await BinaryOption.at(options.long); - short = await BinaryOption.at(options.short); - - await Promise.all([ - sUSDSynth.approve(market.address, sUSDQty, { from: initialBidder }), - sUSDSynth.approve(market.address, sUSDQty, { from: newBidder }), - ]); - - managerMock = await setupContract({ - accounts, - contract: 'GenericMock', - mock: 'BinaryOptionMarketManager', - }); - - const functions = [ - ['incrementTotalDeposited', []], - ['decrementTotalDeposited', []], - ['durations', [61 * 60, 0, 0]], - ['paused', [false]], - ]; - - await Promise.all( - functions.map(f => - mockGenericContractFnc({ - instance: managerMock, - fncName: f[0], - mock: 'BinaryOptionMarketManager', - returns: f[1], - }) - ) - ); - }; - - before(async () => { - MockBinaryOptionMarketManager = artifacts.require('MockBinaryOptionMarketManager'); - TestableBinaryOptionMarket = artifacts.require('TestableBinaryOptionMarket'); - BinaryOptionMarket = artifacts.require('BinaryOptionMarket'); - BinaryOption = artifacts.require('BinaryOption'); - SafeDecimalMath = artifacts.require('SafeDecimalMath'); - Synth = artifacts.require('Synth'); - - const math = await SafeDecimalMath.new(); - TestableBinaryOptionMarket.link(math); - MockBinaryOptionMarketManager.link(math); - await setupNewMarket(); - }); - - addSnapshotBeforeRestoreAfterEach(); - - describe('Basic parameters', () => { - it('static parameters are set properly', async () => { - const times = await market.times(); - assert.bnEqual(times.biddingEnd, toBN(creationTime + biddingTime)); - assert.bnEqual(times.maturity, toBN(creationTime + timeToMaturity)); - assert.bnEqual(times.expiry, toBN(creationTime + timeToMaturity + expiryDuration)); - - const oracleDetails = await market.oracleDetails(); - assert.equal(oracleDetails.key, sAUDKey); - assert.bnEqual(oracleDetails.strikePrice, initialStrikePrice); - assert.bnEqual(oracleDetails.finalPrice, toBN(0)); - - const fees = await market.fees(); - assert.bnEqual(fees.poolFee, initialPoolFee); - assert.bnEqual(fees.creatorFee, initialCreatorFee); - assert.bnEqual(fees.refundFee, initialRefundFee); - - assert.bnEqual(await market.deposited(), initialLongBid.add(initialShortBid)); - assert.equal(await market.owner(), manager.address); - assert.equal(await market.creator(), initialBidder); - }); - - it('BinaryOption instances are set up properly.', async () => { - const prices = computePrices( - initialLongBid, - initialShortBid, - initialLongBid.add(initialShortBid), - totalInitialFee - ); - const observedPrices = await market.prices(); - assert.bnEqual(observedPrices.long, prices.long); - assert.bnEqual(observedPrices.short, prices.short); - - const bids = await market.bidsOf(initialBidder); - assert.bnEqual(await long.bidOf(initialBidder), initialLongBid); - assert.bnEqual(await short.bidOf(initialBidder), initialShortBid); - assert.bnEqual(bids.long, initialLongBid); - assert.bnEqual(bids.short, initialShortBid); - assert.bnEqual(await long.totalBids(), initialLongBid); - assert.bnEqual(await short.totalBids(), initialShortBid); - - const claimable = await market.claimableBalancesOf(initialBidder); - const totalClaimable = await market.totalClaimableSupplies(); - assert.bnEqual(claimable.long, await long.claimableBalanceOf(initialBidder)); - assert.bnEqual(claimable.short, await short.claimableBalanceOf(initialBidder)); - assert.bnEqual(totalClaimable.long, claimable.long); - assert.bnEqual(totalClaimable.short, claimable.short); - - await fastForward(biddingTime + 1); - await market.claimOptions({ from: initialBidder }); - - const balances = await market.balancesOf(initialBidder); - assert.bnEqual(balances.long, claimable.long); - assert.bnEqual(balances.short, claimable.short); - - const totalSupplies = await market.totalSupplies(); - assert.bnEqual(totalSupplies.long, claimable.long); - assert.bnEqual(totalSupplies.short, claimable.short); - - const refundsEnabled = await market.refundsEnabled(); - assert.isTrue(refundsEnabled); - }); - - it('BinaryOption instances cannot transfer if the system is suspended or paused', async () => { - await long.approve(pauper, toUnit(100), { from: initialBidder }); - await manager.setPaused(true, { from: accounts[1] }); - await assert.revert( - long.transfer(market.address, toUnit(1), { from: initialBidder }), - 'This action cannot be performed while the contract is paused' - ); - await assert.revert( - long.transferFrom(initialBidder, market.address, toUnit(1), { from: pauper }), - 'This action cannot be performed while the contract is paused' - ); - await manager.setPaused(false, { from: accounts[1] }); - - await setStatus({ - owner: accounts[1], - systemStatus, - section: 'System', - suspend: true, - }); - await assert.revert( - long.transfer(market.address, toUnit(1), { from: initialBidder }), - 'Operation prohibited' - ); - await assert.revert( - long.transferFrom(initialBidder, market.address, toUnit(1), { from: pauper }), - 'Operation prohibited' - ); - }); - - it('Bad constructor parameters revert.', async () => { - // Insufficient capital - let localCreationTime = await currentTime(); - await assert.revert( - deployMarket({ - resolver: addressResolver.address, - endOfBidding: localCreationTime + 100, - maturity: localCreationTime + 200, - expiry: localCreationTime + 200 + expiryDuration, - oracleKey: sAUDKey, - strikePrice: initialStrikePrice, - longBid: toUnit(0), - shortBid: toUnit(0), - poolFee: initialPoolFee, - creatorFee: initialCreatorFee, - refundFee: initialRefundFee, - creator: initialBidder, - refundsEnabled: true, - }), - 'Insufficient capital' - ); - - // zero initial price on either side - localCreationTime = await currentTime(); - await assert.revert( - deployMarket({ - resolver: addressResolver.address, - endOfBidding: localCreationTime + 100, - maturity: localCreationTime + 200, - expiry: localCreationTime + 200 + expiryDuration, - oracleKey: sAUDKey, - strikePrice: initialStrikePrice, - longBid: toUnit(0), - shortBid: initialShortBid, - poolFee: initialPoolFee, - creatorFee: initialCreatorFee, - refundFee: initialRefundFee, - creator: initialBidder, - refundsEnabled: true, - }), - 'Bids too skewed' - ); - - localCreationTime = await currentTime(); - await assert.revert( - deployMarket({ - resolver: addressResolver.address, - endOfBidding: localCreationTime + 100, - maturity: localCreationTime + 200, - expiry: localCreationTime + 200 + expiryDuration, - oracleKey: sAUDKey, - strikePrice: initialStrikePrice, - longBid: initialLongBid, - shortBid: toUnit(0), - poolFee: initialPoolFee, - creatorFee: initialCreatorFee, - refundFee: initialRefundFee, - creator: initialBidder, - refundsEnabled: true, - }), - 'Bids too skewed' - ); - }); - - it('Only expected functions are mutative', async () => { - ensureOnlyExpectedMutativeFunctions({ - abi: market.abi, - ignoreParents: ['Owned', 'MixinResolver'], - expected: [ - 'bid', - 'refund', - 'resolve', - 'claimOptions', - 'exerciseOptions', - 'expire', - 'cancel', - ], - }); - }); - }); - - describe('Prices', () => { - it('updatePrices is correct.', async () => { - const localCreationTime = await currentTime(); - const localMarket = await deployMarket({ - resolver: addressResolver.address, - endOfBidding: localCreationTime + 100, - maturity: localCreationTime + 200, - expiry: localCreationTime + 200 + expiryDuration, - oracleKey: sAUDKey, - strikePrice: initialStrikePrice, - longBid: initialLongBid, - shortBid: initialShortBid, - poolFee: initialPoolFee, - creatorFee: initialCreatorFee, - refundFee: initialRefundFee, - creator: initialBidder, - refundsEnabled: true, - }); - - const pairs = [ - [toUnit(0.1), toUnit(0.9)], - [toUnit(0.9), toUnit(0.1)], - [toUnit(1), toUnit(1)], - [toUnit(10000), toUnit(10000)], - [toUnit(3), toUnit(1)], - [toUnit(15), toUnit(30)], - [toUnit(7.7), toUnit(17)], - ]; - - for (const p of pairs) { - await localMarket.updatePrices(p[0], p[1], p[0].add(p[1])); - const prices = await localMarket.prices(); - const expectedPrices = computePrices(p[0], p[1], p[0].add(p[1]), totalInitialFee); - assert.bnClose(prices[0], expectedPrices.long, 1); - assert.bnClose(prices[1], expectedPrices.short, 1); - assert.bnClose( - prices[0].add(prices[1]), - divideDecimalRound(toUnit(1), toUnit(1).sub(totalInitialFee)), - 1 - ); - } - }); - - it('updatePrices emits the correct event.', async () => { - const localCreationTime = await currentTime(); - const localMarket = await deployMarket({ - resolver: addressResolver.address, - endOfBidding: localCreationTime + 100, - maturity: localCreationTime + 200, - expiry: localCreationTime + 200 + expiryDuration, - oracleKey: sAUDKey, - strikePrice: initialStrikePrice, - longBid: initialLongBid, - shortBid: initialShortBid, - poolFee: initialPoolFee, - creatorFee: initialCreatorFee, - refundFee: initialRefundFee, - creator: initialBidder, - refundsEnabled: true, - }); - - const tx = await localMarket.updatePrices(toUnit(1), toUnit(1), toUnit(2)); - const log = tx.logs[0]; - const expectedPrices = computePrices(toUnit(1), toUnit(1), toUnit(2), totalInitialFee); - - assert.equal(log.event, 'PricesUpdated'); - assert.bnEqual(log.args.longPrice, expectedPrices.long); - assert.bnEqual(log.args.shortPrice, expectedPrices.short); - }); - - it('Update prices is correct with higher total debt than sum of bids.', async () => { - const localCreationTime = await currentTime(); - const localMarket = await deployMarket({ - resolver: addressResolver.address, - endOfBidding: localCreationTime + 100, - maturity: localCreationTime + 200, - expiry: localCreationTime + 200 + expiryDuration, - oracleKey: sAUDKey, - strikePrice: initialStrikePrice, - longBid: initialLongBid, - shortBid: initialShortBid, - poolFee: initialPoolFee, - creatorFee: initialCreatorFee, - refundFee: initialRefundFee, - creator: initialBidder, - refundsEnabled: true, - }); - - await localMarket.updatePrices(toUnit(1), toUnit(1), toUnit(4)); - const price = divideDecimalRound(toUnit(0.25), toUnit(1).sub(totalInitialFee)); - const observedPrices = await localMarket.prices(); - assert.bnClose(observedPrices.long, price, 1); - assert.bnClose(observedPrices.short, price, 1); - }); - - it('Current prices are correct with positive fee.', async () => { - const currentPrices = await market.prices(); - const expectedPrices = computePrices( - await long.totalBids(), - await short.totalBids(), - await market.deposited(), - totalInitialFee - ); - - assert.bnClose(currentPrices[0], expectedPrices.long, 1); - assert.bnClose(currentPrices[1], expectedPrices.short, 1); - }); - - it('senderPriceAndExercisableDeposits cannot be invoked except by options.', async () => { - await onlyGivenAddressCanInvoke({ - fnc: market.senderPriceAndExercisableDeposits, - args: [], - accounts, - skipPassCheck: true, - reason: 'Sender is not an option', - }); - }); - - it('pricesAfterBidOrRefund correctly computes the result of bids.', async () => { - const [longBid, shortBid] = [toUnit(1), toUnit(23)]; - - // Long side - let expectedPrices = await market.pricesAfterBidOrRefund(Side.Long, longBid, false); - await market.bid(Side.Long, longBid); - let prices = await market.prices(); - assert.bnEqual(expectedPrices.long, prices.long); - assert.bnEqual(expectedPrices.short, prices.short); - - // Null bids are computed properly - expectedPrices = await market.pricesAfterBidOrRefund(Side.Long, toBN(0), false); - assert.bnEqual(expectedPrices.long, prices.long); - assert.bnEqual(expectedPrices.short, prices.short); - - // Short side - expectedPrices = await market.pricesAfterBidOrRefund(Side.Short, shortBid, false); - await market.bid(Side.Short, shortBid); - prices = await market.prices(); - assert.bnEqual(expectedPrices.long, prices.long); - assert.bnEqual(expectedPrices.short, prices.short); - - // Null bids are computed properly - expectedPrices = await market.pricesAfterBidOrRefund(Side.Short, toBN(0), false); - assert.bnEqual(expectedPrices.long, prices.long); - assert.bnEqual(expectedPrices.short, prices.short); - }); - - it('pricesAfterBidOrRefund correctly computes the result of refunds.', async () => { - const [longRefund, shortRefund] = [toUnit(8), toUnit(2)]; - - // Long side - let expectedPrices = await market.pricesAfterBidOrRefund(Side.Long, longRefund, true); - await market.refund(Side.Long, longRefund); - let prices = await market.prices(); - assert.bnEqual(expectedPrices.long, prices.long); - assert.bnEqual(expectedPrices.short, prices.short); - - // Null bids are computed properly - expectedPrices = await market.pricesAfterBidOrRefund(Side.Long, toBN(0), true); - assert.bnEqual(expectedPrices.long, prices.long); - assert.bnEqual(expectedPrices.short, prices.short); - - // Short side - expectedPrices = await market.pricesAfterBidOrRefund(Side.Short, shortRefund, true); - await market.refund(Side.Short, shortRefund); - prices = await market.prices(); - assert.bnEqual(expectedPrices.long, prices.long); - assert.bnEqual(expectedPrices.short, prices.short); - - // Null bids are computed properly - expectedPrices = await market.pricesAfterBidOrRefund(Side.Short, toBN(0), true); - assert.bnEqual(expectedPrices.long, prices.long); - assert.bnEqual(expectedPrices.short, prices.short); - }); - - it('pricesAfterBidOrRefund reverts if the refund is larger than the total on either side.', async () => { - const bids = await market.bidsOf(accounts[0]); - await assert.revert( - market.pricesAfterBidOrRefund(Side.Long, bids.long.add(toBN(1)), true), - 'SafeMath: subtraction overflow' - ); - await assert.revert( - market.pricesAfterBidOrRefund(Side.Short, bids.short.add(toBN(1)), true), - 'SafeMath: subtraction overflow' - ); - }); - - it('pricesAfterBidOrRefund reverts if a refund is equal to the total on either side.', async () => { - const bids = await market.bidsOf(accounts[0]); - await assert.revert( - market.pricesAfterBidOrRefund(Side.Long, bids.long, true), - 'Bids must be nonzero' - ); - await assert.revert( - market.pricesAfterBidOrRefund(Side.Short, bids.short, true), - 'Bids must be nonzero' - ); - }); - - it('bidOrRefundForPrice correctly computes same-side bid values', async () => { - // Long -> Long - const longPrice = toUnit(0.7); - let bid = await market.bidOrRefundForPrice(Side.Long, Side.Long, longPrice, false); - await market.bid(Side.Long, bid); - let prices = await market.prices(); - assert.bnClose(prices.long, longPrice); - - // Short -> Short - const shortPrice = toUnit(0.4); - bid = await market.bidOrRefundForPrice(Side.Short, Side.Short, shortPrice, false); - await market.bid(Side.Short, bid); - prices = await market.prices(); - assert.bnClose(prices.short, shortPrice); - - // Attempting to go to a lower price by bidding on the same side yields 0. - assert.bnEqual( - await market.bidOrRefundForPrice(Side.Long, Side.Long, toUnit(0.1), false), - toBN(0) - ); - assert.bnEqual( - await market.bidOrRefundForPrice(Side.Short, Side.Short, toUnit(0.1), false), - toBN(0) - ); - }); - - it('bidOrRefundForPrice correctly computes opposite-side bid values', async () => { - // Long -> Short - const shortPrice = toUnit(0.2); - let bid = await market.bidOrRefundForPrice(Side.Long, Side.Short, shortPrice, false); - await market.bid(Side.Long, bid); - let prices = await market.prices(); - assert.bnClose(prices.short, shortPrice); - - // Short -> Long - const longPrice = toUnit(0.5); - bid = await market.bidOrRefundForPrice(Side.Short, Side.Long, longPrice, false); - await market.bid(Side.Short, bid); - prices = await market.prices(); - assert.bnClose(prices.long, longPrice); - - // Attempting to go to a higher price by bidding on the other side yields 0. - assert.bnEqual( - await market.bidOrRefundForPrice(Side.Long, Side.Short, toUnit(0.9), false), - toBN(0) - ); - assert.bnEqual( - await market.bidOrRefundForPrice(Side.Short, Side.Long, toUnit(0.9), false), - toBN(0) - ); - }); - - it('bidOrRefundForPrice correctly computes same-side refund values', async () => { - // Long -> Long - const longPrice = toUnit(0.4); - let refund = await market.bidOrRefundForPrice(Side.Long, Side.Long, longPrice, true); - await market.refund(Side.Long, refund); - let prices = await market.prices(); - assert.bnClose(prices.long, longPrice); - - // Short -> Short - const shortPrice = toUnit(0.55); - refund = await market.bidOrRefundForPrice(Side.Short, Side.Short, shortPrice, true); - await market.refund(Side.Short, refund); - prices = await market.prices(); - assert.bnClose(prices.short, shortPrice); - - // Attempting to go to a higher price by refunding on the same side yields 0. - assert.bnEqual( - await market.bidOrRefundForPrice(Side.Long, Side.Long, toUnit(0.9), true), - toBN(0) - ); - assert.bnEqual( - await market.bidOrRefundForPrice(Side.Short, Side.Short, toUnit(0.9), true), - toBN(0) - ); - }); - - it('bidOrRefundForPrice correctly computes opposite-side refund values', async () => { - // Long -> Short - const shortPrice = toUnit(0.5); - let refund = await market.bidOrRefundForPrice(Side.Long, Side.Short, shortPrice, true); - await market.refund(Side.Long, refund); - let prices = await market.prices(); - assert.bnClose(prices.short, shortPrice); - - // Short -> Long - const longPrice = toUnit(0.6); - refund = await market.bidOrRefundForPrice(Side.Short, Side.Long, longPrice, true); - await market.refund(Side.Short, refund); - prices = await market.prices(); - assert.bnClose(prices.long, longPrice); - - // Attempting to go to a lower price by refunding on the other side yields 0. - assert.bnEqual( - await market.bidOrRefundForPrice(Side.Long, Side.Short, toUnit(0.1), true), - toBN(0) - ); - assert.bnEqual( - await market.bidOrRefundForPrice(Side.Short, Side.Long, toUnit(0.1), true), - toBN(0) - ); - }); - - it('pricesAfterBidOrRefund and bidOrRefundForPrice are inverses for bids', async () => { - // bidOrRefundForPrice ∘ pricesAfterBidOrRefund - - let price = toUnit(0.7); - let bid = await market.bidOrRefundForPrice(Side.Long, Side.Long, price, false); - let prices = await market.pricesAfterBidOrRefund(Side.Long, bid, false); - assert.bnClose(price, prices.long); - bid = await market.bidOrRefundForPrice(Side.Short, Side.Short, price, false); - prices = await market.pricesAfterBidOrRefund(Side.Short, bid, false); - assert.bnClose(price, prices.short); - - price = toUnit(0.2); - bid = await market.bidOrRefundForPrice(Side.Long, Side.Short, price, false); - prices = await market.pricesAfterBidOrRefund(Side.Long, bid, false); - assert.bnClose(price, prices.short); - bid = await market.bidOrRefundForPrice(Side.Short, Side.Long, price, false); - prices = await market.pricesAfterBidOrRefund(Side.Short, bid, false); - assert.bnClose(price, prices.long); - - // pricesAfterBidOrRefund ∘ bidOrRefundForPrice - - bid = toUnit(1); - prices = await market.pricesAfterBidOrRefund(Side.Long, bid, false); - assert.bnClose( - await market.bidOrRefundForPrice(Side.Long, Side.Long, prices.long, false), - bid - ); - assert.bnClose( - await market.bidOrRefundForPrice(Side.Long, Side.Short, prices.short, false), - bid - ); - prices = await market.pricesAfterBidOrRefund(Side.Short, bid, false); - assert.bnClose( - await market.bidOrRefundForPrice(Side.Short, Side.Short, prices.short, false), - bid - ); - assert.bnClose( - await market.bidOrRefundForPrice(Side.Short, Side.Long, prices.long, false), - bid - ); - }); - - it('pricesAfterBidOrRefund and bidOrRefundForPrice are inverses for bids', async () => { - // bidOrRefundForPrice ∘ pricesAfterBidOrRefund - - let price = toUnit(0.25); - let refund = await market.bidOrRefundForPrice(Side.Long, Side.Long, price, true); - let prices = await market.pricesAfterBidOrRefund(Side.Long, refund, true); - assert.bnClose(price, prices.long); - refund = await market.bidOrRefundForPrice(Side.Short, Side.Short, price, true); - prices = await market.pricesAfterBidOrRefund(Side.Short, refund, true); - assert.bnClose(price, prices.short); - - price = toUnit(0.85); - refund = await market.bidOrRefundForPrice(Side.Long, Side.Short, price, true); - prices = await market.pricesAfterBidOrRefund(Side.Long, refund, true); - assert.bnClose(price, prices.short); - refund = await market.bidOrRefundForPrice(Side.Short, Side.Long, price, true); - prices = await market.pricesAfterBidOrRefund(Side.Short, refund, true); - assert.bnClose(price, prices.long); - - // pricesAfterBidOrRefund ∘ bidOrRefundForPrice - - refund = toUnit(3.5); - prices = await market.pricesAfterBidOrRefund(Side.Long, refund, true); - assert.bnClose( - await market.bidOrRefundForPrice(Side.Long, Side.Long, prices.long, true), - refund, - 20 - ); - assert.bnClose( - await market.bidOrRefundForPrice(Side.Long, Side.Short, prices.short, true), - refund, - 20 - ); - prices = await market.pricesAfterBidOrRefund(Side.Short, refund, true); - assert.bnClose( - await market.bidOrRefundForPrice(Side.Short, Side.Short, prices.short, true), - refund, - 20 - ); - assert.bnClose( - await market.bidOrRefundForPrice(Side.Short, Side.Long, prices.long, true), - refund, - 20 - ); - }); - }); - - describe('Maturity condition resolution', () => { - it('Current oracle price and timestamp are correct.', async () => { - const now = await currentTime(); - const price = toUnit(0.7); - await exchangeRates.updateRates([sAUDKey], [price], now, { from: oracle }); - const result = await market.oraclePriceAndTimestamp(); - - assert.bnEqual(result.price, price); - assert.bnEqual(result.updatedAt, now); - }); - - it('Result can fluctuate while unresolved, but is fixed after resolution.', async () => { - const two = toBN(2); - assert.isFalse(await market.resolved()); - - let now = await currentTime(); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice.div(two)], now, { - from: oracle, - }); - assert.bnEqual(await market.result(), Side.Short); - now = await currentTime(); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice.mul(two)], now, { - from: oracle, - }); - assert.bnEqual(await market.result(), Side.Long); - - await fastForward(biddingTime + timeToMaturity + 10); - now = await currentTime(); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice.mul(two)], now, { - from: oracle, - }); - await manager.resolveMarket(market.address); - - assert.isTrue(await market.resolved()); - now = await currentTime(); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice.div(two)], now, { - from: oracle, - }); - assert.bnEqual(await market.result(), Side.Long); - now = await currentTime(); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice.mul(two)], now, { - from: oracle, - }); - assert.bnEqual(await market.result(), Side.Long); - }); - - it('Result resolves correctly long.', async () => { - await fastForward(timeToMaturity + 1); - const now = await currentTime(); - const price = initialStrikePrice.add(toBN(1)); - await exchangeRates.updateRates([sAUDKey], [price], now, { from: oracle }); - const tx = await manager.resolveMarket(market.address); - assert.bnEqual(await market.result(), Side.Long); - assert.isTrue(await market.resolved()); - assert.bnEqual((await market.oracleDetails()).finalPrice, price); - - const totalDeposited = initialLongBid.add(initialShortBid); - const poolFees = multiplyDecimalRound(totalDeposited, initialPoolFee); - const creatorFees = multiplyDecimalRound(totalDeposited, initialCreatorFee); - - const log = BinaryOptionMarket.decodeLogs(tx.receipt.rawLogs)[0]; - assert.eventEqual(log, 'MarketResolved', { - result: Side.Long, - oraclePrice: price, - oracleTimestamp: now, - deposited: totalDeposited.sub(poolFees.add(creatorFees)), - poolFees, - creatorFees, - }); - assert.equal(log.event, 'MarketResolved'); - assert.bnEqual(log.args.result, Side.Long); - assert.bnEqual(log.args.oraclePrice, price); - assert.bnEqual(log.args.oracleTimestamp, now); - }); - - it('Result resolves correctly short.', async () => { - await fastForward(timeToMaturity + 1); - const now = await currentTime(); - const price = initialStrikePrice.sub(toBN(1)); - await exchangeRates.updateRates([sAUDKey], [price], now, { from: oracle }); - const tx = await manager.resolveMarket(market.address); - assert.isTrue(await market.resolved()); - assert.bnEqual(await market.result(), Side.Short); - assert.bnEqual((await market.oracleDetails()).finalPrice, price); - - const log = BinaryOptionMarket.decodeLogs(tx.receipt.rawLogs)[0]; - assert.equal(log.event, 'MarketResolved'); - assert.bnEqual(log.args.result, Side.Short); - assert.bnEqual(log.args.oraclePrice, price); - assert.bnEqual(log.args.oracleTimestamp, now); - }); - - it('A result equal to the strike price resolves long.', async () => { - await fastForward(timeToMaturity + 1); - const now = await currentTime(); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice], now, { from: oracle }); - await manager.resolveMarket(market.address); - assert.isTrue(await market.resolved()); - assert.bnEqual(await market.result(), Side.Long); - assert.bnEqual((await market.oracleDetails()).finalPrice, initialStrikePrice); - }); - - it('Resolution cannot occur before maturity.', async () => { - assert.isFalse(await market.canResolve()); - await assert.revert(manager.resolveMarket(market.address), 'Not yet mature'); - }); - - it('Resolution can only occur once.', async () => { - await fastForward(timeToMaturity + 1); - const now = await currentTime(); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice], now, { from: oracle }); - assert.isTrue(await market.canResolve()); - await manager.resolveMarket(market.address); - assert.isFalse(await market.canResolve()); - await assert.revert(manager.resolveMarket(market.address), 'Not an active market'); - - // And check that it works at the market level. - const mockManager = await MockBinaryOptionMarketManager.new(); - const localCreationTime = await currentTime(); - await mockManager.createMarket( - addressResolver.address, - initialBidder, - [capitalRequirement, skewLimit], - sAUDKey, - initialStrikePrice, - true, - [ - localCreationTime + 100, - localCreationTime + 200, - localCreationTime + 200 + expiryDuration, - ], - [toUnit(10), toUnit(10)], - [initialPoolFee, initialCreatorFee, initialRefundFee] - ); - await sUSDSynth.transfer(await mockManager.market(), toUnit(20)); - await fastForward(500); - await mockManager.resolveMarket(); - await assert.revert(mockManager.resolveMarket(), 'Market already resolved'); - }); - - it('Resolution cannot occur if the price is too old.', async () => { - await fastForward(timeToMaturity + 1); - const now = await currentTime(); - await exchangeRates.updateRates( - [sAUDKey], - [initialStrikePrice], - now - (maxOraclePriceAge + 60), - { - from: oracle, - } - ); - assert.isFalse(await market.canResolve()); - await assert.revert(manager.resolveMarket(market.address), 'Price is stale'); - }); - - it('Resolution can occur if the price was updated within the maturity window but before maturity.', async () => { - await fastForward(timeToMaturity + 1); - const now = await currentTime(); - await exchangeRates.updateRates( - [sAUDKey], - [initialStrikePrice], - now - (maxOraclePriceAge - 60), - { - from: oracle, - } - ); - assert.isTrue(await market.canResolve()); - await manager.resolveMarket(market.address); - }); - - it('Resolution properly remits the collected fees.', async () => { - await fastForward(timeToMaturity + 1); - await exchangeRates.updateRates([sAUDKey], [toUnit(0.7)], await currentTime(), { - from: oracle, - }); - - const feeAddress = await feePool.FEE_ADDRESS(); - - const [ - creatorPrebalance, - poolPrebalance, - preDeposits, - preExercisable, - preTotalDeposits, - ] = await Promise.all([ - sUSDSynth.balanceOf(initialBidder), - sUSDSynth.balanceOf(feeAddress), - market.deposited(), - market.exercisableDeposits(), - manager.totalDeposited(), - ]); - - const tx = await manager.resolveMarket(market.address); - const logs = Synth.decodeLogs(tx.receipt.rawLogs); - - const [ - creatorPostbalance, - poolPostbalance, - postDeposits, - postExercisable, - postTotalDeposits, - ] = await Promise.all([ - sUSDSynth.balanceOf(initialBidder), - sUSDSynth.balanceOf(feeAddress), - market.deposited(), - market.exercisableDeposits(), - manager.totalDeposited(), - ]); - - const poolFee = multiplyDecimalRound(initialLongBid.add(initialShortBid), initialPoolFee); - const creatorFee = multiplyDecimalRound( - initialLongBid.add(initialShortBid), - initialCreatorFee - ); - - const poolReceived = poolPostbalance.sub(poolPrebalance); - const creatorReceived = creatorPostbalance.sub(creatorPrebalance); - assert.bnClose(poolReceived, poolFee, 1); - assert.bnClose(creatorReceived, creatorFee, 1); - assert.bnClose(postDeposits, preDeposits.sub(poolFee.add(creatorFee))); - assert.bnClose(postDeposits, preExercisable); - assert.bnClose(postExercisable, preExercisable); - assert.bnClose(postTotalDeposits, preTotalDeposits.sub(poolFee.add(creatorFee))); - - assert.eventEqual(logs[0], 'Transfer', { - from: market.address, - to: await feePool.FEE_ADDRESS(), - value: poolReceived, - }); - assert.eventEqual(logs[1], 'Transfer', { - from: market.address, - to: initialBidder, - value: creatorReceived, - }); - }); - - it('Resolution cannot occur if the system is suspended', async () => { - await fastForward(timeToMaturity + 1); - await exchangeRates.updateRates([sAUDKey], [toUnit(0.7)], await currentTime(), { - from: oracle, - }); - await setStatus({ - owner: accounts[1], - systemStatus, - section: 'System', - suspend: true, - }); - await assert.revert(manager.resolveMarket(market.address), 'Operation prohibited'); - }); - - it('Resolution cannot occur if the manager is paused', async () => { - await fastForward(timeToMaturity + 1); - await exchangeRates.updateRates([sAUDKey], [toUnit(0.7)], await currentTime(), { - from: oracle, - }); - await manager.setPaused(true, { from: accounts[1] }); - await assert.revert( - manager.resolveMarket(market.address), - 'This action cannot be performed while the contract is paused' - ); - }); - }); - - describe('Phases', () => { - it('Can proceed through the phases properly.', async () => { - assert.bnEqual(await market.phase(), Phase.Bidding); - await fastForward(biddingTime + 1); - assert.bnEqual(await market.phase(), Phase.Trading); - await fastForward(timeToMaturity + 1); - assert.bnEqual(await market.phase(), Phase.Maturity); - await fastForward(expiryDuration + 1); - - const now = await currentTime(); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice], now, { - from: oracle, - }); - await manager.resolveMarket(market.address); - - assert.bnEqual(await market.phase(), Phase.Expiry); - }); - - it('Market can expire early if everything has been exercised.', async () => { - await fastForward(biddingTime + timeToMaturity + 1); - - const now = await currentTime(); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice], now, { - from: oracle, - }); - await manager.resolveMarket(market.address); - - assert.bnEqual(await market.phase(), Phase.Maturity); - await market.exerciseOptions({ from: initialBidder }); - assert.bnEqual(await market.phase(), Phase.Expiry); - }); - }); - - describe('Bids', () => { - it('Can place long bids properly.', async () => { - const initialDebt = await market.deposited(); - - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - - assert.bnEqual(await long.totalBids(), initialLongBid.mul(toBN(2))); - assert.bnEqual(await long.bidOf(newBidder), initialLongBid); - - const bids = await market.bidsOf(newBidder); - assert.bnEqual(bids.long, initialLongBid); - assert.bnEqual(bids.short, toBN(0)); - - const totalBids = await market.totalBids(); - assert.bnEqual(totalBids.long, initialLongBid.mul(toBN(2))); - assert.bnEqual(totalBids.short, initialShortBid); - assert.bnEqual(await market.deposited(), initialDebt.add(initialLongBid)); - }); - - it('Can place short bids properly.', async () => { - const initialDebt = await market.deposited(); - - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - - assert.bnEqual(await short.totalBids(), initialShortBid.mul(toBN(2))); - assert.bnEqual(await short.bidOf(newBidder), initialShortBid); - - const bids = await market.bidsOf(newBidder); - assert.bnEqual(bids.long, toBN(0)); - assert.bnEqual(bids.short, initialShortBid); - - const totalBids = await market.totalBids(); - assert.bnEqual(totalBids.long, initialLongBid); - assert.bnEqual(totalBids.short, initialShortBid.mul(toBN(2))); - assert.bnEqual(await market.deposited(), initialDebt.add(initialShortBid)); - }); - - it('Can place both long and short bids at once.', async () => { - const initialDebt = await market.deposited(); - - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - - assert.bnEqual(await long.totalBids(), initialLongBid.mul(toBN(2))); - assert.bnEqual(await long.bidOf(newBidder), initialLongBid); - assert.bnEqual(await short.totalBids(), initialShortBid.mul(toBN(2))); - assert.bnEqual(await short.bidOf(newBidder), initialShortBid); - - const bids = await market.bidsOf(newBidder); - assert.bnEqual(bids.long, initialLongBid); - assert.bnEqual(bids.short, initialShortBid); - - const totalBids = await market.totalBids(); - assert.bnEqual(totalBids.long, initialLongBid.mul(toBN(2))); - assert.bnEqual(totalBids.short, initialShortBid.mul(toBN(2))); - assert.bnEqual( - await market.deposited(), - initialDebt.add(initialShortBid).add(initialLongBid) - ); - }); - - it('Cannot bid past the end of bidding.', async () => { - await fastForward(biddingTime + 1); - await assert.revert(market.bid(Side.Long, 100), 'Bidding inactive'); - await assert.revert(market.bid(Side.Short, 100), 'Bidding inactive'); - }); - - it('Bids properly affect prices.', async () => { - let currentPrices = await market.prices(); - const expectedPrices = computePrices( - await long.totalBids(), - await short.totalBids(), - await market.deposited(), - totalInitialFee - ); - - assert.bnClose(currentPrices[0], expectedPrices.long, 1); - assert.bnClose(currentPrices[1], expectedPrices.short, 1); - - await market.bid(Side.Short, initialShortBid); - - currentPrices = await market.prices(); - const halfWithFee = divideDecimalRound( - toUnit(1), - multiplyDecimalRound(toUnit(2), toUnit(1).sub(totalInitialFee)) - ); - assert.bnClose(currentPrices[0], halfWithFee, 1); - assert.bnClose(currentPrices[1], halfWithFee, 1); - - await market.bid(Side.Long, initialLongBid); - - currentPrices = await market.prices(); - assert.bnClose(currentPrices[0], expectedPrices.long, 1); - assert.bnClose(currentPrices[1], expectedPrices.short, 1); - }); - - it('Bids properly emit events.', async () => { - let tx = await market.bid(Side.Long, initialLongBid, { from: newBidder }); - let currentPrices = await market.prices(); - - assert.equal(tx.logs[0].event, 'Bid'); - assert.bnEqual(tx.logs[0].args.side, Side.Long); - assert.equal(tx.logs[0].args.account, newBidder); - assert.bnEqual(tx.logs[0].args.value, initialLongBid); - - assert.equal(tx.logs[1].event, 'PricesUpdated'); - assert.bnEqual(tx.logs[1].args.longPrice, currentPrices[0]); - assert.bnEqual(tx.logs[1].args.shortPrice, currentPrices[1]); - - tx = await market.bid(Side.Short, initialShortBid, { from: newBidder }); - currentPrices = await market.prices(); - - assert.equal(tx.logs[0].event, 'Bid'); - assert.bnEqual(tx.logs[0].args.side, Side.Short); - assert.equal(tx.logs[0].args.account, newBidder); - assert.bnEqual(tx.logs[0].args.value, initialShortBid); - - assert.equal(tx.logs[1].event, 'PricesUpdated'); - assert.bnEqual(tx.logs[1].args.longPrice, currentPrices[0]); - assert.bnEqual(tx.logs[1].args.shortPrice, currentPrices[1]); - }); - - it('Bids withdraw the proper amount of sUSD', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - assert.bnEqual( - await sUSDSynth.balanceOf(newBidder), - sUSDQty.sub(initialLongBid.add(initialShortBid)) - ); - }); - - it('Bids fail on insufficient sUSD balance.', async () => { - await assert.revert( - market.bid(Side.Long, initialLongBid, { from: pauper }), - 'SafeMath: subtraction overflow' - ); - await assert.revert( - market.bid(Side.Short, initialShortBid, { from: pauper }), - 'SafeMath: subtraction overflow' - ); - }); - - it('Bids fail on insufficient sUSD allowance.', async () => { - await sUSDSynth.approve(market.address, toBN(0), { from: newBidder }); - await assert.revert( - market.bid(Side.Long, initialLongBid, { from: newBidder }), - 'SafeMath: subtraction overflow' - ); - await assert.revert( - market.bid(Side.Short, initialShortBid, { from: newBidder }), - 'SafeMath: subtraction overflow' - ); - }); - - it('Empty bids do nothing.', async () => { - const tx1 = await market.bid(Side.Long, toBN(0), { from: newBidder }); - const tx2 = await market.bid(Side.Short, toBN(0), { from: newBidder }); - - assert.bnEqual(await long.bidOf(newBidder), toBN(0)); - assert.bnEqual(await short.bidOf(newBidder), toBN(0)); - assert.equal(tx1.logs.length, 0); - assert.equal(tx1.receipt.rawLogs, 0); - assert.equal(tx2.logs.length, 0); - assert.equal(tx2.receipt.rawLogs, 0); - }); - - it('Bids less than $0.01 revert.', async () => { - await assert.revert( - market.bid(Side.Long, toUnit('0.0099'), { from: newBidder }), - 'Balance < $0.01' - ); - await assert.revert( - market.bid(Side.Short, toUnit('0.0099'), { from: newBidder }), - 'Balance < $0.01' - ); - - // But we can make smaller bids if our balance is already large enough. - await market.bid(Side.Long, toUnit('0.01'), { from: newBidder }); - await market.bid(Side.Long, toUnit('0.0099'), { from: newBidder }); - assert.bnEqual(await long.bidOf(newBidder), toUnit('0.0199')); - }); - - it('Bidding fails when the system is suspended.', async () => { - await setStatus({ - owner: accounts[1], - systemStatus, - section: 'System', - suspend: true, - }); - await assert.revert( - market.bid(Side.Long, toUnit(1), { from: newBidder }), - 'Operation prohibited' - ); - await assert.revert( - market.bid(Side.Short, toUnit(1), { from: newBidder }), - 'Operation prohibited' - ); - }); - - it('Bidding fails when the manager is paused.', async () => { - await manager.setPaused(true, { from: accounts[1] }); - await assert.revert( - market.bid(Side.Long, toUnit(1), { from: newBidder }), - 'This action cannot be performed while the contract is paused' - ); - await assert.revert( - market.bid(Side.Short, toUnit(1), { from: newBidder }), - 'This action cannot be performed while the contract is paused' - ); - }); - }); - - describe('Refunds', () => { - it('Can refund bids properly.', async () => { - const initialDebt = await market.deposited(); - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - - assert.bnEqual(await long.totalBids(), initialLongBid.mul(toBN(2))); - assert.bnEqual(await long.bidOf(newBidder), initialLongBid); - assert.bnEqual(await short.totalBids(), initialShortBid.mul(toBN(2))); - assert.bnEqual(await short.bidOf(newBidder), initialShortBid); - assert.bnEqual(await market.deposited(), initialDebt.mul(toBN(2))); - - await market.refund(Side.Long, initialLongBid, { from: newBidder }); - await market.refund(Side.Short, initialShortBid, { from: newBidder }); - - assert.bnEqual(await long.totalBids(), initialLongBid); - assert.bnEqual(await long.bidOf(newBidder), toUnit(0)); - assert.bnEqual(await short.totalBids(), initialShortBid); - assert.bnEqual(await short.bidOf(newBidder), toUnit(0)); - - const fee = multiplyDecimalRound(initialLongBid.add(initialShortBid), initialRefundFee); - // The fee is retained in the total debt. - assert.bnEqual(await market.deposited(), initialDebt.add(fee)); - }); - - it('Refunds will fail if not enabled.', async () => { - const localCreationTime = await currentTime(); - const tx = await manager.createMarket( - sAUDKey, - initialStrikePrice, - false, - [localCreationTime + biddingTime, localCreationTime + timeToMaturity], - [initialLongBid, initialShortBid], - { from: initialBidder } - ); - const localMarket = await BinaryOptionMarket.at( - getEventByName({ tx, name: 'MarketCreated' }).args.market - ); - assert.isFalse(await localMarket.refundsEnabled()); - - await sUSDSynth.approve(localMarket.address, initialLongBid.mul(toBN(10)), { - from: newBidder, - }); - await localMarket.bid(Side.Long, initialLongBid, { from: newBidder }); - await localMarket.bid(Side.Short, initialShortBid, { from: newBidder }); - await assert.revert( - localMarket.refund(Side.Long, initialLongBid, { from: newBidder }), - 'Refunds disabled' - ); - await assert.revert( - localMarket.refund(Side.Short, initialShortBid, { from: newBidder }), - 'Refunds disabled' - ); - }); - - it('Refunds will fail if too large.', async () => { - // Refund with no bids. - await assert.revert( - market.refund(Side.Long, toUnit(1), { from: newBidder }), - 'SafeMath: subtraction overflow' - ); - await assert.revert( - market.refund(Side.Short, toUnit(1), { from: newBidder }), - 'SafeMath: subtraction overflow' - ); - - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - - // Refund larger than total supply. - const totalSupply = await market.deposited(); - await assert.revert( - market.refund(Side.Long, totalSupply, { from: newBidder }), - 'SafeMath: subtraction overflow' - ); - await assert.revert( - market.refund(Side.Short, totalSupply, { from: newBidder }), - 'SafeMath: subtraction overflow' - ); - - // Smaller than total supply but larger than balance. - await assert.revert( - market.refund(Side.Long, initialLongBid.add(toBN(1)), { from: newBidder }), - 'SafeMath: subtraction overflow' - ); - await assert.revert( - market.refund(Side.Short, initialShortBid.add(toBN(1)), { from: newBidder }), - 'SafeMath: subtraction overflow' - ); - }); - - it('Refunds properly affect prices.', async () => { - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.refund(Side.Short, initialShortBid, { from: newBidder }); - await market.refund(Side.Long, initialLongBid, { from: newBidder }); - - const debt = multiplyDecimalRound( - initialLongBid.add(initialShortBid), - toUnit(1).add(initialRefundFee) - ); - const expectedPrices = computePrices(initialLongBid, initialShortBid, debt, totalInitialFee); - const currentPrices = await market.prices(); - - assert.bnClose(currentPrices[0], expectedPrices.long, 1); - assert.bnClose(currentPrices[1], expectedPrices.short, 1); - }); - - it('Cannot refund past the end of bidding.', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - - await fastForward(biddingTime + 1); - - await assert.revert( - market.refund(Side.Long, initialLongBid, { from: newBidder }), - 'Bidding inactive' - ); - await assert.revert( - market.refund(Side.Short, initialShortBid, { from: newBidder }), - 'Bidding inactive' - ); - }); - - it('Refunds properly emit events.', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - - const longFee = multiplyDecimalRound(initialLongBid, initialRefundFee); - const shortFee = multiplyDecimalRound(initialShortBid, initialRefundFee); - - let tx = await market.refund(Side.Long, initialLongBid, { from: newBidder }); - let currentPrices = await market.prices(); - - assert.equal(tx.logs[0].event, 'Refund'); - assert.bnEqual(tx.logs[0].args.side, Side.Long); - assert.equal(tx.logs[0].args.account, newBidder); - assert.bnEqual(tx.logs[0].args.value, initialLongBid.sub(longFee)); - assert.bnEqual(tx.logs[0].args.fee, longFee); - - assert.equal(tx.logs[1].event, 'PricesUpdated'); - assert.bnEqual(tx.logs[1].args.longPrice, currentPrices[0]); - assert.bnEqual(tx.logs[1].args.shortPrice, currentPrices[1]); - - tx = await market.refund(Side.Short, initialShortBid, { from: newBidder }); - currentPrices = await market.prices(); - - assert.equal(tx.logs[0].event, 'Refund'); - assert.bnEqual(tx.logs[0].args.side, Side.Short); - assert.equal(tx.logs[0].args.account, newBidder); - assert.bnEqual(tx.logs[0].args.value, initialShortBid.sub(shortFee)); - assert.bnEqual(tx.logs[0].args.fee, shortFee); - - assert.equal(tx.logs[1].event, 'PricesUpdated'); - assert.bnEqual(tx.logs[1].args.longPrice, currentPrices[0]); - assert.bnEqual(tx.logs[1].args.shortPrice, currentPrices[1]); - }); - - it('Refunds remit the proper amount of sUSD', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - await market.refund(Side.Long, initialLongBid, { from: newBidder }); - await market.refund(Side.Short, initialShortBid, { from: newBidder }); - - const fee = multiplyDecimalRound(initialLongBid.add(initialShortBid), initialRefundFee); - assert.bnEqual(await sUSDSynth.balanceOf(newBidder), sUSDQty.sub(fee)); - }); - - it('Empty refunds do nothing.', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - const tx1 = await market.refund(Side.Long, toBN(0), { from: newBidder }); - const tx2 = await market.refund(Side.Short, toBN(0), { from: newBidder }); - - assert.bnEqual(await long.bidOf(newBidder), initialLongBid); - assert.bnEqual(await short.bidOf(newBidder), initialShortBid); - assert.equal(tx1.logs.length, 0); - assert.equal(tx1.receipt.rawLogs, 0); - assert.equal(tx2.logs.length, 0); - assert.equal(tx2.receipt.rawLogs, 0); - }); - - it('Creator may not refund if it would violate the capital requirement.', async () => { - const perSide = capitalRequirement.div(toBN(2)); - - market.refund(Side.Long, initialLongBid.sub(perSide), { from: initialBidder }); - market.refund(Side.Short, initialShortBid.sub(perSide), { from: initialBidder }); - - await assert.revert( - market.refund(Side.Long, toUnit(0.1), { from: initialBidder }), - 'Insufficient capital' - ); - await assert.revert( - market.refund(Side.Short, toUnit(0.1), { from: initialBidder }), - 'Insufficient capital' - ); - }); - - it('Creator may not refund their entire position of either option.', async () => { - await assert.revert( - market.refund(Side.Long, initialLongBid, { from: initialBidder }), - 'Bids too skewed' - ); - await assert.revert( - market.refund(Side.Short, initialShortBid, { from: initialBidder }), - 'Bids too skewed' - ); - }); - - it('Refunding fails when the system is suspended.', async () => { - await setStatus({ - owner: accounts[1], - systemStatus, - section: 'System', - suspend: true, - }); - - await assert.revert( - market.refund(Side.Long, toBN(1), { from: initialBidder }), - 'Operation prohibited' - ); - await assert.revert( - market.refund(Side.Short, toBN(1), { from: initialBidder }), - 'Operation prohibited' - ); - }); - - it('Refunding fails when the manager is paused.', async () => { - await manager.setPaused(true, { from: accounts[1] }); - - await assert.revert( - market.refund(Side.Long, toBN(1), { from: initialBidder }), - 'This action cannot be performed while the contract is paused' - ); - await assert.revert( - market.refund(Side.Short, toBN(1), { from: initialBidder }), - 'This action cannot be performed while the contract is paused' - ); - }); - - it('Refunds yielding a bid less than $0.01 fail.', async () => { - await market.bid(Side.Long, toUnit(1), { from: newBidder }); - await market.bid(Side.Short, toUnit(1), { from: newBidder }); - - const longRefund = toUnit(1).sub(toUnit('0.0099')); - const shortRefund = toUnit(1).sub(toUnit('0.0099')); - - await assert.revert( - market.refund(Side.Long, longRefund, { from: newBidder }), - 'Balance < $0.01' - ); - await assert.revert( - market.refund(Side.Short, shortRefund, { from: newBidder }), - 'Balance < $0.01' - ); - }); - }); - - describe('Claiming Options', () => { - it('Claims yield the proper balances before resolution.', async () => { - await sUSDSynth.issue(pauper, sUSDQty); - await sUSDSynth.approve(manager.address, sUSDQty, { from: pauper }); - await sUSDSynth.approve(market.address, sUSDQty, { from: pauper }); - - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: pauper }); - - await fastForward(biddingTime + 100); - - const prices = await market.prices(); - const longOptions = divideDecimalRound(initialLongBid, prices.long); - const shortOptions = divideDecimalRound(initialShortBid, prices.short); - - const initialBidderClaimable = await market.claimableBalancesOf(initialBidder); - const newBidderClaimable = await market.claimableBalancesOf(newBidder); - const pauperClaimable = await market.claimableBalancesOf(pauper); - assert.bnClose(initialBidderClaimable.long, longOptions); - assert.bnClose(initialBidderClaimable.short, shortOptions); - assert.bnClose(newBidderClaimable.long, longOptions); - assert.bnEqual(newBidderClaimable.short, toBN(0)); - assert.bnEqual(pauperClaimable.long, toBN(0)); - assert.bnClose(pauperClaimable.short, shortOptions); - - const tx1 = await market.claimOptions({ from: newBidder }); - const tx2 = await market.claimOptions({ from: pauper }); - - assert.bnClose(await long.balanceOf(newBidder), longOptions, 1); - assert.bnEqual(await short.balanceOf(newBidder), toBN(0)); - assert.bnEqual(await long.bidOf(newBidder), toBN(0)); - assert.bnEqual(await short.bidOf(newBidder), toBN(0)); - - assert.bnEqual(await long.balanceOf(pauper), toBN(0)); - assert.bnClose(await short.balanceOf(pauper), shortOptions, 1); - assert.bnEqual(await long.bidOf(pauper), toBN(0)); - assert.bnEqual(await short.bidOf(pauper), toBN(0)); - - let logs = BinaryOption.decodeLogs(tx1.receipt.rawLogs); - - assert.equal(logs[0].address, long.address); - assert.equal(logs[0].event, 'Transfer'); - assert.equal(logs[0].args.from, '0x' + '0'.repeat(40)); - assert.equal(logs[0].args.to, newBidder); - assert.bnClose(logs[0].args.value, longOptions, 1); - assert.equal(logs[1].address, long.address); - assert.equal(logs[1].event, 'Issued'); - assert.equal(logs[1].args.account, newBidder); - assert.bnClose(logs[1].args.value, longOptions, 1); - assert.equal(tx1.logs[0].event, 'OptionsClaimed'); - assert.equal(tx1.logs[0].args.account, newBidder); - assert.bnClose(tx1.logs[0].args.longOptions, longOptions, 1); - assert.bnEqual(tx1.logs[0].args.shortOptions, toBN(0)); - - logs = BinaryOption.decodeLogs(tx2.receipt.rawLogs); - - assert.equal(logs[0].address, short.address); - assert.equal(logs[0].event, 'Transfer'); - assert.equal(logs[0].args.from, '0x' + '0'.repeat(40)); - assert.equal(logs[0].args.to, pauper); - assert.bnClose(logs[0].args.value, shortOptions, 1); - assert.equal(logs[1].address, short.address); - assert.equal(logs[1].event, 'Issued'); - assert.equal(logs[1].args.account, pauper); - assert.bnClose(logs[1].args.value, shortOptions, 1); - assert.equal(tx2.logs[0].event, 'OptionsClaimed'); - assert.equal(tx2.logs[0].args.account, pauper); - assert.bnEqual(tx2.logs[0].args.longOptions, toBN(0)); - assert.bnClose(tx2.logs[0].args.shortOptions, shortOptions, 1); - }); - - it('Claims yield the proper balances after resolution.', async () => { - await sUSDSynth.issue(pauper, sUSDQty); - await sUSDSynth.approve(manager.address, sUSDQty, { from: pauper }); - await sUSDSynth.approve(market.address, sUSDQty, { from: pauper }); - - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: pauper }); - - const prices = await market.prices(); - const longOptions = divideDecimalRound(initialLongBid, prices.long); - const shortOptions = divideDecimalRound(initialShortBid, prices.short); - - const totalClaimableSupplies = await market.totalClaimableSupplies(); - assert.bnClose(totalClaimableSupplies.long, longOptions.mul(toBN(2)), 60); - assert.bnClose(totalClaimableSupplies.short, shortOptions.mul(toBN(2)), 60); - - // Resolve the market - await fastForward(biddingTime + timeToMaturity + 100); - const now = await currentTime(); - const price = (await market.oracleDetails()).strikePrice; - await exchangeRates.updateRates([sAUDKey], [price], now, { from: oracle }); - await manager.resolveMarket(market.address); - - const postTotalClaimable = await market.totalClaimableSupplies(); - - // The claimable balance after resolution drops to zero. - assert.bnEqual(postTotalClaimable.long, totalClaimableSupplies.long); - assert.bnEqual(postTotalClaimable.short, toBN(0)); - - const initialBidderClaimable = await market.claimableBalancesOf(initialBidder); - const newBidderClaimable = await market.claimableBalancesOf(newBidder); - const pauperClaimable = await market.claimableBalancesOf(pauper); - assert.bnClose(initialBidderClaimable.long, longOptions); - assert.bnClose(initialBidderClaimable.short, toBN(0)); - assert.bnClose(newBidderClaimable.long, longOptions); - assert.bnEqual(newBidderClaimable.short, toBN(0)); - assert.bnEqual(pauperClaimable.long, toBN(0)); - assert.bnClose(pauperClaimable.short, toBN(0)); - - // Only the winning side has any options to claim. - const tx1 = await market.claimOptions({ from: initialBidder }); - const tx2 = await market.claimOptions({ from: newBidder }); - - // The pauper lost, so he has nothing to claim - await assert.revert(market.claimOptions({ from: pauper }), 'Nothing to claim'); - - assert.bnClose(await long.balanceOf(initialBidder), longOptions, 20); - assert.bnEqual(await short.balanceOf(initialBidder), toBN(0)); - assert.bnEqual(await long.bidOf(initialBidder), toBN(0)); - assert.bnEqual(await short.bidOf(initialBidder), initialShortBid); // The losing bid is not wiped out - - assert.bnClose(await long.balanceOf(newBidder), longOptions, 20); - assert.bnEqual(await short.balanceOf(newBidder), toBN(0)); - assert.bnEqual(await long.bidOf(newBidder), toBN(0)); - assert.bnEqual(await short.bidOf(newBidder), toBN(0)); - - assert.bnEqual(await long.balanceOf(pauper), toBN(0)); - assert.bnEqual(await short.balanceOf(pauper), toBN(0)); - assert.bnEqual(await long.bidOf(pauper), toBN(0)); - assert.bnEqual(await short.bidOf(pauper), initialShortBid); - - let logs = BinaryOption.decodeLogs(tx1.receipt.rawLogs); - - assert.equal(logs[0].address, long.address); - assert.equal(logs[0].event, 'Transfer'); - assert.equal(logs[0].args.from, '0x' + '0'.repeat(40)); - assert.equal(logs[0].args.to, initialBidder); - assert.bnClose(logs[0].args.value, longOptions, 1); - assert.equal(logs[1].address, long.address); - assert.equal(logs[1].event, 'Issued'); - assert.equal(logs[1].args.account, initialBidder); - assert.bnClose(logs[1].args.value, longOptions, 1); - assert.equal(tx1.logs[0].event, 'OptionsClaimed'); - assert.equal(tx1.logs[0].args.account, initialBidder); - assert.bnClose(tx1.logs[0].args.longOptions, longOptions, 1); - assert.bnEqual(tx1.logs[0].args.shortOptions, toBN(0)); - - logs = BinaryOption.decodeLogs(tx2.receipt.rawLogs); - - assert.equal(logs[0].address, long.address); - assert.equal(logs[0].event, 'Transfer'); - assert.equal(logs[0].args.from, '0x' + '0'.repeat(40)); - assert.equal(logs[0].args.to, newBidder); - assert.bnClose(logs[0].args.value, longOptions, 20); - assert.equal(logs[1].address, long.address); - assert.equal(logs[1].event, 'Issued'); - assert.equal(logs[1].args.account, newBidder); - assert.bnClose(logs[1].args.value, longOptions, 20); - assert.equal(tx2.logs[0].event, 'OptionsClaimed'); - assert.equal(tx2.logs[0].args.account, newBidder); - assert.bnClose(tx2.logs[0].args.longOptions, longOptions, 20); - assert.bnEqual(tx2.logs[0].args.shortOptions, toBN(0)); - }); - - it('Can claim both sides simultaneously.', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - - await fastForward(biddingTime * 2); - - const tx = await market.claimOptions({ from: newBidder }); - const prices = await market.prices(); - const longOptions = divideDecimalRound(initialLongBid, prices.long); - const shortOptions = divideDecimalRound(initialShortBid, prices.short); - - assert.bnClose(await long.balanceOf(newBidder), longOptions, 1); - assert.bnClose(await short.balanceOf(newBidder), shortOptions, 1); - - const logs = BinaryOption.decodeLogs(tx.receipt.rawLogs); - - assert.equal(logs[0].address, long.address); - assert.equal(logs[0].event, 'Transfer'); - assert.equal(logs[0].args.from, '0x' + '0'.repeat(40)); - assert.equal(logs[0].args.to, newBidder); - assert.bnClose(logs[0].args.value, longOptions, 1); - assert.equal(logs[1].address, long.address); - assert.equal(logs[1].event, 'Issued'); - assert.equal(logs[1].args.account, newBidder); - assert.bnClose(logs[1].args.value, longOptions, 1); - assert.equal(logs[2].address, short.address); - assert.equal(logs[2].event, 'Transfer'); - assert.equal(logs[2].args.from, '0x' + '0'.repeat(40)); - assert.equal(logs[2].args.to, newBidder); - assert.bnClose(logs[2].args.value, shortOptions, 1); - assert.equal(logs[3].address, short.address); - assert.equal(logs[3].event, 'Issued'); - assert.equal(logs[3].args.account, newBidder); - assert.bnClose(logs[3].args.value, shortOptions, 1); - }); - - it('Can claim when the implicit losing claimable option balance is greater than the deposited sUSD', async () => { - await sUSDSynth.issue(pauper, sUSDQty); - await sUSDSynth.approve(manager.address, sUSDQty, { from: pauper }); - await sUSDSynth.approve(market.address, sUSDQty, { from: pauper }); - - // Set up some bids to trigger the failure condition from SIP-71 - await market.bid(Side.Short, initialLongBid, { from: initialBidder }); - await market.bid(Side.Long, initialLongBid.div(toBN(3)), { from: pauper }); - await market.bid(Side.Short, initialLongBid.div(toBN(3)), { from: pauper }); - await market.bid(Side.Long, initialLongBid.div(toBN(3)), { from: newBidder }); - - await fastForward(biddingTime + timeToMaturity + 100); - const now = await currentTime(); - const price = (await market.oracleDetails()).strikePrice; - await exchangeRates.updateRates([sAUDKey], [price], now, { from: oracle }); - await manager.resolveMarket(market.address); - - await market.exerciseOptions({ from: newBidder }); - - const claimable = await market.claimableBalancesOf(initialBidder); - await market.claimOptions({ from: initialBidder }); - const balances = await market.balancesOf(initialBidder); - assert.bnEqual(balances.long, claimable.long); - assert.bnEqual(balances.short, toBN(0)); - }); - - it('Cannot claim options during bidding.', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - await assert.revert(market.claimOptions({ from: newBidder }), 'Bidding incomplete'); - }); - - it('Claiming with no bids reverts.', async () => { - await fastForward(biddingTime * 2); - await assert.revert(market.claimOptions({ from: newBidder }), 'Nothing to claim'); - }); - - it('Claiming works for an account which already has options.', async () => { - await sUSDSynth.issue(pauper, sUSDQty); - await sUSDSynth.approve(manager.address, sUSDQty, { from: pauper }); - await sUSDSynth.approve(market.address, sUSDQty, { from: pauper }); - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Long, initialLongBid, { from: pauper }); - await fastForward(biddingTime * 2); - await market.claimOptions({ from: newBidder }); - - long.transfer(pauper, toUnit(1), { from: newBidder }); - - await market.claimOptions({ from: pauper }); - - const prices = await market.prices(); - const longOptions = divideDecimalRound(initialLongBid, prices.long); - assert.bnClose(await long.balanceOf(pauper), longOptions.add(toUnit(1))); - }); - - it('Claiming fails if the system is suspended.', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - await fastForward(biddingTime * 2); - - await setStatus({ - owner: accounts[1], - systemStatus, - section: 'System', - suspend: true, - }); - - await assert.revert(market.claimOptions({ from: newBidder }), 'Operation prohibited'); - }); - - it('Claiming fails if the manager is paused.', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - await fastForward(biddingTime * 2); - - await manager.setPaused(true, { from: accounts[1] }); - await assert.revert( - market.claimOptions({ from: newBidder }), - 'This action cannot be performed while the contract is paused' - ); - }); - }); - - describe('Exercising Options', () => { - it('Exercising options yields the proper balances (long case).', async () => { - await sUSDSynth.issue(pauper, sUSDQty); - await sUSDSynth.approve(manager.address, sUSDQty, { from: pauper }); - await sUSDSynth.approve(market.address, sUSDQty, { from: pauper }); - - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: pauper }); - - await fastForward(biddingTime + 100); - - await market.claimOptions({ from: newBidder }); - await market.claimOptions({ from: pauper }); - - await fastForward(timeToMaturity + 100); - - const newBidderBalance = await sUSDSynth.balanceOf(newBidder); - const pauperBalance = await sUSDSynth.balanceOf(pauper); - - const now = await currentTime(); - const price = (await market.oracleDetails()).strikePrice; - await exchangeRates.updateRates([sAUDKey], [price], now, { from: oracle }); - await manager.resolveMarket(market.address); - - const tx1 = await market.exerciseOptions({ from: newBidder }); - const tx2 = await market.exerciseOptions({ from: pauper }); - - const prices = await market.prices(); - const longOptions = divideDecimalRound(initialLongBid, prices.long); - const shortOptions = divideDecimalRound(initialShortBid, prices.short); - - assert.bnEqual(await long.balanceOf(newBidder), toBN(0)); - assert.bnEqual(await short.balanceOf(newBidder), toBN(0)); - assert.bnEqual(await long.bidOf(newBidder), toBN(0)); - assert.bnEqual(await short.bidOf(newBidder), toBN(0)); - assert.bnClose(await sUSDSynth.balanceOf(newBidder), newBidderBalance.add(longOptions), 1); - - assert.bnEqual(await long.balanceOf(pauper), toBN(0)); - assert.bnEqual(await short.balanceOf(pauper), toBN(0)); - assert.bnEqual(await long.bidOf(pauper), toBN(0)); - assert.bnEqual(await short.bidOf(pauper), toBN(0)); - assert.bnEqual(await sUSDSynth.balanceOf(pauper), pauperBalance); - - let logs = BinaryOption.decodeLogs(tx1.receipt.rawLogs); - assert.equal(logs.length, 3); - assert.equal(logs[0].address, long.address); - assert.equal(logs[0].event, 'Transfer'); - assert.equal(logs[0].args.from, newBidder); - assert.equal(logs[0].args.to, '0x' + '0'.repeat(40)); - assert.bnClose(logs[0].args.value, longOptions, 1); - assert.equal(logs[1].address, long.address); - assert.equal(logs[1].event, 'Burned'); - assert.equal(logs[1].args.account, newBidder); - assert.bnClose(logs[1].args.value, longOptions, 1); - assert.equal(tx1.logs.length, 1); - assert.equal(tx1.logs[0].event, 'OptionsExercised'); - assert.equal(tx1.logs[0].args.account, newBidder); - assert.bnClose(tx1.logs[0].args.value, longOptions, 1); - - logs = BinaryOption.decodeLogs(tx2.receipt.rawLogs); - assert.equal(logs.length, 2); - assert.equal(logs[0].address, short.address); - assert.equal(logs[0].event, 'Transfer'); - assert.equal(logs[0].args.from, pauper); - assert.equal(logs[0].args.to, '0x' + '0'.repeat(40)); - assert.bnClose(logs[0].args.value, shortOptions, 1); - assert.equal(logs[1].address, short.address); - assert.equal(logs[1].event, 'Burned'); - assert.equal(logs[1].args.account, pauper); - assert.bnClose(logs[1].args.value, shortOptions, 1); - assert.equal(tx2.logs.length, 1); - assert.equal(tx2.logs[0].event, 'OptionsExercised'); - assert.equal(tx2.logs[0].args.account, pauper); - assert.bnClose(tx2.logs[0].args.value, toBN(0), 1); - }); - - it('Exercising options yields the proper balances (short case).', async () => { - await sUSDSynth.issue(pauper, sUSDQty); - await sUSDSynth.approve(manager.address, sUSDQty, { from: pauper }); - await sUSDSynth.approve(market.address, sUSDQty, { from: pauper }); - - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: pauper }); - - await fastForward(biddingTime + 100); - - await market.claimOptions({ from: newBidder }); - await market.claimOptions({ from: pauper }); - - await fastForward(timeToMaturity + 100); - - const newBidderBalance = await sUSDSynth.balanceOf(newBidder); - const pauperBalance = await sUSDSynth.balanceOf(pauper); - - const now = await currentTime(); - const strikePrice = (await market.oracleDetails()).strikePrice; - const price = strikePrice.div(toBN(2)); - await exchangeRates.updateRates([sAUDKey], [price], now, { from: oracle }); - await manager.resolveMarket(market.address); - - const tx1 = await market.exerciseOptions({ from: newBidder }); - const tx2 = await market.exerciseOptions({ from: pauper }); - - const prices = await market.prices(); - const longOptions = divideDecimalRound(initialLongBid, prices.long); - const shortOptions = divideDecimalRound(initialShortBid, prices.short); - - assert.bnEqual(await long.balanceOf(newBidder), toBN(0)); - assert.bnEqual(await short.balanceOf(newBidder), toBN(0)); - assert.bnEqual(await long.bidOf(newBidder), toBN(0)); - assert.bnEqual(await short.bidOf(newBidder), toBN(0)); - assert.bnEqual(await sUSDSynth.balanceOf(newBidder), newBidderBalance); - - assert.bnEqual(await long.balanceOf(pauper), toBN(0)); - assert.bnEqual(await short.balanceOf(pauper), toBN(0)); - assert.bnEqual(await long.bidOf(pauper), toBN(0)); - assert.bnEqual(await short.bidOf(pauper), toBN(0)); - assert.bnClose(await sUSDSynth.balanceOf(pauper), pauperBalance.add(shortOptions), 1); - - let logs = BinaryOption.decodeLogs(tx1.receipt.rawLogs); - assert.equal(logs.length, 2); - assert.equal(logs[0].address, long.address); - assert.equal(logs[0].event, 'Transfer'); - assert.equal(logs[0].args.from, newBidder); - assert.equal(logs[0].args.to, '0x' + '0'.repeat(40)); - assert.bnClose(logs[0].args.value, longOptions, 1); - assert.equal(logs[1].address, long.address); - assert.equal(logs[1].event, 'Burned'); - assert.equal(logs[1].args.account, newBidder); - assert.bnClose(logs[1].args.value, longOptions, 1); - assert.equal(tx1.logs.length, 1); - assert.equal(tx1.logs[0].event, 'OptionsExercised'); - assert.equal(tx1.logs[0].args.account, newBidder); - assert.bnClose(tx1.logs[0].args.value, toBN(0), 1); - - logs = BinaryOption.decodeLogs(tx2.receipt.rawLogs); - assert.equal(logs.length, 3); - assert.equal(logs[0].address, short.address); - assert.equal(logs[0].event, 'Transfer'); - assert.equal(logs[0].args.from, pauper); - assert.equal(logs[0].args.to, '0x' + '0'.repeat(40)); - assert.bnClose(logs[0].args.value, shortOptions, 1); - assert.equal(logs[1].address, short.address); - assert.equal(logs[1].event, 'Burned'); - assert.equal(logs[1].args.account, pauper); - assert.bnClose(logs[1].args.value, shortOptions, 1); - assert.equal(tx2.logs.length, 1); - assert.equal(tx2.logs[0].event, 'OptionsExercised'); - assert.equal(tx2.logs[0].args.account, pauper); - assert.bnClose(tx2.logs[0].args.value, shortOptions, 1); - }); - - it('Only one side pays out if both sides are owned.', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - await fastForward(biddingTime + 100); - await market.claimOptions({ from: newBidder }); - await fastForward(timeToMaturity + 100); - - const newBidderBalance = await sUSDSynth.balanceOf(newBidder); - - const now = await currentTime(); - const price = (await market.oracleDetails()).strikePrice; - await exchangeRates.updateRates([sAUDKey], [price], now, { from: oracle }); - await manager.resolveMarket(market.address); - - const tx = await market.exerciseOptions({ from: newBidder }); - - const prices = await market.prices(); - const longOptions = divideDecimalRound(initialLongBid, prices.long); - const shortOptions = divideDecimalRound(initialShortBid, prices.short); - - assert.bnEqual(await long.balanceOf(newBidder), toBN(0)); - assert.bnEqual(await short.balanceOf(newBidder), toBN(0)); - assert.bnEqual(await long.bidOf(newBidder), toBN(0)); - assert.bnEqual(await short.bidOf(newBidder), toBN(0)); - assert.bnClose(await sUSDSynth.balanceOf(newBidder), newBidderBalance.add(longOptions), 1); - - const logs = BinaryOption.decodeLogs(tx.receipt.rawLogs); - assert.equal(logs.length, 5); - assert.equal(logs[0].address, long.address); - assert.equal(logs[0].event, 'Transfer'); - assert.equal(logs[0].args.from, newBidder); - assert.equal(logs[0].args.to, '0x' + '0'.repeat(40)); - assert.bnClose(logs[0].args.value, longOptions, 1); - assert.equal(logs[1].address, long.address); - assert.equal(logs[1].event, 'Burned'); - assert.equal(logs[1].args.account, newBidder); - assert.bnClose(logs[1].args.value, longOptions, 1); - assert.equal(logs[2].address, short.address); - assert.equal(logs[2].event, 'Transfer'); - assert.equal(logs[2].args.from, newBidder); - assert.equal(logs[2].args.to, '0x' + '0'.repeat(40)); - assert.bnClose(logs[2].args.value, shortOptions, 1); - assert.equal(logs[3].address, short.address); - assert.equal(logs[3].event, 'Burned'); - assert.equal(logs[3].args.account, newBidder); - assert.bnClose(logs[3].args.value, shortOptions, 1); - assert.equal(tx.logs.length, 1); - assert.equal(tx.logs[0].event, 'OptionsExercised'); - assert.equal(tx.logs[0].args.account, newBidder); - assert.bnClose(tx.logs[0].args.value, longOptions, 1); - }); - - it('Exercising options updates total deposits.', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - - await fastForward(biddingTime + timeToMaturity + 100); - await exchangeRates.updateRates( - [sAUDKey], - [(await market.oracleDetails()).strikePrice], - await currentTime(), - { from: oracle } - ); - await manager.resolveMarket(market.address); - - const preDeposited = await market.deposited(); - const preTotalDeposited = await manager.totalDeposited(); - - await market.exerciseOptions({ from: newBidder }); - - const longOptions = divideDecimalRound(initialLongBid, (await market.prices()).long); - assert.bnClose(await market.deposited(), preDeposited.sub(longOptions), 1); - assert.bnClose(await manager.totalDeposited(), preTotalDeposited.sub(longOptions), 1); - }); - - it('Exercising options resolves an unresolved market.', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - await fastForward(biddingTime + 100); - await market.claimOptions({ from: newBidder }); - await fastForward(timeToMaturity + 100); - await exchangeRates.updateRates( - [sAUDKey], - [(await market.oracleDetails()).strikePrice], - await currentTime(), - { from: oracle } - ); - assert.isFalse(await market.resolved()); - await market.exerciseOptions({ from: newBidder }); - assert.isTrue(await market.resolved()); - }); - - it('Exercising options with none owned reverts.', async () => { - await fastForward(biddingTime + timeToMaturity + 100); - const now = await currentTime(); - const price = (await market.oracleDetails()).strikePrice; - await exchangeRates.updateRates([sAUDKey], [price], now, { from: oracle }); - await manager.resolveMarket(market.address); - - await assert.revert(market.exerciseOptions({ from: pauper }), 'Nothing to exercise'); - }); - - it('Unclaimed options are automatically claimed when exercised.', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - - await fastForward(biddingTime + timeToMaturity + 100); - const newBidderBalance = await sUSDSynth.balanceOf(newBidder); - - const now = await currentTime(); - const price = (await market.oracleDetails()).strikePrice; - await exchangeRates.updateRates([sAUDKey], [price], now, { from: oracle }); - await manager.resolveMarket(market.address); - - const tx = await market.exerciseOptions({ from: newBidder }); - - const prices = await market.prices(); - const longOptions = divideDecimalRound(initialLongBid, prices.long); - - assert.bnEqual(await long.balanceOf(newBidder), toBN(0)); - assert.bnEqual(await short.balanceOf(newBidder), toBN(0)); - assert.bnEqual(await long.bidOf(newBidder), toBN(0)); - assert.bnEqual(await short.bidOf(newBidder), initialShortBid); // The bid on the losing side isn't zeroed. - assert.bnClose(await sUSDSynth.balanceOf(newBidder), newBidderBalance.add(longOptions), 1); - - assert.equal(tx.logs[0].event, 'OptionsClaimed'); - assert.equal(tx.logs[0].args.account, newBidder); - assert.bnClose(tx.logs[0].args.longOptions, longOptions, 1); - assert.bnClose(tx.logs[0].args.shortOptions, toBN(0), 1); - assert.equal(tx.logs[1].event, 'OptionsExercised'); - assert.equal(tx.logs[1].args.account, newBidder); - assert.bnClose(tx.logs[1].args.value, longOptions, 1); - }); - - it('Unclaimed options are automatically claimed even when exercised from an unresolved market.', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialShortBid, { from: newBidder }); - - await fastForward(biddingTime + timeToMaturity + 100); - const newBidderBalance = await sUSDSynth.balanceOf(newBidder); - - const now = await currentTime(); - const price = (await market.oracleDetails()).strikePrice; - await exchangeRates.updateRates([sAUDKey], [price], now, { from: oracle }); - - const tx = await market.exerciseOptions({ from: newBidder }); - - const prices = await market.prices(); - const longOptions = divideDecimalRound(initialLongBid, prices.long); - - assert.bnEqual(await long.balanceOf(newBidder), toBN(0)); - assert.bnEqual(await short.balanceOf(newBidder), toBN(0)); - assert.bnEqual(await long.bidOf(newBidder), toBN(0)); - assert.bnEqual(await short.bidOf(newBidder), initialShortBid); // The bid on the losing side isn't zeroed. - assert.bnClose(await sUSDSynth.balanceOf(newBidder), newBidderBalance.add(longOptions), 1); - - assert.equal(tx.logs[0].event, 'MarketResolved'); - assert.equal(tx.logs[1].event, 'OptionsClaimed'); - assert.equal(tx.logs[1].args.account, newBidder); - assert.bnClose(tx.logs[1].args.longOptions, longOptions, 1); - assert.bnClose(tx.logs[1].args.shortOptions, toBN(0), 1); - assert.equal(tx.logs[2].event, 'OptionsExercised'); - assert.equal(tx.logs[2].args.account, newBidder); - assert.bnClose(tx.logs[2].args.value, longOptions, 1); - }); - - it('Options cannot be exercised if the system is suspended.', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await fastForward(biddingTime + timeToMaturity + 100); - await exchangeRates.updateRates( - [sAUDKey], - [(await market.oracleDetails()).strikePrice], - await currentTime(), - { from: oracle } - ); - await manager.resolveMarket(market.address); - - await setStatus({ - owner: accounts[1], - systemStatus, - section: 'System', - suspend: true, - }); - - await assert.revert(market.exerciseOptions({ from: newBidder }), 'Operation prohibited'); - }); - - it('Options cannot be exercised if the manager is paused.', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await fastForward(biddingTime + timeToMaturity + 100); - await exchangeRates.updateRates( - [sAUDKey], - [(await market.oracleDetails()).strikePrice], - await currentTime(), - { from: oracle } - ); - await manager.resolveMarket(market.address); - - await manager.setPaused(true, { from: accounts[1] }); - await assert.revert( - market.exerciseOptions({ from: newBidder }), - 'This action cannot be performed while the contract is paused' - ); - }); - - it('Options can be exercised if transferred to another account.', async () => { - await fastForward(biddingTime + 100); - const bidderClaimable = await market.claimableBalancesOf(initialBidder); - await market.claimOptions({ from: initialBidder }); - - await long.transfer(newBidder, bidderClaimable.long.div(toBN(2)), { from: initialBidder }); - await short.transfer(pauper, bidderClaimable.short.div(toBN(2)), { from: initialBidder }); - - await fastForward(timeToMaturity + 100); - - const now = await currentTime(); - const price = (await market.oracleDetails()).strikePrice; - await exchangeRates.updateRates([sAUDKey], [price], now, { from: oracle }); - await manager.resolveMarket(market.address); - - let tx = await market.exerciseOptions({ from: initialBidder }); - let logs = await getDecodedLogs({ - hash: tx.receipt.transactionHash, - contracts: [manager, market, long], - }); - - assert.equal(logs.length, 6); - decodedEventEqual({ - event: 'Transfer', - emittedFrom: long.address, - args: [initialBidder, ZERO_ADDRESS, bidderClaimable.long.div(toBN(2))], - log: logs[0], - }); - decodedEventEqual({ - event: 'Burned', - emittedFrom: long.address, - args: [initialBidder, bidderClaimable.long.div(toBN(2))], - log: logs[1], - }); - decodedEventEqual({ - event: 'Transfer', - emittedFrom: short.address, - args: [initialBidder, ZERO_ADDRESS, bidderClaimable.short.div(toBN(2))], - log: logs[2], - }); - decodedEventEqual({ - event: 'Burned', - emittedFrom: short.address, - args: [initialBidder, bidderClaimable.short.div(toBN(2))], - log: logs[3], - }); - decodedEventEqual({ - event: 'OptionsExercised', - emittedFrom: market.address, - args: [initialBidder, bidderClaimable.long.div(toBN(2))], - log: logs[4], - }); - decodedEventEqual({ - event: 'Transfer', - emittedFrom: sUSDProxy, - args: [market.address, initialBidder, bidderClaimable.long.div(toBN(2))], - log: logs[5], - }); - - tx = await market.exerciseOptions({ from: newBidder }); - logs = await getDecodedLogs({ - hash: tx.receipt.transactionHash, - contracts: [manager, market, long], - }); - - assert.equal(logs.length, 4); - decodedEventEqual({ - event: 'Transfer', - emittedFrom: long.address, - args: [newBidder, ZERO_ADDRESS, bidderClaimable.long.div(toBN(2))], - log: logs[0], - }); - decodedEventEqual({ - event: 'Burned', - emittedFrom: long.address, - args: [newBidder, bidderClaimable.long.div(toBN(2))], - log: logs[1], - }); - decodedEventEqual({ - event: 'OptionsExercised', - emittedFrom: market.address, - args: [newBidder, bidderClaimable.long.div(toBN(2))], - log: logs[2], - }); - decodedEventEqual({ - event: 'Transfer', - emittedFrom: sUSDProxy, - args: [market.address, newBidder, bidderClaimable.long.div(toBN(2))], - log: logs[3], - }); - - tx = await market.exerciseOptions({ from: pauper }); - logs = await getDecodedLogs({ - hash: tx.receipt.transactionHash, - contracts: [manager, market, long], - }); - - assert.equal(logs.length, 3); - decodedEventEqual({ - event: 'Transfer', - emittedFrom: short.address, - args: [pauper, ZERO_ADDRESS, bidderClaimable.short.div(toBN(2))], - log: logs[0], - }); - decodedEventEqual({ - event: 'Burned', - emittedFrom: short.address, - args: [pauper, bidderClaimable.short.div(toBN(2))], - log: logs[1], - }); - decodedEventEqual({ - event: 'OptionsExercised', - emittedFrom: market.address, - args: [pauper, toBN(0)], - log: logs[2], - }); - }); - }); - - describe('Expiry', () => { - it('Expired markets destroy themselves and their options.', async () => { - const marketAddress = market.address; - const longAddress = long.address; - const shortAddress = short.address; - - await fastForward(biddingTime + timeToMaturity + expiryDuration + 10); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice], await currentTime(), { - from: oracle, - }); - await manager.resolveMarket(market.address); - await manager.expireMarkets([market.address], { from: initialBidder }); - - assert.equal(await web3.eth.getCode(marketAddress), '0x'); - assert.equal(await web3.eth.getCode(longAddress), '0x'); - assert.equal(await web3.eth.getCode(shortAddress), '0x'); - }); - - it('Unresolved markets cannot be expired', async () => { - await fastForward(biddingTime + timeToMaturity + expiryDuration + 10); - await assert.revert( - manager.expireMarkets([market.address], { from: initialBidder }), - 'Unexpired options remaining' - ); - }); - - it('Market cannot be expired before its time', async () => { - await fastForward(biddingTime + timeToMaturity + 10); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice], await currentTime(), { - from: oracle, - }); - await manager.resolveMarket(market.address); - await assert.revert( - manager.expireMarkets([market.address], { from: initialBidder }), - 'Unexpired options remaining' - ); - }); - - it('Market can be expired early if all options are exercised', async () => { - await fastForward(biddingTime + timeToMaturity + 10); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice], await currentTime(), { - from: oracle, - }); - await market.exerciseOptions({ from: initialBidder }); - const marketAddress = market.address; - await manager.expireMarkets([market.address], { from: initialBidder }); - assert.equal(await web3.eth.getCode(marketAddress), '0x'); - }); - - it('Market cannot be expired except by the manager', async () => { - await fastForward(biddingTime + timeToMaturity + expiryDuration + 10); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice], await currentTime(), { - from: oracle, - }); - await manager.resolveMarket(market.address); - - await onlyGivenAddressCanInvoke({ - fnc: market.expire, - args: [initialBidder], - accounts, - skipPassCheck: true, - reason: 'Only the contract owner may perform this action', - }); - }); - - it('Expired market remits any unclaimed options and extra sUSD to the caller.', async () => { - await sUSDSynth.transfer(market.address, toUnit(1)); - const creatorBalance = await sUSDSynth.balanceOf(initialBidder); - - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - - const deposited = await market.deposited(); - const preTotalDeposited = await manager.totalDeposited(); - - await fastForward(biddingTime + timeToMaturity + expiryDuration + 10); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice], await currentTime(), { - from: oracle, - }); - await manager.resolveMarket(market.address); - await manager.expireMarkets([market.address], { from: initialBidder }); - - const pot = multiplyDecimalRound( - initialLongBid.mul(toBN(2)).add(initialShortBid), - toUnit(1).sub(initialPoolFee.add(initialCreatorFee)) - ); - const creatorFee = multiplyDecimalRound( - initialLongBid.mul(toBN(2)).add(initialShortBid), - initialCreatorFee - ); - const creatorRecovered = pot.add(creatorFee).add(toUnit(1)); - const postCreatorBalance = await sUSDSynth.balanceOf(initialBidder); - assert.bnClose(postCreatorBalance, creatorBalance.add(creatorRecovered)); - assert.bnEqual(await manager.totalDeposited(), preTotalDeposited.sub(deposited)); - }); - - it('Expired market emits no transfer if there is nothing to remit.', async () => { - await fastForward(biddingTime + timeToMaturity + expiryDuration + 10); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice], await currentTime(), { - from: oracle, - }); - - const marketAddress = market.address; - await market.exerciseOptions({ from: initialBidder }); - - const creatorBalance = await sUSDSynth.balanceOf(initialBidder); - const tx = await manager.expireMarkets([market.address], { from: initialBidder }); - const postCreatorBalance = await sUSDSynth.balanceOf(initialBidder); - assert.bnEqual(postCreatorBalance, creatorBalance); - - const log = tx.receipt.logs[0]; - assert.eventEqual(log, 'MarketExpired', { - market: marketAddress, - }); - - const logs = Synth.decodeLogs(tx.receipt.rawLogs); - assert.equal(logs.length, 0); - }); - - it('Market cannot be expired if the system is suspended', async () => { - await fastForward(biddingTime + timeToMaturity + expiryDuration + 10); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice], await currentTime(), { - from: oracle, - }); - await manager.resolveMarket(market.address); - - await setStatus({ - owner: accounts[1], - systemStatus, - section: 'System', - suspend: true, - }); - - await assert.revert( - manager.expireMarkets([market.address], { from: initialBidder }), - 'Operation prohibited' - ); - }); - - it('Market cannot be expired if the manager is paused', async () => { - await fastForward(biddingTime + timeToMaturity + expiryDuration + 10); - await exchangeRates.updateRates([sAUDKey], [initialStrikePrice], await currentTime(), { - from: oracle, - }); - await manager.resolveMarket(market.address); - await manager.setPaused(true, { from: accounts[1] }); - await assert.revert( - manager.expireMarkets([market.address], { from: initialBidder }), - 'This action cannot be performed while the contract is paused' - ); - }); - }); - - describe('Cancellation', () => { - it('Market can be cancelled', async () => { - const marketAddress = market.address; - const longAddress = long.address; - const shortAddress = short.address; - - // Balance in the contract is remitted to the creator - const preBalance = await sUSDSynth.balanceOf(initialBidder); - const preTotalDeposits = await manager.totalDeposited(); - const tx = await manager.cancelMarket(market.address, { from: initialBidder }); - const postBalance = await sUSDSynth.balanceOf(initialBidder); - const postTotalDeposits = await manager.totalDeposited(); - assert.bnEqual(postBalance, preBalance.add(initialLongBid.add(initialShortBid))); - assert.bnEqual(postTotalDeposits, preTotalDeposits.sub(initialLongBid.add(initialShortBid))); - - assert.equal(tx.receipt.logs.length, 1); - assert.eventEqual(tx.receipt.logs[0], 'MarketCancelled', { market: marketAddress }); - - assert.equal(await web3.eth.getCode(marketAddress), '0x'); - assert.equal(await web3.eth.getCode(longAddress), '0x'); - assert.equal(await web3.eth.getCode(shortAddress), '0x'); - }); - - it('Market cannot be cancelled if the system is suspended', async () => { - await setStatus({ - owner: accounts[1], - systemStatus, - section: 'System', - suspend: true, - }); - - await assert.revert( - manager.cancelMarket(market.address, { from: initialBidder }), - 'Operation prohibited' - ); - }); - - it('Market cannot be expired if the manager is paused', async () => { - await manager.setPaused(true, { from: accounts[1] }); - await assert.revert( - manager.cancelMarket(market.address, { from: initialBidder }), - 'This action cannot be performed while the contract is paused' - ); - }); - - it('Cancellation function can only be invoked by manager', async () => { - await onlyGivenAddressCanInvoke({ - fnc: market.cancel, - args: [initialBidder], - accounts, - skipPassCheck: true, - reason: 'Only the contract owner may perform this action', - }); - }); - - it('Market is only cancellable by its creator', async () => { - await onlyGivenAddressCanInvoke({ - fnc: manager.cancelMarket, - args: [market.address], - address: initialBidder, - accounts, - skipPassCheck: false, - reason: 'Sender not market creator', - }); - }); - - it('Market can only be cancelled during bidding', async () => { - await fastForward(biddingTime + 1); - await assert.revert( - manager.cancelMarket(market.address, { from: initialBidder }), - 'Bidding inactive' - ); - await fastForward(timeToMaturity + 1); - await assert.revert( - manager.cancelMarket(market.address, { from: initialBidder }), - 'Bidding inactive' - ); - await fastForward(expiryDuration + 1); - await assert.revert( - manager.cancelMarket(market.address, { from: initialBidder }), - 'Bidding inactive' - ); - }); - - it('Market cannot be cancelled if anyone has bid on it (long)', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await assert.revert( - manager.cancelMarket(market.address, { from: initialBidder }), - 'Not cancellable' - ); - }); - - it('Market cannot be cancelled if anyone has bid on it (short)', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await assert.revert( - manager.cancelMarket(market.address, { from: initialBidder }), - 'Not cancellable' - ); - }); - - it('Market cancellable if everyone refunds', async () => { - await market.bid(Side.Long, initialLongBid, { from: newBidder }); - await market.bid(Side.Short, initialLongBid, { from: newBidder }); - await assert.revert( - manager.cancelMarket(market.address, { from: initialBidder }), - 'Not cancellable' - ); - - // But cancellable again if all users withdraw. - await market.refund(Side.Long, initialLongBid, { from: newBidder }); - await market.refund(Side.Short, initialLongBid, { from: newBidder }); - - // Also the initial bidder may bid all they like. - await market.bid(Side.Long, initialLongBid, { from: initialBidder }); - await market.bid(Side.Short, initialLongBid, { from: initialBidder }); - - await manager.cancelMarket(market.address, { from: initialBidder }); - }); - }); -}); diff --git a/test/contracts/BinaryOptionMarketData.js b/test/contracts/BinaryOptionMarketData.js deleted file mode 100644 index 56183ddab9..0000000000 --- a/test/contracts/BinaryOptionMarketData.js +++ /dev/null @@ -1,140 +0,0 @@ -'use strict'; - -const { contract } = require('hardhat'); -const { assert } = require('./common'); -const { setupContract, setupAllContracts } = require('./setup'); -const { currentTime, toUnit } = require('../utils')(); -const { toBytes32 } = require('../..'); - -contract('BinaryOptionMarketData', accounts => { - let market, setupTime, dataContract; - - before(async () => { - const { AddressResolver: addressResolver } = await setupAllContracts({ - accounts, - synths: ['sUSD'], - contracts: [ - 'BinaryOptionMarketManager', - 'AddressResolver', - 'ExchangeRates', - 'FeePool', - 'Synthetix', - ], - }); - - setupTime = await currentTime(); - market = await setupContract({ - accounts, - contract: 'TestableBinaryOptionMarket', - args: [ - accounts[0], // manager - accounts[1], // creator - addressResolver.address, - [toUnit(2), toUnit(0.05)], // Capital requirement, skew limit - toBytes32('sAUD'), // oracle key - toUnit(1), // strike price - true, - [setupTime + 100, setupTime + 200, setupTime + 300], // bidding end, maturity, expiry - [toUnit(3), toUnit(4)], // long bid, short bid - [toUnit(0.01), toUnit(0.02), toUnit(0.03)], // pool, creator, refund fees - ], - }); - await market.rebuildCache(); - - dataContract = await setupContract({ - accounts, - contract: 'BinaryOptionMarketData', - args: [], - }); - }); - - describe('Data contract reports market data properly', () => { - it('Market parameters', async () => { - const params = await dataContract.getMarketParameters(market.address); - - assert.equal(params.creator, await market.creator()); - - const options = await market.options(); - assert.equal(params.options.long, options.long); - assert.equal(params.options.short, options.short); - - const times = await market.times(); - assert.equal(params.times.biddingEnd, times.biddingEnd); - assert.equal(params.times.maturity, times.maturity); - assert.equal(params.times.expiry, times.expiry); - - const oracleDetails = await market.oracleDetails(); - assert.equal(params.oracleDetails.key, oracleDetails.key); - assert.equal(params.oracleDetails.strikePrice, oracleDetails.strikePrice); - assert.equal(params.oracleDetails.finalPrice, oracleDetails.finalPrice); - - const fees = await market.fees(); - assert.equal(params.fees.poolFee, fees.poolFee); - assert.equal(params.fees.creatorFee, fees.creatorFee); - assert.equal(params.fees.refundFee, fees.refundFee); - - const creatorLimits = await market.creatorLimits(); - assert.equal(params.creatorLimits.capitalRequirement, creatorLimits.capitalRequirement); - assert.equal(params.creatorLimits.skewLimit, creatorLimits.skewLimit); - }); - - it('Market data', async () => { - const data = await dataContract.getMarketData(market.address); - - const oraclePriceAndTimestamp = await market.oraclePriceAndTimestamp(); - assert.equal(data.oraclePriceAndTimestamp.price, oraclePriceAndTimestamp.price); - assert.equal(data.oraclePriceAndTimestamp.updatedAt, oraclePriceAndTimestamp.updatedAt); - - const prices = await market.prices(); - assert.bnEqual(data.prices.long, prices.long); - assert.bnEqual(data.prices.short, prices.short); - - assert.bnEqual(data.deposits.deposited, await market.deposited()); - assert.bnEqual(data.deposits.exercisableDeposits, await market.exercisableDeposits()); - - assert.equal(data.resolution.resolved, await market.resolved()); - assert.equal(data.resolution.canResolve, await market.canResolve()); - - assert.equal(data.phase, await market.phase()); - assert.equal(data.result, await market.result()); - - const totalBids = await market.totalBids(); - assert.equal(data.totalBids.long, totalBids.long); - assert.equal(data.totalBids.short, totalBids.short); - - const totalClaimableSupplies = await market.totalClaimableSupplies(); - assert.equal(data.totalClaimableSupplies.long, totalClaimableSupplies.long); - assert.equal(data.totalClaimableSupplies.short, totalClaimableSupplies.short); - - const totalSupplies = await market.totalSupplies(); - assert.equal(data.totalSupplies.long, totalSupplies.long); - assert.equal(data.totalSupplies.short, totalSupplies.short); - }); - - it('Account data', async () => { - let data = await dataContract.getAccountMarketData(market.address, accounts[1]); - - const bids = await market.bidsOf(accounts[1]); - assert.bnNotEqual(bids.long, toUnit(0)); - assert.bnNotEqual(bids.short, toUnit(0)); - assert.bnEqual(bids.long, data.bids.long); - assert.bnEqual(bids.short, data.bids.short); - - const claimable = await market.claimableBalancesOf(accounts[1]); - assert.bnNotEqual(claimable.long, toUnit(0)); - assert.bnNotEqual(claimable.short, toUnit(0)); - assert.bnEqual(claimable.long, data.claimable.long); - assert.bnEqual(claimable.short, data.claimable.short); - - // Force a claim to set balances to nonzero values, and refresh the data. - await market.forceClaim(accounts[1]); - data = await dataContract.getAccountMarketData(market.address, accounts[1]); - - const balances = await market.balancesOf(accounts[1]); - assert.bnNotEqual(balances.long, toUnit(0)); - assert.bnNotEqual(balances.short, toUnit(0)); - assert.bnEqual(balances.long, data.balances.long); - assert.bnEqual(balances.short, data.balances.short); - }); - }); -}); diff --git a/test/contracts/BinaryOptionMarketManager.js b/test/contracts/BinaryOptionMarketManager.js deleted file mode 100644 index 6cd8d05c80..0000000000 --- a/test/contracts/BinaryOptionMarketManager.js +++ /dev/null @@ -1,1626 +0,0 @@ -'use strict'; - -const { artifacts, contract, web3 } = require('hardhat'); -const { toBN } = web3.utils; - -const { assert, addSnapshotBeforeRestoreAfterEach } = require('./common'); -const { - toUnit, - currentTime, - fastForward, - multiplyDecimalRound, - divideDecimalRound, -} = require('../utils')(); -const { toBytes32 } = require('../..'); -const { setupContract, setupAllContracts } = require('./setup'); -const { - setStatus, - ensureOnlyExpectedMutativeFunctions, - onlyGivenAddressCanInvoke, - getEventByName, -} = require('./helpers'); - -let BinaryOptionMarket; - -const computePrices = (longs, shorts, debt, fee) => { - const totalOptions = multiplyDecimalRound(debt, toUnit(1).sub(fee)); - return { - long: divideDecimalRound(longs, totalOptions), - short: divideDecimalRound(shorts, totalOptions), - }; -}; - -contract('BinaryOptionMarketManager', accounts => { - const [initialCreator, managerOwner, bidder, dummy] = accounts; - - const sUSDQty = toUnit(10000); - - const capitalRequirement = toUnit(2); - const skewLimit = toUnit(0.05); - const maxOraclePriceAge = toBN(60 * 61); - const expiryDuration = toBN(26 * 7 * 24 * 60 * 60); - const maxTimeToMaturity = toBN(365 * 24 * 60 * 60); - - const initialPoolFee = toUnit(0.008); - const initialCreatorFee = toUnit(0.002); - const initialRefundFee = toUnit(0.02); - - let manager, factory, systemStatus, exchangeRates, addressResolver, sUSDSynth, oracle; - - const sAUDKey = toBytes32('sAUD'); - const iAUDKey = toBytes32('iAUD'); - - const Side = { - Long: toBN(0), - Short: toBN(1), - }; - - const createMarket = async ( - man, - oracleKey, - strikePrice, - refundsEnabled, - times, - bids, - creator - ) => { - const tx = await man.createMarket(oracleKey, strikePrice, refundsEnabled, times, bids, { - from: creator, - }); - return BinaryOptionMarket.at(getEventByName({ tx, name: 'MarketCreated' }).args.market); - }; - - before(async () => { - BinaryOptionMarket = artifacts.require('BinaryOptionMarket'); - }); - - before(async () => { - ({ - BinaryOptionMarketManager: manager, - BinaryOptionMarketFactory: factory, - SystemStatus: systemStatus, - AddressResolver: addressResolver, - ExchangeRates: exchangeRates, - SynthsUSD: sUSDSynth, - } = await setupAllContracts({ - accounts, - synths: ['sUSD'], - contracts: [ - 'SystemStatus', - 'BinaryOptionMarketManager', - 'AddressResolver', - 'ExchangeRates', - 'FeePool', - 'Synthetix', - ], - })); - - oracle = await exchangeRates.oracle(); - - await exchangeRates.updateRates([sAUDKey], [toUnit(5)], await currentTime(), { - from: oracle, - }); - - await Promise.all([ - sUSDSynth.issue(initialCreator, sUSDQty), - sUSDSynth.approve(manager.address, sUSDQty, { from: initialCreator }), - sUSDSynth.issue(bidder, sUSDQty), - sUSDSynth.approve(manager.address, sUSDQty, { from: bidder }), - ]); - }); - - addSnapshotBeforeRestoreAfterEach(); - - describe('Basic parameters', () => { - it('Static parameters are set properly', async () => { - const durations = await manager.durations(); - assert.bnEqual(durations.expiryDuration, expiryDuration); - assert.bnEqual(durations.maxOraclePriceAge, maxOraclePriceAge); - assert.bnEqual(durations.maxTimeToMaturity, maxTimeToMaturity); - - const fees = await manager.fees(); - assert.bnEqual(fees.poolFee, initialPoolFee); - assert.bnEqual(fees.creatorFee, initialCreatorFee); - assert.bnEqual(fees.refundFee, initialRefundFee); - - const creatorLimits = await manager.creatorLimits(); - assert.bnEqual(creatorLimits.capitalRequirement, capitalRequirement); - assert.bnEqual(creatorLimits.skewLimit, skewLimit); - assert.bnEqual(await manager.totalDeposited(), toBN(0)); - assert.bnEqual(await manager.marketCreationEnabled(), true); - assert.equal(await manager.resolver(), addressResolver.address); - assert.equal(await manager.owner(), managerOwner); - }); - - it('Only expected functions are mutative', async () => { - ensureOnlyExpectedMutativeFunctions({ - abi: manager.abi, - ignoreParents: ['Owned', 'Pausable', 'MixinResolver'], - expected: [ - 'cancelMarket', - 'createMarket', - 'decrementTotalDeposited', - 'expireMarkets', - 'incrementTotalDeposited', - 'rebuildMarketCaches', - 'migrateMarkets', - 'receiveMarkets', - 'resolveMarket', - 'setCreatorCapitalRequirement', - 'setCreatorFee', - 'setCreatorSkewLimit', - 'setExpiryDuration', - 'setMarketCreationEnabled', - 'setMaxOraclePriceAge', - 'setMaxTimeToMaturity', - 'setMigratingManager', - 'setPoolFee', - 'setRefundFee', - ], - }); - }); - - it('Set capital requirement', async () => { - const newValue = toUnit(20); - const tx = await manager.setCreatorCapitalRequirement(newValue, { from: managerOwner }); - assert.bnEqual((await manager.creatorLimits()).capitalRequirement, newValue); - const log = tx.logs[0]; - assert.equal(log.event, 'CreatorCapitalRequirementUpdated'); - assert.bnEqual(log.args.value, newValue); - }); - - it('Only the owner can set the capital requirement', async () => { - await onlyGivenAddressCanInvoke({ - fnc: manager.setCreatorCapitalRequirement, - args: [toUnit(20)], - accounts, - address: managerOwner, - reason: 'Only the contract owner may perform this action', - }); - }); - - it('Set skew limit', async () => { - const newValue = toUnit(0.3); - const tx = await manager.setCreatorSkewLimit(newValue, { from: managerOwner }); - assert.bnEqual((await manager.creatorLimits()).skewLimit, newValue); - const log = tx.logs[0]; - assert.equal(log.event, 'CreatorSkewLimitUpdated'); - assert.bnEqual(log.args.value, newValue); - }); - - it('Skew limit must be in range 0 to 1', async () => { - const newValue = toUnit(1.01); - await assert.revert( - manager.setCreatorSkewLimit(newValue, { from: managerOwner }), - 'Creator skew limit must be no greater than 1.' - ); - }); - - it('Only the owner can set the skew limit', async () => { - await onlyGivenAddressCanInvoke({ - fnc: manager.setCreatorSkewLimit, - args: [toUnit(0.2)], - accounts, - address: managerOwner, - reason: 'Only the contract owner may perform this action', - }); - }); - - it('Set pool fee', async () => { - const newFee = toUnit(0.5); - const tx = await manager.setPoolFee(newFee, { from: managerOwner }); - assert.bnEqual((await manager.fees()).poolFee, newFee); - const log = tx.logs[0]; - assert.equal(log.event, 'PoolFeeUpdated'); - assert.bnEqual(log.args.fee, newFee); - }); - - it('Only the owner can set the pool fee', async () => { - await onlyGivenAddressCanInvoke({ - fnc: manager.setPoolFee, - args: [toUnit(0.5)], - accounts, - address: managerOwner, - reason: 'Only the contract owner may perform this action', - }); - }); - - it('Set creator fee', async () => { - const newFee = toUnit(0.5); - const tx = await manager.setCreatorFee(newFee, { from: managerOwner }); - assert.bnEqual((await manager.fees()).creatorFee, newFee); - const log = tx.logs[0]; - assert.equal(log.event, 'CreatorFeeUpdated'); - assert.bnEqual(log.args.fee, newFee); - }); - - it('Only the owner can set the creator fee', async () => { - await onlyGivenAddressCanInvoke({ - fnc: manager.setCreatorFee, - args: [toUnit(0.5)], - accounts, - address: managerOwner, - reason: 'Only the contract owner may perform this action', - }); - }); - - it("Total fee can't be set too high", async () => { - await assert.revert( - manager.setPoolFee(toUnit(1), { from: managerOwner }), - 'Total fee must be less than 100%.' - ); - await assert.revert( - manager.setCreatorFee(toUnit(1), { from: managerOwner }), - 'Total fee must be less than 100%.' - ); - }); - - it('Total fee must be nonzero.', async () => { - await manager.setCreatorFee(toUnit(0), { from: managerOwner }); - await assert.revert( - manager.setPoolFee(toBN(0), { from: managerOwner }), - 'Total fee must be nonzero.' - ); - await manager.setCreatorFee(toUnit(0.5), { from: managerOwner }); - await manager.setPoolFee(toUnit(0), { from: managerOwner }); - await assert.revert( - manager.setCreatorFee(toBN(0), { from: managerOwner }), - 'Total fee must be nonzero.' - ); - }); - - it('Set refund fee', async () => { - const newFee = toUnit(1); - const tx = await manager.setRefundFee(newFee, { from: managerOwner }); - assert.bnEqual((await manager.fees()).refundFee, newFee); - const log = tx.logs[0]; - assert.equal(log.event, 'RefundFeeUpdated'); - assert.bnEqual(log.args.fee, newFee); - }); - - it('Only the owner can set the refund fee', async () => { - await onlyGivenAddressCanInvoke({ - fnc: manager.setRefundFee, - args: [toUnit(0.5)], - accounts, - address: managerOwner, - reason: 'Only the contract owner may perform this action', - }); - }); - - it("Refund fee can't be set too high", async () => { - const newFee = toUnit(1.01); - await assert.revert( - manager.setRefundFee(newFee, { from: managerOwner }), - 'Refund fee must be no greater than 100%.' - ); - }); - - it('Set oracle maturity window', async () => { - const tx = await manager.setMaxOraclePriceAge(100, { from: managerOwner }); - assert.bnEqual((await manager.durations()).maxOraclePriceAge, toBN(100)); - const log = tx.logs[0]; - assert.equal(log.event, 'MaxOraclePriceAgeUpdated'); - assert.bnEqual(log.args.duration, toBN(100)); - }); - - it('Only the owner can set the oracle maturity window', async () => { - await onlyGivenAddressCanInvoke({ - fnc: manager.setMaxOraclePriceAge, - args: [100], - accounts, - address: managerOwner, - reason: 'Only the contract owner may perform this action', - }); - }); - - it('Set expiry duration', async () => { - const tx = await manager.setExpiryDuration(100, { from: managerOwner }); - assert.bnEqual((await manager.durations()).expiryDuration, toBN(100)); - assert.eventEqual(tx.logs[0], 'ExpiryDurationUpdated', { duration: toBN(100) }); - }); - - it('Only the owner can set the expiry duration', async () => { - await onlyGivenAddressCanInvoke({ - fnc: manager.setExpiryDuration, - args: [toBN(100)], - accounts, - address: managerOwner, - reason: 'Only the contract owner may perform this action', - }); - }); - - it('Set max time to maturity', async () => { - const tx = await manager.setMaxTimeToMaturity(100, { from: managerOwner }); - assert.bnEqual((await manager.durations()).maxTimeToMaturity, toBN(100)); - const log = tx.logs[0]; - assert.equal(log.event, 'MaxTimeToMaturityUpdated'); - assert.bnEqual(log.args.duration, toBN(100)); - }); - - it('Only the owner can set the max time to maturity', async () => { - await onlyGivenAddressCanInvoke({ - fnc: manager.setMaxTimeToMaturity, - args: [100], - accounts, - address: managerOwner, - reason: 'Only the contract owner may perform this action', - }); - }); - }); - - describe('BinaryOptionMarketFactory', () => { - it('createMarket cannot be invoked except by the manager.', async () => { - const now = await currentTime(); - await onlyGivenAddressCanInvoke({ - fnc: factory.createMarket, - args: [ - initialCreator, - [capitalRequirement, skewLimit], - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200, now + expiryDuration + 200], - [toUnit(2), toUnit(2)], - [initialPoolFee, initialCreatorFee, initialRefundFee], - ], - accounts, - skipPassCheck: true, - reason: 'Only permitted by the manager.', - }); - }); - - it('Only expected functions are mutative.', async () => { - await ensureOnlyExpectedMutativeFunctions({ - abi: factory.abi, - ignoreParents: ['Owned', 'MixinResolver'], - expected: ['createMarket'], - }); - }); - }); - - describe('Market creation', () => { - it('Can create a market', async () => { - const now = await currentTime(); - - const result = await manager.createMarket( - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - { from: initialCreator } - ); - - assert.eventEqual(getEventByName({ tx: result, name: 'OwnerChanged' }), 'OwnerChanged', { - newOwner: manager.address, - }); - assert.eventEqual(getEventByName({ tx: result, name: 'MarketCreated' }), 'MarketCreated', { - creator: initialCreator, - oracleKey: sAUDKey, - strikePrice: toUnit(1), - biddingEndDate: toBN(now + 100), - maturityDate: toBN(now + 200), - expiryDate: toBN(now + 200).add(expiryDuration), - }); - - const decodedLogs = BinaryOptionMarket.decodeLogs(result.receipt.rawLogs); - assert.eventEqual(decodedLogs[1], 'Bid', { - side: Side.Long, - account: initialCreator, - value: toUnit(2), - }); - assert.eventEqual(decodedLogs[2], 'Bid', { - side: Side.Short, - account: initialCreator, - value: toUnit(3), - }); - - const prices = computePrices( - toUnit(2), - toUnit(3), - toUnit(5), - initialPoolFee.add(initialCreatorFee) - ); - assert.eventEqual(decodedLogs[3], 'PricesUpdated', { - longPrice: prices.long, - shortPrice: prices.short, - }); - - const market = await BinaryOptionMarket.at( - getEventByName({ tx: result, name: 'MarketCreated' }).args.market - ); - - const times = await market.times(); - assert.bnEqual(times.biddingEnd, toBN(now + 100)); - assert.bnEqual(times.maturity, toBN(now + 200)); - assert.bnEqual(times.expiry, toBN(now + 200).add(expiryDuration)); - const oracleDetails = await market.oracleDetails(); - assert.equal(oracleDetails.key, sAUDKey); - assert.bnEqual(oracleDetails.strikePrice, toUnit(1)); - assert.bnEqual(oracleDetails.finalPrice, toBN(0)); - assert.equal(await market.creator(), initialCreator); - assert.equal(await market.owner(), manager.address); - assert.equal(await market.resolver(), addressResolver.address); - - const bids = await market.totalBids(); - assert.bnEqual(bids[0], toUnit(2)); - assert.bnEqual(bids[1], toUnit(3)); - assert.bnEqual(await market.deposited(), toUnit(5)); - assert.bnEqual(await manager.totalDeposited(), toUnit(5)); - - const fees = await market.fees(); - assert.bnEqual(fees.poolFee, initialPoolFee); - assert.bnEqual(fees.creatorFee, initialCreatorFee); - assert.bnEqual(fees.refundFee, initialRefundFee); - - assert.bnEqual(await manager.numActiveMarkets(), toBN(1)); - assert.equal((await manager.activeMarkets(0, 100))[0], market.address); - assert.bnEqual(await manager.numMaturedMarkets(), toBN(0)); - assert.equal((await manager.maturedMarkets(0, 100)).length, 0); - }); - - it('Cannot create markets for invalid keys.', async () => { - const now = await currentTime(); - - const sUSDKey = toBytes32('sUSD'); - const nonRate = toBytes32('nonExistent'); - - await assert.revert( - manager.createMarket( - sUSDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - { - from: initialCreator, - } - ), - 'Invalid key' - ); - - await exchangeRates.setInversePricing( - iAUDKey, - toUnit(150), - toUnit(200), - toUnit(110), - false, - false, - { from: await exchangeRates.owner() } - ); - await exchangeRates.updateRates([iAUDKey], [toUnit(151)], await currentTime(), { - from: oracle, - }); - - await assert.revert( - manager.createMarket( - iAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - { - from: initialCreator, - } - ), - 'Invalid key' - ); - - await assert.revert( - manager.createMarket( - nonRate, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - { - from: initialCreator, - } - ), - 'Invalid key' - ); - }); - - it('Cannot create a market without sufficient capital to cover the initial bids.', async () => { - const now = await currentTime(); - await assert.revert( - manager.createMarket( - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - { - from: dummy, - } - ), - 'SafeMath: subtraction overflow' - ); - - await sUSDSynth.issue(dummy, sUSDQty); - - await assert.revert( - manager.createMarket( - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - { - from: dummy, - } - ), - 'SafeMath: subtraction overflow' - ); - - await sUSDSynth.approve(manager.address, sUSDQty, { from: dummy }); - - await manager.createMarket( - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - { - from: dummy, - } - ); - }); - - it('Cannot create a market providing insufficient initial bids', async () => { - const now = await currentTime(); - await assert.revert( - manager.createMarket( - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(0.1), toUnit(0.1)], - { - from: initialCreator, - } - ), - 'Insufficient capital' - ); - }); - - it('Cannot create a market too far into the future', async () => { - const now = await currentTime(); - await assert.revert( - manager.createMarket( - sAUDKey, - toUnit(1), - true, - [now + 100, now + maxTimeToMaturity + 200], - [toUnit(0.1), toUnit(0.1)], - { - from: initialCreator, - } - ), - 'Maturity too far in the future' - ); - }); - - it('Cannot create a market if either initial bid is zero', async () => { - const now = await currentTime(); - await assert.revert( - manager.createMarket( - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(0), toUnit(5)], - { - from: initialCreator, - } - ), - 'Bids too skewed' - ); - await assert.revert( - manager.createMarket( - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(5), toUnit(0)], - { - from: initialCreator, - } - ), - 'Bids too skewed' - ); - }); - - it('Cannot create a market if the system is suspended', async () => { - await setStatus({ - owner: accounts[1], - systemStatus, - section: 'System', - suspend: true, - }); - const now = await currentTime(); - await assert.revert( - manager.createMarket( - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(5), toUnit(5)], - { - from: initialCreator, - } - ), - 'Operation prohibited' - ); - }); - - it('Cannot create a market if the manager is paused', async () => { - await manager.setPaused(true, { from: managerOwner }); - const now = await currentTime(); - await assert.revert( - manager.createMarket( - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(5), toUnit(5)], - { - from: initialCreator, - } - ), - 'This action cannot be performed while the contract is paused' - ); - }); - - it('Market creation can be enabled and disabled.', async () => { - let tx = await manager.setMarketCreationEnabled(false, { from: managerOwner }); - assert.eventEqual(tx.logs[0], 'MarketCreationEnabledUpdated', { - enabled: false, - }); - assert.isFalse(await manager.marketCreationEnabled()); - - tx = await manager.setMarketCreationEnabled(true, { from: managerOwner }); - assert.eventEqual(tx.logs[0], 'MarketCreationEnabledUpdated', { - enabled: true, - }); - - assert.isTrue(await manager.marketCreationEnabled()); - - tx = await manager.setMarketCreationEnabled(true, { from: managerOwner }); - assert.equal(tx.logs.length, 0); - }); - - it('Cannot create a market if market creation is disabled.', async () => { - await manager.setMarketCreationEnabled(false, { from: managerOwner }); - const now = await currentTime(); - await assert.revert( - manager.createMarket( - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(5), toUnit(5)], - { - from: initialCreator, - } - ), - 'Market creation is disabled' - ); - - await manager.setMarketCreationEnabled(true, { from: managerOwner }); - const tx = await manager.createMarket( - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(5), toUnit(5)], - { - from: initialCreator, - } - ); - const localMarket = await BinaryOptionMarket.at( - getEventByName({ tx, name: 'MarketCreated' }).args.market - ); - - assert.bnEqual((await localMarket.oracleDetails()).strikePrice, toUnit(1)); - }); - - it('Cannot create a market if bidding is in the past.', async () => { - const now = await currentTime(); - await assert.revert( - manager.createMarket( - sAUDKey, - toUnit(1), - true, - [now - 1, now + 100], - [toUnit(2), toUnit(3)], - { - from: initialCreator, - } - ), - 'End of bidding has passed' - ); - }); - - it('Cannot create a market if maturity is before end of bidding.', async () => { - const now = await currentTime(); - await assert.revert( - manager.createMarket( - sAUDKey, - toUnit(1), - true, - [now + 100, now + 99], - [toUnit(2), toUnit(3)], - { - from: initialCreator, - } - ), - 'Maturity predates end of bidding' - ); - }); - }); - - describe('Market expiry', () => { - it('Can expire markets', async () => { - const now = await currentTime(); - const [newMarket, newerMarket] = await Promise.all([ - createMarket( - manager, - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - initialCreator - ), - createMarket( - manager, - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(1), toUnit(1)], - initialCreator - ), - ]); - - const newAddress = newMarket.address; - const newerAddress = newerMarket.address; - - assert.bnEqual(await manager.totalDeposited(), toUnit(7)); - await fastForward(expiryDuration + 1000); - await exchangeRates.updateRates([sAUDKey], [toUnit(5)], await currentTime(), { - from: oracle, - }); - await manager.resolveMarket(newAddress); - await manager.resolveMarket(newerAddress); - const tx = await manager.expireMarkets([newAddress, newerAddress], { from: initialCreator }); - - assert.eventEqual(tx.logs[0], 'MarketExpired', { market: newAddress }); - assert.eventEqual(tx.logs[1], 'MarketExpired', { market: newerAddress }); - assert.equal(await web3.eth.getCode(newAddress), '0x'); - assert.equal(await web3.eth.getCode(newerAddress), '0x'); - assert.bnEqual(await manager.totalDeposited(), toUnit(0)); - }); - - it('Cannot expire a market that does not exist', async () => { - await assert.revert(manager.expireMarkets([initialCreator], { from: initialCreator })); - }); - - it('Cannot expire an unresolved market.', async () => { - const now = await currentTime(); - const newMarket = await createMarket( - manager, - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - initialCreator - ); - await assert.revert( - manager.expireMarkets([newMarket.address], { from: initialCreator }), - 'Unexpired options remaining' - ); - }); - - it('Cannot expire an unexpired market.', async () => { - const now = await currentTime(); - const newMarket = await createMarket( - manager, - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - initialCreator - ); - - await fastForward(300); - await exchangeRates.updateRates([sAUDKey], [toUnit(5)], await currentTime(), { - from: oracle, - }); - await manager.resolveMarket(newMarket.address); - await assert.revert( - manager.expireMarkets([newMarket.address], { from: initialCreator }), - 'Unexpired options remaining' - ); - }); - - it('Cannot expire a market if the system is suspended.', async () => { - const now = await currentTime(); - const newMarket = await createMarket( - manager, - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - initialCreator - ); - await fastForward(expiryDuration + 1000); - await exchangeRates.updateRates([sAUDKey], [toUnit(5)], await currentTime(), { - from: oracle, - }); - await manager.resolveMarket(newMarket.address); - - await setStatus({ - owner: accounts[1], - systemStatus, - section: 'System', - suspend: true, - }); - - await assert.revert( - manager.expireMarkets([newMarket.address], { from: bidder }), - 'Operation prohibited' - ); - }); - - it('Cannot expire a market if the manager is paused.', async () => { - const now = await currentTime(); - const newMarket = await createMarket( - manager, - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - initialCreator - ); - await fastForward(expiryDuration + 1000); - await exchangeRates.updateRates([sAUDKey], [toUnit(5)], await currentTime(), { - from: oracle, - }); - await manager.resolveMarket(newMarket.address); - - await manager.setPaused(true, { from: managerOwner }); - await assert.revert( - manager.expireMarkets([newMarket.address], { from: bidder }), - 'This action cannot be performed while the contract is paused' - ); - }); - }); - - describe('Market cancellation', () => { - it('Market expiring a market removes it from the markets list', async () => { - const now = await currentTime(); - const market = await createMarket( - manager, - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - initialCreator - ); - - assert.equal((await manager.activeMarkets(0, 100))[0], market.address); - await manager.cancelMarket(market.address); - - assert.equal((await manager.activeMarkets(0, 100)).length, 0); - assert.equal((await manager.maturedMarkets(0, 100)).length, 0); - }); - }); - - describe('Market tracking', () => { - it('Multiple markets can exist simultaneously, and debt is tracked properly across them.', async () => { - const now = await currentTime(); - const markets = await Promise.all( - [toUnit(1), toUnit(2), toUnit(3)].map(price => - createMarket( - manager, - sAUDKey, - price, - true, - [now + 100, now + 200], - [toUnit(1), toUnit(1)], - initialCreator - ) - ) - ); - await Promise.all( - markets.map(market => sUSDSynth.approve(market.address, sUSDQty, { from: bidder })) - ); - - assert.bnEqual(await manager.totalDeposited(), toUnit(6)); - await markets[0].bid(Side.Long, toUnit(2), { from: bidder }); - assert.bnEqual(await manager.totalDeposited(), toUnit(8)); - await markets[1].bid(Side.Short, toUnit(2), { from: bidder }); - assert.bnEqual(await manager.totalDeposited(), toUnit(10)); - await markets[2].bid(Side.Short, toUnit(2), { from: bidder }); - assert.bnEqual(await manager.totalDeposited(), toUnit(12)); - - await fastForward(expiryDuration + 1000); - await exchangeRates.updateRates([sAUDKey], [toUnit(2)], await currentTime(), { - from: oracle, - }); - await Promise.all(markets.map(m => manager.resolveMarket(m.address))); - - assert.bnEqual(await markets[0].result(), toBN(0)); - assert.bnEqual(await markets[1].result(), toBN(0)); - assert.bnEqual(await markets[2].result(), toBN(1)); - - const feesRemitted = multiplyDecimalRound(initialPoolFee.add(initialCreatorFee), toUnit(4)); - - await manager.expireMarkets([markets[0].address], { from: initialCreator }); - assert.bnEqual(await manager.totalDeposited(), toUnit(8).sub(feesRemitted.mul(toBN(2)))); - await manager.expireMarkets([markets[1].address], { from: initialCreator }); - assert.bnEqual(await manager.totalDeposited(), toUnit(4).sub(feesRemitted)); - await manager.expireMarkets([markets[2].address], { from: initialCreator }); - assert.bnEqual(await manager.totalDeposited(), toUnit(0)); - }); - - it('Market resolution fails for unknown markets', async () => { - await assert.revert(manager.resolveMarket(initialCreator), 'Not an active market'); - }); - - it('Adding, resolving, and expiring markets properly updates market lists', async () => { - const numMarkets = 8; - assert.bnEqual(await manager.numActiveMarkets(), toBN(0)); - assert.equal((await manager.activeMarkets(0, 100)).length, 0); - const now = await currentTime(); - const markets = await Promise.all( - new Array(numMarkets) - .fill(0) - .map(() => - createMarket( - manager, - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(1), toUnit(1)], - initialCreator - ) - ) - ); - assert.bnEqual(await manager.numMaturedMarkets(), toBN(0)); - assert.equal((await manager.maturedMarkets(0, 100)).length, 0); - - const evenMarkets = markets - .filter((e, i) => i % 2 === 0) - .map(m => m.address) - .sort(); - const oddMarkets = markets - .filter((e, i) => i % 2 !== 0) - .map(m => m.address) - .sort(); - - const createdMarkets = markets.map(m => m.address).sort(); - - let recordedMarkets = await manager.activeMarkets(0, 100); - let recordedMarketsSorted = [...recordedMarkets].sort(); - assert.bnEqual(await manager.numActiveMarkets(), toBN(numMarkets)); - assert.equal(createdMarkets.length, recordedMarketsSorted.length); - createdMarkets.forEach((p, i) => assert.equal(p, recordedMarketsSorted[i])); - - // Resolve all the even markets, ensuring they have been transferred. - await fastForward(expiryDuration + 1000); - await exchangeRates.updateRates([sAUDKey], [toUnit(2)], await currentTime(), { - from: oracle, - }); - await Promise.all(evenMarkets.map(m => manager.resolveMarket(m))); - - assert.bnEqual(await manager.numActiveMarkets(), toBN(4)); - recordedMarkets = await manager.activeMarkets(0, 100); - recordedMarketsSorted = [...recordedMarkets].sort(); - assert.equal(oddMarkets.length, recordedMarketsSorted.length); - oddMarkets.forEach((p, i) => assert.equal(p, recordedMarketsSorted[i])); - - assert.bnEqual(await manager.numMaturedMarkets(), toBN(4)); - recordedMarkets = await manager.maturedMarkets(0, 100); - recordedMarketsSorted = [...recordedMarkets].sort(); - assert.equal(evenMarkets.length, recordedMarkets.length); - evenMarkets.forEach((p, i) => assert.equal(p, recordedMarkets[i])); - - // Destroy those markets - await manager.expireMarkets(evenMarkets); - - // Mature the rest of the markets - await Promise.all(oddMarkets.map(m => manager.resolveMarket(m))); - let remainingMarkets = await manager.maturedMarkets(0, 100); - let remainingMarketsSorted = [...remainingMarkets].sort(); - assert.bnEqual(await manager.numMaturedMarkets(), toBN(numMarkets / 2)); - oddMarkets.forEach((p, i) => assert.equal(p, remainingMarketsSorted[i])); - - // Can remove the last market - const lastMarket = (await manager.maturedMarkets(numMarkets / 2 - 1, 1))[0]; - assert.isTrue(remainingMarkets.includes(lastMarket)); - await manager.expireMarkets([lastMarket], { from: initialCreator }); - remainingMarkets = await manager.maturedMarkets(0, 100); - remainingMarketsSorted = [...remainingMarkets].sort(); - assert.bnEqual(await manager.numMaturedMarkets(), toBN(numMarkets / 2 - 1)); - assert.isFalse(remainingMarketsSorted.includes(lastMarket)); - - // Destroy the remaining markets. - await manager.expireMarkets(remainingMarketsSorted); - assert.bnEqual(await manager.numActiveMarkets(), toBN(0)); - assert.equal((await manager.activeMarkets(0, 100)).length, 0); - assert.bnEqual(await manager.numMaturedMarkets(), toBN(0)); - assert.equal((await manager.maturedMarkets(0, 100)).length, 0); - }); - - it('Pagination works properly', async () => { - const numMarkets = 8; - const now = await currentTime(); - const markets = []; - const windowSize = 3; - let ms; - - // Empty list - for (let i = 0; i < numMarkets; i++) { - ms = await manager.activeMarkets(i, 2); - assert.equal(ms.length, 0); - } - - for (let i = 1; i <= numMarkets; i++) { - markets.push( - await createMarket( - manager, - sAUDKey, - toUnit(i), - true, - [now + 100, now + 200], - [toUnit(1), toUnit(1)], - initialCreator - ) - ); - } - - // Single elements - for (let i = 0; i < numMarkets; i++) { - ms = await manager.activeMarkets(i, 1); - assert.equal(ms.length, 1); - const m = await BinaryOptionMarket.at(ms[0]); - assert.bnEqual((await m.oracleDetails()).strikePrice, toUnit(i + 1)); - } - - // shifting window - for (let i = 0; i < numMarkets - windowSize; i++) { - ms = await manager.activeMarkets(i, windowSize); - assert.equal(ms.length, windowSize); - - for (let j = 0; j < windowSize; j++) { - const m = await BinaryOptionMarket.at(ms[j]); - assert.bnEqual((await m.oracleDetails()).strikePrice, toUnit(i + j + 1)); - } - } - - // entire list - ms = await manager.activeMarkets(0, numMarkets); - assert.equal(ms.length, numMarkets); - for (let i = 0; i < numMarkets; i++) { - const m = await BinaryOptionMarket.at(ms[i]); - assert.bnEqual((await m.oracleDetails()).strikePrice, toUnit(i + 1)); - } - - // Page extends past end of list - ms = await manager.activeMarkets(numMarkets - windowSize, windowSize * 2); - assert.equal(ms.length, windowSize); - for (let i = numMarkets - windowSize; i < numMarkets; i++) { - const j = i - (numMarkets - windowSize); - const m = await BinaryOptionMarket.at(ms[j]); - assert.bnEqual((await m.oracleDetails()).strikePrice, toUnit(i + 1)); - } - - // zero page size - for (let i = 0; i < numMarkets; i++) { - ms = await manager.activeMarkets(i, 0); - assert.equal(ms.length, 0); - } - - // index past the end - for (let i = 0; i < 3; i++) { - ms = await manager.activeMarkets(numMarkets, i); - assert.equal(ms.length, 0); - } - - // Page size larger than entire list - ms = await manager.activeMarkets(0, numMarkets * 2); - assert.equal(ms.length, numMarkets); - for (let i = 0; i < numMarkets; i++) { - const m = await BinaryOptionMarket.at(ms[i]); - assert.bnEqual((await m.oracleDetails()).strikePrice, toUnit(i + 1)); - } - }); - }); - - describe('Deposit management', () => { - it('Only active markets can modify the total deposits.', async () => { - const now = await currentTime(); - await createMarket( - manager, - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - initialCreator - ); - - await onlyGivenAddressCanInvoke({ - fnc: manager.incrementTotalDeposited, - args: [toUnit(2)], - accounts, - reason: 'Permitted only for active markets', - }); - await onlyGivenAddressCanInvoke({ - fnc: manager.decrementTotalDeposited, - args: [toUnit(2)], - accounts, - reason: 'Permitted only for known markets', - }); - }); - - it('Creating a market affects total deposits properly.', async () => { - const now = await currentTime(); - await createMarket( - manager, - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - initialCreator - ); - assert.bnEqual(await manager.totalDeposited(), toUnit(5)); - }); - - it('Market destruction affects total debt properly.', async () => { - let now = await currentTime(); - await createMarket( - manager, - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - initialCreator - ); - - now = await currentTime(); - const newMarket = await createMarket( - manager, - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(1), toUnit(1)], - initialCreator - ); - - assert.bnEqual(await manager.totalDeposited(), toUnit(7)); - await fastForward(expiryDuration + 1000); - await exchangeRates.updateRates([sAUDKey], [toUnit(5)], await currentTime(), { - from: oracle, - }); - await manager.resolveMarket(newMarket.address); - await manager.expireMarkets([newMarket.address], { from: initialCreator }); - - assert.bnEqual(await manager.totalDeposited(), toUnit(5)); - }); - - it('Bidding affects total deposits properly.', async () => { - const now = await currentTime(); - const market = await createMarket( - manager, - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - initialCreator - ); - const initialDebt = await manager.totalDeposited(); - - await sUSDSynth.issue(bidder, sUSDQty); - await sUSDSynth.approve(market.address, sUSDQty, { from: bidder }); - - await market.bid(Side.Long, toUnit(1), { from: bidder }); - assert.bnEqual(await manager.totalDeposited(), initialDebt.add(toUnit(1))); - - await market.bid(Side.Short, toUnit(2), { from: bidder }); - assert.bnEqual(await manager.totalDeposited(), initialDebt.add(toUnit(3))); - }); - - it('Refunds affect total deposits properly.', async () => { - const now = await currentTime(); - const market = await createMarket( - manager, - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(2), toUnit(3)], - initialCreator - ); - const initialDebt = await manager.totalDeposited(); - - await sUSDSynth.issue(bidder, sUSDQty); - await sUSDSynth.approve(market.address, sUSDQty, { from: bidder }); - - await market.bid(Side.Long, toUnit(1), { from: bidder }); - await market.bid(Side.Short, toUnit(2), { from: bidder }); - assert.bnEqual(await manager.totalDeposited(), initialDebt.add(toUnit(3))); - - await market.refund(Side.Long, toUnit(0.5), { from: bidder }); - await market.refund(Side.Short, toUnit(1), { from: bidder }); - const refundFeeRetained = multiplyDecimalRound(toUnit(1.5), initialRefundFee); - assert.bnEqual( - await manager.totalDeposited(), - initialDebt.add(toUnit(1.5)).add(refundFeeRetained) - ); - }); - }); - - describe('Market migration', () => { - let markets, newManager, now; - - before(async () => { - now = await currentTime(); - markets = []; - - for (const p of [1, 2, 3]) { - markets.push( - await createMarket( - manager, - sAUDKey, - toUnit(p), - true, - [now + 100, now + 200], - [toUnit(1), toUnit(1)], - initialCreator - ) - ); - } - - newManager = await setupContract({ - accounts, - contract: 'BinaryOptionMarketManager', - args: [ - managerOwner, - addressResolver.address, - 10000, - 10000, - maxTimeToMaturity, - toUnit(10), - toUnit(0.05), - toUnit(0.008), - toUnit(0.002), - toUnit(0.02), - ], - }); - await addressResolver.importAddresses( - [toBytes32('BinaryOptionMarketManager')], - [newManager.address], - { - from: accounts[1], - } - ); - await Promise.all([newManager.rebuildCache(), factory.rebuildCache()]); - - await Promise.all( - markets.map(m => sUSDSynth.approve(m.address, toUnit(1000), { from: bidder })) - ); - await sUSDSynth.approve(newManager.address, toUnit(1000), { from: bidder }); - - await newManager.setMigratingManager(manager.address, { from: managerOwner }); - }); - - it('Migrating manager can be set', async () => { - await manager.setMigratingManager(initialCreator, { from: managerOwner }); - }); - - it('Migrating manager can only be set by the manager owner', async () => { - await onlyGivenAddressCanInvoke({ - fnc: manager.setMigratingManager, - args: [initialCreator], - accounts, - address: managerOwner, - reason: 'Only the contract owner may perform this action', - }); - }); - - it('Markets can be migrated between factories.', async () => { - await manager.migrateMarkets(newManager.address, true, [markets[1].address], { - from: managerOwner, - }); - - const oldMarkets = await manager.activeMarkets(0, 100); - assert.bnEqual(await manager.numActiveMarkets(), toBN(2)); - assert.equal(oldMarkets.length, 2); - assert.equal(oldMarkets[0], markets[0].address); - assert.equal(oldMarkets[1], markets[2].address); - - const newMarkets = await newManager.activeMarkets(0, 100); - assert.bnEqual(await newManager.numActiveMarkets(), toBN(1)); - assert.equal(newMarkets.length, 1); - assert.equal(newMarkets[0], markets[1].address); - - assert.equal(await markets[0].owner(), manager.address); - assert.equal(await markets[2].owner(), manager.address); - assert.equal(await markets[1].owner(), newManager.address); - }); - - it('Markets can only be migrated by the owner.', async () => { - onlyGivenAddressCanInvoke({ - fnc: manager.migrateMarkets, - args: [newManager.address, true, [markets[1].address]], - accounts, - address: managerOwner, - skipPassCheck: true, - reason: 'Only the contract owner may perform this action', - }); - }); - - it('Markets can only be received from the migrating manager.', async () => { - onlyGivenAddressCanInvoke({ - fnc: manager.receiveMarkets, - args: [true, [markets[1].address]], - accounts, - address: managerOwner, - skipPassCheck: true, - reason: 'Only permitted for migrating manager.', - }); - }); - - it('Markets cannot be migrated between factories if the migrating manager unset', async () => { - await newManager.setMigratingManager('0x' + '0'.repeat(40), { from: managerOwner }); - await assert.revert( - manager.migrateMarkets(newManager.address, true, [markets[1].address], { - from: managerOwner, - }), - 'Only permitted for migrating manager.' - ); - }); - - it('An empty migration does nothing, as does migration from an empty manager', async () => { - const newerManager = await setupContract({ - accounts, - contract: 'BinaryOptionMarketManager', - args: [ - managerOwner, - addressResolver.address, - 10000, - 10000, - maxTimeToMaturity, - toUnit(10), - toUnit(0.05), - toUnit(0.008), - toUnit(0.002), - toUnit(0.02), - ], - }); - await manager.migrateMarkets(newManager.address, true, [], { from: managerOwner }); - assert.equal(await newManager.numActiveMarkets(), 0); - - await newerManager.setMigratingManager(newManager.address, { from: managerOwner }); - await newManager.migrateMarkets(newerManager.address, true, [], { from: managerOwner }); - assert.equal(await newerManager.numActiveMarkets(), 0); - }); - - it('Receiving an empty market list does nothing.', async () => { - await newManager.setMigratingManager(managerOwner, { from: managerOwner }); - await newManager.receiveMarkets(true, [], { from: managerOwner }); - assert.bnEqual(await newManager.numActiveMarkets(), 0); - }); - - it('Cannot receive duplicate markets.', async () => { - await manager.migrateMarkets(newManager.address, true, [markets[0].address], { - from: managerOwner, - }); - await newManager.setMigratingManager(managerOwner, { from: managerOwner }); - await assert.revert( - newManager.receiveMarkets(true, [markets[0].address], { from: managerOwner }), - 'Market already known.' - ); - }); - - it('Markets can be migrated to a manager with existing markets.', async () => { - await manager.migrateMarkets(newManager.address, true, [markets[1].address], { - from: managerOwner, - }); - - // And a new market can still be created - await sUSDSynth.approve(newManager.address, toUnit('1000')); - const now = await currentTime(); - await newManager.createMarket( - sAUDKey, - toUnit(1), - true, - [now + 100, now + 200], - [toUnit(6), toUnit(5)], - { from: initialCreator } - ); - - await manager.migrateMarkets(newManager.address, true, [markets[0].address], { - from: managerOwner, - }); - - const oldMarkets = await manager.activeMarkets(0, 100); - assert.bnEqual(await manager.numActiveMarkets(), toBN(1)); - assert.equal(oldMarkets.length, 1); - assert.equal(oldMarkets[0], markets[2].address); - - const newMarkets = await newManager.activeMarkets(0, 100); - assert.bnEqual(await newManager.numActiveMarkets(), toBN(3)); - assert.equal(newMarkets.length, 3); - assert.equal(newMarkets[0], markets[1].address); - assert.equal(newMarkets[2], markets[0].address); - }); - - it('All markets can be migrated from a manager.', async () => { - await manager.migrateMarkets( - newManager.address, - true, - markets.map(m => m.address).reverse(), - { - from: managerOwner, - } - ); - - const oldMarkets = await manager.activeMarkets(0, 100); - assert.bnEqual(await manager.numActiveMarkets(), toBN(0)); - assert.equal(oldMarkets.length, 0); - - const newMarkets = await newManager.activeMarkets(0, 100); - assert.bnEqual(await newManager.numActiveMarkets(), toBN(3)); - assert.equal(newMarkets.length, 3); - assert.equal(newMarkets[0], markets[2].address); - assert.equal(newMarkets[1], markets[1].address); - assert.equal(newMarkets[2], markets[0].address); - }); - - it('Migrating markets updates total deposits properly.', async () => { - await manager.migrateMarkets( - newManager.address, - true, - [markets[2].address, markets[1].address], - { - from: managerOwner, - } - ); - assert.bnEqual(await manager.totalDeposited(), toUnit(2)); - assert.bnEqual(await newManager.totalDeposited(), toUnit(4)); - }); - - it('Migrated markets still operate properly.', async () => { - await manager.migrateMarkets( - newManager.address, - true, - [markets[2].address, markets[1].address], - { - from: managerOwner, - } - ); - - await markets[0].bid(Side.Short, toUnit(1), { from: bidder }); - await markets[1].bid(Side.Long, toUnit(3), { from: bidder }); - assert.bnEqual(await manager.totalDeposited(), toUnit(3)); - assert.bnEqual(await newManager.totalDeposited(), toUnit(7)); - - now = await currentTime(); - await createMarket( - newManager, - sAUDKey, - toUnit(10), - true, - [now + 100, now + 200], - [toUnit(10), toUnit(10)], - bidder - ); - assert.bnEqual(await newManager.totalDeposited(), toUnit(27)); - assert.bnEqual(await newManager.numActiveMarkets(), toBN(3)); - - await fastForward(expiryDuration + 1000); - await exchangeRates.updateRates([sAUDKey], [toUnit(5)], await currentTime(), { - from: oracle, - }); - await newManager.resolveMarket(markets[2].address); - await newManager.expireMarkets([markets[2].address], { from: initialCreator }); - assert.bnEqual(await newManager.numActiveMarkets(), toBN(2)); - assert.bnEqual(await newManager.totalDeposited(), toUnit(25)); - }); - - it('Market migration works while paused/suspended.', async () => { - await setStatus({ - owner: accounts[1], - systemStatus, - section: 'System', - suspend: true, - }); - await manager.setPaused(true, { from: managerOwner }); - await newManager.setPaused(true, { from: managerOwner }); - assert.isTrue(await manager.paused()); - assert.isTrue(await newManager.paused()); - - await manager.migrateMarkets(newManager.address, true, [markets[0].address], { - from: managerOwner, - }); - - assert.bnEqual(await manager.numActiveMarkets(), toBN(2)); - assert.bnEqual(await newManager.numActiveMarkets(), toBN(1)); - }); - - it('Market migration fails if any unknown markets are included', async () => { - await assert.revert( - manager.migrateMarkets(newManager.address, true, [markets[1].address, managerOwner], { - from: managerOwner, - }), - 'Market unknown.' - ); - }); - - it('Market migration events are properly emitted.', async () => { - const tx = await manager.migrateMarkets( - newManager.address, - true, - [markets[0].address, markets[1].address], - { - from: managerOwner, - } - ); - - assert.equal(tx.logs[2].event, 'MarketsMigrated'); - assert.equal(tx.logs[2].args.receivingManager, newManager.address); - assert.equal(tx.logs[2].args.markets[0], markets[0].address); - assert.equal(tx.logs[2].args.markets[1], markets[1].address); - assert.equal(tx.logs[5].event, 'MarketsReceived'); - assert.equal(tx.logs[5].args.migratingManager, manager.address); - assert.equal(tx.logs[5].args.markets[0], markets[0].address); - assert.equal(tx.logs[5].args.markets[1], markets[1].address); - }); - - it('Can sync the caches of child markets.', async () => { - const statusMock = await setupContract({ - accounts, - contract: 'GenericMock', - mock: 'SystemStatus', - }); - - await addressResolver.importAddresses([toBytes32('SystemStatus')], [statusMock.address], { - from: accounts[1], - }); - - // Only sets the resolver for the listed addresses - await manager.rebuildMarketCaches([markets[0].address], { - from: managerOwner, - }); - - assert.ok(await markets[0].isResolverCached()); - assert.notOk(await markets[1].isResolverCached()); - assert.notOk(await markets[2].isResolverCached()); - - // Only sets the resolver for the remaining addresses - await manager.rebuildMarketCaches([markets[1].address, markets[2].address], { - from: managerOwner, - }); - - assert.ok(await markets[0].isResolverCached()); - assert.ok(await markets[1].isResolverCached()); - assert.ok(await markets[2].isResolverCached()); - }); - }); -}); diff --git a/test/contracts/setup.js b/test/contracts/setup.js index 8e3d3da479..b4699ff539 100644 --- a/test/contracts/setup.js +++ b/test/contracts/setup.js @@ -220,20 +220,6 @@ const setupContract = async ({ FeePoolEternalStorage: [owner, tryGetAddressOf('FeePool')], DelegateApprovals: [owner, tryGetAddressOf('EternalStorageDelegateApprovals')], Liquidations: [owner, tryGetAddressOf('AddressResolver')], - BinaryOptionMarketFactory: [owner, tryGetAddressOf('AddressResolver')], - BinaryOptionMarketManager: [ - owner, - tryGetAddressOf('AddressResolver'), - 61 * 60, // max oracle price age: 61 minutes - 26 * 7 * 24 * 60 * 60, // expiry duration: 26 weeks (~ 6 months) - 365 * 24 * 60 * 60, // Max time to maturity: ~ 1 year - toWei('2'), // Capital requirement - toWei('0.05'), // Skew Limit - toWei('0.008'), // pool fee - toWei('0.002'), // creator fee - toWei('0.02'), // refund fee - ], - BinaryOptionMarketData: [], CollateralManagerState: [owner, tryGetAddressOf('CollateralManager')], CollateralManager: [ tryGetAddressOf('CollateralManagerState'), @@ -799,25 +785,6 @@ const setupAllContracts = async ({ ], deps: ['SystemStatus', 'FeePoolState', 'AddressResolver'], }, - { - contract: 'BinaryOptionMarketFactory', - deps: ['AddressResolver'], - }, - { - contract: 'BinaryOptionMarketManager', - deps: [ - 'SystemStatus', - 'AddressResolver', - 'ExchangeRates', - 'FeePool', - 'Synthetix', - 'BinaryOptionMarketFactory', - ], - }, - { - contract: 'BinaryOptionMarketData', - deps: ['BinaryOptionMarketManager', 'BinaryOptionMarket', 'BinaryOption'], - }, { contract: 'CollateralState', deps: [], diff --git a/test/deployments/index.js b/test/deployments/index.js index ff40dd3dac..fdd4a77d3f 100644 --- a/test/deployments/index.js +++ b/test/deployments/index.js @@ -208,8 +208,6 @@ describe('deployments', () => { // that would omit the deps from Depot which were not // redeployed in Hadar (v2.21) [ - 'BinaryOptionMarketFactory', - 'BinaryOptionMarketManager', 'DebtCache', 'DelegateApprovals', 'Depot',