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 Source Code Verified (Exact Match)
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-04-16 */ 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; } } 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 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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 2019 dYdX Trading Inc. Copyright 2020 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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; } struct State10 { uint256 depositedCDSD; uint256 interestMultiplierEntry; uint256 earnableCDSD; uint256 earnedCDSD; uint256 redeemedCDSD; uint256 redeemedThisExpansion; uint256 lastRedeemedExpansionStart; } } 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; } struct State13 { mapping(address => mapping(uint256 => uint256)) couponUnderlyingByAccount; uint256 couponUnderlying; Decimal.D256 price; } struct State16 { IOracle legacyOracle; uint256 epochStartForSushiswapPool; } struct State10 { mapping(address => Account.State10) accounts; uint256 globalInterestMultiplier; uint256 totalCDSDDeposited; uint256 totalCDSDEarnable; uint256 totalCDSDEarned; uint256 expansionStartEpoch; uint256 totalCDSDRedeemable; uint256 totalCDSDRedeemed; } struct State17 { Decimal.D256 CDSDPrice; IOracle CDSDOracle; } } contract State { Storage.State _state; // DIP-13 Storage.State13 _state13; // DIP-16 Storage.State16 _state16; // DIP-10 Storage.State10 _state10; // DIP-17 Storage.State17 _state17; } /* Copyright 2020 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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 = 150; // 150 epochs uint256 private constant BOOTSTRAPPING_PRICE = 154e16; // 1.54 USDC (targeting 4.5% inflation) /* Oracle */ address private constant USDC = address(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); uint256 private constant ORACLE_RESERVE_MINIMUM = 1e10; // 10,000 USDC uint256 private constant CONTRACTION_ORACLE_RESERVE_MINIMUM = 1e9; // 1,000 USDC /* Bonding */ uint256 private constant INITIAL_STAKE_MULTIPLE = 1e6; // 100 DSD -> 100M DSDS /* Epoch */ struct EpochStrategy { uint256 offset; uint256 start; uint256 period; } uint256 private constant EPOCH_OFFSET = 0; uint256 private constant EPOCH_START = 1606348800; uint256 private constant EPOCH_PERIOD = 7200; /* Governance */ uint256 private constant GOVERNANCE_PERIOD = 36; 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 = 6; // 6 epochs /* DAO */ uint256 private constant ADVANCE_INCENTIVE_PREMIUM = 125e16; // pay out 25% more than tx fee value uint256 private constant DAO_EXIT_LOCKUP_EPOCHS = 36; // 36 epochs fluid /* Pool */ uint256 private constant POOL_EXIT_LOCKUP_EPOCHS = 12; // 12 epochs fluid address private constant POOL_ADDRESS = address(0xf929fc6eC25850ce00e457c4F28cDE88A94415D8); address private constant CONTRACTION_POOL_ADDRESS = address(0x170cec2070399B85363b788Af2FB059DB8Ef8aeD); uint256 private constant CONTRACTION_POOL_TARGET_SUPPLY = 10e16; // target 10% of the supply in the CPool uint256 private constant CONTRACTION_POOL_TARGET_REWARD = 29e13; // 0.029% per epoch ~ 250% APY with 10% of supply in the CPool /* Regulator */ uint256 private constant SUPPLY_CHANGE_LIMIT = 2e16; // 2% uint256 private constant SUPPLY_CHANGE_DIVISOR = 25e18; // 25 > Max expansion at 1.5 uint256 private constant ORACLE_POOL_RATIO = 35; // 35% uint256 private constant TREASURY_RATIO = 3; // 3% /* Deployed */ address private constant DAO_ADDRESS = address(0x6Bf977ED1A09214E6209F4EA5f525261f1A2690a); address private constant DOLLAR_ADDRESS = address(0xBD2F0Cd039E0BFcf88901C98c0bFAc5ab27566e3); address private constant CONTRACTION_DOLLAR_ADDRESS = address(0xDe25486CCb4588Ce5D9fB188fb6Af72E768a466a); address private constant PAIR_ADDRESS = address(0x26d8151e631608570F3c28bec769C3AfEE0d73a3); // SushiSwap pair address private constant CONTRACTION_PAIR_ADDRESS = address(0x4a4572D92Daf14D29C3b8d001A2d965c6A2b1515); address private constant TREASURY_ADDRESS = address(0xC7DA8087b8BA11f0892f1B0BFacfD44C116B303e); /* DIP-10 */ uint256 private constant CDSD_REDEMPTION_RATIO = 50; // 50% uint256 private constant CONTRACTION_BONDING_REWARDS = 51000000000000; // ~25% APY uint256 private constant MAX_CDSD_BONDING_REWARDS = 970000000000000; // 0.097% per epoch -> 2x in 60 * 12 epochs /* DIP-17 */ uint256 private constant BASE_EARNABLE_FACTOR = 1e17; // 10% - Minimum Amount of CDSD earnable for DSD burned uint256 private constant MAX_EARNABLE_FACTOR = 5e18; // 500% - Maximum Amount of CDSD earnable for DSD burned /** * Getters */ function getUsdcAddress() internal pure returns (address) { return USDC; } function getOracleReserveMinimum() internal pure returns (uint256) { return ORACLE_RESERVE_MINIMUM; } function getContractionOracleReserveMinimum() internal pure returns (uint256) { return CONTRACTION_ORACLE_RESERVE_MINIMUM; } function getEpochStrategy() internal pure returns (EpochStrategy memory) { return EpochStrategy({ offset: EPOCH_OFFSET, start: EPOCH_START, period: 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 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 getAdvanceIncentivePremium() internal pure returns (Decimal.D256 memory) { return Decimal.D256({ value: ADVANCE_INCENTIVE_PREMIUM }); } function getDAOExitLockupEpochs() internal pure returns (uint256) { return DAO_EXIT_LOCKUP_EPOCHS; } function getPoolExitLockupEpochs() internal pure returns (uint256) { return POOL_EXIT_LOCKUP_EPOCHS; } function getPoolAddress() internal pure returns (address) { return POOL_ADDRESS; } function getContractionPoolAddress() internal pure returns (address) { return CONTRACTION_POOL_ADDRESS; } function getContractionPoolTargetSupply() internal pure returns (Decimal.D256 memory) { return Decimal.D256({value: CONTRACTION_POOL_TARGET_SUPPLY}); } function getContractionPoolTargetReward() internal pure returns (Decimal.D256 memory) { return Decimal.D256({value: CONTRACTION_POOL_TARGET_REWARD}); } function getSupplyChangeLimit() internal pure returns (Decimal.D256 memory) { return Decimal.D256({ value: SUPPLY_CHANGE_LIMIT }); } function getSupplyChangeDivisor() internal pure returns (Decimal.D256 memory) { return Decimal.D256({ value: SUPPLY_CHANGE_DIVISOR }); } 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 getDaoAddress() internal pure returns (address) { return DAO_ADDRESS; } function getDollarAddress() internal pure returns (address) { return DOLLAR_ADDRESS; } function getContractionDollarAddress() internal pure returns (address) { return CONTRACTION_DOLLAR_ADDRESS; } function getPairAddress() internal pure returns (address) { return PAIR_ADDRESS; } function getContractionPairAddress() internal pure returns (address) { return CONTRACTION_PAIR_ADDRESS; } function getTreasuryAddress() internal pure returns (address) { return TREASURY_ADDRESS; } function getCDSDRedemptionRatio() internal pure returns (uint256) { return CDSD_REDEMPTION_RATIO; } function getContractionBondingRewards() internal pure returns (Decimal.D256 memory) { return Decimal.D256({value: CONTRACTION_BONDING_REWARDS}); } function maxCDSDBondingRewards() internal pure returns (Decimal.D256 memory) { return Decimal.D256({value: MAX_CDSD_BONDING_REWARDS}); } function getBaseEarnableFactor() internal pure returns (Decimal.D256 memory) { return Decimal.D256({value: BASE_EARNABLE_FACTOR}); } function getMaxEarnableFactor() internal pure returns (Decimal.D256 memory) { return Decimal.D256({value: MAX_EARNABLE_FACTOR}); } } /* Copyright 2020 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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 "Dynamic Set Dollar Stake"; } function symbol() public view returns (string memory) { return "DSDS"; } 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; } /* DIP-17 */ function contractionOracle() public view returns (IOracle) { return _state17.CDSDOracle; } /* DIP-17 */ function pool() public view returns (address) { return Constants.getPoolAddress(); } function cpool() public view returns (address) { return Constants.getContractionPoolAddress(); } 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 totalCouponUnderlying() public view returns (uint256) { return _state13.couponUnderlying; } function totalCoupons() public view returns (uint256) { return _state.balance.coupons; } function treasury() public view returns (address) { return Constants.getTreasuryAddress(); } // DIP-10 function totalCDSDBonded() public view returns (uint256) { return cdsd().balanceOf(address(this)); } function globalInterestMultiplier() public view returns (uint256) { return _state10.globalInterestMultiplier; } function expansionStartEpoch() public view returns (uint256) { return _state10.expansionStartEpoch; } function totalCDSD() public view returns (uint256) { return cdsd().totalSupply(); } function cdsd() public view returns (IDollar) { return IDollar(Constants.getContractionDollarAddress()); } // end DIP-10 function getPrice() public view returns (Decimal.D256 memory price) { return _state13.price; } /* DIP-17 */ function getCDSDPrice() public view returns (Decimal.D256 memory CDSDPrice) { return _state17.CDSDPrice; } function getEarnableFactor() internal returns (Decimal.D256 memory earnableFactor) { Decimal.D256 memory deltaToPeg = Decimal.one().sub(getPrice()); //Difference of DSD to peg Decimal.D256 memory pricePercentageCDSD = getCDSDPrice().div(getPrice()); // CDSD price percantage of DSD price Decimal.D256 memory earnableFactor = deltaToPeg.div(pricePercentageCDSD); if (earnableFactor.lessThan(Constants.getBaseEarnableFactor())) { //Earnable at least 10% earnableFactor = Constants.getBaseEarnableFactor(); } if (earnableFactor.greaterThan(Constants.getMaxEarnableFactor())) { //Earnable at most 500% earnableFactor = Constants.getMaxEarnableFactor(); } return earnableFactor; } /* End DIP-17 */ /** * Account */ function balanceOfStaged(address account) public view returns (uint256) { return _state.accounts[account].staged; } function balanceOfBonded(address account) public view returns (uint256) { uint256 totalSupplyAmount = totalSupply(); if (totalSupplyAmount == 0) { return 0; } return totalBonded().mul(balanceOf(account)).div(totalSupplyAmount); } function balanceOfCoupons(address account, uint256 epoch) public view returns (uint256) { if (outstandingCoupons(epoch) == 0) { return 0; } return _state.accounts[account].coupons[epoch]; } function balanceOfCouponUnderlying(address account, uint256 epoch) public view returns (uint256) { uint256 underlying = _state13.couponUnderlyingByAccount[account][epoch]; // DIP-13 migration if (underlying == 0 && outstandingCoupons(epoch) == 0) { return _state.accounts[account].coupons[epoch].div(2); } return underlying; } 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]; } // DIP-10 function balanceOfCDSDBonded(address account) public view returns (uint256) { uint256 entry = interestMultiplierEntryByAccount(account); if (entry == 0) { return 0; } uint256 amount = depositedCDSDByAccount(account).mul(_state10.globalInterestMultiplier).div(entry); uint256 cappedAmount = cDSDBondedCap(account); return amount > cappedAmount ? cappedAmount : amount; } function cDSDBondedCap(address account) public view returns (uint256) { return depositedCDSDByAccount(account).add(earnableCDSDByAccount(account)).sub(earnedCDSDByAccount(account)); } function depositedCDSDByAccount(address account) public view returns (uint256) { return _state10.accounts[account].depositedCDSD; } function interestMultiplierEntryByAccount(address account) public view returns (uint256) { return _state10.accounts[account].interestMultiplierEntry; } function earnableCDSDByAccount(address account) public view returns (uint256) { return _state10.accounts[account].earnableCDSD; } function earnedCDSDByAccount(address account) public view returns (uint256) { return _state10.accounts[account].earnedCDSD; } function redeemedCDSDByAccount(address account) public view returns (uint256) { return _state10.accounts[account].redeemedCDSD; } function getRedeemedThisExpansion(address account) public view returns (uint256) { uint256 currentExpansion = _state10.expansionStartEpoch; uint256 accountExpansion = _state10.accounts[account].lastRedeemedExpansionStart; if (currentExpansion != accountExpansion) { return 0; } else { return _state10.accounts[account].redeemedThisExpansion; } } function getCurrentRedeemableCDSDByAccount(address account) public view returns (uint256) { uint256 total = totalCDSDBonded(); if (total == 0) { return 0; } return totalCDSDRedeemable().mul(balanceOfCDSDBonded(account)).div(total).sub(getRedeemedThisExpansion(account)); } function totalCDSDDeposited() public view returns (uint256) { return _state10.totalCDSDDeposited; } function totalCDSDEarnable() public view returns (uint256) { return _state10.totalCDSDEarnable; } function totalCDSDEarned() public view returns (uint256) { return _state10.totalCDSDEarned; } function totalCDSDRedeemed() public view returns (uint256) { return _state10.totalCDSDRedeemed; } function totalCDSDRedeemable() public view returns (uint256) { return _state10.totalCDSDRedeemable; } function maxCDSDOutstanding() public view returns (uint256) { return totalCDSDDeposited().add(totalCDSDEarnable()).sub(totalCDSDEarned()); } // end DIP-10 /** * Epoch */ function epoch() public view returns (uint256) { return _state.epoch.current; } function epochTime() public view returns (uint256) { Constants.EpochStrategy memory current = Constants.getEpochStrategy(); 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 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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 setDebtToZero() internal { _state.balance.debt = 0; } 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); } // DIP-10 function setGlobalInterestMultiplier(uint256 multiplier) internal { _state10.globalInterestMultiplier = multiplier; } function setExpansionStartEpoch(uint256 epoch) internal { _state10.expansionStartEpoch = epoch; } function incrementTotalCDSDRedeemable(uint256 amount) internal { _state10.totalCDSDRedeemable = _state10.totalCDSDRedeemable.add(amount); } function decrementTotalCDSDRedeemable(uint256 amount, string memory reason) internal { _state10.totalCDSDRedeemable = _state10.totalCDSDRedeemable.sub(amount, reason); } function incrementTotalCDSDRedeemed(uint256 amount) internal { _state10.totalCDSDRedeemed = _state10.totalCDSDRedeemed.add(amount); } function decrementTotalCDSDRedeemed(uint256 amount, string memory reason) internal { _state10.totalCDSDRedeemed = _state10.totalCDSDRedeemed.sub(amount, reason); } function clearCDSDRedeemable() internal { _state10.totalCDSDRedeemable = 0; _state10.totalCDSDRedeemed = 0; } function incrementTotalCDSDDeposited(uint256 amount) internal { _state10.totalCDSDDeposited = _state10.totalCDSDDeposited.add(amount); } function decrementTotalCDSDDeposited(uint256 amount, string memory reason) internal { _state10.totalCDSDDeposited = _state10.totalCDSDDeposited.sub(amount, reason); } function incrementTotalCDSDEarnable(uint256 amount) internal { _state10.totalCDSDEarnable = _state10.totalCDSDEarnable.add(amount); } function decrementTotalCDSDEarnable(uint256 amount, string memory reason) internal { _state10.totalCDSDEarnable = _state10.totalCDSDEarnable.sub(amount, reason); } function incrementTotalCDSDEarned(uint256 amount) internal { _state10.totalCDSDEarned = _state10.totalCDSDEarned.add(amount); } function decrementTotalCDSDEarned(uint256 amount, string memory reason) internal { _state10.totalCDSDEarned = _state10.totalCDSDEarned.sub(amount, reason); } // end DIP-10 /** * 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 incrementBalanceOfCouponUnderlying( address account, uint256 epoch, uint256 amount ) internal { _state13.couponUnderlyingByAccount[account][epoch] = _state13.couponUnderlyingByAccount[account][epoch].add( amount ); _state13.couponUnderlying = _state13.couponUnderlying.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 decrementBalanceOfCouponUnderlying( address account, uint256 epoch, uint256 amount, string memory reason ) internal { _state13.couponUnderlyingByAccount[account][epoch] = _state13.couponUnderlyingByAccount[account][epoch].sub( amount, reason ); _state13.couponUnderlying = _state13.couponUnderlying.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 ); } // DIP-10 function incrementBalanceOfDepositedCDSD(address account, uint256 amount) internal { _state10.accounts[account].depositedCDSD = _state10.accounts[account].depositedCDSD.add(amount); } function decrementBalanceOfDepositedCDSD(address account, uint256 amount, string memory reason) internal { _state10.accounts[account].depositedCDSD = _state10.accounts[account].depositedCDSD.sub(amount, reason); } function incrementBalanceOfEarnableCDSD(address account, uint256 amount) internal { _state10.accounts[account].earnableCDSD = _state10.accounts[account].earnableCDSD.add(amount); } function decrementBalanceOfEarnableCDSD(address account, uint256 amount, string memory reason) internal { _state10.accounts[account].earnableCDSD = _state10.accounts[account].earnableCDSD.sub(amount, reason); } function incrementBalanceOfEarnedCDSD(address account, uint256 amount) internal { _state10.accounts[account].earnedCDSD = _state10.accounts[account].earnedCDSD.add(amount); } function decrementBalanceOfEarnedCDSD(address account, uint256 amount, string memory reason) internal { _state10.accounts[account].earnedCDSD = _state10.accounts[account].earnedCDSD.sub(amount, reason); } function incrementBalanceOfRedeemedCDSD(address account, uint256 amount) internal { _state10.accounts[account].redeemedCDSD = _state10.accounts[account].redeemedCDSD.add(amount); } function decrementBalanceOfRedeemedCDSD(address account, uint256 amount, string memory reason) internal { _state10.accounts[account].redeemedCDSD = _state10.accounts[account].redeemedCDSD.sub(amount, reason); } function addRedeemedThisExpansion(address account, uint256 amount) internal returns (uint256) { uint256 currentExpansion = _state10.expansionStartEpoch; uint256 accountExpansion = _state10.accounts[account].lastRedeemedExpansionStart; if (currentExpansion != accountExpansion) { _state10.accounts[account].redeemedThisExpansion = amount; _state10.accounts[account].lastRedeemedExpansionStart = currentExpansion; }else{ _state10.accounts[account].redeemedThisExpansion = _state10.accounts[account].redeemedThisExpansion.add(amount); } } function setCurrentInterestMultiplier(address account) internal returns (uint256) { _state10.accounts[account].interestMultiplierEntry = _state10.globalInterestMultiplier; } function setDepositedCDSDAmount(address account, uint256 amount) internal returns (uint256) { _state10.accounts[account].depositedCDSD = amount; } // end DIP-10 /** * 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); } /** * 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 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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 setPrices(Decimal.D256 memory price, Decimal.D256 memory CDSDPrice) internal { _state13.price = price; _state17.CDSDPrice = CDSDPrice; // track expansion cycles if (price.greaterThan(Decimal.one())) { if (_state10.expansionStartEpoch == 0) { _state10.expansionStartEpoch = epoch(); } } else { _state10.expansionStartEpoch = 0; } } function mintToAccount(address account, uint256 amount) internal { dollar().mint(account, amount); balanceCheck(); } function burnFromAccount(address account, uint256 amount) internal { dollar().transferFrom(account, address(this), amount); dollar().burn(amount); balanceCheck(); } function burnRedeemable(uint256 amount) internal { dollar().burn(amount); decrementTotalRedeemable(amount, "Comptroller: not enough redeemable balance"); balanceCheck(); } function contractionIncentives(Decimal.D256 memory price) internal returns (uint256) { // clear outstanding redeemables uint256 redeemable = totalCDSDRedeemable(); if (redeemable != 0) { clearCDSDRedeemable(); } // accrue interest on CDSD uint256 currentMultiplier = globalInterestMultiplier(); Decimal.D256 memory interest = Constants.maxCDSDBondingRewards(); uint256 newMultiplier = Decimal.D256({ value: currentMultiplier }).mul(Decimal.one().add(interest)).value; setGlobalInterestMultiplier(newMultiplier); // payout CPool rewards Decimal.D256 memory cPoolReward = Decimal.D256({ value: cdsd().totalSupply() }).mul(Constants.getContractionPoolTargetSupply()).mul( Constants.getContractionPoolTargetReward() ); cdsd().mint(Constants.getContractionPoolAddress(), cPoolReward.value); // DSD bonded in the DAO receives a fixed APY uint256 daoBondingRewards; if (totalBonded() != 0) { daoBondingRewards = Decimal.D256(totalBonded()).mul(Constants.getContractionBondingRewards()).value; mintToDAO(daoBondingRewards); } balanceCheck(); return daoBondingRewards; } 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(100); mintToTreasury(treasuryReward); // cDSD redemption logic uint256 newCDSDRedeemable = 0; uint256 outstanding = maxCDSDOutstanding(); uint256 redeemable = totalCDSDRedeemable().sub(totalCDSDRedeemed()); if (redeemable < outstanding) { uint256 newRedeemable = newSupply.mul(Constants.getCDSDRedemptionRatio()).div(100); uint256 newRedeemableCap = outstanding.sub(redeemable); newCDSDRedeemable = newRedeemableCap > newRedeemable ? newRedeemableCap : newRedeemable; incrementTotalCDSDRedeemable(newCDSDRedeemable); } // remaining is for DAO uint256 rewards = poolReward.add(treasuryReward).add(newCDSDRedeemable); uint256 amount = newSupply > rewards ? newSupply.sub(rewards) : 0; // 2. Payout to DAO if (totalBonded() == 0) { amount = 0; } if (amount > 0) { mintToDAO(amount); } balanceCheck(); return (newCDSDRedeemable, amount.add(rewards)); } function balanceCheck() internal view { 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 mintToTreasury(uint256 amount) private { if (amount > 0) { dollar().mint(Constants.getTreasuryAddress(), amount); } } function mintToPool(uint256 amount) private { if (amount > 0) { dollar().mint(pool(), amount); } } } /* Copyright 2020 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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 CDSDMarket is Comptroller { using SafeMath for uint256; event DSDBurned(address indexed account, uint256 amount); event CDSDMinted(address indexed account, uint256 amount); event CDSDRedeemed(address indexed account, uint256 amount); event BondCDSD(address indexed account, uint256 start, uint256 amount); event UnbondCDSD(address indexed account, uint256 start, uint256 amount); function burnDSDForCDSD(uint256 amount) public { require(_state13.price.lessThan(Decimal.one()), "Market: not in contraction"); // deposit and burn DSD dollar().transferFrom(msg.sender, address(this), amount); dollar().burn(amount); balanceCheck(); // mint equivalent CDSD cdsd().mint(msg.sender, amount); // increment earnable uint256 earnable = Decimal.D256({value: amount}).mul(Getters.getEarnableFactor()).value; //DIP-17 incrementBalanceOfEarnableCDSD(msg.sender, earnable); incrementTotalCDSDEarnable(earnable); emit DSDBurned(msg.sender, amount); emit CDSDMinted(msg.sender, amount); } function migrateCouponsToCDSD(uint256 couponEpoch) public returns (uint256) { uint256 couponAmount = balanceOfCoupons(msg.sender, couponEpoch); uint256 couponUnderlyingAmount = balanceOfCouponUnderlying(msg.sender, couponEpoch); // coupons not yet migrated to DIP-13 if (couponAmount == 0 && couponUnderlyingAmount == 0 && outstandingCoupons(couponEpoch) == 0){ couponUnderlyingAmount = _state.accounts[msg.sender].coupons[couponEpoch].div(2); } // set coupon & underlying balances to 0 _state13.couponUnderlyingByAccount[msg.sender][couponEpoch] = 0; _state.accounts[msg.sender].coupons[couponEpoch] = 0; // mint CDSD uint256 totalAmount = couponAmount.add(couponUnderlyingAmount); cdsd().mint(msg.sender, totalAmount); emit CDSDMinted(msg.sender, totalAmount); return totalAmount; } function burnDSDForCDSDAndBond(uint256 amount) external { burnDSDForCDSD(amount); bondCDSD(amount); } function migrateCouponsToCDSDAndBond(uint256 couponEpoch) external { uint256 amountToBond = migrateCouponsToCDSD(couponEpoch); bondCDSD(amountToBond); } function bondCDSD(uint256 amount) public { require(amount > 0, "Market: bound must be greater than 0"); // update earned amount (uint256 userBonded, uint256 userDeposited,) = updateUserEarned(msg.sender); // deposit CDSD amount cdsd().transferFrom(msg.sender, address(this), amount); uint256 totalAmount = userBonded.add(amount); setDepositedCDSDAmount(msg.sender, totalAmount); decrementTotalCDSDDeposited(userDeposited, "Market: insufficient total deposited"); incrementTotalCDSDDeposited(totalAmount); emit BondCDSD(msg.sender, epoch().add(1), amount); } function unbondCDSD(uint256 amount) external { // we cannot allow for CDSD unbonds during expansions, to enforce the pro-rata redemptions require(_state13.price.lessThan(Decimal.one()), "Market: not in contraction"); _unbondCDSD(amount); // withdraw CDSD cdsd().transfer(msg.sender, amount); emit UnbondCDSD(msg.sender, epoch().add(1), amount); } function _unbondCDSD(uint256 amount) internal { // update earned amount (uint256 userBonded, uint256 userDeposited,) = updateUserEarned(msg.sender); require(amount > 0 && userBonded > 0, "Market: amounts > 0!"); require(amount <= userBonded, "Market: insufficient amount to unbound"); // update deposited amount uint256 userTotalAmount = userBonded.sub(amount); setDepositedCDSDAmount(msg.sender, userTotalAmount); decrementTotalCDSDDeposited(userDeposited, "Market: insufficient deposited"); incrementTotalCDSDDeposited(userTotalAmount); } function redeemBondedCDSDForDSD(uint256 amount) external { require(_state13.price.greaterThan(Decimal.one()), "Market: not in expansion"); require(amount > 0, "Market: amounts > 0!"); // check if user is allowed to redeem this amount require(amount <= getCurrentRedeemableCDSDByAccount(msg.sender), "Market: not enough redeemable"); // unbond redeemed amount _unbondCDSD(amount); // burn CDSD cdsd().burn(amount); // mint DSD mintToAccount(msg.sender, amount); addRedeemedThisExpansion(msg.sender, amount); incrementTotalCDSDRedeemed(amount); emit CDSDRedeemed(msg.sender, amount); } function updateUserEarned(address account) internal returns (uint256 userBonded, uint256 userDeposited, uint256 userEarned) { userBonded = balanceOfCDSDBonded(account); userDeposited = depositedCDSDByAccount(account); userEarned = userBonded.sub(userDeposited); if (userEarned > 0) { incrementBalanceOfEarnedCDSD(account, userEarned); // mint acrued interest interest to DAO cdsd().mint(address(this), userEarned); incrementTotalCDSDEarned(userEarned); } // update multiplier entry setCurrentInterestMultiplier(account); } } /* Copyright 2020 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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 newBonded); event ContractionIncentives(uint256 indexed epoch, uint256 price, uint256 delta); event SupplyNeutral(uint256 indexed epoch); function step() internal { (Decimal.D256 memory price, Decimal.D256 memory CDSDPrice) = oracleCapture(); setPrices(price, CDSDPrice); if (price.greaterThan(Decimal.one())) { expansion(price); return; } if (price.lessThan(Decimal.one())) { contraction(price); return; } emit SupplyNeutral(epoch()); } function expansion(Decimal.D256 memory price) private { Decimal.D256 memory delta = limit(price.sub(Decimal.one()).div(Constants.getSupplyChangeDivisor()), price); uint256 newSupply = delta.mul(dollar().totalSupply()).asUint256(); (uint256 newRedeemable, uint256 newBonded) = increaseSupply(newSupply); emit SupplyIncrease(epoch(), price.value, newRedeemable, newBonded); } function contraction(Decimal.D256 memory price) private { (uint256 newDSDSupply) = contractionIncentives(price); emit ContractionIncentives(epoch(), price.value, newDSDSupply); } function limit(Decimal.D256 memory delta, Decimal.D256 memory price) private view returns (Decimal.D256 memory) { Decimal.D256 memory supplyChangeLimit = Constants.getSupplyChangeLimit(); return delta.greaterThan(supplyChangeLimit) ? supplyChangeLimit : delta; } function oracleCapture() private returns (Decimal.D256 memory, Decimal.D256 memory) { (Decimal.D256 memory price, bool valid) = oracle().capture(); if (bootstrappingAt(epoch().sub(1))) { price = Constants.getBootstrappingPrice(); } if (!valid) { price = Decimal.one(); } (Decimal.D256 memory CDSDPrice, bool contractionValid) = contractionOracle().capture(); if (!contractionValid) { CDSDPrice = price; } return (price, CDSDPrice); } } /* Copyright 2020 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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 { 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 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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( Decimal.ratio(votesFor(candidate), totalBondedAt(endsAfter)).greaterThan(Constants.getGovernanceQuorum()), FILE, "Must have quorum" ); 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()); } } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ contract Context { // Empty internal constructor, to prevent people from mistakenly deploying // an instance of this contract, which should be used via inheritance. constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20Mintable}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ contract ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for `sender`'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */ function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Destroys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See {_burn} and {_approve}. */ function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance")); } } /** * @dev Extension of {ERC20} that allows token holders to destroy both their own * tokens and those that they have an allowance for, in a way that can be * recognized off-chain (via event analysis). */ contract ERC20Burnable is Context, ERC20 { /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public { _burn(_msgSender(), amount); } /** * @dev See {ERC20-_burnFrom}. */ function burnFrom(address account, uint256 amount) public { _burnFrom(account, amount); } } /** * @dev Optional functions from the ERC20 standard. */ contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction. */ constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view returns (uint8) { return _decimals; } } /* Copyright 2019 ZeroEx Intl. 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 LibEIP712 { // Hash of the EIP712 Domain Separator Schema // keccak256(abi.encodePacked( // "EIP712Domain(", // "string name,", // "string version,", // "uint256 chainId,", // "address verifyingContract", // ")" // )) bytes32 constant internal _EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH = 0x8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f; /// @dev Calculates a EIP712 domain separator. /// @param name The EIP712 domain name. /// @param version The EIP712 domain version. /// @param verifyingContract The EIP712 verifying contract. /// @return EIP712 domain separator. function hashEIP712Domain( string memory name, string memory version, uint256 chainId, address verifyingContract ) internal pure returns (bytes32 result) { bytes32 schemaHash = _EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH; // Assembly for more efficient computing: // keccak256(abi.encodePacked( // _EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH, // keccak256(bytes(name)), // keccak256(bytes(version)), // chainId, // uint256(verifyingContract) // )) assembly { // Calculate hashes of dynamic data let nameHash := keccak256(add(name, 32), mload(name)) let versionHash := keccak256(add(version, 32), mload(version)) // Load free memory pointer let memPtr := mload(64) // Store params in memory mstore(memPtr, schemaHash) mstore(add(memPtr, 32), nameHash) mstore(add(memPtr, 64), versionHash) mstore(add(memPtr, 96), chainId) mstore(add(memPtr, 128), verifyingContract) // Compute hash result := keccak256(memPtr, 160) } return result; } /// @dev Calculates EIP712 encoding for a hash struct with a given domain hash. /// @param eip712DomainHash Hash of the domain domain separator data, computed /// with getDomainHash(). /// @param hashStruct The EIP712 hash struct. /// @return EIP712 hash applied to the given EIP712 Domain. function hashEIP712Message(bytes32 eip712DomainHash, bytes32 hashStruct) internal pure returns (bytes32 result) { // Assembly for more efficient computing: // keccak256(abi.encodePacked( // EIP191_HEADER, // EIP712_DOMAIN_HASH, // hashStruct // )); assembly { // Load free memory pointer let memPtr := mload(64) mstore(memPtr, 0x1901000000000000000000000000000000000000000000000000000000000000) // EIP191 header mstore(add(memPtr, 2), eip712DomainHash) // EIP712 domain hash mstore(add(memPtr, 34), hashStruct) // Hash of struct // Compute hash result := keccak256(memPtr, 66) } return result; } } /* Copyright 2020 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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 Permittable is ERC20Detailed, ERC20 { bytes32 constant FILE = "Permittable"; // keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); bytes32 public constant EIP712_PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9; string private constant EIP712_VERSION = "1"; bytes32 public EIP712_DOMAIN_SEPARATOR; mapping(address => uint256) nonces; constructor() public { EIP712_DOMAIN_SEPARATOR = LibEIP712.hashEIP712Domain(name(), EIP712_VERSION, Constants.getChainId(), address(this)); } function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external { bytes32 digest = LibEIP712.hashEIP712Message( EIP712_DOMAIN_SEPARATOR, keccak256(abi.encode( EIP712_PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline )) ); address recovered = ecrecover(digest, v, r, s); Require.that( recovered == owner, FILE, "Invalid signature" ); Require.that( recovered != address(0), FILE, "Zero address" ); Require.that( now <= deadline, FILE, "Expired" ); _approve(owner, spender, value); } } /* Copyright 2020 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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 ContractionDollar is IDollar, ERC20Detailed, Permittable, ERC20Burnable { constructor() public ERC20Detailed("Contraction Dynamic Set Dollar", "CDSD", 18) Permittable() {} function mint(address account, uint256 amount) public returns (bool) { require(_msgSender() == Constants.getDaoAddress(), "CDSD: only DAO is allowed to mint"); _mint(account, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public returns (bool) { _transfer(sender, recipient, amount); if ( _msgSender() != Constants.getDaoAddress() && // always allow DAO allowance(sender, _msgSender()) != uint256(-1) ) { _approve( sender, _msgSender(), allowance(sender, _msgSender()).sub(amount, "CDSD: transfer amount exceeds allowance") ); } return true; } } interface AggregatorV3Interface { function decimals() external view returns (uint8); function description() external view returns (string memory); function version() external view returns (uint256); // getRoundData and latestRoundData should both raise "No data present" // if they do not have data to report, instead of returning unset values // which could be misinterpreted as actual reported values. function getRoundData(uint80 _roundId) external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); function latestRoundData() external view returns ( uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound ); } /* Copyright 2020 Dynamic Dollar Devs, based on the works of the Empty Set Squad 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, CDSDMarket, 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 { // committer reward: mintToAccount(msg.sender, 1000e18); // 1000 DSD to committer // Intitialize DIP-17 _state17.CDSDPrice = _state13.price.div(Decimal.D256({ value: 2e18 })); // safe to assume price is roughly half of DSD before oracle kicks in? _state17.CDSDOracle = IOracle(0x40139E3bBdf8cAcc69F1aC1eEf07DBa9b9165CE8); // // set up oracle _state17.CDSDOracle.setup(); _state17.CDSDOracle.capture(); // contributor rewards: mintToAccount(0x8A7D5fe563BbBcbB776bDD0eA8c31b93200A0D01, 20000e18); // contribution to freerangealpha + depolyment cost mintToAccount(0x437cb43D08F64AF2aA64AD2525FE1074E282EC19, 5220e18); // contribution to gus } function advance() external incentivized { Bonding.step(); Regulator.step(); emit Advance(epoch(), block.number, block.timestamp); } modifier incentivized { // run incentivisation after advancing, so we use the updated price uint256 startGas = gasleft(); _; // fetch gasPrice & ETH price from Chainlink (, int256 ethPrice, , , ) = AggregatorV3Interface(0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419).latestRoundData(); (, int256 fastGasPrice, , , ) = AggregatorV3Interface(0x169E633A2D1E6c10dD91238Ba11c4A708dfEF37C).latestRoundData(); // Calculate DSD cost Decimal.D256 memory ethSpent = Decimal.D256({ value: (startGas - gasleft() + 41000).mul(uint256(fastGasPrice)) // approximate used gas for tx }); Decimal.D256 memory usdCost = ethSpent.mul( Decimal.D256({ value: uint256(ethPrice).mul(1e10) // chainlink ETH price has 8 decimals }) ); Decimal.D256 memory dsdCost = usdCost.div(getPrice()); // Add incentive Decimal.D256 memory incentive = dsdCost.mul(Constants.getAdvanceIncentivePremium()); // Mint advance reward to sender mintToAccount(msg.sender, incentive.value); emit Incentivization(msg.sender, incentive.value); } }
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":false,"internalType":"uint256","name":"start","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BondCDSD","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CDSDMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"CDSDRedeemed","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":"uint256","name":"epoch","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"delta","type":"uint256"}],"name":"ContractionIncentives","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DSDBurned","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":"newRedeemable","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":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"start","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"UnbondCDSD","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":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"}],"name":"balanceOfCDSDBonded","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":"balanceOfCouponUnderlying","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":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"bondCDSD","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":"uint256","name":"amount","type":"uint256"}],"name":"burnDSDForCDSD","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnDSDForCDSDAndBond","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"cDSDBondedCap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"cdsd","outputs":[{"internalType":"contract IDollar","name":"","type":"address"}],"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":[],"name":"contractionOracle","outputs":[{"internalType":"contract IOracle","name":"","type":"address"}],"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":"cpool","outputs":[{"internalType":"address","name":"","type":"address"}],"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":[{"internalType":"address","name":"account","type":"address"}],"name":"depositedCDSDByAccount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dollar","outputs":[{"internalType":"contract IDollar","name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earnableCDSDByAccount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"earnedCDSDByAccount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":[],"name":"expansionStartEpoch","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":"getCDSDPrice","outputs":[{"components":[{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct Decimal.D256","name":"CDSDPrice","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getCurrentRedeemableCDSDByAccount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getPrice","outputs":[{"components":[{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct Decimal.D256","name":"price","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getRedeemedThisExpansion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"globalInterestMultiplier","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":"account","type":"address"}],"name":"interestMultiplierEntryByAccount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","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":"maxCDSDOutstanding","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"couponEpoch","type":"uint256"}],"name":"migrateCouponsToCDSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"internalType":"uint256","name":"couponEpoch","type":"uint256"}],"name":"migrateCouponsToCDSDAndBond","outputs":[],"payable":false,"stateMutability":"nonpayable","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":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":"amount","type":"uint256"}],"name":"redeemBondedCDSDForDSD","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"redeemedCDSDByAccount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","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":"totalCDSD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalCDSDBonded","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalCDSDDeposited","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalCDSDEarnable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalCDSDEarned","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalCDSDRedeemable","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalCDSDRedeemed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalCouponUnderlying","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":"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":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"payable":false,"stateMutability":"view","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":"amount","type":"uint256"}],"name":"unbondCDSD","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
608060405234801561001057600080fd5b50614ce7806100206000396000f3fe608060405234801561001057600080fd5b50600436106104b75760003560e01c80637dc0d1d011610278578063b6b55f251161015c578063deeb4d26116100ce578063ea105ac711610092578063ea105ac714610994578063f1b7cf491461099c578063f4dd7cc2146109af578063f7d36943146109c2578063fc7b9c18146109d5578063ffbe3b73146109dd576104b7565b8063deeb4d261461094b578063df9a2b1c14610953578063e6036e2d14610966578063e8dd75c514610979578063e9505dbf1461098c576104b7565b8063bd4aeb1c11610120578063bd4aeb1c146108f4578063c9aff70c146108fc578063cf0237791461090f578063d60b347f14610917578063dd62ed3e1461092a578063dd72c79414610938576104b7565b8063b6b55f25146108a0578063b6c8478e146108b3578063baee3b68146108bb578063bc7513e2146108ce578063bceb514d146108e1576104b7565b806397a5d5b5116101f55780639f6e1b26116101b95780639f6e1b2614610857578063a50cd8e71461086a578063a577b7f81461087d578063a9059cbb146104da578063b0c7439a14610885578063b1248dbe14610898576104b7565b806397a5d5b51461080157806398d5fdca146108145780639940686e146108295780639a649edc1461083c5780639bc289f114610844576104b7565b80638c63e1021161023c5780638c63e102146107ce5780638c960f71146107d6578063900cf0cf146107e9578063930c5ca3146107f157806395d89b41146107f9576104b7565b80637dc0d1d0146107905780638129fc1c14610798578063825ad607146107a057806384ddb875146107b357806386cf9f14146107bb576104b7565b80634303d4f71161039f5780635b9617531161031c57806364668022116102e057806364668022146107295780636a39e3281461073c5780636c0127eb1461074f57806370a0823114610762578063758b47b11461077557806375d5024b1461077d576104b7565b80635b961753146106eb5780635c60da1b146106fe5780635fec2cdf1461070657806360d25aa71461071957806361d027b314610721576104b7565b80635053e461116103635780635053e4611461069557806351adeb571461069d57806351bf21d8146106b257806357f3c7dd146106c557806359006f8c146106d8576104b7565b80634303d4f71461065757806344d96e951461065f57806347c05069146106675780634ad3e6481461067a5780634c73609914610682576104b7565b80631edbcf6c11610438578063353a420c116103fc578063353a420c146105d857806335caba23146105eb578063369e8c1d146105fe5780633a3e6c81146106115780633bc2258b146106245780633fbba9a614610637576104b7565b80631edbcf6c1461058057806323b872dd1461058857806327de9e321461059b5780632e1a7d4d146105b0578063313ce567146105c3576104b7565b806310e95b6c1161047f57806310e95b6c146105355780631305967c1461054857806315e14bf61461055057806316f0115b1461056357806318160ddd14610578576104b7565b806306fdde03146104bc578063095ea7b3146104da5780630a8285b8146104fa5780630c2abae01461050f5780630d78ceb414610522575b600080fd5b6104c46109f0565b6040516104d19190614a2e565b60405180910390f35b6104ed6104e83660046144e6565b610a27565b6040516104d191906149f6565b610502610a30565b6040516104d19190614add565b61050261051d366004614411565b610a6d565b6105026105303660046144e6565b610ace565b610502610543366004614564565b610b53565b610502610b68565b61050261055e366004614411565b610b6e565b61056b610b8c565b6040516104d19190614997565b610502610b96565b610502610b9c565b6104ed610596366004614469565b610ba2565b6105ae6105a9366004614564565b610bab565b005b6105ae6105be366004614564565b610cdd565b6105cb610e15565b6040516104d19190614b14565b6105026105e6366004614411565b610e1a565b6105026105f9366004614411565b610e38565b6105ae61060c366004614411565b610e94565b6104ed61061f366004614411565b610fd6565b610502610632366004614411565b610ff3565b61064a61064536600461442f565b611011565b6040516104d19190614a12565b610502611044565b61050261104a565b6105ae610675366004614411565b611050565b610502611143565b6105026106903660046145a0565b611149565b610502611179565b6106a561119c565b6040516104d19190614a04565b6105026106c0366004614411565b6111ab565b6105ae6106d3366004614564565b6111c9565b6105026106e6366004614411565b61132d565b6105026106f9366004614411565b61134b565b61056b61136e565b6105ae610714366004614564565b611393565b6105026114e4565b61056b6114ea565b610502610737366004614411565b6114f4565b61050261074a366004614564565b611512565b61050261075d366004614411565b611527565b610502610770366004614411565b611542565b6106a5611560565b6104ed61078b366004614564565b61156a565b6106a561157d565b6105ae61158c565b6105026107ae366004614411565b611771565b6105026117a5565b6105026107c9366004614411565b6117ab565b6105026117c6565b6105ae6107e4366004614564565b611840565b610502611855565b61050261185b565b6104c46118a8565b61064a61080f366004614411565b6118c6565b61081c611933565b6040516104d19190614acf565b6105ae610837366004614564565b61194f565b610502611a1d565b610502610852366004614411565b611a23565b61050261086536600461442f565b611a41565b610502610878366004614411565b611a70565b61081c611a87565b610502610893366004614411565b611aa3565b610502611afb565b6105ae6108ae366004614564565b611b01565b61056b611bce565b6105026108c9366004614411565b611bd8565b6105026108dc3660046144e6565b611bf6565b6105ae6108ef3660046144b6565b611c3a565b6106a5611ee0565b61050261090a366004614564565b611eef565b610502611f04565b6104ed610925366004614411565b611f0a565b6105026104e836600461442f565b610502610946366004614564565b611f2b565b6105026120b6565b6105ae610961366004614564565b6120bc565b610502610974366004614411565b61217a565b6105ae610987366004614564565b612198565b6105026121b2565b6105ae6121b8565b6105026109aa366004614411565b612425565b6105ae6109bd366004614564565b612440565b6105ae6109d0366004614564565b612552565b6105026127af565b6105026109eb366004614564565b6127b5565b60408051808201909152601881527f44796e616d69632053657420446f6c6c6172205374616b650000000000000000602082015290565b60005b92915050565b6000610a68610a3d6117a5565b610a5c610a48611143565b610a50611afb565b9063ffffffff6127c716565b9063ffffffff6127ec16565b905090565b600080610a7861185b565b905080610a89576000915050610ac9565b610ac5610a9584611aa3565b610a5c83610ab9610aa588610e38565b610aad6120b6565b9063ffffffff61282e16565b9063ffffffff61286816565b9150505b919050565b6001600160a01b0382166000908152600f6020908152604080832084845290915281205480158015610b065750610b0483611eef565b155b15610b4c576001600160a01b0384166000908152600c60209081526040808320868452600290810190925290912054610b449163ffffffff61286816565b915050610a2a565b9392505050565b6000908152600d602052604090206002015490565b601b5490565b6001600160a01b03166000908152600e602052604090206001015490565b6000610a686128aa565b60035490565b60065490565b60009392505050565b33610bf260025b610bbb836118c6565b6002811115610bc657fe5b1415692832b936b4b9b9b4b7b760b11b72139bdd08199c9bde995b881bdc88199b1d5a59606a1b6128c2565b610bfb33612917565b6000610c22610c0933611542565b610ab9610c1533611771565b869063ffffffff61282e16565b9050610c2e3382612941565b610c5081604051806060016040528060228152602001614c5f6022913961299d565b610c9033846040518060400160405280601d81526020017f426f6e64696e673a20696e73756666696369656e742062616c616e63650000008152506129b8565b337f93530ac0ee8c50e696e13c5ac62355d0c0ba4bd943620d5bda1eb08b64ae7512610cbf6001610a50611855565b8584604051610cd093929190614af9565b60405180910390a2505050565b33610d2560015b610ced836118c6565b6002811115610cf857fe5b1415692832b936b4b9b9b4b7b760b11b73139bdd08199c9bde995b881bdc881b1bd8dad95960621b6128c2565b610d2d61119c565b6001600160a01b031663a9059cbb33846040518363ffffffff1660e01b8152600401610d5a9291906149cd565b602060405180830381600087803b158015610d7457600080fd5b505af1158015610d88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610dac9190810190614516565b50610dd03383604051806060016040528060248152602001614c3b60249139612a63565b336001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436483604051610e099190614add565b60405180910390a25050565b601290565b6001600160a01b03166000908152600e602052604090206003015490565b600080610e4483611bd8565b905080610e55576000915050610ac9565b6000610e6d82610ab9601460010154610aad88611527565b90506000610e7a8561134b565b9050808211610e895781610e8b565b805b95945050505050565b610ec0610ea082610fd6565b6523b7bb32b93760d11b6c139bdd081b9bdb5a5b985d1959609a1b6128c2565b6000610edc6001610a5c610ed385610b6e565b610a5086612425565b9050610f0781610eea611855565b116523b7bb32b93760d11b68139bdd08195b99195960ba1b6128c2565b610f5e610f3b610f15612ac2565b610f2f610f2186611a70565b610f2a866127b5565b612ae4565b9063ffffffff612b1316565b6523b7bb32b93760d11b6f4d75737420686176652071756f72756d60801b6128c2565b610f93610f6a83610e1a565b610f73846114f4565b116523b7bb32b93760d11b6b139bdd08185c1c1c9bdd995960a21b6128c2565b610f9c82612b29565b6040516001600160a01b0383169033907f815ca4497ab9fc80c76f210e6e842a5e198e195aa136034557eee144f790e7bb90600090a35050565b6001600160a01b03166000908152600e6020526040902054151590565b6001600160a01b031660009081526014602052604090206004015490565b6001600160a01b038082166000908152600e60209081526040808320938616835260049093019052205460ff1692915050565b60105490565b60045490565b61105c610ea082610fd6565b61109a61107261106a612c15565b610a50611855565b61107a611179565b116523b7bb32b93760d11b6b115c1bd8da081cde5b98d95960a21b6128c2565b6110ec6110bc6110a8612c1a565b610f2f6110b4856114f4565b610f2a610b96565b6523b7bb32b93760d11b7f4d7573742068617665207375706572206d616a6f7269747900000000000000006128c2565b6111016110f882610e1a565b610f73836114f4565b61110a81612b29565b6040516001600160a01b0382169033907f815ca4497ab9fc80c76f210e6e842a5e198e195aa136034557eee144f790e7bb90600090a350565b60175490565b6000828152600d6020526040812060030180548390811061116657fe5b9060005260206000200154905092915050565b6000611183614368565b61118b612c3c565b905061119681612c6b565b91505090565b6009546001600160a01b031690565b6001600160a01b03166000908152600c602052604090206004015490565b6111f06111d4612c8d565b604080516020810190915260115481529063ffffffff612b1316565b6112155760405162461bcd60e51b815260040161120c90614a5f565b60405180910390fd5b600081116112355760405162461bcd60e51b815260040161120c90614aaf565b61123e33610a6d565b81111561125d5760405162461bcd60e51b815260040161120c90614abf565b61126681612caf565b61126e611560565b6001600160a01b03166342966c68826040518263ffffffff1660e01b81526004016112999190614add565b600060405180830381600087803b1580156112b357600080fd5b505af11580156112c7573d6000803e3d6000fd5b505050506112d53382612d79565b6112df3382612e09565b506112e981612ead565b336001600160a01b03167fbfd31bbef436d4183fc969864fe0511a03b07748526aba9238d0fdb2cd5b54fd826040516113229190614add565b60405180910390a250565b6001600160a01b031660009081526014602052604090206003015490565b6000610a2a6113598361132d565b610a5c6113658561217a565b610a5086611527565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b600081116113b35760405162461bcd60e51b815260040161120c90614a3f565b6000806113bf33612ec6565b50915091506113cc611560565b6001600160a01b03166323b872dd3330866040518463ffffffff1660e01b81526004016113fb939291906149a5565b602060405180830381600087803b15801561141557600080fd5b505af1158015611429573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061144d9190810190614516565b506000611460838563ffffffff6127c716565b905061146c3382612fa5565b5061148f82604051806060016040528060248152602001614c8160249139612fc5565b61149881612fe0565b337fd22a94c050f39e5238f79a498034ba57a72a2a506305aaaac893b3368b6032ca6114c76001610a50611855565b866040516114d6929190614aeb565b60405180910390a250505050565b60155490565b6000610a68612ff9565b6001600160a01b03166000908152600e602052604090206002015490565b6000908152600d602052604090206003015490565b6001600160a01b031660009081526014602052604090205490565b6001600160a01b03166000908152600c602052604090206001015490565b6000610a68613011565b6000611574613029565b90911115919050565b600a546001600160a01b031690565b6115c561159a61092561136e565b15692832b936b4b9b9b4b7b760b11b72105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b6128c2565b6115d56115d061136e565b61302e565b6115e833683635c9adc5dea00000612d79565b6040805160208082018352671bc16d674ec8000082528251908101909252601154825261161b919063ffffffff61305516565b51601c55601d80546001600160a01b0319167340139e3bbdf8cacc69f1ac1eef07dba9b9165ce81790819055604080516302e82ee960e61b815290516001600160a01b03929092169163ba0bba409160048082019260009290919082900301818387803b15801561168b57600080fd5b505af115801561169f573d6000803e3d6000fd5b5050601d546040805163d4a3e9d760e01b815281516001600160a01b03909316945063d4a3e9d79350600480820193918290030181600087803b1580156116e557600080fd5b505af11580156116f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061171d9190810190614534565b5050611747738a7d5fe563bbbcbb776bdd0ea8c31b93200a0d0169043c33c1937564800000612d79565b61176f73437cb43d08f64af2aa64ad2525fe1074e282ec1969011afa0d674133100000612d79565b565b60008061177c610b96565b90508061178d576000915050610ac9565b610ac581610ab961179d86611542565b610aad61104a565b60185490565b6001600160a01b03166000908152600c602052604090205490565b60006117d0611560565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561180857600080fd5b505afa15801561181c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a689190810190614582565b61184981612552565b61185281611393565b50565b60025490565b6000611865611560565b6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016118909190614997565b60206040518083038186803b15801561180857600080fd5b6040805180820190915260048152634453445360e01b602082015290565b60006118d0611855565b6001600160a01b0383166000908152600c602052604090206005015411156118fa57506002610ac9565b6001600160a01b0382166000908152600c602052604090206004015461191e611855565b101561192b576001610a2a565b506000919050565b61193b614389565b506040805160208101909152601154815290565b3361195a6002610bb2565b61196333612917565b600061196d61104a565b1561198d5761198861197d61104a565b610ab9610c15610b96565b6119a5565b6119a5611998613083565b849063ffffffff61282e16565b90506119b1338261308a565b6119ba83613132565b6119dd3384604051806060016040528060248152602001614c3b60249139612a63565b337f44002fdef5a0c2d2e4e05572e9780b95aef97e0e93ffd7cc076b09fa78ff2b46611a0c6001610a50611855565b8386604051610cd093929190614af9565b60085490565b6001600160a01b03166000908152600c602052604090206005015490565b6001600160a01b039182166000908152600c602090815260408083209390941682526003909201909152205490565b6000610a2a611a7e83610e1a565b610a50846114f4565b611a8f614389565b506040805160208101909152601c54815290565b6019546001600160a01b038216600090815260146020526040812060060154909190808214611ad757600092505050610ac9565b5050506001600160a01b038116600090815260146020526040902060050154610ac9565b60165490565b611b0961119c565b6001600160a01b03166323b872dd3330846040518463ffffffff1660e01b8152600401611b38939291906149a5565b602060405180830381600087803b158015611b5257600080fd5b505af1158015611b66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611b8a9190810190614516565b50611b953382612941565b336001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c826040516113229190614add565b6000610a6861314b565b6001600160a01b031660009081526014602052604090206001015490565b6000611c0182611eef565b611c0d57506000610a2a565b506001600160a01b03919091166000908152600c6020908152604080832093835260029093019052205490565b33611c456001610ce4565b611c766000611c5333611542565b116523b7bb32b93760d11b6e4d7573742068617665207374616b6560881b6128c2565b611c7f83610fd6565b611d2257611cbf611c8f33613163565b6523b7bb32b93760d11b7f4e6f7420656e6f756768207374616b6520746f2070726f706f736500000000006128c2565b611cd083611ccb6131a7565b6131ac565b611cd8611855565b336001600160a01b0385167fd15e38a680a427478883cd2d32eb664cb6bb2090b0126a23ebaf3e3784b8c56b611d0c6131a7565b604051611d199190614add565b60405180910390a45b611d52611d31610ed385610b6e565b611d39611855565b106523b7bb32b93760d11b64115b99195960da1b6128c2565b6000611d5d33611542565b90506000611d6b3386611011565b9050806002811115611d7957fe5b846002811115611d8557fe5b1415611d92575050611edb565b6002816002811115611da057fe5b1415611de657611de685836040518060400160405280601b81526020017f476f7665726e3a20496e73756666696369656e742072656a65637400000000008152506131d8565b6001816002811115611df457fe5b1415611e3a57611e3a85836040518060400160405280601c81526020017f476f7665726e3a20496e73756666696369656e7420617070726f766500000000815250613229565b6002846002811115611e4857fe5b1415611e5857611e58858361327a565b6001846002811115611e6657fe5b1415611e7657611e7685836132c9565b611e81338686613318565b611e8b3386613362565b846001600160a01b0316336001600160a01b03167fbe50c78cbc15b0864819aadea36c6499da421b33c38e2ef19bebda583c708c788685604051611ed0929190614a20565b60405180910390a350505b505050565b601d546001600160a01b031690565b6000908152600d602052604090206001015490565b60055490565b6001600160a01b03166000908152600e602052604090206005015460ff1690565b600080611f383384611bf6565b90506000611f463385610ace565b905081158015611f54575080155b8015611f665750611f6484611eef565b155b15611f9e57336000908152600c60209081526040808320878452600290810190925290912054611f9b9163ffffffff61286816565b90505b336000818152600f602090815260408083208884528252808320839055928252600c81528282208783526002019052908120819055611fe3838363ffffffff6127c716565b9050611fed611560565b6001600160a01b03166340c10f1933836040518363ffffffff1660e01b815260040161201a9291906149cd565b602060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061206c9190810190614516565b50336001600160a01b03167fca943751d3c393325730c1c75b0309f5fc8fc8a6f69d4658782a51b7e5b52493826040516120a69190614add565b60405180910390a2949350505050565b601a5490565b336120c76002610bb2565b6120d033612917565b60006120dd61197d61104a565b90506120e93384612941565b61210b83604051806060016040528060228152602001614c5f6022913961299d565b61214b33826040518060400160405280601d81526020017f426f6e64696e673a20696e73756666696369656e742062616c616e63650000008152506129b8565b337f93530ac0ee8c50e696e13c5ac62355d0c0ba4bd943620d5bda1eb08b64ae7512611a0c6001610a50611855565b6001600160a01b031660009081526014602052604090206002015490565b60006121a382611f2b565b90506121ae81611393565b5050565b60195490565b60005a90506121c56133c2565b6121cd61340d565b6121d5611855565b7fc30b728d1c19e5db3678b8ea9e9a063a5655071e1a325c2f7fdbca48baa906004342604051612206929190614aeb565b60405180910390a26000735f4ec3df9cbd43714fe2740f5e3616155c5b84196001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561225d57600080fd5b505afa158015612271573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061229591908101906145bf565b505050915050600073169e633a2d1e6c10dd91238ba11c4a708dfef37c6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156122ea57600080fd5b505afa1580156122fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061232291908101906145bf565b505050915050612330614389565b604051806020016040528061234c845a880361a028019061282e565b90529050612358614389565b61238d604051806020016040528061237e6402540be4008861282e90919063ffffffff16565b9052839063ffffffff6134bb16565b9050612397614389565b6123af6123a2611933565b839063ffffffff61305516565b90506123b9614389565b6123d16123c46134e9565b839063ffffffff6134bb16565b90506123e1338260000151612d79565b805160405133917fbb4f656853bc420ad6e4321622c07eefb4ed40e3f91b35553ce14a6dff4c0981916124149190614add565b60405180910390a250505050505050565b6001600160a01b03166000908152600e602052604090205490565b61246761244b612c8d565b604080516020810190915260115481529063ffffffff61350b16565b6124835760405162461bcd60e51b815260040161120c90614a9f565b61248c81612caf565b612494611560565b6001600160a01b031663a9059cbb33836040518363ffffffff1660e01b81526004016124c19291906149cd565b602060405180830381600087803b1580156124db57600080fd5b505af11580156124ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506125139190810190614516565b50337f2b3ed3dc8ad3da3307af0fc7dcc4d2d92d527e58a0fc3bb9fb60ae2c42ad2ad06125436001610a50611855565b83604051611322929190614aeb565b61255d61244b612c8d565b6125795760405162461bcd60e51b815260040161120c90614a9f565b61258161119c565b6001600160a01b03166323b872dd3330846040518463ffffffff1660e01b81526004016125b0939291906149a5565b602060405180830381600087803b1580156125ca57600080fd5b505af11580156125de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506126029190810190614516565b5061260b61119c565b6001600160a01b03166342966c68826040518263ffffffff1660e01b81526004016126369190614add565b600060405180830381600087803b15801561265057600080fd5b505af1158015612664573d6000803e3d6000fd5b5050505061267061351f565b612678611560565b6001600160a01b03166340c10f1933836040518363ffffffff1660e01b81526004016126a59291906149cd565b602060405180830381600087803b1580156126bf57600080fd5b505af11580156126d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506126f79190810190614516565b50600061271f6127056135f2565b60408051602081019091528481529063ffffffff6134bb16565b51905061272c33826136b0565b612735816136ff565b336001600160a01b03167f8d101b5fb849d7ccb1a58fdfaa8ded79ad9b5d5efe142099d97c2ffae292e50b8360405161276e9190614add565b60405180910390a2336001600160a01b03167fca943751d3c393325730c1c75b0309f5fc8fc8a6f69d4658782a51b7e5b5249383604051610e099190614add565b60075490565b6000908152600d602052604090205490565b600082820183811015610b4c5760405162461bcd60e51b815260040161120c90614a4f565b6000610b4c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613718565b60008261283d57506000610a2a565b8282028284828161284a57fe5b0414610b4c5760405162461bcd60e51b815260040161120c90614a6f565b6000610b4c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613744565b73f929fc6ec25850ce00e457c4f28cde88a94415d890565b82611edb576128d08261377b565b6101d160f51b6128df8361377b565b6040516020016128f19392919061496f565b60408051601f198184030181529082905262461bcd60e51b825261120c91600401614a2e565b61292261106a6131a7565b6001600160a01b039091166000908152600c6020526040902060040155565b6001600160a01b0382166000908152600c602052604090205461296a908263ffffffff6127c716565b6001600160a01b0383166000908152600c6020526040902055600554612996908263ffffffff6127c716565b6005555050565b6004546129b190838363ffffffff61371816565b6004555050565b6001600160a01b0383166000908152600c60205260409020600101546129e590838363ffffffff61371816565b6001600160a01b0384166000908152600c6020526040902060010155600354612a1590838363ffffffff61371816565b6003556040516000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612a56908690614add565b60405180910390a3505050565b6001600160a01b0383166000908152600c6020526040902054612a8d90838363ffffffff61371816565b6001600160a01b0384166000908152600c6020526040902055600554612aba90838363ffffffff61371816565b600555505050565b612aca614389565b5060408051602081019091526702c68af0bb140000815290565b612aec614389565b6040518060200160405280612b0a85670de0b6b3a7640000866137fb565b90529392505050565b6000612b1f8383613819565b6002149392505050565b612b328161384b565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b17905290516000916060916001600160a01b03851691612b7691614963565b600060405180830381855af49150503d8060008114612bb1576040519150601f19603f3d011682016040523d82523d6000602084013e612bb6565b606091505b5091509150818190612bdb5760405162461bcd60e51b815260040161120c9190614a2e565b506040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2505050565b600690565b612c22614389565b506040805160208101909152670928ca80cfc20000815290565b612c44614368565b604051806060016040528060008152602001635fbef0008152602001611c20815250905090565b6000610a2a8260000151610a508460400151610ab98660200151610a5c613894565b612c95614389565b506040805160208101909152670de0b6b3a7640000815290565b600080612cbb33612ec6565b5091509150600083118015612cd05750600082115b612cec5760405162461bcd60e51b815260040161120c90614aaf565b81831115612d0c5760405162461bcd60e51b815260040161120c90614a8f565b6000612d1e838563ffffffff6127ec16565b9050612d2a3382612fa5565b50612d6a826040518060400160405280601e81526020017f4d61726b65743a20696e73756666696369656e74206465706f73697465640000815250612fc5565b612d7381612fe0565b50505050565b612d8161119c565b6001600160a01b03166340c10f1983836040518363ffffffff1660e01b8152600401612dae9291906149e8565b602060405180830381600087803b158015612dc857600080fd5b505af1158015612ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612e009190810190614516565b506121ae61351f565b6019546001600160a01b038316600090815260146020526040812060060154909190808214612e5c576001600160a01b038516600090815260146020526040902060058101859055600601829055612ea5565b6001600160a01b038516600090815260146020526040902060050154612e88908563ffffffff6127c716565b6001600160a01b0386166000908152601460205260409020600501555b505092915050565b601b54612ec0908263ffffffff6127c716565b601b5550565b6000806000612ed484610e38565b9250612edf84611527565b9150612ef1838363ffffffff6127ec16565b90508015612f9457612f038482613898565b612f0b611560565b6001600160a01b03166340c10f1930836040518363ffffffff1660e01b8152600401612f389291906149e8565b602060405180830381600087803b158015612f5257600080fd5b505af1158015612f66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612f8a9190810190614516565b50612f94816138e7565b612f9d84613900565b509193909250565b6001600160a01b0390911660009081526014602052604081209190915590565b601654612fd990838363ffffffff61371816565b6016555050565b601654612ff3908263ffffffff6127c716565b60165550565b73c7da8087b8ba11f0892f1b0bfacfd44c116b303e90565b73de25486ccb4588ce5d9fb188fb6af72e768a466a90565b609690565b6001600160a01b03166000908152600e60205260409020600501805460ff19166001179055565b61305d614389565b6040518060200160405280612b0a8560000151670de0b6b3a764000086600001516137fb565b620f424090565b6001600160a01b0382166000908152600c60205260409020600101546130b6908263ffffffff6127c716565b6001600160a01b0383166000908152600c60205260409020600101556003546130e5908263ffffffff6127c716565b6003556040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90613126908590614add565b60405180910390a35050565b600454613145908263ffffffff6127c716565b60045550565b73170cec2070399b85363b788af2fb059db8ef8aed90565b600061316d61104a565b61317957506000610ac9565b613181614389565b61318d6110b484611542565b9050610ac561319a613926565b829063ffffffff612b1316565b602490565b6131b4611855565b6001600160a01b039092166000908152600e60205260409020918255600190910155565b6001600160a01b0383166000908152600e602052604090206003015461320590838363ffffffff61371816565b6001600160a01b039093166000908152600e60205260409020600301929092555050565b6001600160a01b0383166000908152600e602052604090206002015461325690838363ffffffff61371816565b6001600160a01b039093166000908152600e60205260409020600201929092555050565b6001600160a01b0382166000908152600e60205260409020600301546132a6908263ffffffff6127c716565b6001600160a01b039092166000908152600e602052604090206003019190915550565b6001600160a01b0382166000908152600e60205260409020600201546132f5908263ffffffff6127c716565b6001600160a01b039092166000908152600e602052604090206002019190915550565b6001600160a01b038083166000908152600e6020908152604080832093871683526004909301905220805482919060ff1916600183600281111561335857fe5b0217905550505050565b6001600160a01b0382166000908152600c60205260408120600501549061339461338b84610b6e565b610a5085612425565b905081811115612d73576001600160a01b0384166000908152600c6020526040902060050181905550505050565b6133fd6133cd611855565b6133d5611179565b1166426f6e64696e6760c81b720a6e8d2d8d840c6eae4e4cadce840cae0dec6d606b1b6128c2565b613405613947565b61176f61396e565b613415614389565b61341d614389565b613425613987565b915091506134338282613aea565b61344b61343e612c8d565b839063ffffffff612b1316565b156134605761345982613b25565b505061176f565b61347861346b612c8d565b839063ffffffff61350b16565b156134865761345982613c4a565b61348e611855565b6040517fff7db5a0dc69b02c191ba632db46961b7d0daa1bd30709ddba9b80ad0a15d2c090600090a25050565b6134c3614389565b6040518060200160405280612b0a85600001518560000151670de0b6b3a76400006137fb565b6134f1614389565b506040805160208101909152671158e460913d0000815290565b60006135178383613819565b159392505050565b61176f61354061352d610b9c565b610a50613538611f04565b610a5061104a565b61354861119c565b6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016135739190614997565b60206040518083038186803b15801561358b57600080fd5b505afa15801561359f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506135c39190810190614582565b10156a21b7b6b83a3937b63632b960a91b74496e636f6e73697374656e742062616c616e63657360581b6128c2565b6135fa614389565b613602614389565b61362161360d611933565b613615612c8d565b9063ffffffff613c9116565b905061362b614389565b61364a613636611933565b61363e611a87565b9063ffffffff61305516565b9050613654614389565b613664838363ffffffff61305516565b905061367e613671613cba565b829063ffffffff61350b16565b1561368e5761368b613cba565b90505b61369961319a613cdc565b156136a9576136a6613cdc565b90505b9250505090565b6001600160a01b0382166000908152601460205260409020600201546136dc908263ffffffff6127c716565b6001600160a01b0390921660009081526014602052604090206002019190915550565b601754613712908263ffffffff6127c716565b60175550565b6000818484111561373c5760405162461bcd60e51b815260040161120c9190614a2e565b505050900390565b600081836137655760405162461bcd60e51b815260040161120c9190614a2e565b50600083858161377157fe5b0495945050505050565b6060808260405160200161378f919061494e565b60408051601f19818403018152919052905060205b80156137e4578151600019909101908290829081106137bf57fe5b01602001516001600160f81b031916156137df5760010181529050610ac9565b6137a4565b505060408051600081526020810190915292915050565b600061381182610ab9868663ffffffff61282e16565b949350505050565b80518251600091141561382e57506001610a2a565b815183511161383e576000613841565b60025b60ff169392505050565b61385481613cfe565b6138705760405162461bcd60e51b815260040161120c90614a7f565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b4290565b6001600160a01b0382166000908152601460205260409020600301546138c4908263ffffffff6127c716565b6001600160a01b0390921660009081526014602052604090206003019190915550565b6018546138fa908263ffffffff6127c716565b60185550565b6015546001600160a01b0390911660009081526014602052604081206001019190915590565b61392e614389565b5060408051602081019091526611c37937e08000815290565b61394f610b96565b600d600061395b611855565b8152602081019190915260400160002055565b60025461398290600163ffffffff6127c716565b600255565b61398f614389565b613997614389565b61399f614389565b60006139a961157d565b6001600160a01b031663d4a3e9d76040518163ffffffff1660e01b81526004016040805180830381600087803b1580156139e257600080fd5b505af11580156139f6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613a1a9190810190614534565b91509150613a2e61078b6001610a5c611855565b15613a3e57613a3b613d04565b91505b80613a4e57613a4b612c8d565b91505b613a56614389565b6000613a60611ee0565b6001600160a01b031663d4a3e9d76040518163ffffffff1660e01b81526004016040805180830381600087803b158015613a9957600080fd5b505af1158015613aad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613ad19190810190614534565b9150915080613ade578391505b50919350909150509091565b81516011558051601c55613aff61343e612c8d565b15613b1c57601954613b1757613b13611855565b6019555b6121ae565b60006019555050565b613b2d614389565b613b59613b53613b3b613d26565b61363e613b46612c8d565b869063ffffffff613c9116565b83613d49565b90506000613bed613be8613b6b61119c565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015613ba357600080fd5b505afa158015613bb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613bdb9190810190614582565b849063ffffffff613d7f16565b613da6565b9050600080613bfb83613dc3565b91509150613c07611855565b85516040517f584c448165ec8a6d6b4374119d39b71df645b163f84f0c6c89230f5b8386c2ba91613c3b9186908690614af9565b60405180910390a25050505050565b6000613c5582613f1a565b9050613c5f611855565b82516040517fca273eb1c10e8cc7a5291aba3bae267c0037a2b9e70070e90f059e398d52651d91610e09918590614aeb565b613c99614389565b6040805160208101909152825184518291612b0a919063ffffffff6127ec16565b613cc2614389565b50604080516020810190915267016345785d8a0000815290565b613ce4614389565b506040805160208101909152674563918244f40000815290565b3b151590565b613d0c614389565b50604080516020810190915267155f2dd73a1a0000815290565b613d2e614389565b50604080516020810190915268015af1d78b58c40000815290565b613d51614389565b613d59614389565b613d61614134565b9050613d73848263ffffffff612b1316565b610b4c57509192915050565b613d87614389565b604080516020810190915283518190612b0a908563ffffffff61282e16565b8051600090610a2a90670de0b6b3a764000063ffffffff61286816565b6000806000613de56064610ab9613dd8614155565b879063ffffffff61282e16565b9050613df08161415a565b6000613e0f6064610ab9613e026141ee565b889063ffffffff61282e16565b9050613e1a816141f3565b600080613e25610a30565b90506000613e3c613e34610b68565b610a5c6120b6565b905081811015613e98576000613e656064610ab9613e58614217565b8c9063ffffffff61282e16565b90506000613e79848463ffffffff6127ec16565b9050818111613e885781613e8a565b805b9450613e958561421c565b50505b6000613eae84610a50888863ffffffff6127c716565b90506000818a11613ec0576000613ed0565b613ed08a8363ffffffff6127ec16565b9050613eda61104a565b613ee2575060005b8015613ef157613ef181614235565b613ef961351f565b84613f0a828463ffffffff6127c716565b9850985050505050505050915091565b600080613f256120b6565b90508015613f3557613f356142cc565b6000613f3f6114e4565b9050613f49614389565b613f516142d8565b90506000613f8a613f7083613f64612c8d565b9063ffffffff6142f916565b60408051602081019091528581529063ffffffff6134bb16565b519050613f9681614322565b613f9e614389565b614051613fa9614327565b614045613fb4613cba565b6040518060200160405280613fc7611560565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015613fff57600080fd5b505afa158015614013573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506140379190810190614582565b90529063ffffffff6134bb16565b9063ffffffff6134bb16565b905061405b611560565b6001600160a01b03166340c10f1961407161314b565b83516040516001600160e01b031960e085901b1681526140959291906004016149e8565b602060405180830381600087803b1580156140af57600080fd5b505af11580156140c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506140e79190810190614516565b5060006140f261104a565b1561412157614115614102614348565b604051806020016040528061403761104a565b51905061412181614235565b61412961351f565b979650505050505050565b61413c614389565b50604080516020810190915266470de4df820000815290565b602390565b80156118525761416861119c565b6001600160a01b03166340c10f1961417e610b8c565b836040518363ffffffff1660e01b815260040161419c9291906149e8565b602060405180830381600087803b1580156141b657600080fd5b505af11580156141ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506121ae9190810190614516565b600390565b80156118525761420161119c565b6001600160a01b03166340c10f1961417e612ff9565b603290565b601a5461422f908263ffffffff6127c716565b601a5550565b80156118525761424361119c565b6001600160a01b03166340c10f1930836040518363ffffffff1660e01b81526004016142709291906149e8565b602060405180830381600087803b15801561428a57600080fd5b505af115801561429e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506142c29190810190614516565b5061185281613132565b6000601a819055601b55565b6142e0614389565b50604080516020810190915266037235b96ea000815290565b614301614389565b6040805160208101909152825184518291612b0a919063ffffffff6127c716565b601555565b61432f614389565b506040805160208101909152660107c0e2fc2000815290565b614350614389565b506040805160208101909152652e625ce23000815290565b60405180606001604052806000815260200160008152602001600081525090565b6040518060200160405280600081525090565b8035610a2a81614bfe565b8051610a2a81614c12565b8035610a2a81614c1b565b8051610a2a81614c28565b6000602082840312156143da57600080fd5b6143e46020614b22565b905060006143f284846143bd565b82525092915050565b8035610a2a81614c28565b8051610a2a81614c31565b60006020828403121561442357600080fd5b6000613811848461439c565b6000806040838503121561444257600080fd5b600061444e858561439c565b925050602061445f8582860161439c565b9150509250929050565b60008060006060848603121561447e57600080fd5b600061448a868661439c565b935050602061449b8682870161439c565b92505060406144ac868287016143fb565b9150509250925092565b600080604083850312156144c957600080fd5b60006144d5858561439c565b925050602061445f858286016143b2565b600080604083850312156144f957600080fd5b6000614505858561439c565b925050602061445f858286016143fb565b60006020828403121561452857600080fd5b600061381184846143a7565b6000806040838503121561454757600080fd5b600061455385856143c8565b925050602061445f858286016143a7565b60006020828403121561457657600080fd5b600061381184846143fb565b60006020828403121561459457600080fd5b600061381184846143bd565b600080604083850312156145b357600080fd5b600061450585856143fb565b600080600080600060a086880312156145d757600080fd5b60006145e38888614406565b95505060206145f4888289016143bd565b9450506040614605888289016143bd565b9350506060614616888289016143bd565b925050608061462788828901614406565b9150509295509295909350565b61463d81614ba1565b82525050565b61463d81614b56565b61463d81614b61565b61463d61466182614b66565b614b73565b61463d61466182614b73565b600061467d82614b49565b6146878185610ac9565b9350614697818560208601614bbe565b9290920192915050565b61463d81614ba8565b61463d81614bb3565b60006146be82614b49565b6146c88185614b4d565b93506146d8818560208601614bbe565b6146e181614bea565b9093019392505050565b60006146f8602483614b4d565b7f4d61726b65743a20626f756e64206d75737420626520677265617465722074688152630616e20360e41b602082015260400192915050565b600061473e601b83614b4d565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000614777601883614b4d565b7f4d61726b65743a206e6f7420696e20657870616e73696f6e0000000000000000815260200192915050565b60006147b0602183614b4d565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b60006147f3603b83614b4d565b7f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f81527f6e20746f2061206e6f6e2d636f6e747261637420616464726573730000000000602082015260400192915050565b6000614852602683614b4d565b7f4d61726b65743a20696e73756666696369656e7420616d6f756e7420746f20758152651b989bdd5b9960d21b602082015260400192915050565b600061489a601a83614b4d565b7f4d61726b65743a206e6f7420696e20636f6e7472616374696f6e000000000000815260200192915050565b60006148d3601483614b4d565b734d61726b65743a20616d6f756e7473203e20302160601b815260200192915050565b6000614903601d83614b4d565b7f4d61726b65743a206e6f7420656e6f7567682072656465656d61626c65000000815260200192915050565b80516020830190612d7384825b61463d81614b73565b61463d81614b8c565b600061495a8284614666565b50602001919050565b6000610b4c8284614672565b600061497b8286614672565b91506149878285614655565b600282019150610e8b8284614672565b60208101610a2a8284614643565b606081016149b38286614634565b6149c06020830185614643565b613811604083018461493c565b604081016149db8285614634565b610b4c602083018461493c565b604081016149db8285614643565b60208101610a2a828461464c565b60208101610a2a82846146a1565b60208101610a2a82846146aa565b604081016149db82856146aa565b60208082528101610b4c81846146b3565b60208082528101610a2a816146eb565b60208082528101610a2a81614731565b60208082528101610a2a8161476a565b60208082528101610a2a816147a3565b60208082528101610a2a816147e6565b60208082528101610a2a81614845565b60208082528101610a2a8161488d565b60208082528101610a2a816148c6565b60208082528101610a2a816148f6565b60208101610a2a828461492f565b60208101610a2a828461493c565b604081016149db828561493c565b60608101614b07828661493c565b6149c0602083018561493c565b60208101610a2a8284614945565b60405181810167ffffffffffffffff81118282101715614b4157600080fd5b604052919050565b5190565b90815260200190565b6000610a2a82614b80565b151590565b6001600160f01b03191690565b90565b80610ac981614bf4565b6001600160a01b031690565b60ff1690565b69ffffffffffffffffffff1690565b6000610a2a825b6000610a2a82614b56565b6000610a2a82614b76565b60005b83811015614bd9578181015183820152602001614bc1565b83811115612d735750506000910152565b601f01601f191690565b6003811061185257fe5b614c0781614b56565b811461185257600080fd5b614c0781614b61565b6003811061185257600080fd5b614c0781614b73565b614c0781614b9256fe426f6e64696e673a20696e73756666696369656e74207374616765642062616c616e6365426f6e64696e673a20696e73756666696369656e7420746f74616c20626f6e6465644d61726b65743a20696e73756666696369656e7420746f74616c206465706f7369746564a365627a7a723158200d528abba21df8f1a978bf70bfe1ddb1c450bae8a59f6152f0fc17131615b7816c6578706572696d656e74616cf564736f6c63430005110040
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106104b75760003560e01c80637dc0d1d011610278578063b6b55f251161015c578063deeb4d26116100ce578063ea105ac711610092578063ea105ac714610994578063f1b7cf491461099c578063f4dd7cc2146109af578063f7d36943146109c2578063fc7b9c18146109d5578063ffbe3b73146109dd576104b7565b8063deeb4d261461094b578063df9a2b1c14610953578063e6036e2d14610966578063e8dd75c514610979578063e9505dbf1461098c576104b7565b8063bd4aeb1c11610120578063bd4aeb1c146108f4578063c9aff70c146108fc578063cf0237791461090f578063d60b347f14610917578063dd62ed3e1461092a578063dd72c79414610938576104b7565b8063b6b55f25146108a0578063b6c8478e146108b3578063baee3b68146108bb578063bc7513e2146108ce578063bceb514d146108e1576104b7565b806397a5d5b5116101f55780639f6e1b26116101b95780639f6e1b2614610857578063a50cd8e71461086a578063a577b7f81461087d578063a9059cbb146104da578063b0c7439a14610885578063b1248dbe14610898576104b7565b806397a5d5b51461080157806398d5fdca146108145780639940686e146108295780639a649edc1461083c5780639bc289f114610844576104b7565b80638c63e1021161023c5780638c63e102146107ce5780638c960f71146107d6578063900cf0cf146107e9578063930c5ca3146107f157806395d89b41146107f9576104b7565b80637dc0d1d0146107905780638129fc1c14610798578063825ad607146107a057806384ddb875146107b357806386cf9f14146107bb576104b7565b80634303d4f71161039f5780635b9617531161031c57806364668022116102e057806364668022146107295780636a39e3281461073c5780636c0127eb1461074f57806370a0823114610762578063758b47b11461077557806375d5024b1461077d576104b7565b80635b961753146106eb5780635c60da1b146106fe5780635fec2cdf1461070657806360d25aa71461071957806361d027b314610721576104b7565b80635053e461116103635780635053e4611461069557806351adeb571461069d57806351bf21d8146106b257806357f3c7dd146106c557806359006f8c146106d8576104b7565b80634303d4f71461065757806344d96e951461065f57806347c05069146106675780634ad3e6481461067a5780634c73609914610682576104b7565b80631edbcf6c11610438578063353a420c116103fc578063353a420c146105d857806335caba23146105eb578063369e8c1d146105fe5780633a3e6c81146106115780633bc2258b146106245780633fbba9a614610637576104b7565b80631edbcf6c1461058057806323b872dd1461058857806327de9e321461059b5780632e1a7d4d146105b0578063313ce567146105c3576104b7565b806310e95b6c1161047f57806310e95b6c146105355780631305967c1461054857806315e14bf61461055057806316f0115b1461056357806318160ddd14610578576104b7565b806306fdde03146104bc578063095ea7b3146104da5780630a8285b8146104fa5780630c2abae01461050f5780630d78ceb414610522575b600080fd5b6104c46109f0565b6040516104d19190614a2e565b60405180910390f35b6104ed6104e83660046144e6565b610a27565b6040516104d191906149f6565b610502610a30565b6040516104d19190614add565b61050261051d366004614411565b610a6d565b6105026105303660046144e6565b610ace565b610502610543366004614564565b610b53565b610502610b68565b61050261055e366004614411565b610b6e565b61056b610b8c565b6040516104d19190614997565b610502610b96565b610502610b9c565b6104ed610596366004614469565b610ba2565b6105ae6105a9366004614564565b610bab565b005b6105ae6105be366004614564565b610cdd565b6105cb610e15565b6040516104d19190614b14565b6105026105e6366004614411565b610e1a565b6105026105f9366004614411565b610e38565b6105ae61060c366004614411565b610e94565b6104ed61061f366004614411565b610fd6565b610502610632366004614411565b610ff3565b61064a61064536600461442f565b611011565b6040516104d19190614a12565b610502611044565b61050261104a565b6105ae610675366004614411565b611050565b610502611143565b6105026106903660046145a0565b611149565b610502611179565b6106a561119c565b6040516104d19190614a04565b6105026106c0366004614411565b6111ab565b6105ae6106d3366004614564565b6111c9565b6105026106e6366004614411565b61132d565b6105026106f9366004614411565b61134b565b61056b61136e565b6105ae610714366004614564565b611393565b6105026114e4565b61056b6114ea565b610502610737366004614411565b6114f4565b61050261074a366004614564565b611512565b61050261075d366004614411565b611527565b610502610770366004614411565b611542565b6106a5611560565b6104ed61078b366004614564565b61156a565b6106a561157d565b6105ae61158c565b6105026107ae366004614411565b611771565b6105026117a5565b6105026107c9366004614411565b6117ab565b6105026117c6565b6105ae6107e4366004614564565b611840565b610502611855565b61050261185b565b6104c46118a8565b61064a61080f366004614411565b6118c6565b61081c611933565b6040516104d19190614acf565b6105ae610837366004614564565b61194f565b610502611a1d565b610502610852366004614411565b611a23565b61050261086536600461442f565b611a41565b610502610878366004614411565b611a70565b61081c611a87565b610502610893366004614411565b611aa3565b610502611afb565b6105ae6108ae366004614564565b611b01565b61056b611bce565b6105026108c9366004614411565b611bd8565b6105026108dc3660046144e6565b611bf6565b6105ae6108ef3660046144b6565b611c3a565b6106a5611ee0565b61050261090a366004614564565b611eef565b610502611f04565b6104ed610925366004614411565b611f0a565b6105026104e836600461442f565b610502610946366004614564565b611f2b565b6105026120b6565b6105ae610961366004614564565b6120bc565b610502610974366004614411565b61217a565b6105ae610987366004614564565b612198565b6105026121b2565b6105ae6121b8565b6105026109aa366004614411565b612425565b6105ae6109bd366004614564565b612440565b6105ae6109d0366004614564565b612552565b6105026127af565b6105026109eb366004614564565b6127b5565b60408051808201909152601881527f44796e616d69632053657420446f6c6c6172205374616b650000000000000000602082015290565b60005b92915050565b6000610a68610a3d6117a5565b610a5c610a48611143565b610a50611afb565b9063ffffffff6127c716565b9063ffffffff6127ec16565b905090565b600080610a7861185b565b905080610a89576000915050610ac9565b610ac5610a9584611aa3565b610a5c83610ab9610aa588610e38565b610aad6120b6565b9063ffffffff61282e16565b9063ffffffff61286816565b9150505b919050565b6001600160a01b0382166000908152600f6020908152604080832084845290915281205480158015610b065750610b0483611eef565b155b15610b4c576001600160a01b0384166000908152600c60209081526040808320868452600290810190925290912054610b449163ffffffff61286816565b915050610a2a565b9392505050565b6000908152600d602052604090206002015490565b601b5490565b6001600160a01b03166000908152600e602052604090206001015490565b6000610a686128aa565b60035490565b60065490565b60009392505050565b33610bf260025b610bbb836118c6565b6002811115610bc657fe5b1415692832b936b4b9b9b4b7b760b11b72139bdd08199c9bde995b881bdc88199b1d5a59606a1b6128c2565b610bfb33612917565b6000610c22610c0933611542565b610ab9610c1533611771565b869063ffffffff61282e16565b9050610c2e3382612941565b610c5081604051806060016040528060228152602001614c5f6022913961299d565b610c9033846040518060400160405280601d81526020017f426f6e64696e673a20696e73756666696369656e742062616c616e63650000008152506129b8565b337f93530ac0ee8c50e696e13c5ac62355d0c0ba4bd943620d5bda1eb08b64ae7512610cbf6001610a50611855565b8584604051610cd093929190614af9565b60405180910390a2505050565b33610d2560015b610ced836118c6565b6002811115610cf857fe5b1415692832b936b4b9b9b4b7b760b11b73139bdd08199c9bde995b881bdc881b1bd8dad95960621b6128c2565b610d2d61119c565b6001600160a01b031663a9059cbb33846040518363ffffffff1660e01b8152600401610d5a9291906149cd565b602060405180830381600087803b158015610d7457600080fd5b505af1158015610d88573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610dac9190810190614516565b50610dd03383604051806060016040528060248152602001614c3b60249139612a63565b336001600160a01b03167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436483604051610e099190614add565b60405180910390a25050565b601290565b6001600160a01b03166000908152600e602052604090206003015490565b600080610e4483611bd8565b905080610e55576000915050610ac9565b6000610e6d82610ab9601460010154610aad88611527565b90506000610e7a8561134b565b9050808211610e895781610e8b565b805b95945050505050565b610ec0610ea082610fd6565b6523b7bb32b93760d11b6c139bdd081b9bdb5a5b985d1959609a1b6128c2565b6000610edc6001610a5c610ed385610b6e565b610a5086612425565b9050610f0781610eea611855565b116523b7bb32b93760d11b68139bdd08195b99195960ba1b6128c2565b610f5e610f3b610f15612ac2565b610f2f610f2186611a70565b610f2a866127b5565b612ae4565b9063ffffffff612b1316565b6523b7bb32b93760d11b6f4d75737420686176652071756f72756d60801b6128c2565b610f93610f6a83610e1a565b610f73846114f4565b116523b7bb32b93760d11b6b139bdd08185c1c1c9bdd995960a21b6128c2565b610f9c82612b29565b6040516001600160a01b0383169033907f815ca4497ab9fc80c76f210e6e842a5e198e195aa136034557eee144f790e7bb90600090a35050565b6001600160a01b03166000908152600e6020526040902054151590565b6001600160a01b031660009081526014602052604090206004015490565b6001600160a01b038082166000908152600e60209081526040808320938616835260049093019052205460ff1692915050565b60105490565b60045490565b61105c610ea082610fd6565b61109a61107261106a612c15565b610a50611855565b61107a611179565b116523b7bb32b93760d11b6b115c1bd8da081cde5b98d95960a21b6128c2565b6110ec6110bc6110a8612c1a565b610f2f6110b4856114f4565b610f2a610b96565b6523b7bb32b93760d11b7f4d7573742068617665207375706572206d616a6f7269747900000000000000006128c2565b6111016110f882610e1a565b610f73836114f4565b61110a81612b29565b6040516001600160a01b0382169033907f815ca4497ab9fc80c76f210e6e842a5e198e195aa136034557eee144f790e7bb90600090a350565b60175490565b6000828152600d6020526040812060030180548390811061116657fe5b9060005260206000200154905092915050565b6000611183614368565b61118b612c3c565b905061119681612c6b565b91505090565b6009546001600160a01b031690565b6001600160a01b03166000908152600c602052604090206004015490565b6111f06111d4612c8d565b604080516020810190915260115481529063ffffffff612b1316565b6112155760405162461bcd60e51b815260040161120c90614a5f565b60405180910390fd5b600081116112355760405162461bcd60e51b815260040161120c90614aaf565b61123e33610a6d565b81111561125d5760405162461bcd60e51b815260040161120c90614abf565b61126681612caf565b61126e611560565b6001600160a01b03166342966c68826040518263ffffffff1660e01b81526004016112999190614add565b600060405180830381600087803b1580156112b357600080fd5b505af11580156112c7573d6000803e3d6000fd5b505050506112d53382612d79565b6112df3382612e09565b506112e981612ead565b336001600160a01b03167fbfd31bbef436d4183fc969864fe0511a03b07748526aba9238d0fdb2cd5b54fd826040516113229190614add565b60405180910390a250565b6001600160a01b031660009081526014602052604090206003015490565b6000610a2a6113598361132d565b610a5c6113658561217a565b610a5086611527565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b600081116113b35760405162461bcd60e51b815260040161120c90614a3f565b6000806113bf33612ec6565b50915091506113cc611560565b6001600160a01b03166323b872dd3330866040518463ffffffff1660e01b81526004016113fb939291906149a5565b602060405180830381600087803b15801561141557600080fd5b505af1158015611429573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061144d9190810190614516565b506000611460838563ffffffff6127c716565b905061146c3382612fa5565b5061148f82604051806060016040528060248152602001614c8160249139612fc5565b61149881612fe0565b337fd22a94c050f39e5238f79a498034ba57a72a2a506305aaaac893b3368b6032ca6114c76001610a50611855565b866040516114d6929190614aeb565b60405180910390a250505050565b60155490565b6000610a68612ff9565b6001600160a01b03166000908152600e602052604090206002015490565b6000908152600d602052604090206003015490565b6001600160a01b031660009081526014602052604090205490565b6001600160a01b03166000908152600c602052604090206001015490565b6000610a68613011565b6000611574613029565b90911115919050565b600a546001600160a01b031690565b6115c561159a61092561136e565b15692832b936b4b9b9b4b7b760b11b72105b1c9958591e481a5b9a5d1a585b1a5e9959606a1b6128c2565b6115d56115d061136e565b61302e565b6115e833683635c9adc5dea00000612d79565b6040805160208082018352671bc16d674ec8000082528251908101909252601154825261161b919063ffffffff61305516565b51601c55601d80546001600160a01b0319167340139e3bbdf8cacc69f1ac1eef07dba9b9165ce81790819055604080516302e82ee960e61b815290516001600160a01b03929092169163ba0bba409160048082019260009290919082900301818387803b15801561168b57600080fd5b505af115801561169f573d6000803e3d6000fd5b5050601d546040805163d4a3e9d760e01b815281516001600160a01b03909316945063d4a3e9d79350600480820193918290030181600087803b1580156116e557600080fd5b505af11580156116f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061171d9190810190614534565b5050611747738a7d5fe563bbbcbb776bdd0ea8c31b93200a0d0169043c33c1937564800000612d79565b61176f73437cb43d08f64af2aa64ad2525fe1074e282ec1969011afa0d674133100000612d79565b565b60008061177c610b96565b90508061178d576000915050610ac9565b610ac581610ab961179d86611542565b610aad61104a565b60185490565b6001600160a01b03166000908152600c602052604090205490565b60006117d0611560565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561180857600080fd5b505afa15801561181c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610a689190810190614582565b61184981612552565b61185281611393565b50565b60025490565b6000611865611560565b6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016118909190614997565b60206040518083038186803b15801561180857600080fd5b6040805180820190915260048152634453445360e01b602082015290565b60006118d0611855565b6001600160a01b0383166000908152600c602052604090206005015411156118fa57506002610ac9565b6001600160a01b0382166000908152600c602052604090206004015461191e611855565b101561192b576001610a2a565b506000919050565b61193b614389565b506040805160208101909152601154815290565b3361195a6002610bb2565b61196333612917565b600061196d61104a565b1561198d5761198861197d61104a565b610ab9610c15610b96565b6119a5565b6119a5611998613083565b849063ffffffff61282e16565b90506119b1338261308a565b6119ba83613132565b6119dd3384604051806060016040528060248152602001614c3b60249139612a63565b337f44002fdef5a0c2d2e4e05572e9780b95aef97e0e93ffd7cc076b09fa78ff2b46611a0c6001610a50611855565b8386604051610cd093929190614af9565b60085490565b6001600160a01b03166000908152600c602052604090206005015490565b6001600160a01b039182166000908152600c602090815260408083209390941682526003909201909152205490565b6000610a2a611a7e83610e1a565b610a50846114f4565b611a8f614389565b506040805160208101909152601c54815290565b6019546001600160a01b038216600090815260146020526040812060060154909190808214611ad757600092505050610ac9565b5050506001600160a01b038116600090815260146020526040902060050154610ac9565b60165490565b611b0961119c565b6001600160a01b03166323b872dd3330846040518463ffffffff1660e01b8152600401611b38939291906149a5565b602060405180830381600087803b158015611b5257600080fd5b505af1158015611b66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611b8a9190810190614516565b50611b953382612941565b336001600160a01b03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c826040516113229190614add565b6000610a6861314b565b6001600160a01b031660009081526014602052604090206001015490565b6000611c0182611eef565b611c0d57506000610a2a565b506001600160a01b03919091166000908152600c6020908152604080832093835260029093019052205490565b33611c456001610ce4565b611c766000611c5333611542565b116523b7bb32b93760d11b6e4d7573742068617665207374616b6560881b6128c2565b611c7f83610fd6565b611d2257611cbf611c8f33613163565b6523b7bb32b93760d11b7f4e6f7420656e6f756768207374616b6520746f2070726f706f736500000000006128c2565b611cd083611ccb6131a7565b6131ac565b611cd8611855565b336001600160a01b0385167fd15e38a680a427478883cd2d32eb664cb6bb2090b0126a23ebaf3e3784b8c56b611d0c6131a7565b604051611d199190614add565b60405180910390a45b611d52611d31610ed385610b6e565b611d39611855565b106523b7bb32b93760d11b64115b99195960da1b6128c2565b6000611d5d33611542565b90506000611d6b3386611011565b9050806002811115611d7957fe5b846002811115611d8557fe5b1415611d92575050611edb565b6002816002811115611da057fe5b1415611de657611de685836040518060400160405280601b81526020017f476f7665726e3a20496e73756666696369656e742072656a65637400000000008152506131d8565b6001816002811115611df457fe5b1415611e3a57611e3a85836040518060400160405280601c81526020017f476f7665726e3a20496e73756666696369656e7420617070726f766500000000815250613229565b6002846002811115611e4857fe5b1415611e5857611e58858361327a565b6001846002811115611e6657fe5b1415611e7657611e7685836132c9565b611e81338686613318565b611e8b3386613362565b846001600160a01b0316336001600160a01b03167fbe50c78cbc15b0864819aadea36c6499da421b33c38e2ef19bebda583c708c788685604051611ed0929190614a20565b60405180910390a350505b505050565b601d546001600160a01b031690565b6000908152600d602052604090206001015490565b60055490565b6001600160a01b03166000908152600e602052604090206005015460ff1690565b600080611f383384611bf6565b90506000611f463385610ace565b905081158015611f54575080155b8015611f665750611f6484611eef565b155b15611f9e57336000908152600c60209081526040808320878452600290810190925290912054611f9b9163ffffffff61286816565b90505b336000818152600f602090815260408083208884528252808320839055928252600c81528282208783526002019052908120819055611fe3838363ffffffff6127c716565b9050611fed611560565b6001600160a01b03166340c10f1933836040518363ffffffff1660e01b815260040161201a9291906149cd565b602060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061206c9190810190614516565b50336001600160a01b03167fca943751d3c393325730c1c75b0309f5fc8fc8a6f69d4658782a51b7e5b52493826040516120a69190614add565b60405180910390a2949350505050565b601a5490565b336120c76002610bb2565b6120d033612917565b60006120dd61197d61104a565b90506120e93384612941565b61210b83604051806060016040528060228152602001614c5f6022913961299d565b61214b33826040518060400160405280601d81526020017f426f6e64696e673a20696e73756666696369656e742062616c616e63650000008152506129b8565b337f93530ac0ee8c50e696e13c5ac62355d0c0ba4bd943620d5bda1eb08b64ae7512611a0c6001610a50611855565b6001600160a01b031660009081526014602052604090206002015490565b60006121a382611f2b565b90506121ae81611393565b5050565b60195490565b60005a90506121c56133c2565b6121cd61340d565b6121d5611855565b7fc30b728d1c19e5db3678b8ea9e9a063a5655071e1a325c2f7fdbca48baa906004342604051612206929190614aeb565b60405180910390a26000735f4ec3df9cbd43714fe2740f5e3616155c5b84196001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561225d57600080fd5b505afa158015612271573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061229591908101906145bf565b505050915050600073169e633a2d1e6c10dd91238ba11c4a708dfef37c6001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156122ea57600080fd5b505afa1580156122fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061232291908101906145bf565b505050915050612330614389565b604051806020016040528061234c845a880361a028019061282e565b90529050612358614389565b61238d604051806020016040528061237e6402540be4008861282e90919063ffffffff16565b9052839063ffffffff6134bb16565b9050612397614389565b6123af6123a2611933565b839063ffffffff61305516565b90506123b9614389565b6123d16123c46134e9565b839063ffffffff6134bb16565b90506123e1338260000151612d79565b805160405133917fbb4f656853bc420ad6e4321622c07eefb4ed40e3f91b35553ce14a6dff4c0981916124149190614add565b60405180910390a250505050505050565b6001600160a01b03166000908152600e602052604090205490565b61246761244b612c8d565b604080516020810190915260115481529063ffffffff61350b16565b6124835760405162461bcd60e51b815260040161120c90614a9f565b61248c81612caf565b612494611560565b6001600160a01b031663a9059cbb33836040518363ffffffff1660e01b81526004016124c19291906149cd565b602060405180830381600087803b1580156124db57600080fd5b505af11580156124ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506125139190810190614516565b50337f2b3ed3dc8ad3da3307af0fc7dcc4d2d92d527e58a0fc3bb9fb60ae2c42ad2ad06125436001610a50611855565b83604051611322929190614aeb565b61255d61244b612c8d565b6125795760405162461bcd60e51b815260040161120c90614a9f565b61258161119c565b6001600160a01b03166323b872dd3330846040518463ffffffff1660e01b81526004016125b0939291906149a5565b602060405180830381600087803b1580156125ca57600080fd5b505af11580156125de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506126029190810190614516565b5061260b61119c565b6001600160a01b03166342966c68826040518263ffffffff1660e01b81526004016126369190614add565b600060405180830381600087803b15801561265057600080fd5b505af1158015612664573d6000803e3d6000fd5b5050505061267061351f565b612678611560565b6001600160a01b03166340c10f1933836040518363ffffffff1660e01b81526004016126a59291906149cd565b602060405180830381600087803b1580156126bf57600080fd5b505af11580156126d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506126f79190810190614516565b50600061271f6127056135f2565b60408051602081019091528481529063ffffffff6134bb16565b51905061272c33826136b0565b612735816136ff565b336001600160a01b03167f8d101b5fb849d7ccb1a58fdfaa8ded79ad9b5d5efe142099d97c2ffae292e50b8360405161276e9190614add565b60405180910390a2336001600160a01b03167fca943751d3c393325730c1c75b0309f5fc8fc8a6f69d4658782a51b7e5b5249383604051610e099190614add565b60075490565b6000908152600d602052604090205490565b600082820183811015610b4c5760405162461bcd60e51b815260040161120c90614a4f565b6000610b4c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613718565b60008261283d57506000610a2a565b8282028284828161284a57fe5b0414610b4c5760405162461bcd60e51b815260040161120c90614a6f565b6000610b4c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613744565b73f929fc6ec25850ce00e457c4f28cde88a94415d890565b82611edb576128d08261377b565b6101d160f51b6128df8361377b565b6040516020016128f19392919061496f565b60408051601f198184030181529082905262461bcd60e51b825261120c91600401614a2e565b61292261106a6131a7565b6001600160a01b039091166000908152600c6020526040902060040155565b6001600160a01b0382166000908152600c602052604090205461296a908263ffffffff6127c716565b6001600160a01b0383166000908152600c6020526040902055600554612996908263ffffffff6127c716565b6005555050565b6004546129b190838363ffffffff61371816565b6004555050565b6001600160a01b0383166000908152600c60205260409020600101546129e590838363ffffffff61371816565b6001600160a01b0384166000908152600c6020526040902060010155600354612a1590838363ffffffff61371816565b6003556040516000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90612a56908690614add565b60405180910390a3505050565b6001600160a01b0383166000908152600c6020526040902054612a8d90838363ffffffff61371816565b6001600160a01b0384166000908152600c6020526040902055600554612aba90838363ffffffff61371816565b600555505050565b612aca614389565b5060408051602081019091526702c68af0bb140000815290565b612aec614389565b6040518060200160405280612b0a85670de0b6b3a7640000866137fb565b90529392505050565b6000612b1f8383613819565b6002149392505050565b612b328161384b565b60408051600481526024810182526020810180516001600160e01b031663204a7f0760e21b17905290516000916060916001600160a01b03851691612b7691614963565b600060405180830381855af49150503d8060008114612bb1576040519150601f19603f3d011682016040523d82523d6000602084013e612bb6565b606091505b5091509150818190612bdb5760405162461bcd60e51b815260040161120c9190614a2e565b506040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a2505050565b600690565b612c22614389565b506040805160208101909152670928ca80cfc20000815290565b612c44614368565b604051806060016040528060008152602001635fbef0008152602001611c20815250905090565b6000610a2a8260000151610a508460400151610ab98660200151610a5c613894565b612c95614389565b506040805160208101909152670de0b6b3a7640000815290565b600080612cbb33612ec6565b5091509150600083118015612cd05750600082115b612cec5760405162461bcd60e51b815260040161120c90614aaf565b81831115612d0c5760405162461bcd60e51b815260040161120c90614a8f565b6000612d1e838563ffffffff6127ec16565b9050612d2a3382612fa5565b50612d6a826040518060400160405280601e81526020017f4d61726b65743a20696e73756666696369656e74206465706f73697465640000815250612fc5565b612d7381612fe0565b50505050565b612d8161119c565b6001600160a01b03166340c10f1983836040518363ffffffff1660e01b8152600401612dae9291906149e8565b602060405180830381600087803b158015612dc857600080fd5b505af1158015612ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612e009190810190614516565b506121ae61351f565b6019546001600160a01b038316600090815260146020526040812060060154909190808214612e5c576001600160a01b038516600090815260146020526040902060058101859055600601829055612ea5565b6001600160a01b038516600090815260146020526040902060050154612e88908563ffffffff6127c716565b6001600160a01b0386166000908152601460205260409020600501555b505092915050565b601b54612ec0908263ffffffff6127c716565b601b5550565b6000806000612ed484610e38565b9250612edf84611527565b9150612ef1838363ffffffff6127ec16565b90508015612f9457612f038482613898565b612f0b611560565b6001600160a01b03166340c10f1930836040518363ffffffff1660e01b8152600401612f389291906149e8565b602060405180830381600087803b158015612f5257600080fd5b505af1158015612f66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250612f8a9190810190614516565b50612f94816138e7565b612f9d84613900565b509193909250565b6001600160a01b0390911660009081526014602052604081209190915590565b601654612fd990838363ffffffff61371816565b6016555050565b601654612ff3908263ffffffff6127c716565b60165550565b73c7da8087b8ba11f0892f1b0bfacfd44c116b303e90565b73de25486ccb4588ce5d9fb188fb6af72e768a466a90565b609690565b6001600160a01b03166000908152600e60205260409020600501805460ff19166001179055565b61305d614389565b6040518060200160405280612b0a8560000151670de0b6b3a764000086600001516137fb565b620f424090565b6001600160a01b0382166000908152600c60205260409020600101546130b6908263ffffffff6127c716565b6001600160a01b0383166000908152600c60205260409020600101556003546130e5908263ffffffff6127c716565b6003556040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90613126908590614add565b60405180910390a35050565b600454613145908263ffffffff6127c716565b60045550565b73170cec2070399b85363b788af2fb059db8ef8aed90565b600061316d61104a565b61317957506000610ac9565b613181614389565b61318d6110b484611542565b9050610ac561319a613926565b829063ffffffff612b1316565b602490565b6131b4611855565b6001600160a01b039092166000908152600e60205260409020918255600190910155565b6001600160a01b0383166000908152600e602052604090206003015461320590838363ffffffff61371816565b6001600160a01b039093166000908152600e60205260409020600301929092555050565b6001600160a01b0383166000908152600e602052604090206002015461325690838363ffffffff61371816565b6001600160a01b039093166000908152600e60205260409020600201929092555050565b6001600160a01b0382166000908152600e60205260409020600301546132a6908263ffffffff6127c716565b6001600160a01b039092166000908152600e602052604090206003019190915550565b6001600160a01b0382166000908152600e60205260409020600201546132f5908263ffffffff6127c716565b6001600160a01b039092166000908152600e602052604090206002019190915550565b6001600160a01b038083166000908152600e6020908152604080832093871683526004909301905220805482919060ff1916600183600281111561335857fe5b0217905550505050565b6001600160a01b0382166000908152600c60205260408120600501549061339461338b84610b6e565b610a5085612425565b905081811115612d73576001600160a01b0384166000908152600c6020526040902060050181905550505050565b6133fd6133cd611855565b6133d5611179565b1166426f6e64696e6760c81b720a6e8d2d8d840c6eae4e4cadce840cae0dec6d606b1b6128c2565b613405613947565b61176f61396e565b613415614389565b61341d614389565b613425613987565b915091506134338282613aea565b61344b61343e612c8d565b839063ffffffff612b1316565b156134605761345982613b25565b505061176f565b61347861346b612c8d565b839063ffffffff61350b16565b156134865761345982613c4a565b61348e611855565b6040517fff7db5a0dc69b02c191ba632db46961b7d0daa1bd30709ddba9b80ad0a15d2c090600090a25050565b6134c3614389565b6040518060200160405280612b0a85600001518560000151670de0b6b3a76400006137fb565b6134f1614389565b506040805160208101909152671158e460913d0000815290565b60006135178383613819565b159392505050565b61176f61354061352d610b9c565b610a50613538611f04565b610a5061104a565b61354861119c565b6001600160a01b03166370a08231306040518263ffffffff1660e01b81526004016135739190614997565b60206040518083038186803b15801561358b57600080fd5b505afa15801561359f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506135c39190810190614582565b10156a21b7b6b83a3937b63632b960a91b74496e636f6e73697374656e742062616c616e63657360581b6128c2565b6135fa614389565b613602614389565b61362161360d611933565b613615612c8d565b9063ffffffff613c9116565b905061362b614389565b61364a613636611933565b61363e611a87565b9063ffffffff61305516565b9050613654614389565b613664838363ffffffff61305516565b905061367e613671613cba565b829063ffffffff61350b16565b1561368e5761368b613cba565b90505b61369961319a613cdc565b156136a9576136a6613cdc565b90505b9250505090565b6001600160a01b0382166000908152601460205260409020600201546136dc908263ffffffff6127c716565b6001600160a01b0390921660009081526014602052604090206002019190915550565b601754613712908263ffffffff6127c716565b60175550565b6000818484111561373c5760405162461bcd60e51b815260040161120c9190614a2e565b505050900390565b600081836137655760405162461bcd60e51b815260040161120c9190614a2e565b50600083858161377157fe5b0495945050505050565b6060808260405160200161378f919061494e565b60408051601f19818403018152919052905060205b80156137e4578151600019909101908290829081106137bf57fe5b01602001516001600160f81b031916156137df5760010181529050610ac9565b6137a4565b505060408051600081526020810190915292915050565b600061381182610ab9868663ffffffff61282e16565b949350505050565b80518251600091141561382e57506001610a2a565b815183511161383e576000613841565b60025b60ff169392505050565b61385481613cfe565b6138705760405162461bcd60e51b815260040161120c90614a7f565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b4290565b6001600160a01b0382166000908152601460205260409020600301546138c4908263ffffffff6127c716565b6001600160a01b0390921660009081526014602052604090206003019190915550565b6018546138fa908263ffffffff6127c716565b60185550565b6015546001600160a01b0390911660009081526014602052604081206001019190915590565b61392e614389565b5060408051602081019091526611c37937e08000815290565b61394f610b96565b600d600061395b611855565b8152602081019190915260400160002055565b60025461398290600163ffffffff6127c716565b600255565b61398f614389565b613997614389565b61399f614389565b60006139a961157d565b6001600160a01b031663d4a3e9d76040518163ffffffff1660e01b81526004016040805180830381600087803b1580156139e257600080fd5b505af11580156139f6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613a1a9190810190614534565b91509150613a2e61078b6001610a5c611855565b15613a3e57613a3b613d04565b91505b80613a4e57613a4b612c8d565b91505b613a56614389565b6000613a60611ee0565b6001600160a01b031663d4a3e9d76040518163ffffffff1660e01b81526004016040805180830381600087803b158015613a9957600080fd5b505af1158015613aad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613ad19190810190614534565b9150915080613ade578391505b50919350909150509091565b81516011558051601c55613aff61343e612c8d565b15613b1c57601954613b1757613b13611855565b6019555b6121ae565b60006019555050565b613b2d614389565b613b59613b53613b3b613d26565b61363e613b46612c8d565b869063ffffffff613c9116565b83613d49565b90506000613bed613be8613b6b61119c565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015613ba357600080fd5b505afa158015613bb7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250613bdb9190810190614582565b849063ffffffff613d7f16565b613da6565b9050600080613bfb83613dc3565b91509150613c07611855565b85516040517f584c448165ec8a6d6b4374119d39b71df645b163f84f0c6c89230f5b8386c2ba91613c3b9186908690614af9565b60405180910390a25050505050565b6000613c5582613f1a565b9050613c5f611855565b82516040517fca273eb1c10e8cc7a5291aba3bae267c0037a2b9e70070e90f059e398d52651d91610e09918590614aeb565b613c99614389565b6040805160208101909152825184518291612b0a919063ffffffff6127ec16565b613cc2614389565b50604080516020810190915267016345785d8a0000815290565b613ce4614389565b506040805160208101909152674563918244f40000815290565b3b151590565b613d0c614389565b50604080516020810190915267155f2dd73a1a0000815290565b613d2e614389565b50604080516020810190915268015af1d78b58c40000815290565b613d51614389565b613d59614389565b613d61614134565b9050613d73848263ffffffff612b1316565b610b4c57509192915050565b613d87614389565b604080516020810190915283518190612b0a908563ffffffff61282e16565b8051600090610a2a90670de0b6b3a764000063ffffffff61286816565b6000806000613de56064610ab9613dd8614155565b879063ffffffff61282e16565b9050613df08161415a565b6000613e0f6064610ab9613e026141ee565b889063ffffffff61282e16565b9050613e1a816141f3565b600080613e25610a30565b90506000613e3c613e34610b68565b610a5c6120b6565b905081811015613e98576000613e656064610ab9613e58614217565b8c9063ffffffff61282e16565b90506000613e79848463ffffffff6127ec16565b9050818111613e885781613e8a565b805b9450613e958561421c565b50505b6000613eae84610a50888863ffffffff6127c716565b90506000818a11613ec0576000613ed0565b613ed08a8363ffffffff6127ec16565b9050613eda61104a565b613ee2575060005b8015613ef157613ef181614235565b613ef961351f565b84613f0a828463ffffffff6127c716565b9850985050505050505050915091565b600080613f256120b6565b90508015613f3557613f356142cc565b6000613f3f6114e4565b9050613f49614389565b613f516142d8565b90506000613f8a613f7083613f64612c8d565b9063ffffffff6142f916565b60408051602081019091528581529063ffffffff6134bb16565b519050613f9681614322565b613f9e614389565b614051613fa9614327565b614045613fb4613cba565b6040518060200160405280613fc7611560565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015613fff57600080fd5b505afa158015614013573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506140379190810190614582565b90529063ffffffff6134bb16565b9063ffffffff6134bb16565b905061405b611560565b6001600160a01b03166340c10f1961407161314b565b83516040516001600160e01b031960e085901b1681526140959291906004016149e8565b602060405180830381600087803b1580156140af57600080fd5b505af11580156140c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506140e79190810190614516565b5060006140f261104a565b1561412157614115614102614348565b604051806020016040528061403761104a565b51905061412181614235565b61412961351f565b979650505050505050565b61413c614389565b50604080516020810190915266470de4df820000815290565b602390565b80156118525761416861119c565b6001600160a01b03166340c10f1961417e610b8c565b836040518363ffffffff1660e01b815260040161419c9291906149e8565b602060405180830381600087803b1580156141b657600080fd5b505af11580156141ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506121ae9190810190614516565b600390565b80156118525761420161119c565b6001600160a01b03166340c10f1961417e612ff9565b603290565b601a5461422f908263ffffffff6127c716565b601a5550565b80156118525761424361119c565b6001600160a01b03166340c10f1930836040518363ffffffff1660e01b81526004016142709291906149e8565b602060405180830381600087803b15801561428a57600080fd5b505af115801561429e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506142c29190810190614516565b5061185281613132565b6000601a819055601b55565b6142e0614389565b50604080516020810190915266037235b96ea000815290565b614301614389565b6040805160208101909152825184518291612b0a919063ffffffff6127c716565b601555565b61432f614389565b506040805160208101909152660107c0e2fc2000815290565b614350614389565b506040805160208101909152652e625ce23000815290565b60405180606001604052806000815260200160008152602001600081525090565b6040518060200160405280600081525090565b8035610a2a81614bfe565b8051610a2a81614c12565b8035610a2a81614c1b565b8051610a2a81614c28565b6000602082840312156143da57600080fd5b6143e46020614b22565b905060006143f284846143bd565b82525092915050565b8035610a2a81614c28565b8051610a2a81614c31565b60006020828403121561442357600080fd5b6000613811848461439c565b6000806040838503121561444257600080fd5b600061444e858561439c565b925050602061445f8582860161439c565b9150509250929050565b60008060006060848603121561447e57600080fd5b600061448a868661439c565b935050602061449b8682870161439c565b92505060406144ac868287016143fb565b9150509250925092565b600080604083850312156144c957600080fd5b60006144d5858561439c565b925050602061445f858286016143b2565b600080604083850312156144f957600080fd5b6000614505858561439c565b925050602061445f858286016143fb565b60006020828403121561452857600080fd5b600061381184846143a7565b6000806040838503121561454757600080fd5b600061455385856143c8565b925050602061445f858286016143a7565b60006020828403121561457657600080fd5b600061381184846143fb565b60006020828403121561459457600080fd5b600061381184846143bd565b600080604083850312156145b357600080fd5b600061450585856143fb565b600080600080600060a086880312156145d757600080fd5b60006145e38888614406565b95505060206145f4888289016143bd565b9450506040614605888289016143bd565b9350506060614616888289016143bd565b925050608061462788828901614406565b9150509295509295909350565b61463d81614ba1565b82525050565b61463d81614b56565b61463d81614b61565b61463d61466182614b66565b614b73565b61463d61466182614b73565b600061467d82614b49565b6146878185610ac9565b9350614697818560208601614bbe565b9290920192915050565b61463d81614ba8565b61463d81614bb3565b60006146be82614b49565b6146c88185614b4d565b93506146d8818560208601614bbe565b6146e181614bea565b9093019392505050565b60006146f8602483614b4d565b7f4d61726b65743a20626f756e64206d75737420626520677265617465722074688152630616e20360e41b602082015260400192915050565b600061473e601b83614b4d565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000815260200192915050565b6000614777601883614b4d565b7f4d61726b65743a206e6f7420696e20657870616e73696f6e0000000000000000815260200192915050565b60006147b0602183614b4d565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f8152607760f81b602082015260400192915050565b60006147f3603b83614b4d565b7f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f81527f6e20746f2061206e6f6e2d636f6e747261637420616464726573730000000000602082015260400192915050565b6000614852602683614b4d565b7f4d61726b65743a20696e73756666696369656e7420616d6f756e7420746f20758152651b989bdd5b9960d21b602082015260400192915050565b600061489a601a83614b4d565b7f4d61726b65743a206e6f7420696e20636f6e7472616374696f6e000000000000815260200192915050565b60006148d3601483614b4d565b734d61726b65743a20616d6f756e7473203e20302160601b815260200192915050565b6000614903601d83614b4d565b7f4d61726b65743a206e6f7420656e6f7567682072656465656d61626c65000000815260200192915050565b80516020830190612d7384825b61463d81614b73565b61463d81614b8c565b600061495a8284614666565b50602001919050565b6000610b4c8284614672565b600061497b8286614672565b91506149878285614655565b600282019150610e8b8284614672565b60208101610a2a8284614643565b606081016149b38286614634565b6149c06020830185614643565b613811604083018461493c565b604081016149db8285614634565b610b4c602083018461493c565b604081016149db8285614643565b60208101610a2a828461464c565b60208101610a2a82846146a1565b60208101610a2a82846146aa565b604081016149db82856146aa565b60208082528101610b4c81846146b3565b60208082528101610a2a816146eb565b60208082528101610a2a81614731565b60208082528101610a2a8161476a565b60208082528101610a2a816147a3565b60208082528101610a2a816147e6565b60208082528101610a2a81614845565b60208082528101610a2a8161488d565b60208082528101610a2a816148c6565b60208082528101610a2a816148f6565b60208101610a2a828461492f565b60208101610a2a828461493c565b604081016149db828561493c565b60608101614b07828661493c565b6149c0602083018561493c565b60208101610a2a8284614945565b60405181810167ffffffffffffffff81118282101715614b4157600080fd5b604052919050565b5190565b90815260200190565b6000610a2a82614b80565b151590565b6001600160f01b03191690565b90565b80610ac981614bf4565b6001600160a01b031690565b60ff1690565b69ffffffffffffffffffff1690565b6000610a2a825b6000610a2a82614b56565b6000610a2a82614b76565b60005b83811015614bd9578181015183820152602001614bc1565b83811115612d735750506000910152565b601f01601f191690565b6003811061185257fe5b614c0781614b56565b811461185257600080fd5b614c0781614b61565b6003811061185257600080fd5b614c0781614b73565b614c0781614b9256fe426f6e64696e673a20696e73756666696369656e74207374616765642062616c616e6365426f6e64696e673a20696e73756666696369656e7420746f74616c20626f6e6465644d61726b65743a20696e73756666696369656e7420746f74616c206465706f7369746564a365627a7a723158200d528abba21df8f1a978bf70bfe1ddb1c450bae8a59f6152f0fc17131615b7816c6578706572696d656e74616cf564736f6c63430005110040
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.