Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
Implementation
Compiler Version
v0.5.17+commit.d19bba13
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2021-01-08 */ pragma solidity ^0.5.17; pragma experimental ABIEncoderV2; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } /* Copyright 2019 dYdX Trading Inc. Copyright 2020 Zero Collateral Devs, standing on the shoulders of the Empty Set Squad <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /** * @title Decimal * @author dYdX * * Library that defines a fixed-point number with 18 decimal places. */ library Decimal { using SafeMath for uint256; // ============ Constants ============ uint256 constant BASE = 10**18; // ============ Structs ============ struct D256 { uint256 value; } // ============ Static Functions ============ function zero() internal pure returns (D256 memory) { return D256({value: 0}); } function one() internal pure returns (D256 memory) { return D256({value: BASE}); } function from(uint256 a) internal pure returns (D256 memory) { return D256({value: a.mul(BASE)}); } function ratio(uint256 a, uint256 b) internal pure returns (D256 memory) { return D256({value: getPartial(a, BASE, b)}); } // ============ Self Functions ============ function add(D256 memory self, uint256 b) internal pure returns (D256 memory) { return D256({value: self.value.add(b.mul(BASE))}); } function sub(D256 memory self, uint256 b) internal pure returns (D256 memory) { return D256({value: self.value.sub(b.mul(BASE))}); } function sub( D256 memory self, uint256 b, string memory reason ) internal pure returns (D256 memory) { return D256({value: self.value.sub(b.mul(BASE), reason)}); } function mul(D256 memory self, uint256 b) internal pure returns (D256 memory) { return D256({value: self.value.mul(b)}); } function div(D256 memory self, uint256 b) internal pure returns (D256 memory) { return D256({value: self.value.div(b)}); } function pow(D256 memory self, uint256 b) internal pure returns (D256 memory) { if (b == 0) { return from(1); } D256 memory temp = D256({value: self.value}); for (uint256 i = 1; i < b; i++) { temp = mul(temp, self); } return temp; } function add(D256 memory self, D256 memory b) internal pure returns (D256 memory) { return D256({value: self.value.add(b.value)}); } function sub(D256 memory self, D256 memory b) internal pure returns (D256 memory) { return D256({value: self.value.sub(b.value)}); } function sub( D256 memory self, D256 memory b, string memory reason ) internal pure returns (D256 memory) { return D256({value: self.value.sub(b.value, reason)}); } function mul(D256 memory self, D256 memory b) internal pure returns (D256 memory) { return D256({value: getPartial(self.value, b.value, BASE)}); } function div(D256 memory self, D256 memory b) internal pure returns (D256 memory) { return D256({value: getPartial(self.value, BASE, b.value)}); } function equals(D256 memory self, D256 memory b) internal pure returns (bool) { return self.value == b.value; } function greaterThan(D256 memory self, D256 memory b) internal pure returns (bool) { return compareTo(self, b) == 2; } function lessThan(D256 memory self, D256 memory b) internal pure returns (bool) { return compareTo(self, b) == 0; } function greaterThanOrEqualTo(D256 memory self, D256 memory b) internal pure returns (bool) { return compareTo(self, b) > 0; } function lessThanOrEqualTo(D256 memory self, D256 memory b) internal pure returns (bool) { return compareTo(self, b) < 2; } function isZero(D256 memory self) internal pure returns (bool) { return self.value == 0; } function asUint256(D256 memory self) internal pure returns (uint256) { return self.value.div(BASE); } // ============ Core Methods ============ function getPartial( uint256 target, uint256 numerator, uint256 denominator ) private pure returns (uint256) { return target.mul(numerator).div(denominator); } function compareTo(D256 memory a, D256 memory b) private pure returns (uint256) { if (a.value == b.value) { return 1; } return a.value > b.value ? 2 : 0; } } /* Copyright 2020 Zero Collateral Devs, standing on the shoulders of the Empty Set Squad <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ library Constants { /* Chain */ uint256 private constant CHAIN_ID = 1; // Mainnet /* Bootstrapping */ uint256 private constant BOOTSTRAPPING_PERIOD = 672; // 14 cycles uint256 private constant BOOTSTRAPPING_PRICE = 11e17; // 1.10 DAI /* Oracle */ address private constant USDC = address(0x6B175474E89094C44Da98b954EedeAC495271d0F); // Anywhere the term USDC is refernenced, consider that as "peg", really uint256 private constant ORACLE_RESERVE_MINIMUM = 1e22; // 10,000 DAI /* Bonding */ uint256 private constant INITIAL_STAKE_MULTIPLE = 1e6; // 100 ZAI -> 100M ZAIS /* Epoch */ struct EpochStrategy { uint256 offset; uint256 start; uint256 period; } uint256 private constant CURRENT_EPOCH_OFFSET = 0; uint256 private constant CURRENT_EPOCH_START = 1608422400; uint256 private constant CURRENT_EPOCH_PERIOD = 1800; /* Governance */ uint256 private constant GOVERNANCE_PERIOD = 144; // 3 cycles uint256 private constant GOVERNANCE_EXPIRATION = 48; uint256 private constant GOVERNANCE_QUORUM = 20e16; // 20% uint256 private constant GOVERNANCE_PROPOSAL_THRESHOLD = 5e15; // 0.5% uint256 private constant GOVERNANCE_SUPER_MAJORITY = 66e16; // 66% uint256 private constant GOVERNANCE_EMERGENCY_DELAY = 96; // 2 cycles /* DAO */ uint256 private constant ADVANCE_INCENTIVE = 1e20; // 100 ZAI uint256 private constant DAO_EXIT_LOCKUP_EPOCHS = 240; // 5 cycles fluid /* Pool */ uint256 private constant POOL_EXIT_LOCKUP_EPOCHS = 144; // 3 cycles fluid /* Market */ uint256 private constant COUPON_EXPIRATION = 17520; // 365 cycles uint256 private constant DEBT_RATIO_CAP = 20e16; // 20% /* Regulator */ uint256 private constant SUPPLY_CHANGE_LIMIT = 1e16; // 1% uint256 private constant COUPON_SUPPLY_CHANGE_LIMIT = 2e16; // 2% uint256 private constant ORACLE_POOL_RATIO = 50; // 50% uint256 private constant TREASURY_RATIO = 0; // 0% /* Deployed */ address private constant TREASURY_ADDRESS = address(0x0000000000000000000000000000000000000000); /** * Getters */ function getUsdcAddress() internal pure returns (address) { return USDC; } function getOracleReserveMinimum() internal pure returns (uint256) { return ORACLE_RESERVE_MINIMUM; } function getCurrentEpochStrategy() internal pure returns (EpochStrategy memory) { return EpochStrategy({ offset: CURRENT_EPOCH_OFFSET, start: CURRENT_EPOCH_START, period: CURRENT_EPOCH_PERIOD }); } function getInitialStakeMultiple() internal pure returns (uint256) { return INITIAL_STAKE_MULTIPLE; } function getBootstrappingPeriod() internal pure returns (uint256) { return BOOTSTRAPPING_PERIOD; } function getBootstrappingPrice() internal pure returns (Decimal.D256 memory) { return Decimal.D256({value: BOOTSTRAPPING_PRICE}); } function getGovernancePeriod() internal pure returns (uint256) { return GOVERNANCE_PERIOD; } function getGovernanceExpiration() internal pure returns (uint256) { return GOVERNANCE_EXPIRATION; } function getGovernanceQuorum() internal pure returns (Decimal.D256 memory) { return Decimal.D256({value: GOVERNANCE_QUORUM}); } function getGovernanceProposalThreshold() internal pure returns (Decimal.D256 memory) { return Decimal.D256({value: GOVERNANCE_PROPOSAL_THRESHOLD}); } function getGovernanceSuperMajority() internal pure returns (Decimal.D256 memory) { return Decimal.D256({value: GOVERNANCE_SUPER_MAJORITY}); } function getGovernanceEmergencyDelay() internal pure returns (uint256) { return GOVERNANCE_EMERGENCY_DELAY; } function getAdvanceIncentive() internal pure returns (uint256) { return ADVANCE_INCENTIVE; } function getDAOExitLockupEpochs() internal pure returns (uint256) { return DAO_EXIT_LOCKUP_EPOCHS; } function getPoolExitLockupEpochs() internal pure returns (uint256) { return POOL_EXIT_LOCKUP_EPOCHS; } function getCouponExpiration() internal pure returns (uint256) { return COUPON_EXPIRATION; } function getDebtRatioCap() internal pure returns (Decimal.D256 memory) { return Decimal.D256({value: DEBT_RATIO_CAP}); } function getSupplyChangeLimit() internal pure returns (Decimal.D256 memory) { return Decimal.D256({value: SUPPLY_CHANGE_LIMIT}); } function getCouponSupplyChangeLimit() internal pure returns (Decimal.D256 memory) { return Decimal.D256({value: COUPON_SUPPLY_CHANGE_LIMIT}); } function getOraclePoolRatio() internal pure returns (uint256) { return ORACLE_POOL_RATIO; } function getTreasuryRatio() internal pure returns (uint256) { return TREASURY_RATIO; } function getChainId() internal pure returns (uint256) { return CHAIN_ID; } function getTreasuryAddress() internal pure returns (address) { return TREASURY_ADDRESS; } } /* Copyright 2020 Zero Collateral Devs, standing on the shoulders of the Empty Set Squad <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ contract Curve { using SafeMath for uint256; using Decimal for Decimal.D256; function calculateCouponPremium( uint256 totalSupply, uint256 totalDebt, uint256 amount ) internal pure returns (uint256) { return effectivePremium(totalSupply, totalDebt, amount) .mul(amount) .asUint256(); } function effectivePremium( uint256 totalSupply, uint256 totalDebt, uint256 amount ) private pure returns (Decimal.D256 memory) { Decimal.D256 memory debtRatio = Decimal.ratio(totalDebt, totalSupply); Decimal.D256 memory debtRatioUpperBound = Constants.getDebtRatioCap(); uint256 totalSupplyEnd = totalSupply.sub(amount); uint256 totalDebtEnd = totalDebt.sub(amount); Decimal.D256 memory debtRatioEnd = Decimal.ratio( totalDebtEnd, totalSupplyEnd ); if (debtRatio.greaterThan(debtRatioUpperBound)) { if (debtRatioEnd.greaterThan(debtRatioUpperBound)) { return curve(debtRatioUpperBound); } Decimal.D256 memory premiumCurve = curveMean( debtRatioEnd, debtRatioUpperBound ); Decimal.D256 memory premiumCurveDelta = debtRatioUpperBound.sub( debtRatioEnd ); Decimal.D256 memory premiumFlat = curve(debtRatioUpperBound); Decimal.D256 memory premiumFlatDelta = debtRatio.sub( debtRatioUpperBound ); return (premiumCurve.mul(premiumCurveDelta)) .add(premiumFlat.mul(premiumFlatDelta)) .div(premiumCurveDelta.add(premiumFlatDelta)); } return curveMean(debtRatioEnd, debtRatio); } // 1/(3(1-R)^2)-1/3 function curve(Decimal.D256 memory debtRatio) private pure returns (Decimal.D256 memory) { return Decimal .one() .div(Decimal.from(3).mul((Decimal.one().sub(debtRatio)).pow(2))) .sub(Decimal.ratio(1, 3)); } // 1/(3(1-R)(1-R'))-1/3 function curveMean(Decimal.D256 memory lower, Decimal.D256 memory upper) private pure returns (Decimal.D256 memory) { if (lower.equals(upper)) { return curve(lower); } return Decimal .one() .div( Decimal.from(3).mul(Decimal.one().sub(upper)).mul( Decimal.one().sub(lower) ) ) .sub(Decimal.ratio(1, 3)); } } interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } /** * @dev Interface of the ERC20 standard as defined in the EIP. Does not include * the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /* Copyright 2020 Zero Collateral Devs, standing on the shoulders of the Empty Set Squad <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ contract IDollar is IERC20 { function burn(uint256 amount) public; function burnFrom(address account, uint256 amount) public; function mint(address account, uint256 amount) public returns (bool); } /* Copyright 2020 Zero Collateral Devs, standing on the shoulders of the Empty Set Squad <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ contract IOracle { function setup() public; function capture() public returns (Decimal.D256 memory, bool); function pair() external view returns (address); } /* Copyright 2020 Zero Collateral Devs, standing on the shoulders of the Empty Set Squad <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ contract Account { enum Status {Frozen, Fluid, Locked} struct State { uint256 staged; uint256 balance; mapping(uint256 => uint256) coupons; mapping(address => uint256) couponAllowances; uint256 fluidUntil; uint256 lockedUntil; } } contract Epoch { struct Global { uint256 start; uint256 period; uint256 current; } struct Coupons { uint256 outstanding; uint256 expiration; uint256[] expiring; } struct State { uint256 bonded; Coupons coupons; } } contract Candidate { enum Vote {UNDECIDED, APPROVE, REJECT} struct State { uint256 start; uint256 period; uint256 approve; uint256 reject; mapping(address => Vote) votes; bool initialized; } } contract Storage { struct Provider { IDollar dollar; IOracle oracle; address pool; } struct Balance { uint256 supply; uint256 bonded; uint256 staged; uint256 redeemable; uint256 debt; uint256 coupons; } struct State { Epoch.Global epoch; Balance balance; Provider provider; mapping(address => Account.State) accounts; mapping(uint256 => Epoch.State) epochs; mapping(address => Candidate.State) candidates; } } contract State { Storage.State _state; } /* Copyright 2020 Zero Collateral Devs, standing on the shoulders of the Empty Set Squad <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ contract Getters is State { using SafeMath for uint256; using Decimal for Decimal.D256; bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * ERC20 Interface */ function name() public view returns (string memory) { return "Zero Collateral Dai Stake"; } function symbol() public view returns (string memory) { return "ZAIS"; } function decimals() public view returns (uint8) { return 18; } function balanceOf(address account) public view returns (uint256) { return _state.accounts[account].balance; } function totalSupply() public view returns (uint256) { return _state.balance.supply; } function allowance(address owner, address spender) external view returns (uint256) { return 0; } /** * Global */ function dollar() public view returns (IDollar) { return _state.provider.dollar; } function oracle() public view returns (IOracle) { return _state.provider.oracle; } function pool() public view returns (address) { return _state.provider.pool; } function totalBonded() public view returns (uint256) { return _state.balance.bonded; } function totalStaged() public view returns (uint256) { return _state.balance.staged; } function totalDebt() public view returns (uint256) { return _state.balance.debt; } function totalRedeemable() public view returns (uint256) { return _state.balance.redeemable; } function totalCoupons() public view returns (uint256) { return _state.balance.coupons; } function totalNet() public view returns (uint256) { return dollar().totalSupply().sub(totalDebt()); } /** * Account */ function balanceOfStaged(address account) public view returns (uint256) { return _state.accounts[account].staged; } function balanceOfBonded(address account) public view returns (uint256) { uint256 totalSupply = totalSupply(); if (totalSupply == 0) { return 0; } return totalBonded().mul(balanceOf(account)).div(totalSupply); } function balanceOfCoupons(address account, uint256 epoch) public view returns (uint256) { if (outstandingCoupons(epoch) == 0) { return 0; } return _state.accounts[account].coupons[epoch]; } function statusOf(address account) public view returns (Account.Status) { if (_state.accounts[account].lockedUntil > epoch()) { return Account.Status.Locked; } return epoch() >= _state.accounts[account].fluidUntil ? Account.Status.Frozen : Account.Status.Fluid; } function fluidUntil(address account) public view returns (uint256) { return _state.accounts[account].fluidUntil; } function lockedUntil(address account) public view returns (uint256) { return _state.accounts[account].lockedUntil; } function allowanceCoupons(address owner, address spender) public view returns (uint256) { return _state.accounts[owner].couponAllowances[spender]; } /** * Epoch */ function epoch() public view returns (uint256) { return _state.epoch.current; } function epochTime() public view returns (uint256) { Constants.EpochStrategy memory current = Constants .getCurrentEpochStrategy(); return epochTimeWithStrategy(current); } function epochTimeWithStrategy(Constants.EpochStrategy memory strategy) private view returns (uint256) { return blockTimestamp().sub(strategy.start).div(strategy.period).add( strategy.offset ); } // Overridable for testing function blockTimestamp() internal view returns (uint256) { return block.timestamp; } function outstandingCoupons(uint256 epoch) public view returns (uint256) { return _state.epochs[epoch].coupons.outstanding; } function couponsExpiration(uint256 epoch) public view returns (uint256) { return _state.epochs[epoch].coupons.expiration; } function expiringCoupons(uint256 epoch) public view returns (uint256) { return _state.epochs[epoch].coupons.expiring.length; } function expiringCouponsAtIndex(uint256 epoch, uint256 i) public view returns (uint256) { return _state.epochs[epoch].coupons.expiring[i]; } function totalBondedAt(uint256 epoch) public view returns (uint256) { return _state.epochs[epoch].bonded; } function bootstrappingAt(uint256 epoch) public view returns (bool) { return epoch <= Constants.getBootstrappingPeriod(); } /** * Governance */ function recordedVote(address account, address candidate) public view returns (Candidate.Vote) { return _state.candidates[candidate].votes[account]; } function startFor(address candidate) public view returns (uint256) { return _state.candidates[candidate].start; } function periodFor(address candidate) public view returns (uint256) { return _state.candidates[candidate].period; } function approveFor(address candidate) public view returns (uint256) { return _state.candidates[candidate].approve; } function rejectFor(address candidate) public view returns (uint256) { return _state.candidates[candidate].reject; } function votesFor(address candidate) public view returns (uint256) { return approveFor(candidate).add(rejectFor(candidate)); } function isNominated(address candidate) public view returns (bool) { return _state.candidates[candidate].start > 0; } function isInitialized(address candidate) public view returns (bool) { return _state.candidates[candidate].initialized; } function implementation() public view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } } /* Copyright 2020 Zero Collateral Devs, standing on the shoulders of the Empty Set Squad <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ contract Setters is State, Getters { using SafeMath for uint256; event Transfer(address indexed from, address indexed to, uint256 value); /** * ERC20 Interface */ function transfer(address recipient, uint256 amount) external returns (bool) { return false; } function approve(address spender, uint256 amount) external returns (bool) { return false; } function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool) { return false; } /** * Global */ function incrementTotalBonded(uint256 amount) internal { _state.balance.bonded = _state.balance.bonded.add(amount); } function decrementTotalBonded(uint256 amount, string memory reason) internal { _state.balance.bonded = _state.balance.bonded.sub(amount, reason); } function incrementTotalDebt(uint256 amount) internal { _state.balance.debt = _state.balance.debt.add(amount); } function decrementTotalDebt(uint256 amount, string memory reason) internal { _state.balance.debt = _state.balance.debt.sub(amount, reason); } function incrementTotalRedeemable(uint256 amount) internal { _state.balance.redeemable = _state.balance.redeemable.add(amount); } function decrementTotalRedeemable(uint256 amount, string memory reason) internal { _state.balance.redeemable = _state.balance.redeemable.sub( amount, reason ); } /** * Account */ function incrementBalanceOf(address account, uint256 amount) internal { _state.accounts[account].balance = _state.accounts[account].balance.add( amount ); _state.balance.supply = _state.balance.supply.add(amount); emit Transfer(address(0), account, amount); } function decrementBalanceOf( address account, uint256 amount, string memory reason ) internal { _state.accounts[account].balance = _state.accounts[account].balance.sub( amount, reason ); _state.balance.supply = _state.balance.supply.sub(amount, reason); emit Transfer(account, address(0), amount); } function incrementBalanceOfStaged(address account, uint256 amount) internal { _state.accounts[account].staged = _state.accounts[account].staged.add( amount ); _state.balance.staged = _state.balance.staged.add(amount); } function decrementBalanceOfStaged( address account, uint256 amount, string memory reason ) internal { _state.accounts[account].staged = _state.accounts[account].staged.sub( amount, reason ); _state.balance.staged = _state.balance.staged.sub(amount, reason); } function incrementBalanceOfCoupons( address account, uint256 epoch, uint256 amount ) internal { _state.accounts[account].coupons[epoch] = _state.accounts[account] .coupons[epoch] .add(amount); _state.epochs[epoch].coupons.outstanding = _state.epochs[epoch] .coupons .outstanding .add(amount); _state.balance.coupons = _state.balance.coupons.add(amount); } function decrementBalanceOfCoupons( address account, uint256 epoch, uint256 amount, string memory reason ) internal { _state.accounts[account].coupons[epoch] = _state.accounts[account] .coupons[epoch] .sub(amount, reason); _state.epochs[epoch].coupons.outstanding = _state.epochs[epoch] .coupons .outstanding .sub(amount, reason); _state.balance.coupons = _state.balance.coupons.sub(amount, reason); } function unfreeze(address account) internal { _state.accounts[account].fluidUntil = epoch().add( Constants.getDAOExitLockupEpochs() ); } function updateAllowanceCoupons( address owner, address spender, uint256 amount ) internal { _state.accounts[owner].couponAllowances[spender] = amount; } function decrementAllowanceCoupons( address owner, address spender, uint256 amount, string memory reason ) internal { _state.accounts[owner].couponAllowances[spender] = _state .accounts[owner] .couponAllowances[spender] .sub(amount, reason); } /** * Epoch */ function incrementEpoch() internal { _state.epoch.current = _state.epoch.current.add(1); } function snapshotTotalBonded() internal { _state.epochs[epoch()].bonded = totalSupply(); } function initializeCouponsExpiration(uint256 epoch, uint256 expiration) internal { _state.epochs[epoch].coupons.expiration = expiration; _state.epochs[expiration].coupons.expiring.push(epoch); } function eliminateOutstandingCoupons(uint256 epoch) internal { uint256 outstandingCouponsForEpoch = outstandingCoupons(epoch); if (outstandingCouponsForEpoch == 0) { return; } _state.balance.coupons = _state.balance.coupons.sub( outstandingCouponsForEpoch ); _state.epochs[epoch].coupons.outstanding = 0; } /** * Governance */ function createCandidate(address candidate, uint256 period) internal { _state.candidates[candidate].start = epoch(); _state.candidates[candidate].period = period; } function recordVote( address account, address candidate, Candidate.Vote vote ) internal { _state.candidates[candidate].votes[account] = vote; } function incrementApproveFor(address candidate, uint256 amount) internal { _state.candidates[candidate].approve = _state.candidates[candidate] .approve .add(amount); } function decrementApproveFor( address candidate, uint256 amount, string memory reason ) internal { _state.candidates[candidate].approve = _state.candidates[candidate] .approve .sub(amount, reason); } function incrementRejectFor(address candidate, uint256 amount) internal { _state.candidates[candidate].reject = _state.candidates[candidate] .reject .add(amount); } function decrementRejectFor( address candidate, uint256 amount, string memory reason ) internal { _state.candidates[candidate].reject = _state.candidates[candidate] .reject .sub(amount, reason); } function placeLock(address account, address candidate) internal { uint256 currentLock = _state.accounts[account].lockedUntil; uint256 newLock = startFor(candidate).add(periodFor(candidate)); if (newLock > currentLock) { _state.accounts[account].lockedUntil = newLock; } } function initialized(address candidate) internal { _state.candidates[candidate].initialized = true; } } /* Copyright 2019 dYdX Trading Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /** * @title Require * @author dYdX * * Stringifies parameters to pretty-print revert messages. Costs more gas than regular require() */ library Require { // ============ Constants ============ uint256 constant ASCII_ZERO = 48; // '0' uint256 constant ASCII_RELATIVE_ZERO = 87; // 'a' - 10 uint256 constant ASCII_LOWER_EX = 120; // 'x' bytes2 constant COLON = 0x3a20; // ': ' bytes2 constant COMMA = 0x2c20; // ', ' bytes2 constant LPAREN = 0x203c; // ' <' byte constant RPAREN = 0x3e; // '>' uint256 constant FOUR_BIT_MASK = 0xf; // ============ Library Functions ============ function that( bool must, bytes32 file, bytes32 reason ) internal pure { if (!must) { revert( string( abi.encodePacked( stringifyTruncated(file), COLON, stringifyTruncated(reason) ) ) ); } } function that( bool must, bytes32 file, bytes32 reason, uint256 payloadA ) internal pure { if (!must) { revert( string( abi.encodePacked( stringifyTruncated(file), COLON, stringifyTruncated(reason), LPAREN, stringify(payloadA), RPAREN ) ) ); } } function that( bool must, bytes32 file, bytes32 reason, uint256 payloadA, uint256 payloadB ) internal pure { if (!must) { revert( string( abi.encodePacked( stringifyTruncated(file), COLON, stringifyTruncated(reason), LPAREN, stringify(payloadA), COMMA, stringify(payloadB), RPAREN ) ) ); } } function that( bool must, bytes32 file, bytes32 reason, address payloadA ) internal pure { if (!must) { revert( string( abi.encodePacked( stringifyTruncated(file), COLON, stringifyTruncated(reason), LPAREN, stringify(payloadA), RPAREN ) ) ); } } function that( bool must, bytes32 file, bytes32 reason, address payloadA, uint256 payloadB ) internal pure { if (!must) { revert( string( abi.encodePacked( stringifyTruncated(file), COLON, stringifyTruncated(reason), LPAREN, stringify(payloadA), COMMA, stringify(payloadB), RPAREN ) ) ); } } function that( bool must, bytes32 file, bytes32 reason, address payloadA, uint256 payloadB, uint256 payloadC ) internal pure { if (!must) { revert( string( abi.encodePacked( stringifyTruncated(file), COLON, stringifyTruncated(reason), LPAREN, stringify(payloadA), COMMA, stringify(payloadB), COMMA, stringify(payloadC), RPAREN ) ) ); } } function that( bool must, bytes32 file, bytes32 reason, bytes32 payloadA ) internal pure { if (!must) { revert( string( abi.encodePacked( stringifyTruncated(file), COLON, stringifyTruncated(reason), LPAREN, stringify(payloadA), RPAREN ) ) ); } } function that( bool must, bytes32 file, bytes32 reason, bytes32 payloadA, uint256 payloadB, uint256 payloadC ) internal pure { if (!must) { revert( string( abi.encodePacked( stringifyTruncated(file), COLON, stringifyTruncated(reason), LPAREN, stringify(payloadA), COMMA, stringify(payloadB), COMMA, stringify(payloadC), RPAREN ) ) ); } } // ============ Private Functions ============ function stringifyTruncated( bytes32 input ) private pure returns (bytes memory) { // put the input bytes into the result bytes memory result = abi.encodePacked(input); // determine the length of the input by finding the location of the last non-zero byte for (uint256 i = 32; i > 0; ) { // reverse-for-loops with unsigned integer /* solium-disable-next-line security/no-modify-for-iter-var */ i--; // find the last non-zero byte in order to determine the length if (result[i] != 0) { uint256 length = i + 1; /* solium-disable-next-line security/no-inline-assembly */ assembly { mstore(result, length) // r.length = length; } return result; } } // all bytes are zero return new bytes(0); } function stringify( uint256 input ) private pure returns (bytes memory) { if (input == 0) { return "0"; } // get the final string length uint256 j = input; uint256 length; while (j != 0) { length++; j /= 10; } // allocate the string bytes memory bstr = new bytes(length); // populate the string starting with the least-significant character j = input; for (uint256 i = length; i > 0; ) { // reverse-for-loops with unsigned integer /* solium-disable-next-line security/no-modify-for-iter-var */ i--; // take last decimal digit bstr[i] = byte(uint8(ASCII_ZERO + (j % 10))); // remove the last decimal digit j /= 10; } return bstr; } function stringify( address input ) private pure returns (bytes memory) { uint256 z = uint256(input); // addresses are "0x" followed by 20 bytes of data which take up 2 characters each bytes memory result = new bytes(42); // populate the result with "0x" result[0] = byte(uint8(ASCII_ZERO)); result[1] = byte(uint8(ASCII_LOWER_EX)); // for each byte (starting from the lowest byte), populate the result with two characters for (uint256 i = 0; i < 20; i++) { // each byte takes two characters uint256 shift = i * 2; // populate the least-significant character result[41 - shift] = char(z & FOUR_BIT_MASK); z = z >> 4; // populate the most-significant character result[40 - shift] = char(z & FOUR_BIT_MASK); z = z >> 4; } return result; } function stringify( bytes32 input ) private pure returns (bytes memory) { uint256 z = uint256(input); // bytes32 are "0x" followed by 32 bytes of data which take up 2 characters each bytes memory result = new bytes(66); // populate the result with "0x" result[0] = byte(uint8(ASCII_ZERO)); result[1] = byte(uint8(ASCII_LOWER_EX)); // for each byte (starting from the lowest byte), populate the result with two characters for (uint256 i = 0; i < 32; i++) { // each byte takes two characters uint256 shift = i * 2; // populate the least-significant character result[65 - shift] = char(z & FOUR_BIT_MASK); z = z >> 4; // populate the most-significant character result[64 - shift] = char(z & FOUR_BIT_MASK); z = z >> 4; } return result; } function char( uint256 input ) private pure returns (byte) { // return ASCII digit (0-9) if (input < 10) { return byte(uint8(input + ASCII_ZERO)); } // return ASCII letter (a-f) return byte(uint8(input + ASCII_RELATIVE_ZERO)); } } /* Copyright 2020 Zero Collateral Devs, standing on the shoulders of the Empty Set Squad <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ contract Comptroller is Setters { using SafeMath for uint256; bytes32 private constant FILE = "Comptroller"; function mintToAccount(address account, uint256 amount) internal { dollar().mint(account, amount); if (!bootstrappingAt(epoch())) { increaseDebt(amount); } balanceCheck(); } function burnFromAccount(address account, uint256 amount) internal { dollar().transferFrom(account, address(this), amount); dollar().burn(amount); decrementTotalDebt(amount, "Comptroller: not enough outstanding debt"); balanceCheck(); } function redeemToAccount(address account, uint256 amount) internal { dollar().transfer(account, amount); decrementTotalRedeemable( amount, "Comptroller: not enough redeemable balance" ); balanceCheck(); } function burnRedeemable(uint256 amount) internal { dollar().burn(amount); decrementTotalRedeemable( amount, "Comptroller: not enough redeemable balance" ); balanceCheck(); } function increaseDebt(uint256 amount) internal returns (uint256) { incrementTotalDebt(amount); uint256 lessDebt = resetDebt(Constants.getDebtRatioCap()); balanceCheck(); return lessDebt > amount ? 0 : amount.sub(lessDebt); } function decreaseDebt(uint256 amount) internal { decrementTotalDebt(amount, "Comptroller: not enough debt"); balanceCheck(); } function increaseSupply(uint256 newSupply) internal returns (uint256, uint256) { // 0-a. Pay out to Pool uint256 poolReward = newSupply.mul(Constants.getOraclePoolRatio()).div( 100 ); mintToPool(poolReward); // 0-b. Pay out to Treasury uint256 treasuryReward = newSupply .mul(Constants.getTreasuryRatio()) .div(10000); mintToTreasury(treasuryReward); uint256 rewards = poolReward.add(treasuryReward); newSupply = newSupply > rewards ? newSupply.sub(rewards) : 0; // 1. True up redeemable pool uint256 newRedeemable = 0; uint256 totalRedeemable = totalRedeemable(); uint256 totalCoupons = totalCoupons(); if (totalRedeemable < totalCoupons) { newRedeemable = totalCoupons.sub(totalRedeemable); newRedeemable = newRedeemable > newSupply ? newSupply : newRedeemable; mintToRedeemable(newRedeemable); newSupply = newSupply.sub(newRedeemable); } // 2. Payout to DAO if (totalBonded() == 0) { newSupply = 0; } if (newSupply > 0) { mintToDAO(newSupply); } balanceCheck(); return (newRedeemable, newSupply.add(rewards)); } function resetDebt(Decimal.D256 memory targetDebtRatio) internal returns (uint256) { uint256 targetDebt = targetDebtRatio .mul(dollar().totalSupply()) .asUint256(); uint256 currentDebt = totalDebt(); if (currentDebt > targetDebt) { uint256 lessDebt = currentDebt.sub(targetDebt); decreaseDebt(lessDebt); return lessDebt; } return 0; } function balanceCheck() private { Require.that( dollar().balanceOf(address(this)) >= totalBonded().add(totalStaged()).add(totalRedeemable()), FILE, "Inconsistent balances" ); } function mintToDAO(uint256 amount) private { if (amount > 0) { dollar().mint(address(this), amount); incrementTotalBonded(amount); } } function mintToPool(uint256 amount) private { if (amount > 0) { dollar().mint(pool(), amount); } } function mintToTreasury(uint256 amount) private { if (amount > 0) { dollar().mint(Constants.getTreasuryAddress(), amount); } } function mintToRedeemable(uint256 amount) private { dollar().mint(address(this), amount); incrementTotalRedeemable(amount); balanceCheck(); } } /* Copyright 2020 Zero Collateral Devs, standing on the shoulders of the Empty Set Squad <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ contract Market is Comptroller, Curve { using SafeMath for uint256; bytes32 private constant FILE = "Market"; event CouponExpiration( uint256 indexed epoch, uint256 couponsExpired, uint256 lessRedeemable, uint256 lessDebt, uint256 newBonded ); event CouponPurchase( address indexed account, uint256 indexed epoch, uint256 dollarAmount, uint256 couponAmount ); event CouponRedemption( address indexed account, uint256 indexed epoch, uint256 couponAmount ); event CouponTransfer( address indexed from, address indexed to, uint256 indexed epoch, uint256 value ); event CouponApproval( address indexed owner, address indexed spender, uint256 value ); function step() internal { // Expire prior coupons for (uint256 i = 0; i < expiringCoupons(epoch()); i++) { expireCouponsForEpoch(expiringCouponsAtIndex(epoch(), i)); } // Record expiry for current epoch's coupons uint256 expirationEpoch = epoch().add(Constants.getCouponExpiration()); initializeCouponsExpiration(epoch(), expirationEpoch); } function expireCouponsForEpoch(uint256 epoch) private { uint256 couponsForEpoch = outstandingCoupons(epoch); (uint256 lessRedeemable, uint256 newBonded) = (0, 0); eliminateOutstandingCoupons(epoch); uint256 totalRedeemable = totalRedeemable(); uint256 totalCoupons = totalCoupons(); if (totalRedeemable > totalCoupons) { lessRedeemable = totalRedeemable.sub(totalCoupons); burnRedeemable(lessRedeemable); (, newBonded) = increaseSupply(lessRedeemable); } emit CouponExpiration( epoch, couponsForEpoch, lessRedeemable, 0, newBonded ); } function couponPremium(uint256 amount) public view returns (uint256) { return calculateCouponPremium(dollar().totalSupply(), totalDebt(), amount); } function purchaseCoupons(uint256 dollarAmount) external returns (uint256) { Require.that(dollarAmount > 0, FILE, "Must purchase non-zero amount"); Require.that(totalDebt() >= dollarAmount, FILE, "Not enough debt"); uint256 epoch = epoch(); uint256 couponAmount = dollarAmount.add(couponPremium(dollarAmount)); burnFromAccount(msg.sender, dollarAmount); incrementBalanceOfCoupons(msg.sender, epoch, couponAmount); emit CouponPurchase(msg.sender, epoch, dollarAmount, couponAmount); return couponAmount; } function redeemCoupons(uint256 couponEpoch, uint256 couponAmount) external { require(epoch().sub(couponEpoch) >= 2, "Market: Too early to redeem"); decrementBalanceOfCoupons( msg.sender, couponEpoch, couponAmount, "Market: Insufficient coupon balance" ); redeemToAccount(msg.sender, couponAmount); emit CouponRedemption(msg.sender, couponEpoch, couponAmount); } function approveCoupons(address spender, uint256 amount) external { require( spender != address(0), "Market: Coupon approve to the zero address" ); updateAllowanceCoupons(msg.sender, spender, amount); emit CouponApproval(msg.sender, spender, amount); } function transferCoupons( address sender, address recipient, uint256 epoch, uint256 amount ) external { require( sender != address(0), "Market: Coupon transfer from the zero address" ); require( recipient != address(0), "Market: Coupon transfer to the zero address" ); decrementBalanceOfCoupons( sender, epoch, amount, "Market: Insufficient coupon balance" ); incrementBalanceOfCoupons(recipient, epoch, amount); if ( msg.sender != sender && allowanceCoupons(sender, msg.sender) != uint256(-1) ) { decrementAllowanceCoupons( sender, msg.sender, amount, "Market: Insufficient coupon approval" ); } emit CouponTransfer(sender, recipient, epoch, amount); } } /* Copyright 2020 Zero Collateral Devs, standing on the shoulders of the Empty Set Squad <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ contract Regulator is Comptroller { using SafeMath for uint256; using Decimal for Decimal.D256; event SupplyIncrease( uint256 indexed epoch, uint256 price, uint256 newRedeemable, uint256 lessDebt, uint256 newBonded ); event SupplyDecrease(uint256 indexed epoch, uint256 price, uint256 newDebt); event SupplyNeutral(uint256 indexed epoch); function step() internal { Decimal.D256 memory price = oracleCapture(); if (price.greaterThan(Decimal.one())) { growSupply(price); return; } if (price.lessThan(Decimal.one())) { shrinkSupply(price); return; } emit SupplyNeutral(epoch()); } function shrinkSupply(Decimal.D256 memory price) private { Decimal.D256 memory delta = limit(Decimal.one().sub(price), price); uint256 newDebt = delta.mul(totalNet()).asUint256(); uint256 cappedNewDebt = increaseDebt(newDebt); emit SupplyDecrease(epoch(), price.value, cappedNewDebt); return; } function growSupply(Decimal.D256 memory price) private { uint256 lessDebt = resetDebt(Decimal.zero()); Decimal.D256 memory delta = limit(price.sub(Decimal.one()), price); uint256 newSupply = delta.mul(totalNet()).asUint256(); (uint256 newRedeemable, uint256 newBonded) = increaseSupply(newSupply); emit SupplyIncrease( epoch(), price.value, newRedeemable, lessDebt, newBonded ); } function limit(Decimal.D256 memory delta, Decimal.D256 memory price) private view returns (Decimal.D256 memory) { Decimal.D256 memory supplyChangeLimit = Constants.getSupplyChangeLimit(); uint256 totalRedeemable = totalRedeemable(); uint256 totalCoupons = totalCoupons(); if ( price.greaterThan(Decimal.one()) && (totalRedeemable < totalCoupons) ) { supplyChangeLimit = Constants.getCouponSupplyChangeLimit(); } return delta.greaterThan(supplyChangeLimit) ? supplyChangeLimit : delta; } function oracleCapture() private returns (Decimal.D256 memory) { (Decimal.D256 memory price, bool valid) = oracle().capture(); if (bootstrappingAt(epoch().sub(1))) { return Constants.getBootstrappingPrice(); } if (!valid) { return Decimal.one(); } // Note: Price comes in x 1e12, normalize here return price.div(1e12); } } /* Copyright 2020 Zero Collateral Devs, standing on the shoulders of the Empty Set Squad <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ contract Permission is Setters { bytes32 private constant FILE = "Permission"; // Can modify account state modifier onlyFrozenOrFluid(address account) { Require.that( statusOf(account) != Account.Status.Locked, FILE, "Not frozen or fluid" ); _; } // Can participate in balance-dependant activities modifier onlyFrozenOrLocked(address account) { Require.that( statusOf(account) != Account.Status.Fluid, FILE, "Not frozen or locked" ); _; } modifier initializer() { Require.that( !isInitialized(implementation()), FILE, "Already initialized" ); initialized(implementation()); _; } } /* Copyright 2020 Zero Collateral Devs, standing on the shoulders of the Empty Set Squad <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ contract Bonding is Setters, Permission { using SafeMath for uint256; bytes32 private constant FILE = "Bonding"; event Deposit(address indexed account, uint256 value); event Withdraw(address indexed account, uint256 value); event Bond( address indexed account, uint256 start, uint256 value, uint256 valueUnderlying ); event Unbond( address indexed account, uint256 start, uint256 value, uint256 valueUnderlying ); function step() internal { Require.that(epochTime() > epoch(), FILE, "Still current epoch"); snapshotTotalBonded(); incrementEpoch(); } function deposit(uint256 value) external onlyFrozenOrLocked(msg.sender) { dollar().transferFrom(msg.sender, address(this), value); incrementBalanceOfStaged(msg.sender, value); emit Deposit(msg.sender, value); } function withdraw(uint256 value) external onlyFrozenOrLocked(msg.sender) { dollar().transfer(msg.sender, value); decrementBalanceOfStaged( msg.sender, value, "Bonding: insufficient staged balance" ); emit Withdraw(msg.sender, value); } function bond(uint256 value) external onlyFrozenOrFluid(msg.sender) { unfreeze(msg.sender); uint256 balance = totalBonded() == 0 ? value.mul(Constants.getInitialStakeMultiple()) : value.mul(totalSupply()).div(totalBonded()); incrementBalanceOf(msg.sender, balance); incrementTotalBonded(value); decrementBalanceOfStaged( msg.sender, value, "Bonding: insufficient staged balance" ); emit Bond(msg.sender, epoch().add(1), balance, value); } function unbond(uint256 value) external onlyFrozenOrFluid(msg.sender) { unfreeze(msg.sender); uint256 staged = value.mul(balanceOfBonded(msg.sender)).div( balanceOf(msg.sender) ); incrementBalanceOfStaged(msg.sender, staged); decrementTotalBonded(staged, "Bonding: insufficient total bonded"); decrementBalanceOf(msg.sender, value, "Bonding: insufficient balance"); emit Unbond(msg.sender, epoch().add(1), value, staged); } function unbondUnderlying(uint256 value) external onlyFrozenOrFluid(msg.sender) { unfreeze(msg.sender); uint256 balance = value.mul(totalSupply()).div(totalBonded()); incrementBalanceOfStaged(msg.sender, value); decrementTotalBonded(value, "Bonding: insufficient total bonded"); decrementBalanceOf( msg.sender, balance, "Bonding: insufficient balance" ); emit Unbond(msg.sender, epoch().add(1), balance, value); } } /** * Utility library of inline functions on addresses * * Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/utils/Address.sol * This contract is copied here and renamed from the original to avoid clashes in the compiled artifacts * when the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the * build/artifacts folder) as well as the vanilla Address implementation from an openzeppelin version. */ library OpenZeppelinUpgradesAddress { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /* Copyright 2018-2019 zOS Global Limited Copyright 2020 Zero Collateral Devs, standing on the shoulders of the Empty Set Squad <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /** * Based off of, and designed to interface with, openzeppelin/upgrades package */ contract Upgradeable is State { /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 private constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); function initialize() public; /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) internal { setImplementation(newImplementation); (bool success, bytes memory reason) = newImplementation.delegatecall( abi.encodeWithSignature("initialize()") ); require(success, string(reason)); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function setImplementation(address newImplementation) private { require( OpenZeppelinUpgradesAddress.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address" ); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /* Copyright 2020 Zero Collateral Devs, standing on the shoulders of the Empty Set Squad <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ contract Govern is Setters, Permission, Upgradeable { using SafeMath for uint256; using Decimal for Decimal.D256; bytes32 private constant FILE = "Govern"; event Proposal( address indexed candidate, address indexed account, uint256 indexed start, uint256 period ); event Vote( address indexed account, address indexed candidate, Candidate.Vote vote, uint256 bonded ); event Commit(address indexed account, address indexed candidate); function vote(address candidate, Candidate.Vote vote) external onlyFrozenOrLocked(msg.sender) { Require.that(balanceOf(msg.sender) > 0, FILE, "Must have stake"); if (!isNominated(candidate)) { Require.that( canPropose(msg.sender), FILE, "Not enough stake to propose" ); createCandidate(candidate, Constants.getGovernancePeriod()); emit Proposal( candidate, msg.sender, epoch(), Constants.getGovernancePeriod() ); } Require.that( epoch() < startFor(candidate).add(periodFor(candidate)), FILE, "Ended" ); uint256 bonded = balanceOf(msg.sender); Candidate.Vote recordedVote = recordedVote(msg.sender, candidate); if (vote == recordedVote) { return; } if (recordedVote == Candidate.Vote.REJECT) { decrementRejectFor( candidate, bonded, "Govern: Insufficient reject" ); } if (recordedVote == Candidate.Vote.APPROVE) { decrementApproveFor( candidate, bonded, "Govern: Insufficient approve" ); } if (vote == Candidate.Vote.REJECT) { incrementRejectFor(candidate, bonded); } if (vote == Candidate.Vote.APPROVE) { incrementApproveFor(candidate, bonded); } recordVote(msg.sender, candidate, vote); placeLock(msg.sender, candidate); emit Vote(msg.sender, candidate, vote, bonded); } function commit(address candidate) external { Require.that(isNominated(candidate), FILE, "Not nominated"); uint256 endsAfter = startFor(candidate).add(periodFor(candidate)).sub( 1 ); Require.that(epoch() > endsAfter, FILE, "Not ended"); Require.that( epoch() <= endsAfter.add(1).add(Constants.getGovernanceExpiration()), FILE, "Expired" ); Require.that( Decimal .ratio(votesFor(candidate), totalBondedAt(endsAfter)) .greaterThan(Constants.getGovernanceQuorum()), FILE, "Must have quorom" ); Require.that( approveFor(candidate) > rejectFor(candidate), FILE, "Not approved" ); upgradeTo(candidate); emit Commit(msg.sender, candidate); } function emergencyCommit(address candidate) external { Require.that(isNominated(candidate), FILE, "Not nominated"); Require.that( epochTime() > epoch().add(Constants.getGovernanceEmergencyDelay()), FILE, "Epoch synced" ); Require.that( Decimal.ratio(approveFor(candidate), totalSupply()).greaterThan( Constants.getGovernanceSuperMajority() ), FILE, "Must have super majority" ); Require.that( approveFor(candidate) > rejectFor(candidate), FILE, "Not approved" ); upgradeTo(candidate); emit Commit(msg.sender, candidate); } function canPropose(address account) private view returns (bool) { if (totalBonded() == 0) { return false; } Decimal.D256 memory stake = Decimal.ratio( balanceOf(account), totalSupply() ); return stake.greaterThan(Constants.getGovernanceProposalThreshold()); } } /* Copyright 2020 Zero Collateral Devs, standing on the shoulders of the Empty Set Squad <[email protected]> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ contract Implementation is State, Bonding, Market, Regulator, Govern { using SafeMath for uint256; event Advance(uint256 indexed epoch, uint256 block, uint256 timestamp); event Incentivization(address indexed account, uint256 amount); function initialize() public initializer { // Reward committer incentivize(msg.sender, Constants.getAdvanceIncentive()); // Dev rewards } function advance() external { incentivize(msg.sender, Constants.getAdvanceIncentive()); Bonding.step(); Regulator.step(); Market.step(); emit Advance(epoch(), block.number, block.timestamp); } function incentivize(address account, uint256 amount) private { mintToAccount(account, amount); emit Incentivization(account, amount); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"block","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Advance","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"start","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"valueUnderlying","type":"uint256"}],"name":"Bond","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"candidate","type":"address"}],"name":"Commit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"CouponApproval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"couponsExpired","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lessRedeemable","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lessDebt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBonded","type":"uint256"}],"name":"CouponExpiration","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dollarAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"couponAmount","type":"uint256"}],"name":"CouponPurchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"couponAmount","type":"uint256"}],"name":"CouponRedemption","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"CouponTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Incentivization","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"candidate","type":"address"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"uint256","name":"start","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"period","type":"uint256"}],"name":"Proposal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newDebt","type":"uint256"}],"name":"SupplyDecrease","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newRedeemable","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lessDebt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBonded","type":"uint256"}],"name":"SupplyIncrease","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"SupplyNeutral","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"start","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"valueUnderlying","type":"uint256"}],"name":"Unbond","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"candidate","type":"address"},{"indexed":false,"internalType":"enum Candidate.Vote","name":"vote","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"bonded","type":"uint256"}],"name":"Vote","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Withdraw","type":"event"},{"constant":false,"inputs":[],"name":"advance","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowanceCoupons","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approveCoupons","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"candidate","type":"address"}],"name":"approveFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOfBonded","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"balanceOfCoupons","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOfStaged","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"bond","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"bootstrappingAt","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"candidate","type":"address"}],"name":"commit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"couponPremium","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"couponsExpiration","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"deposit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"dollar","outputs":[{"internalType":"contract IDollar","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"candidate","type":"address"}],"name":"emergencyCommit","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"epoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"epochTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"expiringCoupons","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"i","type":"uint256"}],"name":"expiringCouponsAtIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"fluidUntil","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"implementation","outputs":[{"internalType":"address","name":"impl","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"candidate","type":"address"}],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"candidate","type":"address"}],"name":"isNominated","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"lockedUntil","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"oracle","outputs":[{"internalType":"contract IOracle","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"outstandingCoupons","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"candidate","type":"address"}],"name":"periodFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pool","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"dollarAmount","type":"uint256"}],"name":"purchaseCoupons","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"candidate","type":"address"}],"name":"recordedVote","outputs":[{"internalType":"enum Candidate.Vote","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"couponEpoch","type":"uint256"},{"internalType":"uint256","name":"couponAmount","type":"uint256"}],"name":"redeemCoupons","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"candidate","type":"address"}],"name":"rejectFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"candidate","type":"address"}],"name":"startFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"statusOf","outputs":[{"internalType":"enum Account.Status","name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalBonded","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"uint256","name":"epoch","type":"uint256"}],"name":"totalBondedAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalCoupons","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalDebt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalNet","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalRedeemable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalStaged","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"epoch","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferCoupons","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"unbond","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"unbondUnderlying","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"address","name":"candidate","type":"address"},{"internalType":"enum Candidate.Vote","name":"vote","type":"uint8"}],"name":"vote","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"candidate","type":"address"}],"name":"votesFor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"value","type":"uint256"}],"name":"withdraw","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506142d2806100206000396000f3fe608060405234801561001057600080fd5b50600436106103825760003560e01c80637dc0d1d0116101de578063b6b55f251161010f578063d8f54138116100ad578063ea105ac71161007c578063ea105ac714610714578063f1b7cf491461071c578063fc7b9c181461072f578063ffbe3b731461073757610382565b8063d8f54138146106cd578063dd62ed3e146106e0578063df9a2b1c146106ee578063e5f55c7e1461070157610382565b8063c9aff70c116100e9578063c9aff70c1461068c578063cf0237791461069f578063d60b347f146106a7578063d6a9cf08146106ba57610382565b8063b6b55f2514610653578063bc7513e214610666578063bceb514d1461067957610382565b80639940686e1161017c5780639f6e1b26116101565780639f6e1b2614610625578063a50cd8e714610638578063a6c409f11461064b578063a9059cbb146103ba57610382565b80639940686e146105f75780639a649edc1461060a5780639bc289f11461061257610382565b806386cf9f14116101b857806386cf9f14146105c1578063900cf0cf146105d457806395d89b41146105dc57806397a5d5b5146105e457610382565b80637dc0d1d01461059e5780638129fc1c146105a6578063825ad607146105ae57610382565b8063369e8c1d116102b857806351adeb5711610256578063646680221161023057806364668022146105525780636a39e3281461056557806370a082311461057857806375d5024b1461058b57610382565b806351adeb571461052257806351bf21d8146105375780635c60da1b1461054a57610382565b806344d96e951161029257806344d96e95146104ec57806347c05069146104f45780634c736099146105075780635053e4611461051a57610382565b8063369e8c1d146104a65780633a3e6c81146104b95780633fbba9a6146104cc57610382565b80631edbcf6c116103255780632e1a7d4d116102ff5780632e1a7d4d146104585780632f7f889e1461046b578063313ce5671461047e578063353a420c1461049357610382565b80631edbcf6c1461042a57806323b872dd1461043257806327de9e321461044557610382565b806310e95b6c1161036157806310e95b6c146103da57806315e14bf6146103fa57806316f0115b1461040d57806318160ddd1461042257610382565b80625edd371461038757806306fdde031461039c578063095ea7b3146103ba575b600080fd5b61039a610395366004613a56565b61074a565b005b6103a461086d565b6040516103b19190613f85565b60405180910390f35b6103cd6103c8366004613ae7565b6108a5565b6040516103b19190613f4d565b6103ed6103e8366004613b65565b6108ae565b6040516103b19190614006565b6103ed6104083660046139b1565b6108c6565b6104156108e4565b6040516103b19190613ee0565b6103ed6108f3565b6103ed6108f9565b6103cd610440366004613a09565b6108ff565b61039a610453366004613b65565b610909565b61039a610466366004613b65565b610a53565b61039a610479366004613ae7565b610b8b565b610486610c0b565b6040516103b1919061409a565b6103ed6104a13660046139b1565b610c10565b61039a6104b43660046139b1565b610c2e565b6103cd6104c73660046139b1565b610dbf565b6104df6104da3660046139cf565b610ddc565b6040516103b19190613f69565b6103ed610e0f565b61039a6105023660046139b1565b610e15565b6103ed610515366004613ba1565b610f08565b6103ed610f38565b61052a610f5b565b6040516103b19190613f5b565b6103ed6105453660046139b1565b610f6a565b610415610f88565b6103ed6105603660046139b1565b610fad565b6103ed610573366004613b65565b610fcb565b6103ed6105863660046139b1565b610fe0565b6103cd610599366004613b65565b610ffe565b61052a611011565b61039a611020565b6103ed6105bc3660046139b1565b61107c565b6103ed6105cf3660046139b1565b6110bc565b6103ed6110d7565b6103a46110dd565b6104df6105f23660046139b1565b6110fb565b61039a610605366004613b65565b611160565b6103ed61122e565b6103ed6106203660046139b1565b611234565b6103ed6106333660046139cf565b611252565b6103ed6106463660046139b1565b611281565b6103ed611298565b61039a610661366004613b65565b611322565b6103ed610674366004613ae7565b6113fa565b61039a610687366004613ab7565b61143e565b6103ed61069a366004613b65565b6116e4565b6103ed6116f9565b6103cd6106b53660046139b1565b6116ff565b61039a6106c8366004613ba1565b611720565b6103ed6106db366004613b65565b6117b4565b6103ed6103c83660046139cf565b61039a6106fc366004613b65565b61183f565b6103ed61070f366004613b65565b6118fd565b61039a6119ef565b6103ed61072a3660046139b1565b611a56565b6103ed611a71565b6103ed610745366004613b65565b611a77565b6001600160a01b0384166107795760405162461bcd60e51b815260040161077090613fe6565b60405180910390fd5b6001600160a01b03831661079f5760405162461bcd60e51b815260040161077090613fa6565b6107c38483836040518060600160405280602381526020016141b160239139611a89565b6107ce838383611b34565b336001600160a01b038516148015906107f257506000196107ef8533611252565b14155b1561081b5761081b8433836040518060600160405280602481526020016141f860249139611bdb565b81836001600160a01b0316856001600160a01b03167f0f1dbb1ccbe57a1590c7baad7b01d581b730c9ebc535dcde4345e6db424063d88460405161085f9190614006565b60405180910390a450505050565b60408051808201909152601981527f5a65726f20436f6c6c61746572616c20446169205374616b650000000000000060208201525b90565b60005b92915050565b6000818152600d60205260409020600201545b919050565b6001600160a01b03166000908152600e602052604090206001015490565b600b546001600160a01b031690565b60035490565b60065490565b60005b9392505050565b3361095060025b610919836110fb565b600281111561092457fe5b1415692832b936b4b9b9b4b7b760b11b72139bdd08199c9bde995b881bdc88199b1d5a59606a1b611c4c565b61095933611ca1565b600061098c61096733610fe0565b6109806109733361107c565b869063ffffffff611ccb16565b9063ffffffff611d0516565b90506109983382611d47565b6109ba8160405180606001604052806022815260200161421c60229139611da3565b6109fa33846040518060400160405280601d81526020017f426f6e64696e673a20696e73756666696369656e742062616c616e6365000000815250611dbe565b337f93530ac0ee8c50e696e13c5ac62355d0c0ba4bd943620d5bda1eb08b64ae7512610a356001610a296110d7565b9063ffffffff611e6916565b8584604051610a4693929190614057565b60405180910390a2505050565b33610a9b60015b610a63836110fb565b6002811115610a6e57fe5b1415692832b936b4b9b9b4b7b760b11b73139bdd08199c9bde995b881bdc881b1bd8dad95960621b611c4c565b610aa3610f5b565b6001600160a01b031663a9059cbb33846040518363ffffffff1660e01b8152600401610ad0929190613f16565b602060405180830381600087803b158015610aea57600080fd5b505af1158015610afe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b229190810190613b17565b50610b4633836040518060600160405280602481526020016141d460249139611e8e565b336001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436483604051610b7f9190614006565b60405180910390a25050565b6001600160a01b038216610bb15760405162461bcd60e51b815260040161077090613fd6565b610bbc338383611eed565b816001600160a01b0316336001600160a01b03167f8ff27e6b95060c1ca851e7c2c28af8b413eb1a8bcb637b0290da9543a709cce383604051610bff9190614006565b60405180910390a35050565b601290565b6001600160a01b03166000908152600e602052604090206003015490565b610c5a610c3a82610dbf565b6523b7bb32b93760d11b6c139bdd081b9bdb5a5b985d1959609a1b611c4c565b6000610c826001610c76610c6d856108c6565b610a2986611a56565b9063ffffffff611f1d16565b9050610cad81610c906110d7565b116523b7bb32b93760d11b68139bdd08195b99195960ba1b611c4c565b610cf0610ccc610cbb611f5f565b610a2984600163ffffffff611e6916565b610cd46110d7565b11156523b7bb32b93760d11b66115e1c1a5c995960ca1b611c4c565b610d47610d24610cfe611f64565b610d18610d0a86611281565b610d1386611a77565b611f86565b9063ffffffff611fb516565b6523b7bb32b93760d11b6f4d75737420686176652071756f726f6d60801b611c4c565b610d7c610d5383610c10565b610d5c84610fad565b116523b7bb32b93760d11b6b139bdd08185c1c1c9bdd995960a21b611c4c565b610d8582611fcb565b6040516001600160a01b0383169033907f815ca4497ab9fc80c76f210e6e842a5e198e195aa136034557eee144f790e7bb90600090a35050565b6001600160a01b03166000908152600e6020526040902054151590565b6001600160a01b038082166000908152600e60209081526040808320938616835260049093019052205460ff1692915050565b60045490565b610e21610c3a82610dbf565b610e5f610e37610e2f6120b7565b610a296110d7565b610e3f610f38565b116523b7bb32b93760d11b6b115c1bd8da081cde5b98d95960a21b611c4c565b610eb1610e81610e6d6120bc565b610d18610e7985610fad565b610d136108f3565b6523b7bb32b93760d11b7f4d7573742068617665207375706572206d616a6f726974790000000000000000611c4c565b610ec6610ebd82610c10565b610d5c83610fad565b610ecf81611fcb565b6040516001600160a01b0382169033907f815ca4497ab9fc80c76f210e6e842a5e198e195aa136034557eee144f790e7bb90600090a350565b6000828152600d60205260408120600301805483908110610f2557fe5b9060005260206000200154905092915050565b6000610f42613913565b610f4a6120de565b9050610f558161210d565b91505090565b6009546001600160a01b031690565b6001600160a01b03166000908152600c602052604090206004015490565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6001600160a01b03166000908152600e602052604090206002015490565b6000908152600d602052604090206003015490565b6001600160a01b03166000908152600c602052604090206001015490565b600061100861212f565b90911115919050565b600a546001600160a01b031690565b61105961102e6106b5610f88565b15692832b936b4b9b9b4b7b760b11b72105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b611c4c565b611069611064610f88565b612135565b61107a3361107561215c565b612169565b565b6000806110876108f3565b9050806110985760009150506108c1565b610902816109806110a886610fe0565b6110b0610e0f565b9063ffffffff611ccb16565b6001600160a01b03166000908152600c602052604090205490565b60025490565b6040805180820190915260048152635a41495360e01b602082015290565b60006111056110d7565b6001600160a01b0383166000908152600c6020526040902060050154111561112f575060026108c1565b6001600160a01b0382166000908152600c60205260409020600401546111536110d7565b10156108a55760016108a8565b3361116b6002610910565b61117433611ca1565b600061117e610e0f565b1561119e5761119961118e610e0f565b6109806109736108f3565b6111b6565b6111b66111a96121ac565b849063ffffffff611ccb16565b90506111c233826121b3565b6111cb8361224f565b6111ee33846040518060600160405280602481526020016141d460249139611e8e565b337f44002fdef5a0c2d2e4e05572e9780b95aef97e0e93ffd7cc076b09fa78ff2b4661121d6001610a296110d7565b8386604051610a4693929190614057565b60085490565b6001600160a01b03166000908152600c602052604090206005015490565b6001600160a01b039182166000908152600c602090815260408083209390941682526003909201909152205490565b60006108a861128f83610c10565b610a2984610fad565b600061131d6112a5611a71565b6112ad610f5b565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156112e557600080fd5b505afa1580156112f9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610c769190810190613b83565b905090565b3361132d6001610a5a565b611335610f5b565b6001600160a01b03166323b872dd3330856040518463ffffffff1660e01b815260040161136493929190613eee565b602060405180830381600087803b15801561137e57600080fd5b505af1158015611392573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113b69190810190613b17565b506113c13383611d47565b336001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c83604051610b7f9190614006565b6000611405826116e4565b611411575060006108a8565b506001600160a01b03919091166000908152600c6020908152604080832093835260029093019052205490565b336114496001610a5a565b61147a600061145733610fe0565b116523b7bb32b93760d11b6e4d7573742068617665207374616b6560881b611c4c565b61148383610dbf565b611526576114c361149333612268565b6523b7bb32b93760d11b7f4e6f7420656e6f756768207374616b6520746f2070726f706f73650000000000611c4c565b6114d4836114cf6122ac565b6122b1565b6114dc6110d7565b336001600160a01b0385167fd15e38a680a427478883cd2d32eb664cb6bb2090b0126a23ebaf3e3784b8c56b6115106122ac565b60405161151d9190614006565b60405180910390a45b611556611535610c6d856108c6565b61153d6110d7565b106523b7bb32b93760d11b64115b99195960da1b611c4c565b600061156133610fe0565b9050600061156f3386610ddc565b905080600281111561157d57fe5b84600281111561158957fe5b14156115965750506116df565b60028160028111156115a457fe5b14156115ea576115ea85836040518060400160405280601b81526020017f476f7665726e3a20496e73756666696369656e742072656a65637400000000008152506122dd565b60018160028111156115f857fe5b141561163e5761163e85836040518060400160405280601c81526020017f476f7665726e3a20496e73756666696369656e7420617070726f76650000000081525061232e565b600284600281111561164c57fe5b141561165c5761165c858361237f565b600184600281111561166a57fe5b141561167a5761167a85836123ce565b61168533868661241d565b61168f3386612467565b846001600160a01b0316336001600160a01b03167fbe50c78cbc15b0864819aadea36c6499da421b33c38e2ef19bebda583c708c7886856040516116d4929190613f77565b60405180910390a350505b505050565b6000908152600d602052604090206001015490565b60055490565b6001600160a01b03166000908152600e602052604090206005015460ff1690565b600261172e83610c766110d7565b101561174c5760405162461bcd60e51b815260040161077090613ff6565b6117703383836040518060600160405280602381526020016141b160239139611a89565b61177a33826124c8565b81336001600160a01b03167f46e9903ae8ac9e9f0c9bc321b05965c1c036e7d4783758703f5cdfc4133c51b683604051610bff9190614006565b60006108a86117c1610f5b565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156117f957600080fd5b505afa15801561180d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506118319190810190613b83565b611839611a71565b8461257e565b3361184a6002610910565b61185333611ca1565b600061186061118e610e0f565b905061186c3384611d47565b61188e8360405180606001604052806022815260200161421c60229139611da3565b6118ce33826040518060400160405280601d81526020017f426f6e64696e673a20696e73756666696369656e742062616c616e6365000000815250611dbe565b337f93530ac0ee8c50e696e13c5ac62355d0c0ba4bd943620d5bda1eb08b64ae751261121d6001610a296110d7565b6000611936600083116513585c9ad95d60d21b7f4d757374207075726368617365206e6f6e2d7a65726f20616d6f756e74000000611c4c565b61196682611942611a71565b10156513585c9ad95d60d21b6e139bdd08195b9bdd59da081919589d608a1b611c4c565b60006119706110d7565b9050600061198d611980856117b4565b859063ffffffff611e6916565b905061199933856125ab565b6119a4338383611b34565b81336001600160a01b03167fbce252db29f761f815dc2e9ea60005af065efba6eb619d2a0b2a113fdeb6141486846040516119e0929190614014565b60405180910390a39392505050565b6119fb3361107561215c565b611a036126bc565b611a0b612707565b611a13612792565b611a1b6110d7565b7fc30b728d1c19e5db3678b8ea9e9a063a5655071e1a325c2f7fdbca48baa906004342604051611a4c929190614014565b60405180910390a2565b6001600160a01b03166000908152600e602052604090205490565b60075490565b6000908152600d602052604090205490565b6001600160a01b0384166000908152600c60209081526040808320868452600201909152902054611ac190838363ffffffff6127ec16565b6001600160a01b0385166000908152600c60209081526040808320878452600201825280832093909355600d90522060010154611b0590838363ffffffff6127ec16565b6000848152600d6020526040902060010155600854611b2b90838363ffffffff6127ec16565b60085550505050565b6001600160a01b0383166000908152600c60209081526040808320858452600201909152902054611b6b908263ffffffff611e6916565b6001600160a01b0384166000908152600c60209081526040808320868452600201825280832093909355600d90522060010154611bae908263ffffffff611e6916565b6000838152600d6020526040902060010155600854611bd3908263ffffffff611e6916565b600855505050565b6001600160a01b038085166000908152600c602090815260408083209387168352600390930190522054611c1690838363ffffffff6127ec16565b6001600160a01b039485166000908152600c60209081526040808320969097168252600390950190945293909220929092555050565b826116df57611c5a82612818565b6101d160f51b611c6983612818565b604051602001611c7b93929190613eaf565b60408051601f198184030181529082905262461bcd60e51b825261077091600401613f85565b611cac610e2f612898565b6001600160a01b039091166000908152600c6020526040902060040155565b600082611cda575060006108a8565b82820282848281611ce757fe5b04146109025760405162461bcd60e51b815260040161077090613fb6565b600061090283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061289d565b6001600160a01b0382166000908152600c6020526040902054611d70908263ffffffff611e6916565b6001600160a01b0383166000908152600c6020526040902055600554611d9c908263ffffffff611e6916565b6005555050565b600454611db790838363ffffffff6127ec16565b6004555050565b6001600160a01b0383166000908152600c6020526040902060010154611deb90838363ffffffff6127ec16565b6001600160a01b0384166000908152600c6020526040902060010155600354611e1b90838363ffffffff6127ec16565b6003556040516000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611e5c908690614006565b60405180910390a3505050565b6000828201838110156109025760405162461bcd60e51b815260040161077090613f96565b6001600160a01b0383166000908152600c6020526040902054611eb890838363ffffffff6127ec16565b6001600160a01b0384166000908152600c6020526040902055600554611ee590838363ffffffff6127ec16565b600555505050565b6001600160a01b039283166000908152600c60209081526040808320949095168252600390930190925291902055565b600061090283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506127ec565b603090565b611f6c613934565b5060408051602081019091526702c68af0bb140000815290565b611f8e613934565b6040518060200160405280611fac85670de0b6b3a7640000866128d4565b90529392505050565b6000611fc183836128ea565b6002149392505050565b611fd48161291c565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b17905290516000916060916001600160a01b0385169161201891613ea3565b600060405180830381855af49150503d8060008114612053576040519150601f19603f3d011682016040523d82523d6000602084013e612058565b606091505b509150915081819061207d5760405162461bcd60e51b81526004016107709190613f85565b506040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2505050565b606090565b6120c4613934565b506040805160208101909152670928ca80cfc20000815290565b6120e6613913565b604051806060016040528060008152602001635fde94008152602001610708815250905090565b60006108a88260000151610a2984604001516109808660200151610c76612965565b6102a090565b6001600160a01b03166000908152600e60205260409020600501805460ff19166001179055565b68056bc75e2d6310000090565b6121738282612969565b816001600160a01b03167fbb4f656853bc420ad6e4321622c07eefb4ed40e3f91b35553ce14a6dff4c098182604051610b7f9190614006565b620f424090565b6001600160a01b0382166000908152600c60205260409020600101546121df908263ffffffff611e6916565b6001600160a01b0383166000908152600c602052604090206001015560035461220e908263ffffffff611e6916565b6003556040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610bff908590614006565b600454612262908263ffffffff611e6916565b60045550565b6000612272610e0f565b61227e575060006108c1565b612286613934565b612292610e7984610fe0565b905061090261229f612a12565b829063ffffffff611fb516565b609090565b6122b96110d7565b6001600160a01b039092166000908152600e60205260409020918255600190910155565b6001600160a01b0383166000908152600e602052604090206003015461230a90838363ffffffff6127ec16565b6001600160a01b039093166000908152600e60205260409020600301929092555050565b6001600160a01b0383166000908152600e602052604090206002015461235b90838363ffffffff6127ec16565b6001600160a01b039093166000908152600e60205260409020600201929092555050565b6001600160a01b0382166000908152600e60205260409020600301546123ab908263ffffffff611e6916565b6001600160a01b039092166000908152600e602052604090206003019190915550565b6001600160a01b0382166000908152600e60205260409020600201546123fa908263ffffffff611e6916565b6001600160a01b039092166000908152600e602052604090206002019190915550565b6001600160a01b038083166000908152600e6020908152604080832093871683526004909301905220805482919060ff1916600183600281111561245d57fe5b0217905550505050565b6001600160a01b0382166000908152600c602052604081206005015490612499612490846108c6565b610a2985611a56565b9050818111156124c2576001600160a01b0384166000908152600c602052604090206005018190555b50505050565b6124d0610f5b565b6001600160a01b031663a9059cbb83836040518363ffffffff1660e01b81526004016124fd929190613f3f565b602060405180830381600087803b15801561251757600080fd5b505af115801561252b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061254f9190810190613b17565b50612572816040518060600160405280602a8152602001614266602a9139612a33565b61257a612a4e565b5050565b60006125a361259e83612592878787612b21565b9063ffffffff612c9a16565b612cc1565b949350505050565b6125b3610f5b565b6001600160a01b03166323b872dd8330846040518463ffffffff1660e01b81526004016125e293929190613f31565b602060405180830381600087803b1580156125fc57600080fd5b505af1158015612610573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506126349190810190613b17565b5061263d610f5b565b6001600160a01b03166342966c68826040518263ffffffff1660e01b81526004016126689190614006565b600060405180830381600087803b15801561268257600080fd5b505af1158015612696573d6000803e3d6000fd5b505050506125728160405180606001604052806028815260200161423e60289139612cde565b6126f76126c76110d7565b6126cf610f38565b1166426f6e64696e6760c81b720a6e8d2d8d840c6eae4e4cadce840cae0dec6d606b1b611c4c565b6126ff612cf9565b61107a612d20565b61270f613934565b612717612d39565b905061272461229f612e17565b156127385761273281612e39565b5061107a565b612750612743612e17565b829063ffffffff612ef516565b1561275e5761273281612f09565b6127666110d7565b6040517fff7db5a0dc69b02c191ba632db46961b7d0daa1bd30709ddba9b80ad0a15d2c090600090a250565b60005b6127a06105736110d7565b8110156127c8576127c06127bb6127b56110d7565b83610f08565b612f9b565b600101612795565b5060006127d6610e2f613033565b90506127e96127e36110d7565b82613039565b50565b600081848411156128105760405162461bcd60e51b81526004016107709190613f85565b505050900390565b6060808260405160200161282c9190613e8e565b60408051601f19818403018152919052905060205b80156128815781516000199091019082908290811061285c57fe5b01602001516001600160f81b0319161561287c57600101815290506108c1565b612841565b505060408051600081526020810190915292915050565b60f090565b600081836128be5760405162461bcd60e51b81526004016107709190613f85565b5060008385816128ca57fe5b0495945050505050565b60006125a382610980868663ffffffff611ccb16565b8051825160009114156128ff575060016108a8565b815183511161290f576000612912565b60025b60ff169392505050565b6129258161306b565b6129415760405162461bcd60e51b815260040161077090613fc6565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b4290565b612971610f5b565b6001600160a01b03166340c10f1983836040518363ffffffff1660e01b815260040161299e929190613f3f565b602060405180830381600087803b1580156129b857600080fd5b505af11580156129cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506129f09190810190613b17565b506129fc6105996110d7565b61257257612a0981613071565b5061257a612a4e565b612a1a613934565b5060408051602081019091526611c37937e08000815290565b600654612a4790838363ffffffff6127ec16565b6006555050565b61107a612a6f612a5c6108f9565b610a29612a676116f9565b610a29610e0f565b612a77610f5b565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612aa29190613ee0565b60206040518083038186803b158015612aba57600080fd5b505afa158015612ace573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612af29190810190613b83565b10156a21b7b6b83a3937b63632b960a91b74496e636f6e73697374656e742062616c616e63657360581b611c4c565b612b29613934565b612b31613934565b612b3b8486611f86565b9050612b45613934565b612b4d611f64565b90506000612b61878663ffffffff611f1d16565b90506000612b75878763ffffffff611f1d16565b9050612b7f613934565b612b898284611f86565b9050612b9b858563ffffffff611fb516565b15612c8357612bb0818563ffffffff611fb516565b15612bca57612bbe846130b8565b95505050505050610902565b612bd2613934565b612bdc8286613110565b9050612be6613934565b612bf6868463ffffffff61316d16565b9050612c00613934565b612c09876130b8565b9050612c13613934565b612c23898963ffffffff61316d16565b9050612c73612c38848363ffffffff61319616565b612c67612c4b858563ffffffff6131bf16565b612c5b888863ffffffff6131bf16565b9063ffffffff61319616565b9063ffffffff6131ed16565b9950505050505050505050610902565b612c8d8186613110565b9998505050505050505050565b612ca2613934565b604080516020810190915283518190611fac908563ffffffff611ccb16565b80516000906108a890670de0b6b3a764000063ffffffff611d0516565b600754612cf290838363ffffffff6127ec16565b6007555050565b612d016108f3565b600d6000612d0d6110d7565b8152602081019190915260400160002055565b600254612d3490600163ffffffff611e6916565b600255565b612d41613934565b612d49613934565b6000612d53611011565b6001600160a01b031663d4a3e9d76040518163ffffffff1660e01b81526004016040805180830381600087803b158015612d8c57600080fd5b505af1158015612da0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612dc49190810190613b35565b91509150612dd86105996001610c766110d7565b15612dee57612de561321b565b925050506108a2565b80612dfb57612de5612e17565b612e108264e8d4a5100063ffffffff61323d16565b9250505090565b612e1f613934565b506040805160208101909152670de0b6b3a7640000815290565b6000612e4b612e46613264565b61327f565b9050612e55613934565b612e76612e70612e63612e17565b859063ffffffff61316d16565b84613354565b90506000612e9561259e612e88611298565b849063ffffffff612c9a16565b9050600080612ea3836133df565b91509150612eaf6110d7565b86516040517f32fcaa1e76ed9517f4749d8ec9a77dd5e7329456d740b9bf9665d900eef5e28391612ee59186908a908790614072565b60405180910390a2505050505050565b6000612f0183836128ea565b159392505050565b612f11613934565b612f32612f2c83612f20612e17565b9063ffffffff61316d16565b83613354565b90506000612f4461259e612e88611298565b90506000612f5182613071565b9050612f5b6110d7565b84516040517f5e139d4b8080a4a00dcc151e8217694aeebae893936326aa22096924a990667791612f8d918590614014565b60405180910390a250505050565b6000612fa6826116e4565b9050600080612fb484613513565b6000612fbe6108f9565b90506000612fca61122e565b905080821115612ffc57612fe4828263ffffffff611f1d16565b9350612fef84613556565b612ff8846133df565b9350505b857f753df65b37159bf237ae1fca97ba1bd57cf83bc9498f271a514a4d7bafe87bda8686600087604051612ee59493929190614022565b61447090565b6000828152600d6020908152604080832060020184905592825291812060030180546001810182559082529190200155565b3b151590565b600061307c826135e5565b6000613089612e46611f64565b9050613093612a4e565b8281116130af576130aa838263ffffffff611f1d16565b610902565b50600092915050565b6130c0613934565b6108a86130cf60016003611f86565b612f206131086130f260026130e688612f20612e17565b9063ffffffff6135fe16565b6130fc6003613654565b9063ffffffff6131bf16565b612c67612e17565b613118613934565b613128838363ffffffff61368816565b1561313d57613136836130b8565b90506108a8565b61090261314c60016003611f86565b612f2061310861315e87612f20612e17565b6130fc6130f288612f20612e17565b613175613934565b6040805160208101909152825184518291611fac919063ffffffff611f1d16565b61319e613934565b6040805160208101909152825184518291611fac919063ffffffff611e6916565b6131c7613934565b6040518060200160405280611fac85600001518560000151670de0b6b3a76400006128d4565b6131f5613934565b6040518060200160405280611fac8560000151670de0b6b3a764000086600001516128d4565b613223613934565b506040805160208101909152670f43fc2c04ee0000815290565b613245613934565b604080516020810190915283518190611fac908563ffffffff611d0516565b61326c613934565b5060408051602081019091526000815290565b60008061330d61259e613290610f5b565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156132c857600080fd5b505afa1580156132dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506133009190810190613b83565b859063ffffffff612c9a16565b90506000613319611a71565b90508181111561334a576000613335828463ffffffff611f1d16565b90506133408161368f565b92506108c1915050565b5060009392505050565b61335c613934565b613364613934565b61336c6136ce565b905060006133786108f9565b9050600061338461122e565b905061339e613391612e17565b869063ffffffff611fb516565b80156133a957508082105b156133b9576133b66136ef565b92505b6133c9868463ffffffff611fb516565b6133d357856133d5565b825b9695505050505050565b600080600061340160646109806133f4613710565b879063ffffffff611ccb16565b905061340c81613715565b600061342c61271061098061341f6137a9565b889063ffffffff611ccb16565b9050613437816137ae565b6000613449838363ffffffff611e6916565b9050808611613459576000613469565b613469868263ffffffff611f1d16565b95506000806134766108f9565b9050600061348261122e565b9050808210156134cb5761349c818363ffffffff611f1d16565b92508883116134ab57826134ad565b885b92506134b8836137d2565b6134c8898463ffffffff611f1d16565b98505b6134d3610e0f565b6134dc57600098505b88156134eb576134eb89613863565b6134f3612a4e565b826135048a8663ffffffff611e6916565b97509750505050505050915091565b600061351e826116e4565b90508061352b57506127e9565b60085461353e908263ffffffff611f1d16565b600855506000908152600d6020526040812060010155565b61355e610f5b565b6001600160a01b03166342966c68826040518263ffffffff1660e01b81526004016135899190614006565b600060405180830381600087803b1580156135a357600080fd5b505af11580156135b7573d6000803e3d6000fd5b505050506135dd816040518060600160405280602a8152602001614266602a9139612a33565b6127e9612a4e565b6007546135f8908263ffffffff611e6916565b60075550565b613606613934565b81613615576131366001613654565b61361d613934565b5060408051602081019091528351815260015b8381101561364c5761364282866131bf565b9150600101613630565b509392505050565b61365c613934565b60408051602081019091528061368084670de0b6b3a764000063ffffffff611ccb16565b905292915050565b5190511490565b6135dd816040518060400160405280601c81526020017f436f6d7074726f6c6c65723a206e6f7420656e6f756768206465627400000000815250612cde565b6136d6613934565b506040805160208101909152662386f26fc10000815290565b6136f7613934565b50604080516020810190915266470de4df820000815290565b603290565b80156127e957613723610f5b565b6001600160a01b03166340c10f196137396108e4565b836040518363ffffffff1660e01b8152600401613757929190613f3f565b602060405180830381600087803b15801561377157600080fd5b505af1158015613785573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061257a9190810190613b17565b600090565b80156127e9576137bc610f5b565b6001600160a01b03166340c10f196137396137a9565b6137da610f5b565b6001600160a01b03166340c10f1930836040518363ffffffff1660e01b8152600401613807929190613f3f565b602060405180830381600087803b15801561382157600080fd5b505af1158015613835573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506138599190810190613b17565b506135dd816138fa565b80156127e957613871610f5b565b6001600160a01b03166340c10f1930836040518363ffffffff1660e01b815260040161389e929190613f3f565b602060405180830381600087803b1580156138b857600080fd5b505af11580156138cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506138f09190810190613b17565b506127e98161224f565b60065461390d908263ffffffff611e6916565b60065550565b60405180606001604052806000815260200160008152602001600081525090565b6040518060200160405280600081525090565b80356108a88161417d565b80516108a881614191565b80356108a88161419a565b60006020828403121561397a57600080fd5b61398460206140a8565b9050600061399284846139a6565b82525092915050565b80356108a8816141a7565b80516108a8816141a7565b6000602082840312156139c357600080fd5b60006125a38484613947565b600080604083850312156139e257600080fd5b60006139ee8585613947565b92505060206139ff85828601613947565b9150509250929050565b600080600060608486031215613a1e57600080fd5b6000613a2a8686613947565b9350506020613a3b86828701613947565b9250506040613a4c8682870161399b565b9150509250925092565b60008060008060808587031215613a6c57600080fd5b6000613a788787613947565b9450506020613a8987828801613947565b9350506040613a9a8782880161399b565b9250506060613aab8782880161399b565b91505092959194509250565b60008060408385031215613aca57600080fd5b6000613ad68585613947565b92505060206139ff8582860161395d565b60008060408385031215613afa57600080fd5b6000613b068585613947565b92505060206139ff8582860161399b565b600060208284031215613b2957600080fd5b60006125a38484613952565b60008060408385031215613b4857600080fd5b6000613b548585613968565b92505060206139ff85828601613952565b600060208284031215613b7757600080fd5b60006125a3848461399b565b600060208284031215613b9557600080fd5b60006125a384846139a6565b60008060408385031215613bb457600080fd5b6000613b06858561399b565b613bc981614115565b82525050565b613bc9816140dc565b613bc9816140e7565b613bc9613bed826140ec565b6108a2565b613bc9613bed826108a2565b6000613c09826140cf565b613c1381856108c1565b9350613c2381856020860161413d565b9290920192915050565b613bc98161411c565b613bc981614127565b613bc981614132565b6000613c53826140cf565b613c5d81856140d3565b9350613c6d81856020860161413d565b613c7681614169565b9093019392505050565b6000613c8d601b836140d3565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000613cc6602b836140d3565b7f4d61726b65743a20436f75706f6e207472616e7366657220746f20746865207a81526a65726f206164647265737360a81b602082015260400192915050565b6000613d136021836140d3565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b6000613d56603b836140d3565b7f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f81527f6e20746f2061206e6f6e2d636f6e747261637420616464726573730000000000602082015260400192915050565b6000613db5602a836140d3565b7f4d61726b65743a20436f75706f6e20617070726f766520746f20746865207a65815269726f206164647265737360b01b602082015260400192915050565b6000613e01602d836140d3565b7f4d61726b65743a20436f75706f6e207472616e736665722066726f6d2074686581526c207a65726f206164647265737360981b602082015260400192915050565b6000613e50601b836140d3565b7f4d61726b65743a20546f6f206561726c7920746f2072656465656d0000000000815260200192915050565b613bc9816108a2565b613bc98161410f565b6000613e9a8284613bf2565b50602001919050565b60006109028284613bfe565b6000613ebb8286613bfe565b9150613ec78285613be1565b600282019150613ed78284613bfe565b95945050505050565b602081016108a88284613bcf565b60608101613efc8286613bc0565b613f096020830185613bcf565b6125a36040830184613e7c565b60408101613f248285613bc0565b6109026020830184613e7c565b60608101613efc8286613bcf565b60408101613f248285613bcf565b602081016108a88284613bd8565b602081016108a88284613c2d565b602081016108a88284613c36565b60408101613f248285613c36565b602080825281016109028184613c48565b602080825281016108a881613c80565b602080825281016108a881613cb9565b602080825281016108a881613d06565b602080825281016108a881613d49565b602080825281016108a881613da8565b602080825281016108a881613df4565b602080825281016108a881613e43565b602081016108a88284613e7c565b60408101613f248285613e7c565b608081016140308287613e7c565b61403d6020830186613e7c565b61404a6040830185613c3f565b613ed76060830184613e7c565b606081016140658286613e7c565b613f096020830185613e7c565b608081016140808287613e7c565b61408d6020830186613e7c565b61404a6040830185613e7c565b602081016108a88284613e85565b60405181810167ffffffffffffffff811182821017156140c757600080fd5b604052919050565b5190565b90815260200190565b60006108a882614103565b151590565b6001600160f01b03191690565b806108c181614173565b6001600160a01b031690565b60ff1690565b60006108a8825b60006108a8826140dc565b60006108a8826140f9565b60006108a8826108a2565b60005b83811015614158578181015183820152602001614140565b838111156124c25750506000910152565b601f01601f191690565b600381106127e957fe5b614186816140dc565b81146127e957600080fd5b614186816140e7565b600381106127e957600080fd5b614186816108a256fe4d61726b65743a20496e73756666696369656e7420636f75706f6e2062616c616e6365426f6e64696e673a20696e73756666696369656e74207374616765642062616c616e63654d61726b65743a20496e73756666696369656e7420636f75706f6e20617070726f76616c426f6e64696e673a20696e73756666696369656e7420746f74616c20626f6e646564436f6d7074726f6c6c65723a206e6f7420656e6f756768206f75747374616e64696e672064656274436f6d7074726f6c6c65723a206e6f7420656e6f7567682072656465656d61626c652062616c616e6365a365627a7a723158207e590f07508db00e92ff9638629a3e71b2e1889d90f85ae5542b0b73d9518b346c6578706572696d656e74616cf564736f6c63430005110040
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106103825760003560e01c80637dc0d1d0116101de578063b6b55f251161010f578063d8f54138116100ad578063ea105ac71161007c578063ea105ac714610714578063f1b7cf491461071c578063fc7b9c181461072f578063ffbe3b731461073757610382565b8063d8f54138146106cd578063dd62ed3e146106e0578063df9a2b1c146106ee578063e5f55c7e1461070157610382565b8063c9aff70c116100e9578063c9aff70c1461068c578063cf0237791461069f578063d60b347f146106a7578063d6a9cf08146106ba57610382565b8063b6b55f2514610653578063bc7513e214610666578063bceb514d1461067957610382565b80639940686e1161017c5780639f6e1b26116101565780639f6e1b2614610625578063a50cd8e714610638578063a6c409f11461064b578063a9059cbb146103ba57610382565b80639940686e146105f75780639a649edc1461060a5780639bc289f11461061257610382565b806386cf9f14116101b857806386cf9f14146105c1578063900cf0cf146105d457806395d89b41146105dc57806397a5d5b5146105e457610382565b80637dc0d1d01461059e5780638129fc1c146105a6578063825ad607146105ae57610382565b8063369e8c1d116102b857806351adeb5711610256578063646680221161023057806364668022146105525780636a39e3281461056557806370a082311461057857806375d5024b1461058b57610382565b806351adeb571461052257806351bf21d8146105375780635c60da1b1461054a57610382565b806344d96e951161029257806344d96e95146104ec57806347c05069146104f45780634c736099146105075780635053e4611461051a57610382565b8063369e8c1d146104a65780633a3e6c81146104b95780633fbba9a6146104cc57610382565b80631edbcf6c116103255780632e1a7d4d116102ff5780632e1a7d4d146104585780632f7f889e1461046b578063313ce5671461047e578063353a420c1461049357610382565b80631edbcf6c1461042a57806323b872dd1461043257806327de9e321461044557610382565b806310e95b6c1161036157806310e95b6c146103da57806315e14bf6146103fa57806316f0115b1461040d57806318160ddd1461042257610382565b80625edd371461038757806306fdde031461039c578063095ea7b3146103ba575b600080fd5b61039a610395366004613a56565b61074a565b005b6103a461086d565b6040516103b19190613f85565b60405180910390f35b6103cd6103c8366004613ae7565b6108a5565b6040516103b19190613f4d565b6103ed6103e8366004613b65565b6108ae565b6040516103b19190614006565b6103ed6104083660046139b1565b6108c6565b6104156108e4565b6040516103b19190613ee0565b6103ed6108f3565b6103ed6108f9565b6103cd610440366004613a09565b6108ff565b61039a610453366004613b65565b610909565b61039a610466366004613b65565b610a53565b61039a610479366004613ae7565b610b8b565b610486610c0b565b6040516103b1919061409a565b6103ed6104a13660046139b1565b610c10565b61039a6104b43660046139b1565b610c2e565b6103cd6104c73660046139b1565b610dbf565b6104df6104da3660046139cf565b610ddc565b6040516103b19190613f69565b6103ed610e0f565b61039a6105023660046139b1565b610e15565b6103ed610515366004613ba1565b610f08565b6103ed610f38565b61052a610f5b565b6040516103b19190613f5b565b6103ed6105453660046139b1565b610f6a565b610415610f88565b6103ed6105603660046139b1565b610fad565b6103ed610573366004613b65565b610fcb565b6103ed6105863660046139b1565b610fe0565b6103cd610599366004613b65565b610ffe565b61052a611011565b61039a611020565b6103ed6105bc3660046139b1565b61107c565b6103ed6105cf3660046139b1565b6110bc565b6103ed6110d7565b6103a46110dd565b6104df6105f23660046139b1565b6110fb565b61039a610605366004613b65565b611160565b6103ed61122e565b6103ed6106203660046139b1565b611234565b6103ed6106333660046139cf565b611252565b6103ed6106463660046139b1565b611281565b6103ed611298565b61039a610661366004613b65565b611322565b6103ed610674366004613ae7565b6113fa565b61039a610687366004613ab7565b61143e565b6103ed61069a366004613b65565b6116e4565b6103ed6116f9565b6103cd6106b53660046139b1565b6116ff565b61039a6106c8366004613ba1565b611720565b6103ed6106db366004613b65565b6117b4565b6103ed6103c83660046139cf565b61039a6106fc366004613b65565b61183f565b6103ed61070f366004613b65565b6118fd565b61039a6119ef565b6103ed61072a3660046139b1565b611a56565b6103ed611a71565b6103ed610745366004613b65565b611a77565b6001600160a01b0384166107795760405162461bcd60e51b815260040161077090613fe6565b60405180910390fd5b6001600160a01b03831661079f5760405162461bcd60e51b815260040161077090613fa6565b6107c38483836040518060600160405280602381526020016141b160239139611a89565b6107ce838383611b34565b336001600160a01b038516148015906107f257506000196107ef8533611252565b14155b1561081b5761081b8433836040518060600160405280602481526020016141f860249139611bdb565b81836001600160a01b0316856001600160a01b03167f0f1dbb1ccbe57a1590c7baad7b01d581b730c9ebc535dcde4345e6db424063d88460405161085f9190614006565b60405180910390a450505050565b60408051808201909152601981527f5a65726f20436f6c6c61746572616c20446169205374616b650000000000000060208201525b90565b60005b92915050565b6000818152600d60205260409020600201545b919050565b6001600160a01b03166000908152600e602052604090206001015490565b600b546001600160a01b031690565b60035490565b60065490565b60005b9392505050565b3361095060025b610919836110fb565b600281111561092457fe5b1415692832b936b4b9b9b4b7b760b11b72139bdd08199c9bde995b881bdc88199b1d5a59606a1b611c4c565b61095933611ca1565b600061098c61096733610fe0565b6109806109733361107c565b869063ffffffff611ccb16565b9063ffffffff611d0516565b90506109983382611d47565b6109ba8160405180606001604052806022815260200161421c60229139611da3565b6109fa33846040518060400160405280601d81526020017f426f6e64696e673a20696e73756666696369656e742062616c616e6365000000815250611dbe565b337f93530ac0ee8c50e696e13c5ac62355d0c0ba4bd943620d5bda1eb08b64ae7512610a356001610a296110d7565b9063ffffffff611e6916565b8584604051610a4693929190614057565b60405180910390a2505050565b33610a9b60015b610a63836110fb565b6002811115610a6e57fe5b1415692832b936b4b9b9b4b7b760b11b73139bdd08199c9bde995b881bdc881b1bd8dad95960621b611c4c565b610aa3610f5b565b6001600160a01b031663a9059cbb33846040518363ffffffff1660e01b8152600401610ad0929190613f16565b602060405180830381600087803b158015610aea57600080fd5b505af1158015610afe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b229190810190613b17565b50610b4633836040518060600160405280602481526020016141d460249139611e8e565b336001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436483604051610b7f9190614006565b60405180910390a25050565b6001600160a01b038216610bb15760405162461bcd60e51b815260040161077090613fd6565b610bbc338383611eed565b816001600160a01b0316336001600160a01b03167f8ff27e6b95060c1ca851e7c2c28af8b413eb1a8bcb637b0290da9543a709cce383604051610bff9190614006565b60405180910390a35050565b601290565b6001600160a01b03166000908152600e602052604090206003015490565b610c5a610c3a82610dbf565b6523b7bb32b93760d11b6c139bdd081b9bdb5a5b985d1959609a1b611c4c565b6000610c826001610c76610c6d856108c6565b610a2986611a56565b9063ffffffff611f1d16565b9050610cad81610c906110d7565b116523b7bb32b93760d11b68139bdd08195b99195960ba1b611c4c565b610cf0610ccc610cbb611f5f565b610a2984600163ffffffff611e6916565b610cd46110d7565b11156523b7bb32b93760d11b66115e1c1a5c995960ca1b611c4c565b610d47610d24610cfe611f64565b610d18610d0a86611281565b610d1386611a77565b611f86565b9063ffffffff611fb516565b6523b7bb32b93760d11b6f4d75737420686176652071756f726f6d60801b611c4c565b610d7c610d5383610c10565b610d5c84610fad565b116523b7bb32b93760d11b6b139bdd08185c1c1c9bdd995960a21b611c4c565b610d8582611fcb565b6040516001600160a01b0383169033907f815ca4497ab9fc80c76f210e6e842a5e198e195aa136034557eee144f790e7bb90600090a35050565b6001600160a01b03166000908152600e6020526040902054151590565b6001600160a01b038082166000908152600e60209081526040808320938616835260049093019052205460ff1692915050565b60045490565b610e21610c3a82610dbf565b610e5f610e37610e2f6120b7565b610a296110d7565b610e3f610f38565b116523b7bb32b93760d11b6b115c1bd8da081cde5b98d95960a21b611c4c565b610eb1610e81610e6d6120bc565b610d18610e7985610fad565b610d136108f3565b6523b7bb32b93760d11b7f4d7573742068617665207375706572206d616a6f726974790000000000000000611c4c565b610ec6610ebd82610c10565b610d5c83610fad565b610ecf81611fcb565b6040516001600160a01b0382169033907f815ca4497ab9fc80c76f210e6e842a5e198e195aa136034557eee144f790e7bb90600090a350565b6000828152600d60205260408120600301805483908110610f2557fe5b9060005260206000200154905092915050565b6000610f42613913565b610f4a6120de565b9050610f558161210d565b91505090565b6009546001600160a01b031690565b6001600160a01b03166000908152600c602052604090206004015490565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6001600160a01b03166000908152600e602052604090206002015490565b6000908152600d602052604090206003015490565b6001600160a01b03166000908152600c602052604090206001015490565b600061100861212f565b90911115919050565b600a546001600160a01b031690565b61105961102e6106b5610f88565b15692832b936b4b9b9b4b7b760b11b72105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b611c4c565b611069611064610f88565b612135565b61107a3361107561215c565b612169565b565b6000806110876108f3565b9050806110985760009150506108c1565b610902816109806110a886610fe0565b6110b0610e0f565b9063ffffffff611ccb16565b6001600160a01b03166000908152600c602052604090205490565b60025490565b6040805180820190915260048152635a41495360e01b602082015290565b60006111056110d7565b6001600160a01b0383166000908152600c6020526040902060050154111561112f575060026108c1565b6001600160a01b0382166000908152600c60205260409020600401546111536110d7565b10156108a55760016108a8565b3361116b6002610910565b61117433611ca1565b600061117e610e0f565b1561119e5761119961118e610e0f565b6109806109736108f3565b6111b6565b6111b66111a96121ac565b849063ffffffff611ccb16565b90506111c233826121b3565b6111cb8361224f565b6111ee33846040518060600160405280602481526020016141d460249139611e8e565b337f44002fdef5a0c2d2e4e05572e9780b95aef97e0e93ffd7cc076b09fa78ff2b4661121d6001610a296110d7565b8386604051610a4693929190614057565b60085490565b6001600160a01b03166000908152600c602052604090206005015490565b6001600160a01b039182166000908152600c602090815260408083209390941682526003909201909152205490565b60006108a861128f83610c10565b610a2984610fad565b600061131d6112a5611a71565b6112ad610f5b565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156112e557600080fd5b505afa1580156112f9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610c769190810190613b83565b905090565b3361132d6001610a5a565b611335610f5b565b6001600160a01b03166323b872dd3330856040518463ffffffff1660e01b815260040161136493929190613eee565b602060405180830381600087803b15801561137e57600080fd5b505af1158015611392573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506113b69190810190613b17565b506113c13383611d47565b336001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c83604051610b7f9190614006565b6000611405826116e4565b611411575060006108a8565b506001600160a01b03919091166000908152600c6020908152604080832093835260029093019052205490565b336114496001610a5a565b61147a600061145733610fe0565b116523b7bb32b93760d11b6e4d7573742068617665207374616b6560881b611c4c565b61148383610dbf565b611526576114c361149333612268565b6523b7bb32b93760d11b7f4e6f7420656e6f756768207374616b6520746f2070726f706f73650000000000611c4c565b6114d4836114cf6122ac565b6122b1565b6114dc6110d7565b336001600160a01b0385167fd15e38a680a427478883cd2d32eb664cb6bb2090b0126a23ebaf3e3784b8c56b6115106122ac565b60405161151d9190614006565b60405180910390a45b611556611535610c6d856108c6565b61153d6110d7565b106523b7bb32b93760d11b64115b99195960da1b611c4c565b600061156133610fe0565b9050600061156f3386610ddc565b905080600281111561157d57fe5b84600281111561158957fe5b14156115965750506116df565b60028160028111156115a457fe5b14156115ea576115ea85836040518060400160405280601b81526020017f476f7665726e3a20496e73756666696369656e742072656a65637400000000008152506122dd565b60018160028111156115f857fe5b141561163e5761163e85836040518060400160405280601c81526020017f476f7665726e3a20496e73756666696369656e7420617070726f76650000000081525061232e565b600284600281111561164c57fe5b141561165c5761165c858361237f565b600184600281111561166a57fe5b141561167a5761167a85836123ce565b61168533868661241d565b61168f3386612467565b846001600160a01b0316336001600160a01b03167fbe50c78cbc15b0864819aadea36c6499da421b33c38e2ef19bebda583c708c7886856040516116d4929190613f77565b60405180910390a350505b505050565b6000908152600d602052604090206001015490565b60055490565b6001600160a01b03166000908152600e602052604090206005015460ff1690565b600261172e83610c766110d7565b101561174c5760405162461bcd60e51b815260040161077090613ff6565b6117703383836040518060600160405280602381526020016141b160239139611a89565b61177a33826124c8565b81336001600160a01b03167f46e9903ae8ac9e9f0c9bc321b05965c1c036e7d4783758703f5cdfc4133c51b683604051610bff9190614006565b60006108a86117c1610f5b565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156117f957600080fd5b505afa15801561180d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506118319190810190613b83565b611839611a71565b8461257e565b3361184a6002610910565b61185333611ca1565b600061186061118e610e0f565b905061186c3384611d47565b61188e8360405180606001604052806022815260200161421c60229139611da3565b6118ce33826040518060400160405280601d81526020017f426f6e64696e673a20696e73756666696369656e742062616c616e6365000000815250611dbe565b337f93530ac0ee8c50e696e13c5ac62355d0c0ba4bd943620d5bda1eb08b64ae751261121d6001610a296110d7565b6000611936600083116513585c9ad95d60d21b7f4d757374207075726368617365206e6f6e2d7a65726f20616d6f756e74000000611c4c565b61196682611942611a71565b10156513585c9ad95d60d21b6e139bdd08195b9bdd59da081919589d608a1b611c4c565b60006119706110d7565b9050600061198d611980856117b4565b859063ffffffff611e6916565b905061199933856125ab565b6119a4338383611b34565b81336001600160a01b03167fbce252db29f761f815dc2e9ea60005af065efba6eb619d2a0b2a113fdeb6141486846040516119e0929190614014565b60405180910390a39392505050565b6119fb3361107561215c565b611a036126bc565b611a0b612707565b611a13612792565b611a1b6110d7565b7fc30b728d1c19e5db3678b8ea9e9a063a5655071e1a325c2f7fdbca48baa906004342604051611a4c929190614014565b60405180910390a2565b6001600160a01b03166000908152600e602052604090205490565b60075490565b6000908152600d602052604090205490565b6001600160a01b0384166000908152600c60209081526040808320868452600201909152902054611ac190838363ffffffff6127ec16565b6001600160a01b0385166000908152600c60209081526040808320878452600201825280832093909355600d90522060010154611b0590838363ffffffff6127ec16565b6000848152600d6020526040902060010155600854611b2b90838363ffffffff6127ec16565b60085550505050565b6001600160a01b0383166000908152600c60209081526040808320858452600201909152902054611b6b908263ffffffff611e6916565b6001600160a01b0384166000908152600c60209081526040808320868452600201825280832093909355600d90522060010154611bae908263ffffffff611e6916565b6000838152600d6020526040902060010155600854611bd3908263ffffffff611e6916565b600855505050565b6001600160a01b038085166000908152600c602090815260408083209387168352600390930190522054611c1690838363ffffffff6127ec16565b6001600160a01b039485166000908152600c60209081526040808320969097168252600390950190945293909220929092555050565b826116df57611c5a82612818565b6101d160f51b611c6983612818565b604051602001611c7b93929190613eaf565b60408051601f198184030181529082905262461bcd60e51b825261077091600401613f85565b611cac610e2f612898565b6001600160a01b039091166000908152600c6020526040902060040155565b600082611cda575060006108a8565b82820282848281611ce757fe5b04146109025760405162461bcd60e51b815260040161077090613fb6565b600061090283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061289d565b6001600160a01b0382166000908152600c6020526040902054611d70908263ffffffff611e6916565b6001600160a01b0383166000908152600c6020526040902055600554611d9c908263ffffffff611e6916565b6005555050565b600454611db790838363ffffffff6127ec16565b6004555050565b6001600160a01b0383166000908152600c6020526040902060010154611deb90838363ffffffff6127ec16565b6001600160a01b0384166000908152600c6020526040902060010155600354611e1b90838363ffffffff6127ec16565b6003556040516000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611e5c908690614006565b60405180910390a3505050565b6000828201838110156109025760405162461bcd60e51b815260040161077090613f96565b6001600160a01b0383166000908152600c6020526040902054611eb890838363ffffffff6127ec16565b6001600160a01b0384166000908152600c6020526040902055600554611ee590838363ffffffff6127ec16565b600555505050565b6001600160a01b039283166000908152600c60209081526040808320949095168252600390930190925291902055565b600061090283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506127ec565b603090565b611f6c613934565b5060408051602081019091526702c68af0bb140000815290565b611f8e613934565b6040518060200160405280611fac85670de0b6b3a7640000866128d4565b90529392505050565b6000611fc183836128ea565b6002149392505050565b611fd48161291c565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b17905290516000916060916001600160a01b0385169161201891613ea3565b600060405180830381855af49150503d8060008114612053576040519150601f19603f3d011682016040523d82523d6000602084013e612058565b606091505b509150915081819061207d5760405162461bcd60e51b81526004016107709190613f85565b506040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2505050565b606090565b6120c4613934565b506040805160208101909152670928ca80cfc20000815290565b6120e6613913565b604051806060016040528060008152602001635fde94008152602001610708815250905090565b60006108a88260000151610a2984604001516109808660200151610c76612965565b6102a090565b6001600160a01b03166000908152600e60205260409020600501805460ff19166001179055565b68056bc75e2d6310000090565b6121738282612969565b816001600160a01b03167fbb4f656853bc420ad6e4321622c07eefb4ed40e3f91b35553ce14a6dff4c098182604051610b7f9190614006565b620f424090565b6001600160a01b0382166000908152600c60205260409020600101546121df908263ffffffff611e6916565b6001600160a01b0383166000908152600c602052604090206001015560035461220e908263ffffffff611e6916565b6003556040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610bff908590614006565b600454612262908263ffffffff611e6916565b60045550565b6000612272610e0f565b61227e575060006108c1565b612286613934565b612292610e7984610fe0565b905061090261229f612a12565b829063ffffffff611fb516565b609090565b6122b96110d7565b6001600160a01b039092166000908152600e60205260409020918255600190910155565b6001600160a01b0383166000908152600e602052604090206003015461230a90838363ffffffff6127ec16565b6001600160a01b039093166000908152600e60205260409020600301929092555050565b6001600160a01b0383166000908152600e602052604090206002015461235b90838363ffffffff6127ec16565b6001600160a01b039093166000908152600e60205260409020600201929092555050565b6001600160a01b0382166000908152600e60205260409020600301546123ab908263ffffffff611e6916565b6001600160a01b039092166000908152600e602052604090206003019190915550565b6001600160a01b0382166000908152600e60205260409020600201546123fa908263ffffffff611e6916565b6001600160a01b039092166000908152600e602052604090206002019190915550565b6001600160a01b038083166000908152600e6020908152604080832093871683526004909301905220805482919060ff1916600183600281111561245d57fe5b0217905550505050565b6001600160a01b0382166000908152600c602052604081206005015490612499612490846108c6565b610a2985611a56565b9050818111156124c2576001600160a01b0384166000908152600c602052604090206005018190555b50505050565b6124d0610f5b565b6001600160a01b031663a9059cbb83836040518363ffffffff1660e01b81526004016124fd929190613f3f565b602060405180830381600087803b15801561251757600080fd5b505af115801561252b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061254f9190810190613b17565b50612572816040518060600160405280602a8152602001614266602a9139612a33565b61257a612a4e565b5050565b60006125a361259e83612592878787612b21565b9063ffffffff612c9a16565b612cc1565b949350505050565b6125b3610f5b565b6001600160a01b03166323b872dd8330846040518463ffffffff1660e01b81526004016125e293929190613f31565b602060405180830381600087803b1580156125fc57600080fd5b505af1158015612610573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506126349190810190613b17565b5061263d610f5b565b6001600160a01b03166342966c68826040518263ffffffff1660e01b81526004016126689190614006565b600060405180830381600087803b15801561268257600080fd5b505af1158015612696573d6000803e3d6000fd5b505050506125728160405180606001604052806028815260200161423e60289139612cde565b6126f76126c76110d7565b6126cf610f38565b1166426f6e64696e6760c81b720a6e8d2d8d840c6eae4e4cadce840cae0dec6d606b1b611c4c565b6126ff612cf9565b61107a612d20565b61270f613934565b612717612d39565b905061272461229f612e17565b156127385761273281612e39565b5061107a565b612750612743612e17565b829063ffffffff612ef516565b1561275e5761273281612f09565b6127666110d7565b6040517fff7db5a0dc69b02c191ba632db46961b7d0daa1bd30709ddba9b80ad0a15d2c090600090a250565b60005b6127a06105736110d7565b8110156127c8576127c06127bb6127b56110d7565b83610f08565b612f9b565b600101612795565b5060006127d6610e2f613033565b90506127e96127e36110d7565b82613039565b50565b600081848411156128105760405162461bcd60e51b81526004016107709190613f85565b505050900390565b6060808260405160200161282c9190613e8e565b60408051601f19818403018152919052905060205b80156128815781516000199091019082908290811061285c57fe5b01602001516001600160f81b0319161561287c57600101815290506108c1565b612841565b505060408051600081526020810190915292915050565b60f090565b600081836128be5760405162461bcd60e51b81526004016107709190613f85565b5060008385816128ca57fe5b0495945050505050565b60006125a382610980868663ffffffff611ccb16565b8051825160009114156128ff575060016108a8565b815183511161290f576000612912565b60025b60ff169392505050565b6129258161306b565b6129415760405162461bcd60e51b815260040161077090613fc6565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b4290565b612971610f5b565b6001600160a01b03166340c10f1983836040518363ffffffff1660e01b815260040161299e929190613f3f565b602060405180830381600087803b1580156129b857600080fd5b505af11580156129cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506129f09190810190613b17565b506129fc6105996110d7565b61257257612a0981613071565b5061257a612a4e565b612a1a613934565b5060408051602081019091526611c37937e08000815290565b600654612a4790838363ffffffff6127ec16565b6006555050565b61107a612a6f612a5c6108f9565b610a29612a676116f9565b610a29610e0f565b612a77610f5b565b6001600160a01b03166370a08231306040518263ffffffff1660e01b8152600401612aa29190613ee0565b60206040518083038186803b158015612aba57600080fd5b505afa158015612ace573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612af29190810190613b83565b10156a21b7b6b83a3937b63632b960a91b74496e636f6e73697374656e742062616c616e63657360581b611c4c565b612b29613934565b612b31613934565b612b3b8486611f86565b9050612b45613934565b612b4d611f64565b90506000612b61878663ffffffff611f1d16565b90506000612b75878763ffffffff611f1d16565b9050612b7f613934565b612b898284611f86565b9050612b9b858563ffffffff611fb516565b15612c8357612bb0818563ffffffff611fb516565b15612bca57612bbe846130b8565b95505050505050610902565b612bd2613934565b612bdc8286613110565b9050612be6613934565b612bf6868463ffffffff61316d16565b9050612c00613934565b612c09876130b8565b9050612c13613934565b612c23898963ffffffff61316d16565b9050612c73612c38848363ffffffff61319616565b612c67612c4b858563ffffffff6131bf16565b612c5b888863ffffffff6131bf16565b9063ffffffff61319616565b9063ffffffff6131ed16565b9950505050505050505050610902565b612c8d8186613110565b9998505050505050505050565b612ca2613934565b604080516020810190915283518190611fac908563ffffffff611ccb16565b80516000906108a890670de0b6b3a764000063ffffffff611d0516565b600754612cf290838363ffffffff6127ec16565b6007555050565b612d016108f3565b600d6000612d0d6110d7565b8152602081019190915260400160002055565b600254612d3490600163ffffffff611e6916565b600255565b612d41613934565b612d49613934565b6000612d53611011565b6001600160a01b031663d4a3e9d76040518163ffffffff1660e01b81526004016040805180830381600087803b158015612d8c57600080fd5b505af1158015612da0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612dc49190810190613b35565b91509150612dd86105996001610c766110d7565b15612dee57612de561321b565b925050506108a2565b80612dfb57612de5612e17565b612e108264e8d4a5100063ffffffff61323d16565b9250505090565b612e1f613934565b506040805160208101909152670de0b6b3a7640000815290565b6000612e4b612e46613264565b61327f565b9050612e55613934565b612e76612e70612e63612e17565b859063ffffffff61316d16565b84613354565b90506000612e9561259e612e88611298565b849063ffffffff612c9a16565b9050600080612ea3836133df565b91509150612eaf6110d7565b86516040517f32fcaa1e76ed9517f4749d8ec9a77dd5e7329456d740b9bf9665d900eef5e28391612ee59186908a908790614072565b60405180910390a2505050505050565b6000612f0183836128ea565b159392505050565b612f11613934565b612f32612f2c83612f20612e17565b9063ffffffff61316d16565b83613354565b90506000612f4461259e612e88611298565b90506000612f5182613071565b9050612f5b6110d7565b84516040517f5e139d4b8080a4a00dcc151e8217694aeebae893936326aa22096924a990667791612f8d918590614014565b60405180910390a250505050565b6000612fa6826116e4565b9050600080612fb484613513565b6000612fbe6108f9565b90506000612fca61122e565b905080821115612ffc57612fe4828263ffffffff611f1d16565b9350612fef84613556565b612ff8846133df565b9350505b857f753df65b37159bf237ae1fca97ba1bd57cf83bc9498f271a514a4d7bafe87bda8686600087604051612ee59493929190614022565b61447090565b6000828152600d6020908152604080832060020184905592825291812060030180546001810182559082529190200155565b3b151590565b600061307c826135e5565b6000613089612e46611f64565b9050613093612a4e565b8281116130af576130aa838263ffffffff611f1d16565b610902565b50600092915050565b6130c0613934565b6108a86130cf60016003611f86565b612f206131086130f260026130e688612f20612e17565b9063ffffffff6135fe16565b6130fc6003613654565b9063ffffffff6131bf16565b612c67612e17565b613118613934565b613128838363ffffffff61368816565b1561313d57613136836130b8565b90506108a8565b61090261314c60016003611f86565b612f2061310861315e87612f20612e17565b6130fc6130f288612f20612e17565b613175613934565b6040805160208101909152825184518291611fac919063ffffffff611f1d16565b61319e613934565b6040805160208101909152825184518291611fac919063ffffffff611e6916565b6131c7613934565b6040518060200160405280611fac85600001518560000151670de0b6b3a76400006128d4565b6131f5613934565b6040518060200160405280611fac8560000151670de0b6b3a764000086600001516128d4565b613223613934565b506040805160208101909152670f43fc2c04ee0000815290565b613245613934565b604080516020810190915283518190611fac908563ffffffff611d0516565b61326c613934565b5060408051602081019091526000815290565b60008061330d61259e613290610f5b565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156132c857600080fd5b505afa1580156132dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506133009190810190613b83565b859063ffffffff612c9a16565b90506000613319611a71565b90508181111561334a576000613335828463ffffffff611f1d16565b90506133408161368f565b92506108c1915050565b5060009392505050565b61335c613934565b613364613934565b61336c6136ce565b905060006133786108f9565b9050600061338461122e565b905061339e613391612e17565b869063ffffffff611fb516565b80156133a957508082105b156133b9576133b66136ef565b92505b6133c9868463ffffffff611fb516565b6133d357856133d5565b825b9695505050505050565b600080600061340160646109806133f4613710565b879063ffffffff611ccb16565b905061340c81613715565b600061342c61271061098061341f6137a9565b889063ffffffff611ccb16565b9050613437816137ae565b6000613449838363ffffffff611e6916565b9050808611613459576000613469565b613469868263ffffffff611f1d16565b95506000806134766108f9565b9050600061348261122e565b9050808210156134cb5761349c818363ffffffff611f1d16565b92508883116134ab57826134ad565b885b92506134b8836137d2565b6134c8898463ffffffff611f1d16565b98505b6134d3610e0f565b6134dc57600098505b88156134eb576134eb89613863565b6134f3612a4e565b826135048a8663ffffffff611e6916565b97509750505050505050915091565b600061351e826116e4565b90508061352b57506127e9565b60085461353e908263ffffffff611f1d16565b600855506000908152600d6020526040812060010155565b61355e610f5b565b6001600160a01b03166342966c68826040518263ffffffff1660e01b81526004016135899190614006565b600060405180830381600087803b1580156135a357600080fd5b505af11580156135b7573d6000803e3d6000fd5b505050506135dd816040518060600160405280602a8152602001614266602a9139612a33565b6127e9612a4e565b6007546135f8908263ffffffff611e6916565b60075550565b613606613934565b81613615576131366001613654565b61361d613934565b5060408051602081019091528351815260015b8381101561364c5761364282866131bf565b9150600101613630565b509392505050565b61365c613934565b60408051602081019091528061368084670de0b6b3a764000063ffffffff611ccb16565b905292915050565b5190511490565b6135dd816040518060400160405280601c81526020017f436f6d7074726f6c6c65723a206e6f7420656e6f756768206465627400000000815250612cde565b6136d6613934565b506040805160208101909152662386f26fc10000815290565b6136f7613934565b50604080516020810190915266470de4df820000815290565b603290565b80156127e957613723610f5b565b6001600160a01b03166340c10f196137396108e4565b836040518363ffffffff1660e01b8152600401613757929190613f3f565b602060405180830381600087803b15801561377157600080fd5b505af1158015613785573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061257a9190810190613b17565b600090565b80156127e9576137bc610f5b565b6001600160a01b03166340c10f196137396137a9565b6137da610f5b565b6001600160a01b03166340c10f1930836040518363ffffffff1660e01b8152600401613807929190613f3f565b602060405180830381600087803b15801561382157600080fd5b505af1158015613835573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506138599190810190613b17565b506135dd816138fa565b80156127e957613871610f5b565b6001600160a01b03166340c10f1930836040518363ffffffff1660e01b815260040161389e929190613f3f565b602060405180830381600087803b1580156138b857600080fd5b505af11580156138cc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506138f09190810190613b17565b506127e98161224f565b60065461390d908263ffffffff611e6916565b60065550565b60405180606001604052806000815260200160008152602001600081525090565b6040518060200160405280600081525090565b80356108a88161417d565b80516108a881614191565b80356108a88161419a565b60006020828403121561397a57600080fd5b61398460206140a8565b9050600061399284846139a6565b82525092915050565b80356108a8816141a7565b80516108a8816141a7565b6000602082840312156139c357600080fd5b60006125a38484613947565b600080604083850312156139e257600080fd5b60006139ee8585613947565b92505060206139ff85828601613947565b9150509250929050565b600080600060608486031215613a1e57600080fd5b6000613a2a8686613947565b9350506020613a3b86828701613947565b9250506040613a4c8682870161399b565b9150509250925092565b60008060008060808587031215613a6c57600080fd5b6000613a788787613947565b9450506020613a8987828801613947565b9350506040613a9a8782880161399b565b9250506060613aab8782880161399b565b91505092959194509250565b60008060408385031215613aca57600080fd5b6000613ad68585613947565b92505060206139ff8582860161395d565b60008060408385031215613afa57600080fd5b6000613b068585613947565b92505060206139ff8582860161399b565b600060208284031215613b2957600080fd5b60006125a38484613952565b60008060408385031215613b4857600080fd5b6000613b548585613968565b92505060206139ff85828601613952565b600060208284031215613b7757600080fd5b60006125a3848461399b565b600060208284031215613b9557600080fd5b60006125a384846139a6565b60008060408385031215613bb457600080fd5b6000613b06858561399b565b613bc981614115565b82525050565b613bc9816140dc565b613bc9816140e7565b613bc9613bed826140ec565b6108a2565b613bc9613bed826108a2565b6000613c09826140cf565b613c1381856108c1565b9350613c2381856020860161413d565b9290920192915050565b613bc98161411c565b613bc981614127565b613bc981614132565b6000613c53826140cf565b613c5d81856140d3565b9350613c6d81856020860161413d565b613c7681614169565b9093019392505050565b6000613c8d601b836140d3565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000613cc6602b836140d3565b7f4d61726b65743a20436f75706f6e207472616e7366657220746f20746865207a81526a65726f206164647265737360a81b602082015260400192915050565b6000613d136021836140d3565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b6000613d56603b836140d3565b7f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f81527f6e20746f2061206e6f6e2d636f6e747261637420616464726573730000000000602082015260400192915050565b6000613db5602a836140d3565b7f4d61726b65743a20436f75706f6e20617070726f766520746f20746865207a65815269726f206164647265737360b01b602082015260400192915050565b6000613e01602d836140d3565b7f4d61726b65743a20436f75706f6e207472616e736665722066726f6d2074686581526c207a65726f206164647265737360981b602082015260400192915050565b6000613e50601b836140d3565b7f4d61726b65743a20546f6f206561726c7920746f2072656465656d0000000000815260200192915050565b613bc9816108a2565b613bc98161410f565b6000613e9a8284613bf2565b50602001919050565b60006109028284613bfe565b6000613ebb8286613bfe565b9150613ec78285613be1565b600282019150613ed78284613bfe565b95945050505050565b602081016108a88284613bcf565b60608101613efc8286613bc0565b613f096020830185613bcf565b6125a36040830184613e7c565b60408101613f248285613bc0565b6109026020830184613e7c565b60608101613efc8286613bcf565b60408101613f248285613bcf565b602081016108a88284613bd8565b602081016108a88284613c2d565b602081016108a88284613c36565b60408101613f248285613c36565b602080825281016109028184613c48565b602080825281016108a881613c80565b602080825281016108a881613cb9565b602080825281016108a881613d06565b602080825281016108a881613d49565b602080825281016108a881613da8565b602080825281016108a881613df4565b602080825281016108a881613e43565b602081016108a88284613e7c565b60408101613f248285613e7c565b608081016140308287613e7c565b61403d6020830186613e7c565b61404a6040830185613c3f565b613ed76060830184613e7c565b606081016140658286613e7c565b613f096020830185613e7c565b608081016140808287613e7c565b61408d6020830186613e7c565b61404a6040830185613e7c565b602081016108a88284613e85565b60405181810167ffffffffffffffff811182821017156140c757600080fd5b604052919050565b5190565b90815260200190565b60006108a882614103565b151590565b6001600160f01b03191690565b806108c181614173565b6001600160a01b031690565b60ff1690565b60006108a8825b60006108a8826140dc565b60006108a8826140f9565b60006108a8826108a2565b60005b83811015614158578181015183820152602001614140565b838111156124c25750506000910152565b601f01601f191690565b600381106127e957fe5b614186816140dc565b81146127e957600080fd5b614186816140e7565b600381106127e957600080fd5b614186816108a256fe4d61726b65743a20496e73756666696369656e7420636f75706f6e2062616c616e6365426f6e64696e673a20696e73756666696369656e74207374616765642062616c616e63654d61726b65743a20496e73756666696369656e7420636f75706f6e20617070726f76616c426f6e64696e673a20696e73756666696369656e7420746f74616c20626f6e646564436f6d7074726f6c6c65723a206e6f7420656e6f756768206f75747374616e64696e672064656274436f6d7074726f6c6c65723a206e6f7420656e6f7567682072656465656d61626c652062616c616e6365a365627a7a723158207e590f07508db00e92ff9638629a3e71b2e1889d90f85ae5542b0b73d9518b346c6578706572696d656e74616cf564736f6c63430005110040
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.