ERC-20
Overview
Max Total Supply
500 XUSD
Holders
13
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
13.180272979776234334 XUSDValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
XUSDStablecoin
Compiler Version
v0.6.11+commit.5ef660b1
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "../Common/Context.sol"; import "../ERC20/IERC20.sol"; import "../ERC20/ERC20Custom.sol"; import "../ERC20/ERC20.sol"; import "../Math/SafeMath.sol"; import "./Pools/IXUSDPool.sol"; import "../Oracle/UniswapPairOracle.sol"; import "../Oracle/ChainlinkETHUSDPriceConsumer.sol"; contract XUSDStablecoin is ERC20Custom { using SafeMath for uint256; /* ========== STATE VARIABLES ========== */ enum PriceChoice { XUSD, XUS } ChainlinkETHUSDPriceConsumer private eth_usd_pricer; uint8 private eth_usd_pricer_decimals; UniswapPairOracle private xusdEthOracle; UniswapPairOracle private xusEthOracle; string public symbol; string public name; uint8 public constant decimals = 18; address public owner_address; address public timelock_address; // Governance timelock address address public controller_address; // Controller contract to dynamically adjust system parameters automatically address public xus_address; address public xusd_eth_oracle_address; address public xus_eth_oracle_address; address public weth_address; address public eth_usd_consumer_address; // mint 500 at genesis to bootstrap liquidity uint256 public constant genesis_supply = 500e18; // The addresses in this array are added by the oracle and these contracts are able to mint xusd address[] public xusd_pools_array; // Mapping is also used for faster verification mapping(address => bool) public xusd_pools; // Constants for various precisions uint256 private constant PRICE_PRECISION = 1e6; uint256 public global_collateral_ratio; // 6 decimals of precision, e.g. 924102 = 0.924102 uint256 public redemption_fee = 3000; // 6 decimals of precision, divide by 1000000 in calculations for fee uint256 public minting_fee = 7000; // 6 decimals of precision, divide by 1000000 in calculations for fee uint256 public xusd_step; // Amount to change the collateralization ratio by upon refreshCollateralRatio() uint256 public refresh_cooldown; // Seconds to wait before being able to run refreshCollateralRatio() again uint256 public price_target; // The price of XUSD at which the collateral ratio will respond to; this value is only used for the collateral ratio mechanism and not for minting and redeeming which are hardcoded at $1 uint256 public price_band; // The bound above and below the price target at which the refreshCollateralRatio() will not change the collateral ratio bool public collateral_ratio_paused = false; /* ========== MODIFIERS ========== */ modifier onlyPools() { require(xusd_pools[msg.sender] == true, "Only xusd pools can call this function"); _; } modifier onlyByOwnerOrGovernance() { require(msg.sender == owner_address || msg.sender == timelock_address || msg.sender == controller_address, "You are not the owner, controller, or the governance timelock"); _; } modifier onlyByOwnerGovernanceOrPool() { require( msg.sender == owner_address || msg.sender == timelock_address || xusd_pools[msg.sender] == true, "You are not the owner, the governance timelock, or a pool"); _; } /* ========== CONSTRUCTOR ========== */ constructor( string memory _name, string memory _symbol, address _timelock_address ) public { name = _name; symbol = _symbol; timelock_address = _timelock_address; owner_address = msg.sender; _mint(owner_address, genesis_supply); xusd_step = 2500; // 6 decimals of precision, equal to 0.25% global_collateral_ratio = 1000000; // XUSD system starts off fully collateralized (6 decimals of precision) refresh_cooldown = 3600; // Refresh cooldown period is set to 1 hour (3600 seconds) at genesis price_target = 1000000; // Collateral ratio will adjust according to the $1 price target at genesis price_band = 5000; // Collateral ratio will not adjust if between $0.995 and $1.005 at genesis } // FOR TEST ONLY! REMOVE WHEN MAINNET!!! // function setCR(uint256 _cr) external onlyByOwnerOrGovernance { // global_collateral_ratio = _cr; // } /* ========== VIEWS ========== */ // Choice = 'XUSD' or 'XUS' for now function oracle_price(PriceChoice choice) internal view returns (uint256) { // Get the ETH / USD price first, and cut it down to 1e6 precision uint256 eth_usd_price = uint256(eth_usd_pricer.getLatestPrice()).mul(PRICE_PRECISION).div(uint256(10) ** eth_usd_pricer_decimals); uint256 price_vs_eth; if (choice == PriceChoice.XUSD) { price_vs_eth = uint256(xusdEthOracle.consult(weth_address, PRICE_PRECISION)); // How much XUSD if you put in PRICE_PRECISION WETH } else if (choice == PriceChoice.XUS) { price_vs_eth = uint256(xusEthOracle.consult(weth_address, PRICE_PRECISION)); // How much XUS if you put in PRICE_PRECISION WETH } else revert("INVALID PRICE CHOICE. Needs to be either 0 (XUSD) or 1 (XUS)"); // Will be in 1e6 format return eth_usd_price.mul(PRICE_PRECISION).div(price_vs_eth); } // Returns X XUSD = 1 USD function xusd_price() public view returns (uint256) { return oracle_price(PriceChoice.XUSD); } // Returns X XUS = 1 USD function xus_price() public view returns (uint256) { return oracle_price(PriceChoice.XUS); } function eth_usd_price() public view returns (uint256) { return uint256(eth_usd_pricer.getLatestPrice()).mul(PRICE_PRECISION).div(uint256(10) ** eth_usd_pricer_decimals); } // This is needed to avoid costly repeat calls to different getter functions // It is cheaper gas-wise to just dump everything and only use some of the info function xusd_info() public view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256) { return ( oracle_price(PriceChoice.XUSD), // xusd_price() oracle_price(PriceChoice.XUS), // xus_price() totalSupply(), // totalSupply() global_collateral_ratio, // global_collateral_ratio() globalCollateralValue(), // globalCollateralValue minting_fee, // minting_fee() redemption_fee, // redemption_fee() uint256(eth_usd_pricer.getLatestPrice()).mul(PRICE_PRECISION).div(uint256(10) ** eth_usd_pricer_decimals) //eth_usd_price ); } // Iterate through all xusd pools and calculate all value of collateral in all pools globally function globalCollateralValue() public view returns (uint256) { uint256 total_collateral_value_d18 = 0; for (uint i = 0; i < xusd_pools_array.length; i++){ // Exclude null addresses if (xusd_pools_array[i] != address(0)){ total_collateral_value_d18 = total_collateral_value_d18.add(IXUSDPool(xusd_pools_array[i]).collatDollarBalance()); } } return total_collateral_value_d18; } /* ========== PUBLIC FUNCTIONS ========== */ // There needs to be a time interval that this can be called. Otherwise it can be called multiple times per expansion. uint256 public last_call_time; // Last time the refreshCollateralRatio function was called function refreshCollateralRatio() public { require(collateral_ratio_paused == false, "Collateral Ratio has been paused"); uint256 xusd_price_cur = xusd_price(); require(block.timestamp - last_call_time >= refresh_cooldown, "Must wait for the refresh cooldown since last refresh"); // Step increments are 0.25% (upon genesis, changable by setXUSDStep()) if (xusd_price_cur > price_target.add(price_band)) { //decrease collateral ratio if(global_collateral_ratio <= xusd_step){ //if within a step of 0, go to 0 global_collateral_ratio = 0; } else { global_collateral_ratio = global_collateral_ratio.sub(xusd_step); } } else if (xusd_price_cur < price_target.sub(price_band)) { //increase collateral ratio if(global_collateral_ratio.add(xusd_step) >= 1000000){ global_collateral_ratio = 1000000; // cap collateral ratio at 1.000000 } else { global_collateral_ratio = global_collateral_ratio.add(xusd_step); } } last_call_time = block.timestamp; // Set the time of the last expansion } /* ========== RESTRICTED FUNCTIONS ========== */ // Used by pools when user redeems function pool_burn_from(address b_address, uint256 b_amount) public onlyPools { super._burnFrom(b_address, b_amount); emit XUSDBurned(b_address, msg.sender, b_amount); } // This function is what other xusd pools will call to mint new XUSD function pool_mint(address m_address, uint256 m_amount) public onlyPools { super._mint(m_address, m_amount); emit XUSDMinted(msg.sender, m_address, m_amount); } // Adds collateral addresses supported, such as tether and busd, must be ERC20 function addPool(address pool_address) public onlyByOwnerOrGovernance { require(xusd_pools[pool_address] == false, "address already exists"); xusd_pools[pool_address] = true; xusd_pools_array.push(pool_address); } // Remove a pool function removePool(address pool_address) public onlyByOwnerOrGovernance { require(xusd_pools[pool_address] == true, "address doesn't exist already"); // Delete from the mapping delete xusd_pools[pool_address]; // 'Delete' from the array by setting the address to 0x0 for (uint i = 0; i < xusd_pools_array.length; i++){ if (xusd_pools_array[i] == pool_address) { xusd_pools_array[i] = address(0); // This will leave a null in the array and keep the indices the same break; } } } function setOwner(address _owner_address) external onlyByOwnerOrGovernance { owner_address = _owner_address; } function setRedemptionFee(uint256 red_fee) public onlyByOwnerOrGovernance { redemption_fee = red_fee; } function setMintingFee(uint256 min_fee) public onlyByOwnerOrGovernance { minting_fee = min_fee; } function setXUSDStep(uint256 _new_step) public onlyByOwnerOrGovernance { xusd_step = _new_step; } function setPriceTarget (uint256 _new_price_target) public onlyByOwnerOrGovernance { price_target = _new_price_target; } function setRefreshCooldown(uint256 _new_cooldown) public onlyByOwnerOrGovernance { refresh_cooldown = _new_cooldown; } function setXUSAddress(address _xus_address) public onlyByOwnerOrGovernance { xus_address = _xus_address; } function setETHUSDOracle(address _eth_usd_consumer_address) public onlyByOwnerOrGovernance { eth_usd_consumer_address = _eth_usd_consumer_address; eth_usd_pricer = ChainlinkETHUSDPriceConsumer(eth_usd_consumer_address); eth_usd_pricer_decimals = eth_usd_pricer.getDecimals(); } function setTimelock(address new_timelock) external onlyByOwnerOrGovernance { timelock_address = new_timelock; } function setController(address _controller_address) external onlyByOwnerOrGovernance { controller_address = _controller_address; } function setPriceBand(uint256 _price_band) external onlyByOwnerOrGovernance { price_band = _price_band; } // Sets the XUSD_ETH Uniswap oracle address function setXUSDEthOracle(address _xusd_oracle_addr, address _weth_address) public onlyByOwnerOrGovernance { xusd_eth_oracle_address = _xusd_oracle_addr; xusdEthOracle = UniswapPairOracle(_xusd_oracle_addr); weth_address = _weth_address; } // Sets the XUS_ETH Uniswap oracle address function setXUSEthOracle(address _xus_oracle_addr, address _weth_address) public onlyByOwnerOrGovernance { xus_eth_oracle_address = _xus_oracle_addr; xusEthOracle = UniswapPairOracle(_xus_oracle_addr); weth_address = _weth_address; } function toggleCollateralRatio() public onlyByOwnerOrGovernance { collateral_ratio_paused = !collateral_ratio_paused; } /* ========== EVENTS ========== */ // Track XUSD burned event XUSDBurned(address indexed from, address indexed to, uint256 amount); // Track XUSD minted event XUSDMinted(address indexed from, address indexed to, uint256 amount); }
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; /* * @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 { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; import "../Common/Context.sol"; import "./IERC20.sol"; import "../Math/SafeMath.sol"; import "../Utils/Address.sol"; /** * @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; string private _name; string private _symbol; uint8 private _decimals; /** * @dev Sets the values for {name} and {symbol}, initializes {decimals} with * a default value of 18. * * To select a different value for {decimals}, use {_setupDecimals}. * * All three of these values are immutable: they can only be set once during * construction. */ constructor (string memory name, string memory symbol) public { _name = name; _symbol = symbol; _decimals = 18; } /** * @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. This is the value {ERC20} uses, unless {_setupDecimals} is * called. * * 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; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override 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 virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address.approve(address spender, uint256 amount) */ function approve(address spender, uint256 amount) public virtual override 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 virtual override 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 virtual 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 virtual 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 virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _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 virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); } /** * @dev Destroys `amount` tokens from `account`, deducting from the caller's * allowance. * * See {ERC20-_burn} and {ERC20-allowance}. * * Requirements: * * - the caller must have allowance for `accounts`'s tokens of at least * `amount`. */ function burnFrom(address account, uint256 amount) public virtual { uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance"); _approve(account, _msgSender(), decreasedAllowance); _burn(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 virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _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 virtual { 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 virtual { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance")); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of `from`'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of `from`'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:using-hooks.adoc[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; import "../Common/Context.sol"; import "./IERC20.sol"; import "../Math/SafeMath.sol"; import "../Utils/Address.sol"; // Due to compiling issues, _name, _symbol, and _decimals were removed /** * @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 ERC20Custom is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) internal _balances; mapping (address => mapping (address => uint256)) internal _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view override 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 virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address.approve(address spender, uint256 amount) */ function approve(address spender, uint256 amount) public virtual override 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 virtual override 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 virtual 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 virtual 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 virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _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 virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from the caller. * * See {ERC20-_burn}. */ function burn(uint256 amount) public virtual { _burn(_msgSender(), amount); } /** * @dev Destroys `amount` tokens from `account`, deducting from the caller's * allowance. * * See {ERC20-_burn} and {ERC20-allowance}. * * Requirements: * * - the caller must have allowance for `accounts`'s tokens of at least * `amount`. */ function burnFrom(address account, uint256 amount) public virtual { uint256 decreasedAllowance = allowance(account, _msgSender()).sub(amount, "ERC20: burn amount exceeds allowance"); _approve(account, _msgSender(), decreasedAllowance); _burn(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 virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _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 virtual { 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 virtual { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance")); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of `from`'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of `from`'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:using-hooks.adoc[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; import "../Common/Context.sol"; import "../Math/SafeMath.sol"; /** * @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); }
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; // computes square roots using the babylonian method // https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method library Babylonian { function sqrt(uint y) internal pure returns (uint z) { if (y > 3) { z = y; uint x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } // else z = 0 } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; import './Babylonian.sol'; // a library for handling binary fixed point numbers (https://en.wikipedia.org/wiki/Q_(number_format)) library FixedPoint { // range: [0, 2**112 - 1] // resolution: 1 / 2**112 struct uq112x112 { uint224 _x; } // range: [0, 2**144 - 1] // resolution: 1 / 2**112 struct uq144x112 { uint _x; } uint8 private constant RESOLUTION = 112; uint private constant Q112 = uint(1) << RESOLUTION; uint private constant Q224 = Q112 << RESOLUTION; // encode a uint112 as a UQ112x112 function encode(uint112 x) internal pure returns (uq112x112 memory) { return uq112x112(uint224(x) << RESOLUTION); } // encodes a uint144 as a UQ144x112 function encode144(uint144 x) internal pure returns (uq144x112 memory) { return uq144x112(uint256(x) << RESOLUTION); } // divide a UQ112x112 by a uint112, returning a UQ112x112 function div(uq112x112 memory self, uint112 x) internal pure returns (uq112x112 memory) { require(x != 0, 'FixedPoint: DIV_BY_ZERO'); return uq112x112(self._x / uint224(x)); } // multiply a UQ112x112 by a uint, returning a UQ144x112 // reverts on overflow function mul(uq112x112 memory self, uint y) internal pure returns (uq144x112 memory) { uint z; require(y == 0 || (z = uint(self._x) * y) / y == uint(self._x), "FixedPoint: MULTIPLICATION_OVERFLOW"); return uq144x112(z); } // returns a UQ112x112 which represents the ratio of the numerator to the denominator // equivalent to encode(numerator).div(denominator) function fraction(uint112 numerator, uint112 denominator) internal pure returns (uq112x112 memory) { require(denominator > 0, "FixedPoint: DIV_BY_ZERO"); return uq112x112((uint224(numerator) << RESOLUTION) / denominator); } // decode a UQ112x112 into a uint112 by truncating after the radix point function decode(uq112x112 memory self) internal pure returns (uint112) { return uint112(self._x >> RESOLUTION); } // decode a UQ144x112 into a uint144 by truncating after the radix point function decode144(uq144x112 memory self) internal pure returns (uint144) { return uint144(self._x >> RESOLUTION); } // take the reciprocal of a UQ112x112 function reciprocal(uq112x112 memory self) internal pure returns (uq112x112 memory) { require(self._x != 0, 'FixedPoint: ZERO_RECIPROCAL'); return uq112x112(uint224(Q224 / self._x)); } // square root of a UQ112x112 function sqrt(uq112x112 memory self) internal pure returns (uq112x112 memory) { return uq112x112(uint224(Babylonian.sqrt(uint256(self._x)) << 56)); } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; /** * @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; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0; 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 ); }
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "./AggregatorV3Interface.sol"; contract ChainlinkETHUSDPriceConsumer { AggregatorV3Interface internal priceFeed; constructor() public { priceFeed = AggregatorV3Interface(0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419); } /** * Returns the latest price */ function getLatestPrice() public view returns (int) { ( , int price, , , ) = priceFeed.latestRoundData(); return price; } function getDecimals() public view returns (uint8) { return priceFeed.decimals(); } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; import '../Uniswap/Interfaces/IUniswapV2Factory.sol'; import '../Uniswap/Interfaces/IUniswapV2Pair.sol'; import '../Math/FixedPoint.sol'; import '../Uniswap/UniswapV2OracleLibrary.sol'; import '../Uniswap/UniswapV2Library.sol'; // Fixed window oracle that recomputes the average price for the entire period once every period // Note that the price average is only guaranteed to be over at least 1 period, but may be over a longer period contract UniswapPairOracle { using FixedPoint for *; address owner_address; address timelock_address; uint public PERIOD = 3600; // 1 hour TWAP (time-weighted average price) IUniswapV2Pair public immutable pair; address public immutable token0; address public immutable token1; uint public price0CumulativeLast; uint public price1CumulativeLast; uint32 public blockTimestampLast; FixedPoint.uq112x112 public price0Average; FixedPoint.uq112x112 public price1Average; modifier onlyByOwnerOrGovernance() { require(msg.sender == owner_address || msg.sender == timelock_address, "You are not an owner or the governance timelock"); _; } constructor(address factory, address tokenA, address tokenB, address _owner_address, address _timelock_address) public { IUniswapV2Pair _pair = IUniswapV2Pair(UniswapV2Library.pairFor(factory, tokenA, tokenB)); pair = _pair; token0 = _pair.token0(); token1 = _pair.token1(); price0CumulativeLast = _pair.price0CumulativeLast(); // Fetch the current accumulated price value (1 / 0) price1CumulativeLast = _pair.price1CumulativeLast(); // Fetch the current accumulated price value (0 / 1) uint112 reserve0; uint112 reserve1; (reserve0, reserve1, blockTimestampLast) = _pair.getReserves(); require(reserve0 != 0 && reserve1 != 0, 'UniswapPairOracle: NO_RESERVES'); // Ensure that there's liquidity in the pair owner_address = _owner_address; timelock_address = _timelock_address; } function setOwner(address _owner_address) external onlyByOwnerOrGovernance { owner_address = _owner_address; } function setTimelock(address _timelock_address) external onlyByOwnerOrGovernance { timelock_address = _timelock_address; } function setPeriod(uint _period) external onlyByOwnerOrGovernance { PERIOD = _period; } function update() external { (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) = UniswapV2OracleLibrary.currentCumulativePrices(address(pair)); uint32 timeElapsed = blockTimestamp - blockTimestampLast; // Overflow is desired // Ensure that at least one full period has passed since the last update require(timeElapsed >= PERIOD, 'UniswapPairOracle: PERIOD_NOT_ELAPSED'); // Overflow is desired, casting never truncates // Cumulative price is in (uq112x112 price * seconds) units so we simply wrap it after division by time elapsed price0Average = FixedPoint.uq112x112(uint224((price0Cumulative - price0CumulativeLast) / timeElapsed)); price1Average = FixedPoint.uq112x112(uint224((price1Cumulative - price1CumulativeLast) / timeElapsed)); price0CumulativeLast = price0Cumulative; price1CumulativeLast = price1Cumulative; blockTimestampLast = blockTimestamp; } // Note this will always return 0 before update has been called successfully for the first time. function consult(address token, uint amountIn) external view returns (uint amountOut) { if (token == token0) { amountOut = price0Average.mul(amountIn).decode144(); } else { require(token == token1, 'UniswapPairOracle: INVALID_TOKEN'); amountOut = price1Average.mul(amountIn).decode144(); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; }
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; 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; }
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; import './Interfaces/IUniswapV2Pair.sol'; import './Interfaces/IUniswapV2Factory.sol'; import "../Math/SafeMath.sol"; library UniswapV2Library { using SafeMath for uint; // returns sorted token addresses, used to handle return values from pairs sorted in this order function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS'); } // Less efficient than the CREATE2 method below function pairFor(address factory, address tokenA, address tokenB) internal view returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = IUniswapV2Factory(factory).getPair(token0, token1); } // calculates the CREATE2 address for a pair without making any external calls function pairForCreate2(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash )))); // this matches the CREATE2 in UniswapV2Factory.createPair } // fetches and sorts the reserves for a pair function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); } // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; } // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amountIn.mul(997); uint numerator = amountInWithFee.mul(reserveOut); uint denominator = reserveIn.mul(1000).add(amountInWithFee); amountOut = numerator / denominator; } // given an output amount of an asset and pair reserves, returns a required input amount of the other asset function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn.mul(amountOut).mul(1000); uint denominator = reserveOut.sub(amountOut).mul(997); amountIn = (numerator / denominator).add(1); } // performs chained getAmountOut calculations on any number of pairs function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]); amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); } } // performs chained getAmountIn calculations on any number of pairs function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.length - 1; i > 0; i--) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]); amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); } } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; import '../Uniswap/Interfaces/IUniswapV2Pair.sol'; import '../Math/FixedPoint.sol'; // library with helper methods for oracles that are concerned with computing average prices library UniswapV2OracleLibrary { using FixedPoint for *; // helper function that returns the current block timestamp within the range of uint32, i.e. [0, 2**32 - 1] function currentBlockTimestamp() internal view returns (uint32) { return uint32(block.timestamp % 2 ** 32); } // produces the cumulative price using counterfactuals to save gas and avoid a call to sync. function currentCumulativePrices( address pair ) internal view returns (uint price0Cumulative, uint price1Cumulative, uint32 blockTimestamp) { blockTimestamp = currentBlockTimestamp(); price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast(); price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast(); // if time has elapsed since the last update on the pair, mock the accumulated price values (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast) = IUniswapV2Pair(pair).getReserves(); if (blockTimestampLast != blockTimestamp) { // subtraction overflow is desired uint32 timeElapsed = blockTimestamp - blockTimestampLast; // addition overflow is desired // counterfactual price0Cumulative += uint(FixedPoint.fraction(reserve1, reserve0)._x) * timeElapsed; // counterfactual price1Cumulative += uint(FixedPoint.fraction(reserve0, reserve1)._x) * timeElapsed; } } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain`call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; interface IXUSDPool { function collatDollarBalance() external view returns (uint256); function availableExcessCollatDV() external view returns (uint256); function getCollateralPrice() external view returns (uint256); }
{ "remappings": [], "optimizer": { "enabled": false, "runs": 200 }, "evmVersion": "istanbul", "libraries": {}, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"address","name":"_timelock_address","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","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":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"XUSDBurned","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":"amount","type":"uint256"}],"name":"XUSDMinted","type":"event"},{"inputs":[{"internalType":"address","name":"pool_address","type":"address"}],"name":"addPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"collateral_ratio_paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller_address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"eth_usd_consumer_address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eth_usd_price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"genesis_supply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"globalCollateralValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"global_collateral_ratio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"last_call_time","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minting_fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner_address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"b_address","type":"address"},{"internalType":"uint256","name":"b_amount","type":"uint256"}],"name":"pool_burn_from","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"m_address","type":"address"},{"internalType":"uint256","name":"m_amount","type":"uint256"}],"name":"pool_mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"price_band","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"price_target","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"redemption_fee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"refreshCollateralRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"refresh_cooldown","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pool_address","type":"address"}],"name":"removePool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_controller_address","type":"address"}],"name":"setController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_eth_usd_consumer_address","type":"address"}],"name":"setETHUSDOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"min_fee","type":"uint256"}],"name":"setMintingFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_owner_address","type":"address"}],"name":"setOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_price_band","type":"uint256"}],"name":"setPriceBand","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_new_price_target","type":"uint256"}],"name":"setPriceTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"red_fee","type":"uint256"}],"name":"setRedemptionFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_new_cooldown","type":"uint256"}],"name":"setRefreshCooldown","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"new_timelock","type":"address"}],"name":"setTimelock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_xus_address","type":"address"}],"name":"setXUSAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_xusd_oracle_addr","type":"address"},{"internalType":"address","name":"_weth_address","type":"address"}],"name":"setXUSDEthOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_new_step","type":"uint256"}],"name":"setXUSDStep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_xus_oracle_addr","type":"address"},{"internalType":"address","name":"_weth_address","type":"address"}],"name":"setXUSEthOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"timelock_address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"toggleCollateralRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"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"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"weth_address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xus_address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xus_eth_oracle_address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xus_price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xusd_eth_oracle_address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xusd_info","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"xusd_pools","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"xusd_pools_array","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xusd_price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xusd_step","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
6080604052610bb8601355611b586014556000601960006101000a81548160ff0219169083151502179055503480156200003857600080fd5b50604051620056113803806200561183398181016040528101906200005e9190620004b5565b82600790805190602001906200007692919062000393565b5081600690805190602001906200008f92919062000393565b5080600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555033600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506200014f600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16681b1ae4d6e2ef5000006200018760201b60201c565b6109c4601581905550620f4240601281905550610e10601681905550620f42406017819055506113886018819055505050506200072d565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415620001fa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001f190620005f4565b60405180910390fd5b6200020e600083836200033660201b60201c565b6200022a816002546200033b60201b620034361790919060201c565b60028190555062000288816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546200033b60201b620034361790919060201c565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516200032a919062000616565b60405180910390a35050565b505050565b60008082840190508381101562000389576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016200038090620005d2565b60405180910390fd5b8091505092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10620003d657805160ff191683800117855562000407565b8280016001018555821562000407579182015b8281111562000406578251825591602001919060010190620003e9565b5b5090506200041691906200041a565b5090565b6200043f91905b808211156200043b57600081600090555060010162000421565b5090565b90565b600081519050620004538162000713565b92915050565b600082601f8301126200046b57600080fd5b8151620004826200047c8262000661565b62000633565b915080825260208301602083018583830111156200049f57600080fd5b620004ac838284620006dd565b50505092915050565b600080600060608486031215620004cb57600080fd5b600084015167ffffffffffffffff811115620004e657600080fd5b620004f48682870162000459565b935050602084015167ffffffffffffffff8111156200051257600080fd5b620005208682870162000459565b9250506040620005338682870162000442565b9150509250925092565b60006200054c601b836200068e565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b60006200058e601f836200068e565b91507f45524332303a206d696e7420746f20746865207a65726f2061646472657373006000830152602082019050919050565b620005cc81620006d3565b82525050565b60006020820190508181036000830152620005ed816200053d565b9050919050565b600060208201905081810360008301526200060f816200057f565b9050919050565b60006020820190506200062d6000830184620005c1565b92915050565b6000604051905081810181811067ffffffffffffffff821117156200065757600080fd5b8060405250919050565b600067ffffffffffffffff8211156200067957600080fd5b601f19601f8301169050602081019050919050565b600082825260208201905092915050565b6000620006ac82620006b3565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015620006fd578082015181840152602081019050620006e0565b838111156200070d576000848401525b50505050565b6200071e816200069f565b81146200072a57600080fd5b50565b614ed4806200073d6000396000f3fe608060405234801561001057600080fd5b50600436106103835760003560e01c8063741d3c18116101de578063b717fa451161010f578063d2d97b06116100ad578063e56b742c1161007c578063e56b742c14610a14578063ebeb9ebf14610a39578063f56a40ae14610a57578063f853c9f414610a7557610383565b8063d2d97b061461098c578063d914cd4b146109aa578063dc6663c7146109c6578063dd62ed3e146109e457610383565b8063c03f7be3116100e9578063c03f7be314610916578063c3355b8d14610934578063cb73999f14610952578063cd1b7fcc1461097057610383565b8063b717fa45146108c0578063bdacb303146108f0578063bef40ec81461090c57610383565b8063a087b6a61161017c578063a9059cbb11610156578063a9059cbb1461083a578063ad2f8ce41461086a578063b0fc69ce14610886578063b4f56b26146108a457610383565b8063a087b6a6146107d0578063a457c2d7146107ee578063a8a778ae1461081e57610383565b806380edef8e116101b857806380edef8e1461075a57806387a140c31461077857806392eefe9b1461079657806395d89b41146107b257610383565b8063741d3c181461070657806379cc6790146107225780637dbc1df01461073e57610383565b80632eb9771b116102b857806342966c68116102565780636140133b116102305780636140133b1461066c57806365e244fc1461068857806367feda3e146106b857806370a08231146106d657610383565b806342966c681461061457806351e238e31461063057806360e10f811461064e57610383565b8063395093511161029257806339509351146105a25780633b7d0946146105d25780634013124a146105ee578063408ab10f146105f857610383565b80632eb9771b14610548578063313ce56714610566578063345ba24b1461058457610383565b806322403cb21161032557806323b872dd116102ff57806323b872dd146104be578063246126bd146104ee5780632853fb101461050c5780632cb4f63e1461052a57610383565b806322403cb2146104665780632258750a14610484578063238a4709146104a257610383565b80630a619ae0116103615780630a619ae0146103f257806313af40351461041057806318160ddd1461042c5780631c5df1e51461044a57610383565b806306fdde031461038857806307a2e5f6146103a6578063095ea7b3146103c2575b600080fd5b610390610a91565b60405161039d9190614a14565b60405180910390f35b6103c060048036038101906103bb9190614299565b610b2f565b005b6103dc60048036038101906103d79190614324565b610d36565b6040516103e991906149f9565b60405180910390f35b6103fa610d54565b6040516104079190614c16565b60405180910390f35b61042a60048036038101906104259190614270565b610d5a565b005b610434610ede565b6040516104419190614c16565b60405180910390f35b610464600480360381019061045f9190614389565b610ee8565b005b61046e611032565b60405161047b91906149b5565b60405180910390f35b61048c611058565b6040516104999190614c16565b60405180910390f35b6104bc60048036038101906104b79190614389565b61105e565b005b6104d860048036038101906104d391906142d5565b6111a8565b6040516104e591906149f9565b60405180910390f35b6104f6611281565b60405161050391906149b5565b60405180910390f35b6105146112a7565b6040516105219190614c16565b60405180910390f35b6105326112ad565b60405161053f9190614c16565b60405180910390f35b6105506112b3565b60405161055d9190614c16565b60405180910390f35b61056e6112b9565b60405161057b9190614caf565b60405180910390f35b61058c6112be565b6040516105999190614c16565b60405180910390f35b6105bc60048036038101906105b79190614324565b6113a1565b6040516105c991906149f9565b60405180910390f35b6105ec60048036038101906105e79190614270565b611454565b005b6105f6611761565b005b610612600480360381019061060d9190614389565b6118dc565b005b61062e60048036038101906106299190614389565b611a26565b005b610638611a3a565b6040516106459190614c16565b60405180910390f35b610656611a47565b6040516106639190614c16565b60405180910390f35b61068660048036038101906106819190614389565b611a58565b005b6106a2600480360381019061069d9190614389565b611ba2565b6040516106af91906149b5565b60405180910390f35b6106c0611bde565b6040516106cd91906149b5565b60405180910390f35b6106f060048036038101906106eb9190614270565b611c04565b6040516106fd9190614c16565b60405180910390f35b610720600480360381019061071b9190614270565b611c4c565b005b61073c60048036038101906107379190614324565b611eed565b005b61075860048036038101906107539190614389565b611f4f565b005b610762612099565b60405161076f91906149b5565b60405180910390f35b6107806120bf565b60405161078d91906149f9565b60405180910390f35b6107b060048036038101906107ab9190614270565b6120d2565b005b6107ba612256565b6040516107c79190614a14565b60405180910390f35b6107d86122f4565b6040516107e591906149b5565b60405180910390f35b61080860048036038101906108039190614324565b61231a565b60405161081591906149f9565b60405180910390f35b61083860048036038101906108339190614324565b6123e7565b005b610854600480360381019061084f9190614324565b6124ed565b60405161086191906149f9565b60405180910390f35b610884600480360381019061087f9190614389565b61250b565b005b61088e612655565b60405161089b91906149b5565b60405180910390f35b6108be60048036038101906108b99190614324565b61267b565b005b6108da60048036038101906108d59190614270565b612781565b6040516108e791906149f9565b60405180910390f35b61090a60048036038101906109059190614270565b6127a1565b005b610914612925565b005b61091e612a91565b60405161092b9190614c16565b60405180910390f35b61093c612a97565b6040516109499190614c16565b60405180910390f35b61095a612a9d565b6040516109679190614c16565b60405180910390f35b61098a60048036038101906109859190614299565b612aa3565b005b610994612caa565b6040516109a19190614c16565b60405180910390f35b6109c460048036038101906109bf9190614270565b612e0e565b005b6109ce61309f565b6040516109db91906149b5565b60405180910390f35b6109fe60048036038101906109f99190614299565b6130c5565b604051610a0b9190614c16565b60405180910390f35b610a1c61314c565b604051610a30989796959493929190614c31565b60405180910390f35b610a4161327b565b604051610a4e9190614c16565b60405180910390f35b610a5f61328c565b604051610a6c91906149b5565b60405180910390f35b610a8f6004803603810190610a8a9190614270565b6132b2565b005b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b275780601f10610afc57610100808354040283529160200191610b27565b820191906000526020600020905b815481529060010190602001808311610b0a57829003601f168201915b505050505081565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610bd85750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80610c305750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6690614af6565b60405180910390fd5b81600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000610d4a610d4361348b565b8484613493565b6001905092915050565b60155481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610e035750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80610e5b5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9190614af6565b60405180910390fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600254905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610f915750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80610fe95750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611028576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101f90614af6565b60405180910390fd5b8060168190555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601a5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806111075750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b8061115f5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61119e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119590614af6565b60405180910390fd5b8060148190555050565b60006111b584848461365e565b611276846111c161348b565b61127185604051806060016040528060288152602001614e2e60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061122761348b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f39092919063ffffffff16565b613493565b600190509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60185481565b60175481565b60125481565b601281565b600061139c600360149054906101000a900460ff1660ff16600a0a61138e620f4240600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b815260040160206040518083038186803b15801561134857600080fd5b505afa15801561135c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113809190614360565b61394e90919063ffffffff16565b6139be90919063ffffffff16565b905090565b600061144a6113ae61348b565b8461144585600160006113bf61348b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343690919063ffffffff16565b613493565b6001905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806114fd5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806115555750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611594576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158b90614af6565b60405180910390fd5b60011515601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611627576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161e90614ab6565b60405180910390fd5b601160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905560008090505b60108054905081101561175d578173ffffffffffffffffffffffffffffffffffffffff16601082815481106116ad57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156117505760006010828154811061170357fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061175d565b808060010191505061167c565b5050565b60001515601960009054906101000a900460ff161515146117b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ae90614bb6565b60405180910390fd5b60006117c1611a47565b9050601654601a544203101561180c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180390614b96565b60405180910390fd5b61182360185460175461343690919063ffffffff16565b8111156118655760155460125411611842576000601281905550611860565b611859601554601254613a0890919063ffffffff16565b6012819055505b6118d2565b61187c601854601754613a0890919063ffffffff16565b8110156118d157620f424061189e60155460125461343690919063ffffffff16565b106118b257620f42406012819055506118d0565b6118c960155460125461343690919063ffffffff16565b6012819055505b5b5b42601a8190555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806119855750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806119dd5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1390614af6565b60405180910390fd5b8060178190555050565b611a37611a3161348b565b82613a52565b50565b681b1ae4d6e2ef50000081565b6000611a536000613c00565b905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611b015750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80611b595750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611b98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b8f90614af6565b60405180910390fd5b8060188190555050565b60108181548110611baf57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611cf55750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80611d4d5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611d8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8390614af6565b60405180910390fd5b80600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f0141d846040518163ffffffff1660e01b815260040160206040518083038186803b158015611e9857600080fd5b505afa158015611eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed091906143db565b600360146101000a81548160ff021916908360ff16021790555050565b6000611f2c82604051806060016040528060248152602001614e5660249139611f1d86611f1861348b565b6130c5565b6138f39092919063ffffffff16565b9050611f4083611f3a61348b565b83613493565b611f4a8383613a52565b505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611ff85750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806120505750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61208f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208690614af6565b60405180910390fd5b8060138190555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601960009054906101000a900460ff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061217b5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806121d35750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612212576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161220990614af6565b60405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156122ec5780601f106122c1576101008083540402835291602001916122ec565b820191906000526020600020905b8154815290600101906020018083116122cf57829003601f168201915b505050505081565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006123dd61232761348b565b846123d885604051806060016040528060258152602001614e7a602591396001600061235161348b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f39092919063ffffffff16565b613493565b6001905092915050565b60011515601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461247a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247190614a56565b60405180910390fd5b6124848282613f3e565b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4d62459ee04e10636b8fb474ff487ba15b01c013a2bdf7f9e82deafb88043502836040516124e19190614c16565b60405180910390a35050565b60006125016124fa61348b565b848461365e565b6001905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806125b45750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b8061260c5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61264b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161264290614af6565b60405180910390fd5b8060158190555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60011515601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461270e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270590614a56565b60405180910390fd5b612718828261400d565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f67aaa692dd2aa98aefdd0a45df45f3ef389ca47386032994bfdf0f66c19f08e0836040516127759190614c16565b60405180910390a35050565b60116020528060005260406000206000915054906101000a900460ff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061284a5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806128a25750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6128e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128d890614af6565b60405180910390fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806129ce5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80612a265750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612a65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a5c90614af6565b60405180910390fd5b601960009054906101000a900460ff1615601960006101000a81548160ff021916908315150217905550565b60165481565b60145481565b60135481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612b4c5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80612ba45750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612be3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bda90614af6565b60405180910390fd5b81600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000806000905060008090505b601080549050811015612e0657600073ffffffffffffffffffffffffffffffffffffffff1660108281548110612ce957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612df957612df660108281548110612d3f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166317284c946040518163ffffffff1660e01b815260040160206040518083038186803b158015612daf57600080fd5b505afa158015612dc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612de791906143b2565b8361343690919063ffffffff16565b91505b8080600101915050612cb7565b508091505090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612eb75750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80612f0f5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612f4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f4590614af6565b60405180910390fd5b60001515601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612fe1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fd890614bd6565b60405180910390fd5b6001601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506010819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000806000806000806000806131626000613c00565b61316c6001613c00565b613174610ede565b60125461317f612caa565b601454601354613261600360149054906101000a900460ff1660ff16600a0a613253620f4240600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b815260040160206040518083038186803b15801561320d57600080fd5b505afa158015613221573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132459190614360565b61394e90919063ffffffff16565b6139be90919063ffffffff16565b975097509750975097509750975097509091929394959697565b60006132876001613c00565b905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061335b5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806133b35750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6133f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016133e990614af6565b60405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015613481576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161347890614a96565b60405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415613503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016134fa90614b76565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613573576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161356a90614a76565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516136519190614c16565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156136ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016136c590614b56565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561373e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161373590614a36565b60405180910390fd5b6137498383836141a1565b6137b481604051806060016040528060268152602001614e08602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f39092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613847816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343690919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516138e69190614c16565b60405180910390a3505050565b600083831115829061393b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016139329190614a14565b60405180910390fd5b5060008385039050809150509392505050565b60008083141561396157600090506139b8565b600082840290508284828161397257fe5b04146139b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016139aa90614b16565b60405180910390fd5b809150505b92915050565b6000613a0083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506141a6565b905092915050565b6000613a4a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506138f3565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613ac2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613ab990614b36565b60405180910390fd5b613ace826000836141a1565b613b3981604051806060016040528060228152602001614de6602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f39092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613b9081600254613a0890919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051613bf49190614c16565b60405180910390a35050565b600080613cdf600360149054906101000a900460ff1660ff16600a0a613cd1620f4240600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b815260040160206040518083038186803b158015613c8b57600080fd5b505afa158015613c9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cc39190614360565b61394e90919063ffffffff16565b6139be90919063ffffffff16565b90506000806001811115613cef57fe5b846001811115613cfb57fe5b1415613dda57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633ddac953600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16620f42406040518363ffffffff1660e01b8152600401613d839291906149d0565b60206040518083038186803b158015613d9b57600080fd5b505afa158015613daf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dd391906143b2565b9050613f0d565b600180811115613de657fe5b846001811115613df257fe5b1415613ed157600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633ddac953600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16620f42406040518363ffffffff1660e01b8152600401613e7a9291906149d0565b60206040518083038186803b158015613e9257600080fd5b505afa158015613ea6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613eca91906143b2565b9050613f0c565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613f0390614ad6565b60405180910390fd5b5b613f3581613f27620f42408561394e90919063ffffffff16565b6139be90919063ffffffff16565b92505050919050565b613f488282613a52565b61400982613f5461348b565b61400484604051806060016040528060248152602001614e5660249139600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000613fba61348b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f39092919063ffffffff16565b613493565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561407d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161407490614bf6565b60405180910390fd5b614089600083836141a1565b61409e8160025461343690919063ffffffff16565b6002819055506140f5816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343690919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516141959190614c16565b60405180910390a35050565b505050565b600080831182906141ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016141e49190614a14565b60405180910390fd5b5060008385816141f957fe5b049050809150509392505050565b60008135905061421681614d89565b92915050565b60008151905061422b81614da0565b92915050565b60008135905061424081614db7565b92915050565b60008151905061425581614db7565b92915050565b60008151905061426a81614dce565b92915050565b60006020828403121561428257600080fd5b600061429084828501614207565b91505092915050565b600080604083850312156142ac57600080fd5b60006142ba85828601614207565b92505060206142cb85828601614207565b9150509250929050565b6000806000606084860312156142ea57600080fd5b60006142f886828701614207565b935050602061430986828701614207565b925050604061431a86828701614231565b9150509250925092565b6000806040838503121561433757600080fd5b600061434585828601614207565b925050602061435685828601614231565b9150509250929050565b60006020828403121561437257600080fd5b60006143808482850161421c565b91505092915050565b60006020828403121561439b57600080fd5b60006143a984828501614231565b91505092915050565b6000602082840312156143c457600080fd5b60006143d284828501614246565b91505092915050565b6000602082840312156143ed57600080fd5b60006143fb8482850161425b565b91505092915050565b61440d81614ce6565b82525050565b61441c81614cf8565b82525050565b600061442d82614cca565b6144378185614cd5565b9350614447818560208601614d45565b61445081614d78565b840191505092915050565b6000614468602383614cd5565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006144ce602683614cd5565b91507f4f6e6c79207875736420706f6f6c732063616e2063616c6c207468697320667560008301527f6e6374696f6e00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614534602283614cd5565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061459a601b83614cd5565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b60006145da601d83614cd5565b91507f6164647265737320646f65736e277420657869737420616c72656164790000006000830152602082019050919050565b600061461a603c83614cd5565b91507f494e56414c49442050524943452043484f4943452e204e6565647320746f206260008301527f6520656974686572203020285855534429206f722031202858555329000000006020830152604082019050919050565b6000614680603d83614cd5565b91507f596f7520617265206e6f7420746865206f776e65722c20636f6e74726f6c6c6560008301527f722c206f722074686520676f7665726e616e63652074696d656c6f636b0000006020830152604082019050919050565b60006146e6602183614cd5565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061474c602183614cd5565b91507f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008301527f73000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006147b2602583614cd5565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614818602483614cd5565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061487e603583614cd5565b91507f4d757374207761697420666f7220746865207265667265736820636f6f6c646f60008301527f776e2073696e6365206c617374207265667265736800000000000000000000006020830152604082019050919050565b60006148e4602083614cd5565b91507f436f6c6c61746572616c20526174696f20686173206265656e207061757365646000830152602082019050919050565b6000614924601683614cd5565b91507f6164647265737320616c726561647920657869737473000000000000000000006000830152602082019050919050565b6000614964601f83614cd5565b91507f45524332303a206d696e7420746f20746865207a65726f2061646472657373006000830152602082019050919050565b6149a081614d2e565b82525050565b6149af81614d38565b82525050565b60006020820190506149ca6000830184614404565b92915050565b60006040820190506149e56000830185614404565b6149f26020830184614997565b9392505050565b6000602082019050614a0e6000830184614413565b92915050565b60006020820190508181036000830152614a2e8184614422565b905092915050565b60006020820190508181036000830152614a4f8161445b565b9050919050565b60006020820190508181036000830152614a6f816144c1565b9050919050565b60006020820190508181036000830152614a8f81614527565b9050919050565b60006020820190508181036000830152614aaf8161458d565b9050919050565b60006020820190508181036000830152614acf816145cd565b9050919050565b60006020820190508181036000830152614aef8161460d565b9050919050565b60006020820190508181036000830152614b0f81614673565b9050919050565b60006020820190508181036000830152614b2f816146d9565b9050919050565b60006020820190508181036000830152614b4f8161473f565b9050919050565b60006020820190508181036000830152614b6f816147a5565b9050919050565b60006020820190508181036000830152614b8f8161480b565b9050919050565b60006020820190508181036000830152614baf81614871565b9050919050565b60006020820190508181036000830152614bcf816148d7565b9050919050565b60006020820190508181036000830152614bef81614917565b9050919050565b60006020820190508181036000830152614c0f81614957565b9050919050565b6000602082019050614c2b6000830184614997565b92915050565b600061010082019050614c47600083018b614997565b614c54602083018a614997565b614c616040830189614997565b614c6e6060830188614997565b614c7b6080830187614997565b614c8860a0830186614997565b614c9560c0830185614997565b614ca260e0830184614997565b9998505050505050505050565b6000602082019050614cc460008301846149a6565b92915050565b600081519050919050565b600082825260208201905092915050565b6000614cf182614d0e565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015614d63578082015181840152602081019050614d48565b83811115614d72576000848401525b50505050565b6000601f19601f8301169050919050565b614d9281614ce6565b8114614d9d57600080fd5b50565b614da981614d04565b8114614db457600080fd5b50565b614dc081614d2e565b8114614dcb57600080fd5b50565b614dd781614d38565b8114614de257600080fd5b5056fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212209d6e03380ba54bfd1954f40dd4b44332e978b168156fb92f694b4f756a7efbe764736f6c634300060b0033000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000008c18e770b49a5879d8998ec26f2bb5a4cb3ec2e7000000000000000000000000000000000000000000000000000000000000000f5855534420537461626c65636f696e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045855534400000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106103835760003560e01c8063741d3c18116101de578063b717fa451161010f578063d2d97b06116100ad578063e56b742c1161007c578063e56b742c14610a14578063ebeb9ebf14610a39578063f56a40ae14610a57578063f853c9f414610a7557610383565b8063d2d97b061461098c578063d914cd4b146109aa578063dc6663c7146109c6578063dd62ed3e146109e457610383565b8063c03f7be3116100e9578063c03f7be314610916578063c3355b8d14610934578063cb73999f14610952578063cd1b7fcc1461097057610383565b8063b717fa45146108c0578063bdacb303146108f0578063bef40ec81461090c57610383565b8063a087b6a61161017c578063a9059cbb11610156578063a9059cbb1461083a578063ad2f8ce41461086a578063b0fc69ce14610886578063b4f56b26146108a457610383565b8063a087b6a6146107d0578063a457c2d7146107ee578063a8a778ae1461081e57610383565b806380edef8e116101b857806380edef8e1461075a57806387a140c31461077857806392eefe9b1461079657806395d89b41146107b257610383565b8063741d3c181461070657806379cc6790146107225780637dbc1df01461073e57610383565b80632eb9771b116102b857806342966c68116102565780636140133b116102305780636140133b1461066c57806365e244fc1461068857806367feda3e146106b857806370a08231146106d657610383565b806342966c681461061457806351e238e31461063057806360e10f811461064e57610383565b8063395093511161029257806339509351146105a25780633b7d0946146105d25780634013124a146105ee578063408ab10f146105f857610383565b80632eb9771b14610548578063313ce56714610566578063345ba24b1461058457610383565b806322403cb21161032557806323b872dd116102ff57806323b872dd146104be578063246126bd146104ee5780632853fb101461050c5780632cb4f63e1461052a57610383565b806322403cb2146104665780632258750a14610484578063238a4709146104a257610383565b80630a619ae0116103615780630a619ae0146103f257806313af40351461041057806318160ddd1461042c5780631c5df1e51461044a57610383565b806306fdde031461038857806307a2e5f6146103a6578063095ea7b3146103c2575b600080fd5b610390610a91565b60405161039d9190614a14565b60405180910390f35b6103c060048036038101906103bb9190614299565b610b2f565b005b6103dc60048036038101906103d79190614324565b610d36565b6040516103e991906149f9565b60405180910390f35b6103fa610d54565b6040516104079190614c16565b60405180910390f35b61042a60048036038101906104259190614270565b610d5a565b005b610434610ede565b6040516104419190614c16565b60405180910390f35b610464600480360381019061045f9190614389565b610ee8565b005b61046e611032565b60405161047b91906149b5565b60405180910390f35b61048c611058565b6040516104999190614c16565b60405180910390f35b6104bc60048036038101906104b79190614389565b61105e565b005b6104d860048036038101906104d391906142d5565b6111a8565b6040516104e591906149f9565b60405180910390f35b6104f6611281565b60405161050391906149b5565b60405180910390f35b6105146112a7565b6040516105219190614c16565b60405180910390f35b6105326112ad565b60405161053f9190614c16565b60405180910390f35b6105506112b3565b60405161055d9190614c16565b60405180910390f35b61056e6112b9565b60405161057b9190614caf565b60405180910390f35b61058c6112be565b6040516105999190614c16565b60405180910390f35b6105bc60048036038101906105b79190614324565b6113a1565b6040516105c991906149f9565b60405180910390f35b6105ec60048036038101906105e79190614270565b611454565b005b6105f6611761565b005b610612600480360381019061060d9190614389565b6118dc565b005b61062e60048036038101906106299190614389565b611a26565b005b610638611a3a565b6040516106459190614c16565b60405180910390f35b610656611a47565b6040516106639190614c16565b60405180910390f35b61068660048036038101906106819190614389565b611a58565b005b6106a2600480360381019061069d9190614389565b611ba2565b6040516106af91906149b5565b60405180910390f35b6106c0611bde565b6040516106cd91906149b5565b60405180910390f35b6106f060048036038101906106eb9190614270565b611c04565b6040516106fd9190614c16565b60405180910390f35b610720600480360381019061071b9190614270565b611c4c565b005b61073c60048036038101906107379190614324565b611eed565b005b61075860048036038101906107539190614389565b611f4f565b005b610762612099565b60405161076f91906149b5565b60405180910390f35b6107806120bf565b60405161078d91906149f9565b60405180910390f35b6107b060048036038101906107ab9190614270565b6120d2565b005b6107ba612256565b6040516107c79190614a14565b60405180910390f35b6107d86122f4565b6040516107e591906149b5565b60405180910390f35b61080860048036038101906108039190614324565b61231a565b60405161081591906149f9565b60405180910390f35b61083860048036038101906108339190614324565b6123e7565b005b610854600480360381019061084f9190614324565b6124ed565b60405161086191906149f9565b60405180910390f35b610884600480360381019061087f9190614389565b61250b565b005b61088e612655565b60405161089b91906149b5565b60405180910390f35b6108be60048036038101906108b99190614324565b61267b565b005b6108da60048036038101906108d59190614270565b612781565b6040516108e791906149f9565b60405180910390f35b61090a60048036038101906109059190614270565b6127a1565b005b610914612925565b005b61091e612a91565b60405161092b9190614c16565b60405180910390f35b61093c612a97565b6040516109499190614c16565b60405180910390f35b61095a612a9d565b6040516109679190614c16565b60405180910390f35b61098a60048036038101906109859190614299565b612aa3565b005b610994612caa565b6040516109a19190614c16565b60405180910390f35b6109c460048036038101906109bf9190614270565b612e0e565b005b6109ce61309f565b6040516109db91906149b5565b60405180910390f35b6109fe60048036038101906109f99190614299565b6130c5565b604051610a0b9190614c16565b60405180910390f35b610a1c61314c565b604051610a30989796959493929190614c31565b60405180910390f35b610a4161327b565b604051610a4e9190614c16565b60405180910390f35b610a5f61328c565b604051610a6c91906149b5565b60405180910390f35b610a8f6004803603810190610a8a9190614270565b6132b2565b005b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b275780601f10610afc57610100808354040283529160200191610b27565b820191906000526020600020905b815481529060010190602001808311610b0a57829003601f168201915b505050505081565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610bd85750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80610c305750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6690614af6565b60405180910390fd5b81600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000610d4a610d4361348b565b8484613493565b6001905092915050565b60155481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610e035750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80610e5b5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9190614af6565b60405180910390fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600254905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610f915750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80610fe95750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611028576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101f90614af6565b60405180910390fd5b8060168190555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601a5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806111075750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b8061115f5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61119e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119590614af6565b60405180910390fd5b8060148190555050565b60006111b584848461365e565b611276846111c161348b565b61127185604051806060016040528060288152602001614e2e60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061122761348b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f39092919063ffffffff16565b613493565b600190509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60185481565b60175481565b60125481565b601281565b600061139c600360149054906101000a900460ff1660ff16600a0a61138e620f4240600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b815260040160206040518083038186803b15801561134857600080fd5b505afa15801561135c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113809190614360565b61394e90919063ffffffff16565b6139be90919063ffffffff16565b905090565b600061144a6113ae61348b565b8461144585600160006113bf61348b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343690919063ffffffff16565b613493565b6001905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806114fd5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806115555750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611594576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158b90614af6565b60405180910390fd5b60011515601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611627576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161e90614ab6565b60405180910390fd5b601160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905560008090505b60108054905081101561175d578173ffffffffffffffffffffffffffffffffffffffff16601082815481106116ad57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156117505760006010828154811061170357fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061175d565b808060010191505061167c565b5050565b60001515601960009054906101000a900460ff161515146117b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ae90614bb6565b60405180910390fd5b60006117c1611a47565b9050601654601a544203101561180c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180390614b96565b60405180910390fd5b61182360185460175461343690919063ffffffff16565b8111156118655760155460125411611842576000601281905550611860565b611859601554601254613a0890919063ffffffff16565b6012819055505b6118d2565b61187c601854601754613a0890919063ffffffff16565b8110156118d157620f424061189e60155460125461343690919063ffffffff16565b106118b257620f42406012819055506118d0565b6118c960155460125461343690919063ffffffff16565b6012819055505b5b5b42601a8190555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806119855750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806119dd5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611a1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1390614af6565b60405180910390fd5b8060178190555050565b611a37611a3161348b565b82613a52565b50565b681b1ae4d6e2ef50000081565b6000611a536000613c00565b905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611b015750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80611b595750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611b98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b8f90614af6565b60405180910390fd5b8060188190555050565b60108181548110611baf57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611cf55750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80611d4d5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611d8c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8390614af6565b60405180910390fd5b80600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f0141d846040518163ffffffff1660e01b815260040160206040518083038186803b158015611e9857600080fd5b505afa158015611eac573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ed091906143db565b600360146101000a81548160ff021916908360ff16021790555050565b6000611f2c82604051806060016040528060248152602001614e5660249139611f1d86611f1861348b565b6130c5565b6138f39092919063ffffffff16565b9050611f4083611f3a61348b565b83613493565b611f4a8383613a52565b505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611ff85750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806120505750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61208f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208690614af6565b60405180910390fd5b8060138190555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601960009054906101000a900460ff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061217b5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806121d35750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612212576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161220990614af6565b60405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156122ec5780601f106122c1576101008083540402835291602001916122ec565b820191906000526020600020905b8154815290600101906020018083116122cf57829003601f168201915b505050505081565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006123dd61232761348b565b846123d885604051806060016040528060258152602001614e7a602591396001600061235161348b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f39092919063ffffffff16565b613493565b6001905092915050565b60011515601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461247a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247190614a56565b60405180910390fd5b6124848282613f3e565b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f4d62459ee04e10636b8fb474ff487ba15b01c013a2bdf7f9e82deafb88043502836040516124e19190614c16565b60405180910390a35050565b60006125016124fa61348b565b848461365e565b6001905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806125b45750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b8061260c5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61264b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161264290614af6565b60405180910390fd5b8060158190555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60011515601160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461270e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270590614a56565b60405180910390fd5b612718828261400d565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f67aaa692dd2aa98aefdd0a45df45f3ef389ca47386032994bfdf0f66c19f08e0836040516127759190614c16565b60405180910390a35050565b60116020528060005260406000206000915054906101000a900460ff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061284a5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806128a25750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6128e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128d890614af6565b60405180910390fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806129ce5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80612a265750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612a65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a5c90614af6565b60405180910390fd5b601960009054906101000a900460ff1615601960006101000a81548160ff021916908315150217905550565b60165481565b60145481565b60135481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612b4c5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80612ba45750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612be3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bda90614af6565b60405180910390fd5b81600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000806000905060008090505b601080549050811015612e0657600073ffffffffffffffffffffffffffffffffffffffff1660108281548110612ce957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612df957612df660108281548110612d3f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166317284c946040518163ffffffff1660e01b815260040160206040518083038186803b158015612daf57600080fd5b505afa158015612dc3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612de791906143b2565b8361343690919063ffffffff16565b91505b8080600101915050612cb7565b508091505090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612eb75750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b80612f0f5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612f4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f4590614af6565b60405180910390fd5b60001515601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612fe1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612fd890614bd6565b60405180910390fd5b6001601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506010819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000806000806000806000806131626000613c00565b61316c6001613c00565b613174610ede565b60125461317f612caa565b601454601354613261600360149054906101000a900460ff1660ff16600a0a613253620f4240600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b815260040160206040518083038186803b15801561320d57600080fd5b505afa158015613221573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132459190614360565b61394e90919063ffffffff16565b6139be90919063ffffffff16565b975097509750975097509750975097509091929394959697565b60006132876001613c00565b905090565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061335b5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b806133b35750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6133f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016133e990614af6565b60405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015613481576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161347890614a96565b60405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415613503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016134fa90614b76565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613573576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161356a90614a76565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516136519190614c16565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156136ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016136c590614b56565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561373e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161373590614a36565b60405180910390fd5b6137498383836141a1565b6137b481604051806060016040528060268152602001614e08602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f39092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613847816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343690919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516138e69190614c16565b60405180910390a3505050565b600083831115829061393b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016139329190614a14565b60405180910390fd5b5060008385039050809150509392505050565b60008083141561396157600090506139b8565b600082840290508284828161397257fe5b04146139b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016139aa90614b16565b60405180910390fd5b809150505b92915050565b6000613a0083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506141a6565b905092915050565b6000613a4a83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506138f3565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613ac2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613ab990614b36565b60405180910390fd5b613ace826000836141a1565b613b3981604051806060016040528060228152602001614de6602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f39092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613b9081600254613a0890919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051613bf49190614c16565b60405180910390a35050565b600080613cdf600360149054906101000a900460ff1660ff16600a0a613cd1620f4240600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b815260040160206040518083038186803b158015613c8b57600080fd5b505afa158015613c9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613cc39190614360565b61394e90919063ffffffff16565b6139be90919063ffffffff16565b90506000806001811115613cef57fe5b846001811115613cfb57fe5b1415613dda57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633ddac953600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16620f42406040518363ffffffff1660e01b8152600401613d839291906149d0565b60206040518083038186803b158015613d9b57600080fd5b505afa158015613daf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613dd391906143b2565b9050613f0d565b600180811115613de657fe5b846001811115613df257fe5b1415613ed157600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633ddac953600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16620f42406040518363ffffffff1660e01b8152600401613e7a9291906149d0565b60206040518083038186803b158015613e9257600080fd5b505afa158015613ea6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613eca91906143b2565b9050613f0c565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613f0390614ad6565b60405180910390fd5b5b613f3581613f27620f42408561394e90919063ffffffff16565b6139be90919063ffffffff16565b92505050919050565b613f488282613a52565b61400982613f5461348b565b61400484604051806060016040528060248152602001614e5660249139600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000613fba61348b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138f39092919063ffffffff16565b613493565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561407d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161407490614bf6565b60405180910390fd5b614089600083836141a1565b61409e8160025461343690919063ffffffff16565b6002819055506140f5816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461343690919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516141959190614c16565b60405180910390a35050565b505050565b600080831182906141ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016141e49190614a14565b60405180910390fd5b5060008385816141f957fe5b049050809150509392505050565b60008135905061421681614d89565b92915050565b60008151905061422b81614da0565b92915050565b60008135905061424081614db7565b92915050565b60008151905061425581614db7565b92915050565b60008151905061426a81614dce565b92915050565b60006020828403121561428257600080fd5b600061429084828501614207565b91505092915050565b600080604083850312156142ac57600080fd5b60006142ba85828601614207565b92505060206142cb85828601614207565b9150509250929050565b6000806000606084860312156142ea57600080fd5b60006142f886828701614207565b935050602061430986828701614207565b925050604061431a86828701614231565b9150509250925092565b6000806040838503121561433757600080fd5b600061434585828601614207565b925050602061435685828601614231565b9150509250929050565b60006020828403121561437257600080fd5b60006143808482850161421c565b91505092915050565b60006020828403121561439b57600080fd5b60006143a984828501614231565b91505092915050565b6000602082840312156143c457600080fd5b60006143d284828501614246565b91505092915050565b6000602082840312156143ed57600080fd5b60006143fb8482850161425b565b91505092915050565b61440d81614ce6565b82525050565b61441c81614cf8565b82525050565b600061442d82614cca565b6144378185614cd5565b9350614447818560208601614d45565b61445081614d78565b840191505092915050565b6000614468602383614cd5565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006144ce602683614cd5565b91507f4f6e6c79207875736420706f6f6c732063616e2063616c6c207468697320667560008301527f6e6374696f6e00000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614534602283614cd5565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061459a601b83614cd5565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b60006145da601d83614cd5565b91507f6164647265737320646f65736e277420657869737420616c72656164790000006000830152602082019050919050565b600061461a603c83614cd5565b91507f494e56414c49442050524943452043484f4943452e204e6565647320746f206260008301527f6520656974686572203020285855534429206f722031202858555329000000006020830152604082019050919050565b6000614680603d83614cd5565b91507f596f7520617265206e6f7420746865206f776e65722c20636f6e74726f6c6c6560008301527f722c206f722074686520676f7665726e616e63652074696d656c6f636b0000006020830152604082019050919050565b60006146e6602183614cd5565b91507f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008301527f77000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061474c602183614cd5565b91507f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008301527f73000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006147b2602583614cd5565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000614818602483614cd5565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061487e603583614cd5565b91507f4d757374207761697420666f7220746865207265667265736820636f6f6c646f60008301527f776e2073696e6365206c617374207265667265736800000000000000000000006020830152604082019050919050565b60006148e4602083614cd5565b91507f436f6c6c61746572616c20526174696f20686173206265656e207061757365646000830152602082019050919050565b6000614924601683614cd5565b91507f6164647265737320616c726561647920657869737473000000000000000000006000830152602082019050919050565b6000614964601f83614cd5565b91507f45524332303a206d696e7420746f20746865207a65726f2061646472657373006000830152602082019050919050565b6149a081614d2e565b82525050565b6149af81614d38565b82525050565b60006020820190506149ca6000830184614404565b92915050565b60006040820190506149e56000830185614404565b6149f26020830184614997565b9392505050565b6000602082019050614a0e6000830184614413565b92915050565b60006020820190508181036000830152614a2e8184614422565b905092915050565b60006020820190508181036000830152614a4f8161445b565b9050919050565b60006020820190508181036000830152614a6f816144c1565b9050919050565b60006020820190508181036000830152614a8f81614527565b9050919050565b60006020820190508181036000830152614aaf8161458d565b9050919050565b60006020820190508181036000830152614acf816145cd565b9050919050565b60006020820190508181036000830152614aef8161460d565b9050919050565b60006020820190508181036000830152614b0f81614673565b9050919050565b60006020820190508181036000830152614b2f816146d9565b9050919050565b60006020820190508181036000830152614b4f8161473f565b9050919050565b60006020820190508181036000830152614b6f816147a5565b9050919050565b60006020820190508181036000830152614b8f8161480b565b9050919050565b60006020820190508181036000830152614baf81614871565b9050919050565b60006020820190508181036000830152614bcf816148d7565b9050919050565b60006020820190508181036000830152614bef81614917565b9050919050565b60006020820190508181036000830152614c0f81614957565b9050919050565b6000602082019050614c2b6000830184614997565b92915050565b600061010082019050614c47600083018b614997565b614c54602083018a614997565b614c616040830189614997565b614c6e6060830188614997565b614c7b6080830187614997565b614c8860a0830186614997565b614c9560c0830185614997565b614ca260e0830184614997565b9998505050505050505050565b6000602082019050614cc460008301846149a6565b92915050565b600081519050919050565b600082825260208201905092915050565b6000614cf182614d0e565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015614d63578082015181840152602081019050614d48565b83811115614d72576000848401525b50505050565b6000601f19601f8301169050919050565b614d9281614ce6565b8114614d9d57600080fd5b50565b614da981614d04565b8114614db457600080fd5b50565b614dc081614d2e565b8114614dcb57600080fd5b50565b614dd781614d38565b8114614de257600080fd5b5056fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212209d6e03380ba54bfd1954f40dd4b44332e978b168156fb92f694b4f756a7efbe764736f6c634300060b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000008c18e770b49a5879d8998ec26f2bb5a4cb3ec2e7000000000000000000000000000000000000000000000000000000000000000f5855534420537461626c65636f696e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000045855534400000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _name (string): XUSD Stablecoin
Arg [1] : _symbol (string): XUSD
Arg [2] : _timelock_address (address): 0x8c18e770B49A5879D8998eC26f2bb5A4Cb3Ec2e7
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : 0000000000000000000000008c18e770b49a5879d8998ec26f2bb5a4cb3ec2e7
Arg [3] : 000000000000000000000000000000000000000000000000000000000000000f
Arg [4] : 5855534420537461626c65636f696e0000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [6] : 5855534400000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.