ERC-20
Overview
Max Total Supply
20,085,647.736341831558056056 XSD
Holders
125
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
40,526.07 XSDValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
XSDStablecoin
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../ERC20/ERC20Custom.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "../BankX/BankXToken.sol"; import "./Pools/CollateralPool.sol"; import "./Pools/Interfaces/IBankXWETHpool.sol"; import "./Pools/Interfaces/IXSDWETHpool.sol"; import "../Oracle/ChainlinkETHUSDPriceConsumer.sol"; import "../Oracle/ChainlinkXAGUSDPriceConsumer.sol"; contract XSDStablecoin is ERC20Custom { /* ========== STATE VARIABLES ========== */ //change genesis mint numbers enum PriceChoice { XSD, BankX } ChainlinkETHUSDPriceConsumer private eth_usd_pricer; ChainlinkXAGUSDPriceConsumer private xag_usd_pricer; uint8 private eth_usd_pricer_decimals; uint8 private xag_usd_pricer_decimals; string public symbol; string public name; uint8 public constant decimals = 18; address public pid_address; // pid controller address address public treasury; //stores the genesis supply address public collateral_pool_address; address public router; address public eth_usd_oracle_address; address public xag_usd_oracle_address; address public smartcontract_owner; // interest rate related variables uint256 public interest_rate; IBankXWETHpool private bankxEthPool; IXSDWETHpool private xsdEthPool; uint256 public cap_rate; // genesis mint: 17M //mint cap at 40M uint256 public genesis_supply; // The addresses in this array are added by the oracle and these contracts are able to mint xsd address[] public xsd_pools_array; // Mapping is also used for faster verification mapping(address => bool) public xsd_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 xsd_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 XSD 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(xsd_pools[msg.sender] == true, "Only xsd pools can call this function"); _;//check happens before the function is executed } modifier onlyByOwner(){ require(msg.sender == smartcontract_owner, "You are not the owner"); _; } modifier onlyByOwnerPID() { require(msg.sender == smartcontract_owner || msg.sender == pid_address, "You are not the owner or the pid controller"); _; } modifier onlyByOwnerOrPool() { require( msg.sender == smartcontract_owner || xsd_pools[msg.sender] == true, "You are not the owner or a pool"); _; } /* ========== CONSTRUCTOR ========== */ constructor( string memory _name, string memory _symbol, uint256 _pool_amount, uint256 _genesis_supply, address _smartcontract_owner, address _treasury, uint256 _cap_rate ) { require((_smartcontract_owner != address(0)) && (_treasury != address(0)), "Zero address detected"); name = _name; symbol = _symbol; genesis_supply = _genesis_supply + _pool_amount; treasury = _treasury; _mint(_smartcontract_owner, _pool_amount); _mint(treasury, _genesis_supply); smartcontract_owner = _smartcontract_owner; xsd_step = 2500; // 6 decimals of precision, equal to 0.25% global_collateral_ratio = 1000000; // XSD system starts off fully collateralized (6 decimals of precision) interest_rate = 52800; //interest rate starts off at 5% refresh_cooldown = 3600; // Refresh cooldown period is set to 1 hour (3600 seconds) at genesis price_target = 800000; // Change price target to 1 gram of silver price_band = 5000; // Collateral ratio will not adjust if 0.005 off target at genesis cap_rate = _cap_rate;// Maximum mint amount } //change price target to reflect true value of silver /* ========== VIEWS ========== */ // Choice = 'XSD' or 'BankX' for now function pool_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())*PRICE_PRECISION)/(uint256(10) ** eth_usd_pricer_decimals); uint256 price_vs_eth = 0; uint256 reserve0; uint256 reserve1; if (choice == PriceChoice.XSD) { (reserve0, reserve1, ) = xsdEthPool.getReserves(); if(reserve0 == 0 || reserve1 == 0){ return 1; } price_vs_eth = reserve0/(reserve1); // How much XSD if you put in 1 WETH } else if (choice == PriceChoice.BankX) { (reserve0, reserve1, ) = bankxEthPool.getReserves(); if(reserve0 == 0 || reserve1 == 0){ return 1; } price_vs_eth = reserve0/(reserve1); // How much BankX if you put in 1 WETH } else revert("INVALID PRICE CHOICE. Needs to be either 0 (XSD) or 1 (BankX)"); // Will be in 1e6 format return _eth_usd_price/price_vs_eth; } // Returns X XSD = 1 USD //XSD price function xsd_price() public view returns (uint256) { return pool_price(PriceChoice.XSD); } // Returns X BankX = 1 USD function bankx_price() public view returns (uint256) { return pool_price(PriceChoice.BankX); } function eth_usd_price() public view returns (uint256) { return (uint256(eth_usd_pricer.getLatestPrice())*PRICE_PRECISION)/(uint256(10) ** eth_usd_pricer_decimals); } //silver price //hard coded value for testing on goerli function xag_usd_price() public view returns (uint256) { return (uint256(xag_usd_pricer.getLatestPrice())*PRICE_PRECISION)/(uint256(10) ** xag_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 xsd_info() public view returns (uint256, uint256, uint256, uint256, uint256, uint256) { return ( pool_price(PriceChoice.XSD), // xsd_price() pool_price(PriceChoice.BankX), // bankx_price() totalSupply(), // totalSupply() global_collateral_ratio, // global_collateral_ratio() globalCollateralValue(), // globalCollateralValue (uint256(eth_usd_pricer.getLatestPrice())*PRICE_PRECISION)/(uint256(10) ** eth_usd_pricer_decimals) //eth_usd_price ); } // Iterate through all xsd pools and calculate all value of collateral in all pools globally function globalCollateralValue() public view returns (uint256) { uint256 collateral_amount = 0; collateral_amount = CollateralPool(payable(collateral_pool_address)).collatDollarBalance(); return collateral_amount; } /* ========== PUBLIC FUNCTIONS ========== */ // There needs to be a time interval that this can be called. Otherwise it can be called multiple times per expansion. // To simulate global collateral ratio set xsd price higher than silver price and hit refresh collateral ratio. 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 xsd_price_cur = xsd_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 setXSDStep()) if (xsd_price_cur > (price_target+price_band)) { //decrease collateral ratio if(global_collateral_ratio <= xsd_step){ //if within a step of 0, go to 0 global_collateral_ratio = 0; } else { global_collateral_ratio = global_collateral_ratio-xsd_step; } } else if (xsd_price_cur < price_target-price_band) { //increase collateral ratio if(global_collateral_ratio+xsd_step >= 1000000){ global_collateral_ratio = 1000000; // cap collateral ratio at 1.000000 } else { global_collateral_ratio = global_collateral_ratio+xsd_step; } } else last_call_time = block.timestamp; // Set the time of the last expansion uint256 _interest_rate = (1000000-global_collateral_ratio)/(2); //update interest rate if(_interest_rate>52800){ interest_rate = _interest_rate; } else{ interest_rate = 52800; } emit CollateralRatioRefreshed(global_collateral_ratio); } function creatorMint(uint256 amount) public onlyByOwner{ require(genesis_supply+amount<cap_rate,"cap limit reached"); super._mint(treasury,amount); } /* ========== 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 XSDBurned(b_address, msg.sender, b_amount); } // This function is what other xsd pools will call to mint new XSD function pool_mint(address m_address, uint256 m_amount) public onlyPools { super._mint(m_address, m_amount); emit XSDMinted(msg.sender, m_address, m_amount); } // Adds collateral addresses supported, such as tether and busd, must be ERC20 function addPool(address pool_address) public onlyByOwner { require(pool_address != address(0), "Zero address detected"); require(xsd_pools[pool_address] == false, "Address already exists"); xsd_pools[pool_address] = true; xsd_pools_array.push(pool_address); emit PoolAdded(pool_address); } // Remove a pool function removePool(address pool_address) public onlyByOwner { require(pool_address != address(0), "Zero address detected"); require(xsd_pools[pool_address] == true, "Address nonexistant"); // Delete from the mapping delete xsd_pools[pool_address]; // 'Delete' from the array by setting the address to 0x0 for (uint i = 0; i < xsd_pools_array.length; i++){ if (xsd_pools_array[i] == pool_address) { xsd_pools_array[i] = address(0); // This will leave a null in the array and keep the indices the same break; } } emit PoolRemoved(pool_address); } // create a seperate function for users and the pool function burnpoolXSD(uint _xsdamount) public { //uXSD = totalSupply - collat_XSD require(msg.sender == router, "Only the router can access this function"); require(totalSupply()-CollateralPool(payable(collateral_pool_address)).collat_XSD()>_xsdamount, "uXSD has to be positive"); super._burn(address(xsdEthPool),_xsdamount); xsdEthPool.sync(); emit XSDBurned(msg.sender, address(this), _xsdamount); } // add burn function for users function burnUserXSD(uint _xsdamount) public { require(totalSupply()-CollateralPool(payable(collateral_pool_address)).collat_XSD()>_xsdamount, "uXSD has to be positive"); super._burn(msg.sender, _xsdamount); emit XSDBurned(msg.sender, address(this), _xsdamount); } function setXSDStep(uint256 _new_step) public onlyByOwnerPID { xsd_step = _new_step; emit XSDStepSet(_new_step); } function setPriceTarget (uint256 _new_price_target) public onlyByOwnerPID { price_target = _new_price_target; emit PriceTargetSet(_new_price_target); } function setRefreshCooldown(uint256 _new_cooldown) public onlyByOwnerPID { refresh_cooldown = _new_cooldown; emit RefreshCooldownSet(_new_cooldown); } function setTreasury(address _new_treasury) public onlyByOwner { require(_new_treasury != address(0), "Zero address detected"); treasury = _new_treasury; } function setETHUSDOracle(address _eth_usd_oracle_address) public onlyByOwner { require(_eth_usd_oracle_address != address(0), "Zero address detected"); eth_usd_oracle_address = _eth_usd_oracle_address; eth_usd_pricer = ChainlinkETHUSDPriceConsumer(eth_usd_oracle_address); eth_usd_pricer_decimals = eth_usd_pricer.getDecimals(); emit ETHUSDOracleSet(_eth_usd_oracle_address); } function setXAGUSDOracle(address _xag_usd_oracle_address) public onlyByOwner { require(_xag_usd_oracle_address != address(0), "Zero address detected"); xag_usd_oracle_address = _xag_usd_oracle_address; xag_usd_pricer = ChainlinkXAGUSDPriceConsumer(xag_usd_oracle_address); xag_usd_pricer_decimals = xag_usd_pricer.getDecimals(); emit XAGUSDOracleSet(_xag_usd_oracle_address); } function setPIDController(address _pid_address) external onlyByOwner { require(_pid_address != address(0), "Zero address detected"); pid_address = _pid_address; emit PIDControllerSet(_pid_address); } function setRouterAddress(address _router) external onlyByOwner { require(_router != address(0), "Zero address detected"); router = _router; } function setPriceBand(uint256 _price_band) external onlyByOwner { price_band = _price_band; emit PriceBandSet(_price_band); } // Sets the XSD_ETH Uniswap oracle address function setXSDEthPool(address _xsd_pool_addr) public onlyByOwner { require(_xsd_pool_addr != address(0), "Zero address detected"); xsdEthPool = IXSDWETHpool(_xsd_pool_addr); emit XSDETHPoolSet(_xsd_pool_addr); } // Sets the BankX_ETH Uniswap oracle address function setBankXEthPool(address _bankx_pool_addr) public onlyByOwner { require(_bankx_pool_addr != address(0), "Zero address detected"); bankxEthPool = IBankXWETHpool(_bankx_pool_addr); emit BankXEthPoolSet(_bankx_pool_addr); } //sets the collateral pool address function setCollateralEthPool(address _collateral_pool_address) public onlyByOwner { require(_collateral_pool_address != address(0), "Zero address detected"); collateral_pool_address = payable(_collateral_pool_address); } function setSmartContractOwner(address _smartcontract_owner) external{ require(msg.sender == smartcontract_owner, "Only the smart contract owner can access this function"); require(msg.sender != address(0), "Zero address detected"); smartcontract_owner = _smartcontract_owner; } function renounceOwnership() external{ require(msg.sender == smartcontract_owner, "Only the smart contract owner can access this function"); smartcontract_owner = address(0); } /* ========== EVENTS ========== */ // Track XSD burned event XSDBurned(address indexed from, address indexed to, uint256 amount); // Track XSD minted event XSDMinted(address indexed from, address indexed to, uint256 amount); event CollateralRatioRefreshed(uint256 global_collateral_ratio); event PoolAdded(address pool_address); event PoolRemoved(address pool_address); event RedemptionFeeSet(uint256 red_fee); event MintingFeeSet(uint256 min_fee); event XSDStepSet(uint256 new_step); event PriceTargetSet(uint256 new_price_target); event RefreshCooldownSet(uint256 new_cooldown); event ETHUSDOracleSet(address eth_usd_oracle_address); event XAGUSDOracleSet(address xag_usd_oracle_address); event PIDControllerSet(address _pid_controller); event PriceBandSet(uint256 price_band); event XSDETHPoolSet(address xsd_pool_addr); event BankXEthPoolSet(address bankx_pool_addr); event CollateralRatioToggled(bool collateral_ratio_paused); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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); /** * @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 `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, 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 `from` to `to` 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 from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.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 to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, 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) { address owner = _msgSender(); _approve(owner, 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}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); return true; } /** * @dev Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @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) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + 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) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } 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 from, address to, uint256 amount) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); _afterTokenTransfer(from, to, 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 += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(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 Transfers 'tokens' from 'account' to origin address, 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); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(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 { } /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/ERC20.sol) pragma solidity ^0.8.0; import "./IERC20.sol"; import "./extensions/IERC20Metadata.sol"; import "../../utils/Context.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 {ERC20PresetMinterPauser}. * * 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 Contracts guidelines: functions revert * instead 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, IERC20Metadata { mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The default value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor(string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override 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 this function is * overridden; * * 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 virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address to, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _transfer(owner, to, 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}. * * NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on * `transferFrom`. This is semantically equivalent to an infinite approval. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { address owner = _msgSender(); _approve(owner, 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}. * * NOTE: Does not update the allowance if the current allowance * is the maximum `uint256`. * * Requirements: * * - `from` and `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ function transferFrom( address from, address to, uint256 amount ) public virtual override returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); 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) { address owner = _msgSender(); _approve(owner, spender, allowance(owner, spender) + 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) { address owner = _msgSender(); uint256 currentAllowance = allowance(owner, spender); require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(owner, spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * This 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: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `from` must have a balance of at least `amount`. */ function _transfer( address from, address to, uint256 amount ) internal virtual { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(from, to, amount); uint256 fromBalance = _balances[from]; require(fromBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[from] = fromBalance - amount; } _balances[to] += amount; emit Transfer(from, to, amount); _afterTokenTransfer(from, to, 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: * * - `account` 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 += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); _afterTokenTransfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; emit Transfer(account, address(0), amount); _afterTokenTransfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This 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 Updates `owner` s allowance for `spender` based on spent `amount`. * * Does not update the allowance amount in case of infinite allowance. * Revert if not enough allowance is available. * * Might emit an {Approval} event. */ function _spendAllowance( address owner, address spender, uint256 amount ) internal virtual { uint256 currentAllowance = allowance(owner, spender); if (currentAllowance != type(uint256).max) { require(currentAllowance >= amount, "ERC20: insufficient allowance"); unchecked { _approve(owner, spender, currentAllowance - amount); } } } /** * @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 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:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * has been transferred to `to`. * - when `from` is zero, `amount` tokens have been minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens have been burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../ERC20/ERC20Custom.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../XSD/XSDStablecoin.sol"; contract BankXToken is ERC20Custom { /* ========== STATE VARIABLES ========== */ string public symbol; string public name; uint8 public constant decimals = 18; uint256 public genesis_supply; // 2B is printed upon genesis address public pool_address; //points to BankX pool address address public treasury; //stores the genesis supply address public router; XSDStablecoin private XSD; //XSD stablecoin instance address public smartcontract_owner; /* ========== MODIFIERS ========== */ modifier onlyPools() { require(XSD.xsd_pools(msg.sender) == true, "Only xsd pools can mint new BankX"); _; } modifier onlyByOwner() { require(msg.sender == smartcontract_owner, "You are not an owner"); _; } /* ========== CONSTRUCTOR ========== */ constructor( string memory _name, string memory _symbol, uint256 _pool_amount, uint256 _genesis_supply, address _treasury, address _smartcontract_owner ) { require((_treasury != address(0)), "Zero address detected"); name = _name; symbol = _symbol; genesis_supply = _genesis_supply + _pool_amount; treasury = _treasury; _mint(_msgSender(), _pool_amount); _mint(treasury, _genesis_supply); smartcontract_owner = _smartcontract_owner; } /* ========== RESTRICTED FUNCTIONS ========== */ function setPool(address new_pool) external onlyByOwner { require(new_pool != address(0), "Zero address detected"); pool_address = new_pool; } function setTreasury(address new_treasury) external onlyByOwner { require(new_treasury != address(0), "Treasury address cannot be 0"); treasury = new_treasury; } function setRouterAddress(address _router) external onlyByOwner { require(_router != address(0), "Zero address detected"); router = _router; } function setXSDAddress(address xsd_contract_address) external onlyByOwner { require(xsd_contract_address != address(0), "Zero address detected"); XSD = XSDStablecoin(xsd_contract_address); emit XSDAddressSet(xsd_contract_address); } function mint(address to, uint256 amount) public onlyPools { _mint(to, amount); emit BankXMinted(address(this), to, amount); } function genesisSupply() public view returns(uint256){ return genesis_supply; } // This function is what other xsd pools will call to mint new BankX (similar to the XSD mint) function pool_mint(address m_address, uint256 m_amount) external onlyPools { super._mint(m_address, m_amount); emit BankXMinted(address(this), m_address, m_amount); } // This function is what other xsd pools will call to burn BankX function pool_burn_from(address b_address, uint256 b_amount) external onlyPools { super._burnFrom(b_address, b_amount); emit BankXBurned(b_address, address(this), b_amount); } //burn bankx from the pool when bankx is inflationary function burnpoolBankX(uint _bankx_amount) public { require(msg.sender == router, "Only Router can access this function"); require(totalSupply()>genesis_supply,"BankX must be deflationary"); super._burn(pool_address, _bankx_amount); IBankXWETHpool(pool_address).sync(); emit BankXBurned(msg.sender, address(this), _bankx_amount); } function setSmartContractOwner(address _smartcontract_owner) external{ require(msg.sender == smartcontract_owner, "Only the smart contract owner can access this function"); require(msg.sender != address(0), "Zero address detected"); smartcontract_owner = _smartcontract_owner; } function renounceOwnership() external{ require(msg.sender == smartcontract_owner, "Only the smart contract owner can access this function"); smartcontract_owner = address(0); } /* ========== EVENTS ========== */ // Track BankX burned event BankXBurned(address indexed from, address indexed to, uint256 amount); // Track BankX minted event BankXMinted(address indexed from, address indexed to, uint256 amount); event XSDAddressSet(address addr); }
// SPDX-License-Identifier: MIT /* BBBBBBBBBBBBBBBBB kkkkkkkk XXXXXXX XXXXXXX B::::::::::::::::B k::::::k X:::::X X:::::X B::::::BBBBBB:::::B k::::::k X:::::X X:::::X BB:::::B B:::::B k::::::k X::::::X X::::::X B::::B B:::::B aaaaaaaaaaaaa nnnn nnnnnnnn k:::::k kkkkkkk XXX:::::X X:::::XXX B::::B B:::::B a::::::::::::a n:::nn::::::::nn k:::::k k:::::k X:::::X X:::::X B::::BBBBBB:::::B aaaaaaaaa:::::a n::::::::::::::nn k:::::k k:::::k X:::::X:::::X B:::::::::::::BB a::::a nn:::::::::::::::n k:::::k k:::::k X:::::::::X B::::BBBBBB:::::B aaaaaaa:::::a n:::::nnnn:::::n k::::::k:::::k X:::::::::X B::::B B:::::B aa::::::::::::a n::::n n::::n k:::::::::::k X:::::X:::::X B::::B B:::::B a::::aaaa::::::a n::::n n::::n k:::::::::::k X:::::X X:::::X B::::B B:::::B a::::a a:::::a n::::n n::::n k::::::k:::::k XXX:::::X X:::::XXX BB:::::BBBBBB::::::B a::::a a:::::a n::::n n::::n k::::::k k:::::k X::::::X X::::::X B:::::::::::::::::B a:::::aaaa::::::a n::::n n::::n k::::::k k:::::k X:::::X X:::::X B::::::::::::::::B a::::::::::aa:::a n::::n n::::n k::::::k k:::::k X:::::X X:::::X BBBBBBBBBBBBBBBBB aaaaaaaaaa aaaa nnnnnn nnnnnn kkkkkkkk kkkkkkk XXXXXXX XXXXXXX Currency Creators Manifesto Our world faces an urgent crisis of currency manipulation, theft and inflation. Under the current system, currency is controlled by and benefits elite families, governments and large banking institutions. We believe currencies should be minted by and benefit the individual, not the establishment. It is time to take back the control of and the freedom that money can provide. BankX is rebuilding the legacy banking system from the ground up by providing you with the capability to create currency and be in complete control of wealth creation with a concept we call ‘Individual Created Digital Currency’ (ICDC). You own the collateral. You mint currency. You earn interest. You leverage without the risk of liquidation. You stake to earn even more returns. All of this is done with complete autonomy and decentralization. BankX has built a stablecoin for Individual Freedom. BankX is the antidote for the malevolent financial system bringing in a new future of freedom where you are in complete control with no middlemen, bank or central bank between you and your finances. This capability to create currency and be in complete control of wealth creation will be in the hands of every individual that uses BankX. By 2030, we will rid the world of the corrupt, tyrannical and incompetent banking system replacing it with a system where billions of people will be in complete control of their financial future. Everyone will be given ultimate freedom to use their assets to create currency, earn interest and multiply returns to accomplish their individual goals. The mission of BankX is to be the first to mint $1 trillion in stablecoin. We will bring about this transformation by attracting people that believe what we believe. We will partner with other blockchain protocols and build decentralized applications that drive even more usage. Finally, we will deploy a private network that is never connected to the Internet to communicate between counterparties, that allows for blockchain-to-blockchain interoperability and stores private keys and cryptocurrency wallets. Our ecosystem, network and platform has never been seen in the market and provides us with a long term sustainable competitive advantage. We value individual freedom. We believe in financial autonomy. We are anti-establishment. We envision a future of self-empowerment. */ pragma solidity ^0.8.0; import '@uniswap/lib/contracts/libraries/TransferHelper.sol'; import '@openzeppelin/contracts/security/ReentrancyGuard.sol'; import "../../BankX/BankXToken.sol"; import "../XSDStablecoin.sol"; import "./Interfaces/IBankXWETHpool.sol"; import "./Interfaces/IXSDWETHpool.sol"; import '../../Oracle/Interfaces/IPIDController.sol'; import "../../ERC20/IWETH.sol"; import "./CollateralPoolLibrary.sol"; contract CollateralPool is ReentrancyGuard { // accumulated interest rate: 0.000002739726639247 /* ========== STATE VARIABLES ========== */ address public WETH; address public smartcontract_owner; address public xsd_contract_address; address public bankx_contract_address; address public xsdweth_pool; address public bankxweth_pool; address public pid_address; BankXToken private BankX; XSDStablecoin private XSD; IPIDController private pid_controller; uint256 public collat_XSD; bool public mint_paused; bool public redeem_paused; bool public buyback_paused; struct MintInfo { uint256 accum_interest; //accumulated interest from previous mints uint256 interest_rate; //interest rate at that particular timestamp uint256 time; //last timestamp uint256 amount; //XSD amount minted } mapping(address=>MintInfo) public mintMapping; mapping (address => uint256) public redeemBankXBalances; mapping (address => uint256) public redeemCollateralBalances; mapping (address => uint256) public vestingtimestamp; uint256 public unclaimedPoolCollateral; uint256 public unclaimedPoolBankX; uint256 public collateral_equivalent_d18; uint256 public bankx_minted_count; mapping (address => uint256) public lastRedeemed; // Number of blocks to wait before being able to collectRedemption() uint256 public redemption_delay = 2; /* ========== MODIFIERS ========== */ modifier onlyByOwner() { require(msg.sender == smartcontract_owner, "Not owner"); _; } /* ========== CONSTRUCTOR ========== */ constructor( address _xsd_contract_address, address _bankx_contract_address, address _bankxweth_pool, address _xsdweth_pool, address _WETH, address _smartcontract_owner ) { require( (_xsd_contract_address != address(0)) && (_bankx_contract_address != address(0)) && (_WETH != address(0)) && (_bankxweth_pool != address(0)) && (_xsdweth_pool != address(0)) , "Zero address detected"); XSD = XSDStablecoin(_xsd_contract_address); BankX = BankXToken(_bankx_contract_address); xsd_contract_address = _xsd_contract_address; bankx_contract_address = _bankx_contract_address; xsdweth_pool = _xsdweth_pool; bankxweth_pool = _bankxweth_pool; WETH = _WETH; smartcontract_owner = _smartcontract_owner; } /* ========== VIEWS ========== */ //only accept ETH via fallback function from the WETH contract receive() external payable { assert(msg.sender == WETH); } // Returns dollar value of collateral held in this XSD pool function collatDollarBalance() public view returns (uint256) { return ((IWETH(WETH).balanceOf(address(this))*XSD.eth_usd_price())/(1e6)); } // Returns the value of excess collateral held in this XSD pool, compared to what is needed to maintain the global collateral ratio function availableExcessCollatDV() public view returns (uint256) { uint256 global_collateral_ratio = XSD.global_collateral_ratio(); uint256 global_collat_value = XSD.globalCollateralValue(); if (global_collateral_ratio > (1e6)) global_collateral_ratio = (1e6); // Handles an overcollateralized contract with CR > 1 uint256 required_collat_dollar_value_d18 = ((collat_XSD)*global_collateral_ratio*(XSD.xag_usd_price()*(1e4))/(311035))/(1e12); // Calculates collateral needed to back each 1 XSD with $1 of collateral at current collat ratio if ((global_collat_value-unclaimedPoolCollateral)>required_collat_dollar_value_d18) return (global_collat_value-unclaimedPoolCollateral-required_collat_dollar_value_d18); else return 0; } /* ========== INTERNAL FUNCTIONS ======== */ function mintInterestCalc(uint xsd_amount,address sender) internal { (mintMapping[sender].accum_interest, mintMapping[sender].interest_rate, mintMapping[sender].time, mintMapping[sender].amount) = CollateralPoolLibrary.calcMintInterest(xsd_amount,XSD.xag_usd_price(), XSD.interest_rate(), mintMapping[sender].accum_interest, mintMapping[sender].interest_rate, mintMapping[sender].time, mintMapping[sender].amount); } function redeemInterestCalc(uint xsd_amount,address sender) internal { (mintMapping[sender].accum_interest, mintMapping[sender].interest_rate, mintMapping[sender].time, mintMapping[sender].amount)=CollateralPoolLibrary.calcRedemptionInterest(xsd_amount,XSD.xag_usd_price(), mintMapping[sender].accum_interest, mintMapping[sender].interest_rate, mintMapping[sender].time, mintMapping[sender].amount); } /* ========== PUBLIC FUNCTIONS ========== */ // We separate out the 1t1, fractional and algorithmic minting functions for gas efficiency function mint1t1XSD(uint256 XSD_out_min) external payable nonReentrant { require(!mint_paused, "Mint Paused"); require(msg.value>0, "Invalid collateral amount"); require(XSD.global_collateral_ratio() >= (1e6), "Collateral ratio must be >= 1"); (uint256 xsd_amount_d18) = CollateralPoolLibrary.calcMint1t1XSD( XSD.eth_usd_price(), XSD.xag_usd_price(), msg.value ); //1 XSD for each $1 worth of collateral require(XSD_out_min <= xsd_amount_d18, "Slippage limit reached"); mintInterestCalc(xsd_amount_d18,msg.sender); IWETH(WETH).deposit{value: msg.value}(); assert(IWETH(WETH).transfer(address(this), msg.value)); collat_XSD = collat_XSD + xsd_amount_d18; XSD.pool_mint(msg.sender, xsd_amount_d18); } // 0% collateral-backed function mintAlgorithmicXSD(uint256 bankx_amount_d18, uint256 XSD_out_min) external nonReentrant { require(!mint_paused, "Mint Paused"); uint256 bankx_price = XSD.bankx_price(); uint256 xag_usd_price = XSD.xag_usd_price(); //for testing //require(XSD.global_collateral_ratio() == 0, "Collateral ratio must be 0"); (uint256 xsd_amount_d18) = CollateralPoolLibrary.calcMintAlgorithmicXSD( bankx_price, // X BankX / 1 USD xag_usd_price, bankx_amount_d18 ); require(XSD_out_min <= xsd_amount_d18, "Slippage limit reached"); mintInterestCalc(xsd_amount_d18,msg.sender); collat_XSD = collat_XSD + xsd_amount_d18; bankx_minted_count = bankx_minted_count + bankx_amount_d18; BankX.pool_burn_from(msg.sender, bankx_amount_d18); XSD.pool_mint(msg.sender, xsd_amount_d18); } // Will fail if fully collateralized or fully algorithmic // > 0% and < 100% collateral-backed function mintFractionalXSD(uint256 bankx_amount, uint256 XSD_out_min) external payable nonReentrant { require(!mint_paused, "Mint Paused"); uint256 xag_usd_price = XSD.xag_usd_price(); uint256 global_collateral_ratio = XSD.global_collateral_ratio(); require(global_collateral_ratio < (1e6) && global_collateral_ratio > 0, "Collateral ratio needs to be between .000001 and .999999"); CollateralPoolLibrary.MintFF_Params memory input_params = CollateralPoolLibrary.MintFF_Params( XSD.bankx_price(), XSD.eth_usd_price(), bankx_amount, msg.value, global_collateral_ratio ); (uint256 mint_amount, uint256 bankx_needed) = CollateralPoolLibrary.calcMintFractionalXSD(input_params); mint_amount = (mint_amount*31103477)/((xag_usd_price)); //grams of silver in calculated mint amount require(XSD_out_min <= mint_amount, "Slippage limit reached"); require(bankx_needed <= bankx_amount, "Not enough BankX inputted"); mintInterestCalc(mint_amount,msg.sender); bankx_minted_count = bankx_minted_count + bankx_needed; BankX.pool_burn_from(msg.sender, bankx_needed); IWETH(WETH).deposit{value: msg.value}(); assert(IWETH(WETH).transfer(address(this), msg.value)); collat_XSD = collat_XSD + mint_amount; XSD.pool_mint(msg.sender, mint_amount); } // Redeem collateral. 100% collateral-backed function redeem1t1XSD(uint256 XSD_amount, uint256 COLLATERAL_out_min) external nonReentrant { require(!pid_controller.bucket3(), "Cannot withdraw in times of deficit"); require(!redeem_paused, "Redeem Paused"); require(XSD.global_collateral_ratio() == (1e6), "Collateral ratio must be == 1"); require(XSD_amount<=mintMapping[msg.sender].amount, "OVERREDEMPTION ERROR"); // convert xsd to $ and then to collateral value (uint256 XSD_dollar,uint256 collateral_needed) = CollateralPoolLibrary.calcRedeem1t1XSD( XSD.eth_usd_price(), XSD.xag_usd_price(), XSD_amount ); uint total_xsd_amount = mintMapping[msg.sender].amount; require(collateral_needed <= (IWETH(WETH).balanceOf(address(this))-unclaimedPoolCollateral), "Not enough collateral in pool"); require(COLLATERAL_out_min <= collateral_needed, "Slippage limit reached"); redeemInterestCalc(XSD_amount, msg.sender); uint current_accum_interest = (XSD_amount*mintMapping[msg.sender].accum_interest)/total_xsd_amount; redeemBankXBalances[msg.sender] = (redeemBankXBalances[msg.sender]+current_accum_interest); redeemCollateralBalances[msg.sender] = redeemCollateralBalances[msg.sender]+XSD_dollar; unclaimedPoolCollateral = unclaimedPoolCollateral+XSD_dollar; lastRedeemed[msg.sender] = block.number; unclaimedPoolBankX = (unclaimedPoolBankX+current_accum_interest); uint256 bankx_amount = (current_accum_interest*1e6)/XSD.bankx_price(); // Move all external functions to the end collat_XSD -= XSD_amount; mintMapping[msg.sender].accum_interest = (mintMapping[msg.sender].accum_interest - current_accum_interest); XSD.pool_burn_from(msg.sender, XSD_amount); BankX.pool_mint(address(this), bankx_amount); } // Will fail if fully collateralized or algorithmic // Redeem XSD for collateral and BankX. > 0% and < 100% collateral-backed function redeemFractionalXSD(uint256 XSD_amount, uint256 BankX_out_min, uint256 COLLATERAL_out_min) external nonReentrant { require(!pid_controller.bucket3(), "Cannot withdraw in times of deficit"); require(!redeem_paused, "Redeem Paused"); require(XSD_amount<=mintMapping[msg.sender].amount, "OVERREDEMPTION ERROR"); uint256 xag_usd_price = XSD.xag_usd_price(); uint256 global_collateral_ratio = XSD.global_collateral_ratio(); require(global_collateral_ratio < (1e6) && global_collateral_ratio > 0, "Collateral ratio needs to be between .000001 and .999999"); uint256 bankx_dollar_value_d18 = XSD_amount - ((XSD_amount*global_collateral_ratio)/(1e6)); bankx_dollar_value_d18 = (bankx_dollar_value_d18*xag_usd_price)/(31103477); uint256 bankx_amount = (bankx_dollar_value_d18*1e6)/XSD.bankx_price(); // Get dollar value required and then convert to collateral value(WETH) uint256 collateral_dollar_value = (XSD_amount*global_collateral_ratio)/(1e6); collateral_dollar_value = (collateral_dollar_value*xag_usd_price)/31103477; uint256 collateral_amount = (collateral_dollar_value*1e6)/XSD.eth_usd_price(); require(collateral_amount <= (IWETH(WETH).balanceOf(address(this))-unclaimedPoolCollateral), "Not enough collateral in pool"); require(COLLATERAL_out_min <= collateral_amount, "Slippage limit reached [collateral]"); require(BankX_out_min <= bankx_amount, "Slippage limit reached [BankX]"); redeemCollateralBalances[msg.sender] = redeemCollateralBalances[msg.sender]+collateral_dollar_value; unclaimedPoolCollateral = unclaimedPoolCollateral+collateral_dollar_value; lastRedeemed[msg.sender] = block.number; uint total_xsd_amount = mintMapping[msg.sender].amount; redeemInterestCalc(XSD_amount, msg.sender); uint current_accum_interest = (XSD_amount*mintMapping[msg.sender].accum_interest)/total_xsd_amount; redeemBankXBalances[msg.sender] = redeemBankXBalances[msg.sender]+current_accum_interest; bankx_amount = bankx_amount + ((current_accum_interest*1e6)/XSD.bankx_price()); mintMapping[msg.sender].accum_interest = mintMapping[msg.sender].accum_interest - current_accum_interest; redeemBankXBalances[msg.sender] = redeemBankXBalances[msg.sender]+bankx_dollar_value_d18; unclaimedPoolBankX = unclaimedPoolBankX+bankx_dollar_value_d18+current_accum_interest; collat_XSD -= XSD_amount; // Move all external functions to the end XSD.pool_burn_from(msg.sender, XSD_amount); BankX.pool_mint(address(this), bankx_amount); } // Redeem XSD for BankX. 0% collateral-backed function redeemAlgorithmicXSD(uint256 XSD_amount, uint256 BankX_out_min) external nonReentrant { require(!pid_controller.bucket3(), "Cannot withdraw in times of deficit"); require(!redeem_paused, "Redeem Paused"); require(XSD_amount<=mintMapping[msg.sender].amount, "OVERREDEMPTION ERROR"); uint256 bankx_price = XSD.bankx_price(); //for testing //require(XSD.global_collateral_ratio() == 0, "Collateral ratio must be 0"); uint256 bankx_dollar_value_d18 = (XSD_amount*XSD.xag_usd_price())/(31103477); uint256 bankx_amount = (bankx_dollar_value_d18*1e6)/bankx_price; lastRedeemed[msg.sender] = block.number; uint total_xsd_amount = mintMapping[msg.sender].amount; require(BankX_out_min <= bankx_amount, "Slippage limit reached"); redeemInterestCalc(XSD_amount, msg.sender); uint current_accum_interest = XSD_amount*mintMapping[msg.sender].accum_interest/total_xsd_amount; //precision of 6 redeemBankXBalances[msg.sender] = (redeemBankXBalances[msg.sender]+current_accum_interest); bankx_amount = bankx_amount + ((current_accum_interest*1e6)/bankx_price); mintMapping[msg.sender].accum_interest = (mintMapping[msg.sender].accum_interest - current_accum_interest); redeemBankXBalances[msg.sender] = redeemBankXBalances[msg.sender]+bankx_dollar_value_d18; unclaimedPoolBankX = unclaimedPoolBankX+bankx_dollar_value_d18+current_accum_interest; collat_XSD -= XSD_amount; // Move all external functions to the end XSD.pool_burn_from(msg.sender, XSD_amount); BankX.pool_mint(address(this), bankx_amount); } // After a redemption happens, transfer the newly minted BankX and owed collateral from this pool // contract to the user. Redemption is split into two functions to prevent flash loans from being able // to take out XSD/collateral from the system, use an AMM to trade the new price, and then mint back into the system. function collectRedemption() external nonReentrant{ require(!pid_controller.bucket3(), "Cannot withdraw in times of deficit"); require(!redeem_paused, "Redeem Paused"); require((lastRedeemed[msg.sender]+(redemption_delay)) <= block.number, "Must wait for redemption_delay blocks before collecting redemption"); //require(redeemCollateralBalances[msg.sender]< , "Not enough collateral in the pool"); //check for bucket and revert if there is a deficit. // add address parameter uint BankXDollarAmount; uint CollateralDollarAmount; uint BankXAmount; uint CollateralAmount; // Use Checks-Effects-Interactions pattern if(redeemBankXBalances[msg.sender] > 0){ BankXDollarAmount = redeemBankXBalances[msg.sender]; BankXAmount = (BankXDollarAmount*1e6)/XSD.bankx_price(); redeemBankXBalances[msg.sender] = 0; unclaimedPoolBankX = unclaimedPoolBankX-BankXDollarAmount; TransferHelper.safeTransfer(address(BankX), msg.sender, BankXAmount); } if(redeemCollateralBalances[msg.sender] > 0){ CollateralDollarAmount = redeemCollateralBalances[msg.sender]; CollateralAmount = (CollateralDollarAmount*1e6)/XSD.eth_usd_price(); redeemCollateralBalances[msg.sender] = 0; unclaimedPoolCollateral = unclaimedPoolCollateral-CollateralDollarAmount; IWETH(WETH).withdraw(CollateralAmount); //try to unwrap eth in the redeem TransferHelper.safeTransferETH(msg.sender, CollateralAmount); } } // Function can be called by an BankX holder to have the protocol buy back BankX with excess collateral value from a desired collateral pool // This can also happen if the collateral ratio > 1 // add XSD as a burn option while uXSD value is positive // need two seperate functions: one for bankx and one for XSD function buyBackBankX(uint256 BankX_amount,uint256 COLLATERAL_out_min) external{ require(!buyback_paused, "Buyback Paused"); CollateralPoolLibrary.BuybackBankX_Params memory input_params = CollateralPoolLibrary.BuybackBankX_Params( availableExcessCollatDV(), XSD.bankx_price(), XSD.eth_usd_price(), BankX_amount ); (collateral_equivalent_d18) = (CollateralPoolLibrary.calcBuyBackBankX(input_params)); require(COLLATERAL_out_min <= collateral_equivalent_d18, "Slippage limit reached"); // Give the sender their desired collateral and burn the BankX BankX.pool_burn_from(msg.sender, BankX_amount); TransferHelper.safeTransfer(address(WETH), address(this), collateral_equivalent_d18); IWETH(WETH).withdraw(collateral_equivalent_d18); TransferHelper.safeTransferETH(msg.sender, collateral_equivalent_d18); } //buyback with XSD instead of bankx function buyBackXSD(uint256 XSD_amount, uint256 collateral_out_min) external { require(!buyback_paused, "Buyback Paused"); if(XSD_amount != 0) require((XSD.totalSupply()+XSD_amount)>collat_XSD, "uXSD MUST BE POSITIVE"); CollateralPoolLibrary.BuybackXSD_Params memory input_params = CollateralPoolLibrary.BuybackXSD_Params( availableExcessCollatDV(), XSD.xsd_price(), XSD.eth_usd_price(), XSD_amount ); (collateral_equivalent_d18) = (CollateralPoolLibrary.calcBuyBackXSD(input_params)); require(collateral_out_min <= collateral_equivalent_d18, "Slippage limit reached"); XSD.pool_burn_from(msg.sender, XSD_amount); TransferHelper.safeTransfer(address(WETH), address(this), collateral_equivalent_d18); IWETH(WETH).withdraw(collateral_equivalent_d18); TransferHelper.safeTransferETH(msg.sender, collateral_equivalent_d18); } // Combined into one function due to 24KiB contract memory limit function setPoolParameters(uint256 new_redemption_delay, bool _mint_paused, bool _redeem_paused, bool _buyback_paused) external onlyByOwner { redemption_delay = new_redemption_delay; mint_paused = _mint_paused; redeem_paused = _redeem_paused; buyback_paused = _buyback_paused; emit PoolParametersSet(new_redemption_delay); } function setPIDController(address new_pid_address) external onlyByOwner { pid_controller = IPIDController(new_pid_address); pid_address = new_pid_address; } function setSmartContractOwner(address _smartcontract_owner) external{ require(msg.sender == smartcontract_owner, "Only the smart contract owner can access this function"); require(msg.sender != address(0), "Zero address detected"); smartcontract_owner = _smartcontract_owner; } function renounceOwnership() external{ require(msg.sender == smartcontract_owner, "Only the smart contract owner can access this function"); smartcontract_owner = address(0); } function resetAddresses(address _xsd_contract_address, address _bankx_contract_address, address _bankxweth_pool, address _xsdweth_pool, address _WETH) external{ require(msg.sender == smartcontract_owner, "Only the smart contract owner can access this function"); require( (_xsd_contract_address != address(0)) && (_bankx_contract_address != address(0)) && (_WETH != address(0)) && (_bankxweth_pool != address(0)) && (_xsdweth_pool != address(0)) , "Zero address detected"); XSD = XSDStablecoin(_xsd_contract_address); BankX = BankXToken(_bankx_contract_address); xsd_contract_address = _xsd_contract_address; bankx_contract_address = _bankx_contract_address; xsdweth_pool = _xsdweth_pool; bankxweth_pool = _bankxweth_pool; WETH = _WETH; } /* ========== EVENTS ========== */ event PoolParametersSet(uint256 new_redemption_delay); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IBankXWETHpool { function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); 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 collatDollarBalance() external returns(uint); function swap(uint amount0Out, uint amount1Out, address to) external; //function flush() external; function skim(address to) external; function sync() external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IXSDWETHpool { function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); 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 collatDollarBalance() external returns (uint); function swap(uint amount0Out, uint amount1Out, address to) external; //function flush() external; function skim(address to) external; function sync() external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./AggregatorV3Interface.sol"; contract ChainlinkETHUSDPriceConsumer { AggregatorV3Interface internal priceFeed; constructor() { //Mainnet address: 0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419 //Rinkeby address: 0x8A753747A1Fa494EC906cE90E9f37563A8AF630e //Kovan address: 0x9326BFA02ADD2366b30bacB125260Af641031331 //Goerli address: 0xD4a33860578De61DBAbDc8BFdb98FD742fA7028e //BNB address: 0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE 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.8.0; import "./AggregatorV3Interface.sol"; contract ChainlinkXAGUSDPriceConsumer { AggregatorV3Interface internal priceFeed; constructor() { //Mainnet address: 0x379589227b15F1a12195D3f2d90bBc9F31f95235 //Rinkeby address: 0x9c1946428f4f159dB4889aA6B218833f467e1BfD //Kovan address: 0x4594051c018Ac096222b5077C3351d523F93a963 //BNB address: 0x817326922c909b16944817c207562B25C4dF16aD priceFeed = AggregatorV3Interface(0x379589227b15F1a12195D3f2d90bBc9F31f95235); } /** * 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 // OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.6.0; // helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false library TransferHelper { function safeApprove( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('approve(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::safeApprove: approve failed' ); } function safeTransfer( address token, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transfer(address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::safeTransfer: transfer failed' ); } function safeTransferFrom( address token, address from, address to, uint256 value ) internal { // bytes4(keccak256(bytes('transferFrom(address,address,uint256)'))); (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper::transferFrom: transferFrom failed' ); } function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, 'TransferHelper::safeTransferETH: ETH transfer failed'); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IPIDController{ function bucket1() external view returns (bool); function bucket2() external view returns (bool); function bucket3() external view returns (bool); function diff1() external view returns (uint); function diff2() external view returns (uint); function diff3() external view returns (uint); function amountpaid1() external view returns (uint); function amountpaid2() external view returns (uint); function amountpaid3() external view returns (uint); function bankx_arbi_limit() external view returns (uint); function xsd_arbi_limit() external view returns (uint); function bankx_burnable_limit() external view returns (uint); function xsd_burnable_limit() external view returns (uint); function amountPaidBankXWETH(uint ethvalue) external; function amountPaidXSDWETH(uint ethvalue) external; function amountPaidCollateralPool(uint ethvalue) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IWETH { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function transferFrom(address src, address dst, uint wad) external returns (bool); function balanceOf(address account) external view returns (uint256); function withdraw(uint) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library CollateralPoolLibrary { // ================ Structs ================ // Needed to lower stack size struct MintFF_Params { uint256 bankx_price_usd; uint256 col_price_usd; uint256 bankx_amount; uint256 collateral_amount; uint256 col_ratio; } struct BuybackBankX_Params { uint256 excess_collateral_dollar_value_d18; uint256 bankx_price_usd; uint256 col_price_usd; uint256 BankX_amount; } struct BuybackXSD_Params { uint256 excess_collateral_dollar_value_d18; uint256 xsd_price_usd; uint256 col_price_usd; uint256 XSD_amount; } // ================ Functions ================ // xsd is at the price of one gram of silver. function calcMint1t1XSD(uint256 col_price, uint256 silver_price, uint256 collateral_amount_d18) public pure returns (uint256) { uint256 gram_price = (silver_price*(1e4))/(311035); return (collateral_amount_d18*(col_price))/(gram_price); } // xsd is at the price of one gram of silver function calcMintAlgorithmicXSD(uint256 bankx_price_usd, uint256 silver_price, uint256 bankx_amount_d18) public pure returns (uint256) { uint256 gram_price = (silver_price*(1e4))/(311035); return (bankx_amount_d18*bankx_price_usd)/(gram_price); } //new-code-start function calcMintInterest(uint256 XSD_amount,uint256 silver_price,uint256 rate, uint256 accum_interest, uint256 interest_rate, uint256 time, uint256 amount) internal view returns(uint256, uint256, uint256, uint256) { uint256 gram_price = (silver_price*(1e4))/(311035); if(time == 0){ interest_rate = rate; amount = XSD_amount; time = block.timestamp; } else{ uint delta_t = block.timestamp - time; delta_t = delta_t/(86400); //1 day = 86400 accum_interest = accum_interest+((amount*gram_price*interest_rate*delta_t)/(365*(1e12))); //check calculation for interest rate - done interest_rate = (amount*interest_rate) + (XSD_amount*rate);//weighted average interest calculation is in two parts amount = amount+XSD_amount; interest_rate = interest_rate/amount;//second part time = block.timestamp; } return ( accum_interest, interest_rate, time, amount ); } function calcRedemptionInterest(uint256 XSD_amount,uint256 silver_price, uint256 accum_interest, uint256 interest_rate, uint256 time, uint256 amount) internal view returns(uint256, uint256, uint256, uint256){ uint256 gram_price = (silver_price*(1e4))/(311035); uint delta_t = block.timestamp - time; delta_t = delta_t/(86400); accum_interest = accum_interest+((amount*gram_price*interest_rate*delta_t)/(365*(1e12))); amount = amount - XSD_amount; time = block.timestamp; return ( accum_interest, interest_rate, time, amount ); } //new-code-end // Must be internal because of the struct // xsd must be the dollar value of one price of silver function calcMintFractionalXSD(MintFF_Params memory params) internal pure returns (uint256, uint256) { // Since solidity truncates division, every division operation must be the last operation in the equation to ensure minimum error // The contract must check the proper ratio was sent to mint XSD. We do this by seeing the minimum mintable XSD based on each amount uint256 bankx_dollar_value_d18; uint256 c_dollar_value_d18; // Scoping for stack concerns { // USD amounts of the collateral and the BankX bankx_dollar_value_d18 = params.bankx_amount*(params.bankx_price_usd)/(1e6); c_dollar_value_d18 = params.collateral_amount*(params.col_price_usd)/(1e6); } uint calculated_bankx_dollar_value_d18 = (c_dollar_value_d18*(1e6)/(params.col_ratio)) -(c_dollar_value_d18); uint calculated_bankx_needed = calculated_bankx_dollar_value_d18*(1e6)/(params.bankx_price_usd); return ( (c_dollar_value_d18+calculated_bankx_dollar_value_d18), calculated_bankx_needed ); } function calcRedeem1t1XSD(uint256 col_price_usd,uint256 silver_price, uint256 XSD_amount) public pure returns (uint256,uint256) { uint256 gram_price = (silver_price*(1e4))/(311035); return ((XSD_amount*gram_price/1e6),((XSD_amount*gram_price)/col_price_usd)); } // Must be internal because of the struct function calcBuyBackBankX(BuybackBankX_Params memory params) internal pure returns (uint256) { // If the total collateral value is higher than the amount required at the current collateral ratio then buy back up to the possible BankX with the desired collateral require(params.excess_collateral_dollar_value_d18 > 0, "No excess collateral to buy back!"); // Make sure not to take more than is available uint256 bankx_dollar_value_d18 = (params.BankX_amount*params.bankx_price_usd); require((bankx_dollar_value_d18/1e6) <= params.excess_collateral_dollar_value_d18, "You are trying to buy back more than the excess!"); // Get the equivalent amount of collateral based on the market value of BankX provided uint256 collateral_equivalent_d18 = (bankx_dollar_value_d18)/(params.col_price_usd); //collateral_equivalent_d18 = collateral_equivalent_d18-((collateral_equivalent_d18*(params.buyback_fee))/(1e6)); return ( collateral_equivalent_d18 ); } function calcBuyBackXSD(BuybackXSD_Params memory params) internal pure returns (uint256) { require(params.excess_collateral_dollar_value_d18 > 0, "No excess collateral to buy back!"); uint256 xsd_dollar_value_d18 = params.XSD_amount*(params.xsd_price_usd); require((xsd_dollar_value_d18/1e6) <= params.excess_collateral_dollar_value_d18, "You are trying to buy more than the excess!"); uint256 collateral_equivalent_d18 = (xsd_dollar_value_d18)/(params.col_price_usd); return ( collateral_equivalent_d18 ); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.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 ); }
{ "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
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":"uint256","name":"_pool_amount","type":"uint256"},{"internalType":"uint256","name":"_genesis_supply","type":"uint256"},{"internalType":"address","name":"_smartcontract_owner","type":"address"},{"internalType":"address","name":"_treasury","type":"address"},{"internalType":"uint256","name":"_cap_rate","type":"uint256"}],"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":false,"internalType":"address","name":"bankx_pool_addr","type":"address"}],"name":"BankXEthPoolSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"global_collateral_ratio","type":"uint256"}],"name":"CollateralRatioRefreshed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"collateral_ratio_paused","type":"bool"}],"name":"CollateralRatioToggled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"eth_usd_oracle_address","type":"address"}],"name":"ETHUSDOracleSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"min_fee","type":"uint256"}],"name":"MintingFeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_pid_controller","type":"address"}],"name":"PIDControllerSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pool_address","type":"address"}],"name":"PoolAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pool_address","type":"address"}],"name":"PoolRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"price_band","type":"uint256"}],"name":"PriceBandSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"new_price_target","type":"uint256"}],"name":"PriceTargetSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"red_fee","type":"uint256"}],"name":"RedemptionFeeSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"new_cooldown","type":"uint256"}],"name":"RefreshCooldownSet","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":false,"internalType":"address","name":"xag_usd_oracle_address","type":"address"}],"name":"XAGUSDOracleSet","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":"XSDBurned","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"xsd_pool_addr","type":"address"}],"name":"XSDETHPoolSet","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":"XSDMinted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"new_step","type":"uint256"}],"name":"XSDStepSet","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":[],"name":"bankx_price","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":[{"internalType":"uint256","name":"_xsdamount","type":"uint256"}],"name":"burnUserXSD","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_xsdamount","type":"uint256"}],"name":"burnpoolXSD","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cap_rate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collateral_pool_address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collateral_ratio_paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"creatorMint","outputs":[],"stateMutability":"nonpayable","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_oracle_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":"interest_rate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"last_call_time","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":"pid_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":"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":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_bankx_pool_addr","type":"address"}],"name":"setBankXEthPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collateral_pool_address","type":"address"}],"name":"setCollateralEthPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_eth_usd_oracle_address","type":"address"}],"name":"setETHUSDOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pid_address","type":"address"}],"name":"setPIDController","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":"_new_cooldown","type":"uint256"}],"name":"setRefreshCooldown","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_router","type":"address"}],"name":"setRouterAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_smartcontract_owner","type":"address"}],"name":"setSmartContractOwner","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_new_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_xag_usd_oracle_address","type":"address"}],"name":"setXAGUSDOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_xsd_pool_addr","type":"address"}],"name":"setXSDEthPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_new_step","type":"uint256"}],"name":"setXSDStep","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"smartcontract_owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xag_usd_oracle_address","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xag_usd_price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xsd_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"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"xsd_pools","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"xsd_pools_array","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xsd_price","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"xsd_step","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60806040526000601a60006101000a81548160ff0219169083151502179055503480156200002c57600080fd5b506040516200637038038062006370833981810160405281019062000052919062000600565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015620000bd5750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b620000ff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000f69062000752565b60405180910390fd5b8660069081620001109190620009b5565b508560059081620001229190620009b5565b50848462000131919062000acb565b60128190555081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506200018a83866200024b60201b60201c565b620001be600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856200024b60201b60201c565b82600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506109c4601681905550620f424060158190555061ce40600e81905550610e10601781905550620c3500601881905550611388601981905550806011819055505050505050505062000ba6565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620002bd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620002b49062000b56565b60405180910390fd5b620002d160008383620003c360201b60201c565b8060026000828254620002e5919062000acb565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546200033c919062000acb565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051620003a3919062000b89565b60405180910390a3620003bf60008383620003c860201b60201c565b5050565b505050565b505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200043682620003eb565b810181811067ffffffffffffffff82111715620004585762000457620003fc565b5b80604052505050565b60006200046d620003cd565b90506200047b82826200042b565b919050565b600067ffffffffffffffff8211156200049e576200049d620003fc565b5b620004a982620003eb565b9050602081019050919050565b60005b83811015620004d6578082015181840152602081019050620004b9565b60008484015250505050565b6000620004f9620004f38462000480565b62000461565b905082815260208101848484011115620005185762000517620003e6565b5b62000525848285620004b6565b509392505050565b600082601f830112620005455762000544620003e1565b5b815162000557848260208601620004e2565b91505092915050565b6000819050919050565b620005758162000560565b81146200058157600080fd5b50565b60008151905062000595816200056a565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620005c8826200059b565b9050919050565b620005da81620005bb565b8114620005e657600080fd5b50565b600081519050620005fa81620005cf565b92915050565b600080600080600080600060e0888a031215620006225762000621620003d7565b5b600088015167ffffffffffffffff811115620006435762000642620003dc565b5b620006518a828b016200052d565b975050602088015167ffffffffffffffff811115620006755762000674620003dc565b5b620006838a828b016200052d565b9650506040620006968a828b0162000584565b9550506060620006a98a828b0162000584565b9450506080620006bc8a828b01620005e9565b93505060a0620006cf8a828b01620005e9565b92505060c0620006e28a828b0162000584565b91505092959891949750929550565b600082825260208201905092915050565b7f5a65726f20616464726573732064657465637465640000000000000000000000600082015250565b60006200073a601583620006f1565b9150620007478262000702565b602082019050919050565b600060208201905081810360008301526200076d816200072b565b9050919050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620007c757607f821691505b602082108103620007dd57620007dc6200077f565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620008477fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000808565b62000853868362000808565b95508019841693508086168417925050509392505050565b6000819050919050565b600062000896620008906200088a8462000560565b6200086b565b62000560565b9050919050565b6000819050919050565b620008b28362000875565b620008ca620008c1826200089d565b84845462000815565b825550505050565b600090565b620008e1620008d2565b620008ee818484620008a7565b505050565b5b8181101562000916576200090a600082620008d7565b600181019050620008f4565b5050565b601f82111562000965576200092f81620007e3565b6200093a84620007f8565b810160208510156200094a578190505b620009626200095985620007f8565b830182620008f3565b50505b505050565b600082821c905092915050565b60006200098a600019846008026200096a565b1980831691505092915050565b6000620009a5838362000977565b9150826002028217905092915050565b620009c08262000774565b67ffffffffffffffff811115620009dc57620009db620003fc565b5b620009e88254620007ae565b620009f58282856200091a565b600060209050601f83116001811462000a2d576000841562000a18578287015190505b62000a24858262000997565b86555062000a94565b601f19841662000a3d86620007e3565b60005b8281101562000a675784890151825560018201915060208501945060208101905062000a40565b8683101562000a87578489015162000a83601f89168262000977565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600062000ad88262000560565b915062000ae58362000560565b925082820190508082111562000b005762000aff62000a9c565b5b92915050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b600062000b3e601f83620006f1565b915062000b4b8262000b06565b602082019050919050565b6000602082019050818103600083015262000b718162000b2f565b9050919050565b62000b838162000560565b82525050565b600060208201905062000ba0600083018462000b78565b92915050565b6157ba8062000bb66000396000f3fe608060405234801561001057600080fd5b50600436106103a45760003560e01c806370a08231116101e9578063aa8076641161010f578063d2d97b06116100ad578063f0f442601161007c578063f0f4426014610a92578063f887ea4014610aae578063fb00f0ad14610acc578063fb6027b614610ae8576103a4565b8063d2d97b0614610a0a578063d914cd4b14610a28578063dd62ed3e14610a44578063e2daacca14610a74576103a4565b8063b4f56b26116100e9578063b4f56b2614610994578063bf9e7a12146109b0578063c03f7be3146109ce578063cbb3d808146109ec576103a4565b8063aa8076641461093e578063ae18bf231461095c578063b37d591c14610978576103a4565b806387a140c311610187578063a3a1d7cb11610156578063a3a1d7cb146108a4578063a457c2d7146108c2578063a8a778ae146108f2578063a9059cbb1461090e576103a4565b806387a140c31461083057806395d89b411461084e57806398ee20ab1461086c5780639d3688f814610888576103a4565b806379cc6790116101c357806379cc6790146107a85780637f759ffd146107c45780638503fce6146107e25780638767edbb14610800576103a4565b806370a0823114610752578063715018a614610782578063741d3c181461078c576103a4565b8063345ba24b116102ce57806341cb87fc1161026c57806351e238e31161023b57806351e238e3146106dc5780635bec29d3146106fa5780636140133b1461071857806361d027b314610734576103a4565b806341cb87fc1461066a57806342966c68146106865780634b5fcbc0146106a25780634c568bcf146106c0576103a4565b80633ec52178116102a85780633ec52178146106035780634003b6a9146106265780634013124a14610644578063408ab10f1461064e576103a4565b8063345ba24b1461059957806339509351146105b75780633b7d0946146105e7576103a4565b80632258750a116103465780632853fb10116103155780632853fb10146105215780632cb4f63e1461053f5780632eb9771b1461055d578063313ce5671461057b576103a4565b80632258750a1461049b57806323b872dd146104b957806325928ba1146104e95780632703a31114610505576103a4565b80630ac5eb72116103825780630ac5eb7214610413578063147216c81461043157806318160ddd146104615780631c5df1e51461047f576103a4565b806303bb91bb146103a957806306fdde03146103c5578063095ea7b3146103e3575b600080fd5b6103c360048036038101906103be91906142d1565b610b04565b005b6103cd610c7e565b6040516103da919061438e565b60405180910390f35b6103fd60048036038101906103f891906143e6565b610d0c565b60405161040a9190614441565b60405180910390f35b61041b610d2f565b604051610428919061446b565b60405180910390f35b61044b600480360381019061044691906142d1565b610d35565b6040516104589190614441565b60405180910390f35b610469610d55565b604051610476919061446b565b60405180910390f35b61049960048036038101906104949190614486565b610d5f565b005b6104a3610e88565b6040516104b0919061446b565b60405180910390f35b6104d360048036038101906104ce91906144b3565b610e8e565b6040516104e09190614441565b60405180910390f35b61050360048036038101906104fe9190614486565b610ebd565b005b61051f600480360381019061051a9190614486565b610fe6565b005b610529611270565b604051610536919061446b565b60405180910390f35b610547611276565b604051610554919061446b565b60405180910390f35b61056561127c565b604051610572919061446b565b60405180910390f35b610583611282565b6040516105909190614522565b60405180910390f35b6105a1611287565b6040516105ae919061446b565b60405180910390f35b6105d160048036038101906105cc91906143e6565b611353565b6040516105de9190614441565b60405180910390f35b61060160048036038101906105fc91906142d1565b61138a565b005b61060b61169d565b60405161061d9695949392919061453d565b60405180910390f35b61062e6117a6565b60405161063b919061446b565b60405180910390f35b61064c6117ac565b005b61066860048036038101906106639190614486565b61198d565b005b610684600480360381019061067f91906142d1565b611ab6565b005b6106a0600480360381019061069b9190614486565b611bf9565b005b6106aa611c0d565b6040516106b7919061446b565b60405180910390f35b6106da60048036038101906106d59190614486565b611c1e565b005b6106e4611d74565b6040516106f1919061446b565b60405180910390f35b610702611d7a565b60405161070f91906145ad565b60405180910390f35b610732600480360381019061072d9190614486565b611da0565b005b61073c611e71565b60405161074991906145ad565b60405180910390f35b61076c600480360381019061076791906142d1565b611e97565b604051610779919061446b565b60405180910390f35b61078a611edf565b005b6107a660048036038101906107a191906142d1565b611fb3565b005b6107c260048036038101906107bd91906143e6565b61223b565b005b6107cc61229d565b6040516107d9919061446b565b60405180910390f35b6107ea612369565b6040516107f7919061446b565b60405180910390f35b61081a60048036038101906108159190614486565b61237a565b60405161082791906145ad565b60405180910390f35b6108386123b9565b6040516108459190614441565b60405180910390f35b6108566123cc565b604051610863919061438e565b60405180910390f35b610886600480360381019061088191906142d1565b61245a565b005b6108a2600480360381019061089d91906142d1565b61259d565b005b6108ac612717565b6040516108b991906145ad565b60405180910390f35b6108dc60048036038101906108d791906143e6565b61273d565b6040516108e99190614441565b60405180910390f35b61090c600480360381019061090791906143e6565b6127b4565b005b610928600480360381019061092391906143e6565b6128ba565b6040516109359190614441565b60405180910390f35b6109466128dd565b60405161095391906145ad565b60405180910390f35b610976600480360381019061097191906142d1565b612903565b005b610992600480360381019061098d91906142d1565b612a46565b005b6109ae60048036038101906109a991906143e6565b612cce565b005b6109b8612dd4565b6040516109c591906145ad565b60405180910390f35b6109d6612dfa565b6040516109e3919061446b565b60405180910390f35b6109f4612e00565b604051610a01919061446b565b60405180910390f35b610a12612e06565b604051610a1f919061446b565b60405180910390f35b610a426004803603810190610a3d91906142d1565b612ea7565b005b610a5e6004803603810190610a5991906145c8565b61312e565b604051610a6b919061446b565b60405180910390f35b610a7c6131b5565b604051610a8991906145ad565b60405180910390f35b610aac6004803603810190610aa791906142d1565b6131db565b005b610ab661331e565b604051610ac391906145ad565b60405180910390f35b610ae66004803603810190610ae191906142d1565b613344565b005b610b026004803603810190610afd9190614486565b6134be565b005b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8b90614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610c03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfa906146c0565b60405180910390fd5b80601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f6de8d4b0cdd375f5b656c2bfb69c0aff15919fcc59b5ac0b2e5eb516e32f4f9f81604051610c7391906145ad565b60405180910390a150565b60068054610c8b9061470f565b80601f0160208091040260200160405190810160405280929190818152602001828054610cb79061470f565b8015610d045780601f10610cd957610100808354040283529160200191610d04565b820191906000526020600020905b815481529060010190602001808311610ce757829003601f168201915b505050505081565b600080610d176135ce565b9050610d248185856135d6565b600191505092915050565b60115481565b60146020528060005260406000206000915054906101000a900460ff1681565b6000600254905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610e085750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3e906147b2565b60405180910390fd5b806017819055507fc7443059c2ed485e2c9efe4e766bef9432a6f0ed6695741ab4afdffab3b9215781604051610e7d919061446b565b60405180910390a150565b601b5481565b600080610e996135ce565b9050610ea685828561379f565b610eb185858561382b565b60019150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610f665750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610fa5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9c906147b2565b60405180910390fd5b806016819055507f72375459ce00db9856e2794404802920ff3507dd3e2d34170755d82f0784bfbc81604051610fdb919061446b565b60405180910390a150565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611076576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106d90614844565b60405180910390fd5b80600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632c09ffdc6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111089190614879565b611110610d55565b61111a91906148d5565b1161115a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115190614955565b60405180910390fd5b611186601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682613aaa565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156111f057600080fd5b505af1158015611204573d6000803e3d6000fd5b505050503073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fd810700f8827f1f81697c0dbca6ecceaa70cd6730926b3acd476bdfddc1aec0a83604051611265919061446b565b60405180910390a350565b60195481565b60185481565b60155481565b601281565b6000600460149054906101000a900460ff16600a6112a59190614aa8565b620f4240600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b8152600401602060405180830381865afa158015611316573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133a9190614b29565b6113449190614b56565b61134e9190614bc7565b905090565b60008061135e6135ce565b905061137f818585611370858961312e565b61137a9190614bf8565b6135d6565b600191505092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461141a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141190614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611489576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611480906146c0565b60405180910390fd5b60011515601460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461151c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151390614c78565b60405180910390fd5b601460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905560005b601380549050811015611662578173ffffffffffffffffffffffffffffffffffffffff16601382815481106115a6576115a5614c98565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361164f5760006013828154811061160257611601614c98565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611662565b808061165a90614cc7565b91505061156e565b507f4106dfdaa577573db51c0ca93f766dbedfa0758faa2e7f5bcdb7c142be803c3f8160405161169291906145ad565b60405180910390a150565b6000806000806000806116b06000613c80565b6116ba6001613c80565b6116c2610d55565b6015546116cd612e06565b600460149054906101000a900460ff16600a6116e99190614aa8565b620f4240600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561175a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061177e9190614b29565b6117889190614b56565b6117929190614bc7565b955095509550955095509550909192939495565b60165481565b60001515601a60009054906101000a900460ff16151514611802576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f990614d5b565b60405180910390fd5b600061180c611c0d565b9050601754601b544261181f91906148d5565b1015611860576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161185790614ded565b60405180910390fd5b6019546018546118709190614bf8565b8111156118ab576016546015541161188f5760006015819055506118a6565b60165460155461189f91906148d5565b6015819055505b61190f565b6019546018546118bb91906148d5565b81101561190657620f42406016546015546118d69190614bf8565b106118ea57620f4240601581905550611901565b6016546015546118fa9190614bf8565b6015819055505b61190e565b42601b819055505b5b60006002601554620f424061192491906148d5565b61192e9190614bc7565b905061ce408111156119465780600e81905550611950565b61ce40600e819055505b7fb1200af9b3ac4dec88c9d01e1fb7cc7fa1f0fe55bf4afac1f30cc4fc2b2d1dd2601554604051611981919061446b565b60405180910390a15050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611a365750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611a75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6c906147b2565b60405180910390fd5b806018819055507f898a2c9df7982133daaa8cfd78b8c49c520cba03205eec6480552c19059f6e3a81604051611aab919061446b565b60405180910390a150565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3d90614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611bb5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bac906146c0565b60405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611c0a611c046135ce565b82613aaa565b50565b6000611c196000613c80565b905090565b80600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632c09ffdc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb09190614879565b611cb8610d55565b611cc291906148d5565b11611d02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf990614955565b60405180910390fd5b611d0c3382613aaa565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fd810700f8827f1f81697c0dbca6ecceaa70cd6730926b3acd476bdfddc1aec0a83604051611d69919061446b565b60405180910390a350565b60125481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e2790614654565b60405180910390fd5b806019819055507fe9febe6aec89ff2870eeab6d13333c59cbed275b1d9a95f527c853d99ddb7cf481604051611e66919061446b565b60405180910390a150565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6690614e7f565b60405180910390fd5b6000600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036120b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a9906146c0565b60405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f0141d846040518163ffffffff1660e01b8152600401602060405180830381865afa1580156121c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121e79190614ecb565b600460146101000a81548160ff021916908360ff1602179055507f4e76cd2b10c38c98ffe935e9b3e851cf6d1078a0a6f487a0636af025eded51588160405161223091906145ad565b60405180910390a150565b600061227a826040518060600160405280602481526020016157616024913961226b866122666135ce565b61312e565b613fe19092919063ffffffff16565b905061228e836122886135ce565b836135d6565b6122988383613aaa565b505050565b6000600460159054906101000a900460ff16600a6122bb9190614aa8565b620f4240600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561232c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123509190614b29565b61235a9190614b56565b6123649190614bc7565b905090565b60006123756001613c80565b905090565b6013818154811061238a57600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601a60009054906101000a900460ff1681565b600580546123d99061470f565b80601f01602080910402602001604051908101604052809291908181526020018280546124059061470f565b80156124525780601f1061242757610100808354040283529160200191612452565b820191906000526020600020905b81548152906001019060200180831161243557829003601f168201915b505050505081565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146124ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124e190614e7f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1603612559576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612550906146c0565b60405180910390fd5b80600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461262d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262490614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361269c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612693906146c0565b60405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f8aa057551fc4d51bb43d1efc7d5c24840b862ef53c1c14c10f63a6967920982f8160405161270c91906145ad565b60405180910390a150565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806127486135ce565b90506000612756828661312e565b90508381101561279b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161279290614f6a565b60405180910390fd5b6127a882868684036135d6565b60019250505092915050565b60011515601460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612847576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161283e90614ffc565b60405180910390fd5b6128518282614036565b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd810700f8827f1f81697c0dbca6ecceaa70cd6730926b3acd476bdfddc1aec0a836040516128ae919061446b565b60405180910390a35050565b6000806128c56135ce565b90506128d281858561382b565b600191505092915050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612993576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161298a90614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129f9906146c0565b60405180910390fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612ad6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acd90614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612b45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b3c906146c0565b60405180910390fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f0141d846040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c7a9190614ecb565b600460156101000a81548160ff021916908360ff1602179055507fe36a86b9a4b971cf74ff19700543b61688a9e4f0250d4dc1984d98e83323cd6781604051612cc391906145ad565b60405180910390a150565b60011515601460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5890614ffc565b60405180910390fd5b612d6b8282614105565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f4b5881170b234a82bb6ffb0c8055dbef290cce470b7d2dbaa17b6ae068560bdf83604051612dc8919061446b565b60405180910390a35050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60175481565b600e5481565b60008060009050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166317284c946040518163ffffffff1660e01b8152600401602060405180830381865afa158015612e7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e9e9190614879565b90508091505090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612f37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f2e90614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612fa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f9d906146c0565b60405180910390fd5b60001515601460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514613039576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161303090615068565b60405180910390fd5b6001601460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506013819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f73cca62ab1b520c9715bf4e6c71e3e518c754e7148f65102f43289a7df0efea68160405161312391906145ad565b60405180910390a150565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461326b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161326290614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036132da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132d1906146c0565b60405180910390fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146133d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016133cb90614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603613443576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161343a906146c0565b60405180910390fd5b80600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f8a4ef3e7d977f3fe331fc75dd5dde4c2381da896d74fa48faee49f6f8f548e24816040516134b391906145ad565b60405180910390a150565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461354e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161354590614654565b60405180910390fd5b6011548160125461355f9190614bf8565b1061359f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613596906150d4565b60405180910390fd5b6135cb600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682614105565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603613645576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161363c90615166565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036136b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016136ab906151f8565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051613792919061446b565b60405180910390a3505050565b60006137ab848461312e565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146138255781811015613817576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161380e90615264565b60405180910390fd5b61382484848484036135d6565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361389a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613891906152f6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603613909576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161390090615388565b60405180910390fd5b613914838383614264565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561399a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016139919061541a565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613a2d9190614bf8565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051613a91919061446b565b60405180910390a3613aa4848484614269565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603613b19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613b10906154ac565b60405180910390fd5b613b2582600083614264565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015613bab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613ba29061553e565b60405180910390fd5b8181036000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160026000828254613c0291906148d5565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051613c67919061446b565b60405180910390a3613c7b83600084614269565b505050565b600080600460149054906101000a900460ff16600a613c9f9190614aa8565b620f4240600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b8152600401602060405180830381865afa158015613d10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d349190614b29565b613d3e9190614b56565b613d489190614bc7565b90506000808060006001811115613d6257613d6161555e565b5b866001811115613d7557613d7461555e565b5b03613e6e57601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015613de7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e0b919061560f565b826dffffffffffffffffffffffffffff169250816dffffffffffffffffffffffffffff1691505080925081935050506000821480613e495750600081145b15613e5b576001945050505050613fdc565b8082613e679190614bc7565b9250613fc9565b600180811115613e8157613e8061555e565b5b866001811115613e9457613e9361555e565b5b03613f8d57600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015613f06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f2a919061560f565b826dffffffffffffffffffffffffffff169250816dffffffffffffffffffffffffffff1691505080925081935050506000821480613f685750600081145b15613f7a576001945050505050613fdc565b8082613f869190614bc7565b9250613fc8565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613fbf906156d4565b60405180910390fd5b5b8284613fd59190614bc7565b9450505050505b919050565b6000838311158290614029576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401614020919061438e565b60405180910390fd5b5082840390509392505050565b6140408282613aaa565b6141018261404c6135ce565b6140fc8460405180606001604052806024815260200161576160249139600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006140b26135ce565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613fe19092919063ffffffff16565b6135d6565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603614174576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161416b90615740565b60405180910390fd5b61418060008383614264565b80600260008282546141929190614bf8565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546141e79190614bf8565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161424c919061446b565b60405180910390a361426060008383614269565b5050565b505050565b505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061429e82614273565b9050919050565b6142ae81614293565b81146142b957600080fd5b50565b6000813590506142cb816142a5565b92915050565b6000602082840312156142e7576142e661426e565b5b60006142f5848285016142bc565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561433857808201518184015260208101905061431d565b60008484015250505050565b6000601f19601f8301169050919050565b6000614360826142fe565b61436a8185614309565b935061437a81856020860161431a565b61438381614344565b840191505092915050565b600060208201905081810360008301526143a88184614355565b905092915050565b6000819050919050565b6143c3816143b0565b81146143ce57600080fd5b50565b6000813590506143e0816143ba565b92915050565b600080604083850312156143fd576143fc61426e565b5b600061440b858286016142bc565b925050602061441c858286016143d1565b9150509250929050565b60008115159050919050565b61443b81614426565b82525050565b60006020820190506144566000830184614432565b92915050565b614465816143b0565b82525050565b6000602082019050614480600083018461445c565b92915050565b60006020828403121561449c5761449b61426e565b5b60006144aa848285016143d1565b91505092915050565b6000806000606084860312156144cc576144cb61426e565b5b60006144da868287016142bc565b93505060206144eb868287016142bc565b92505060406144fc868287016143d1565b9150509250925092565b600060ff82169050919050565b61451c81614506565b82525050565b60006020820190506145376000830184614513565b92915050565b600060c082019050614552600083018961445c565b61455f602083018861445c565b61456c604083018761445c565b614579606083018661445c565b614586608083018561445c565b61459360a083018461445c565b979650505050505050565b6145a781614293565b82525050565b60006020820190506145c2600083018461459e565b92915050565b600080604083850312156145df576145de61426e565b5b60006145ed858286016142bc565b92505060206145fe858286016142bc565b9150509250929050565b7f596f7520617265206e6f7420746865206f776e65720000000000000000000000600082015250565b600061463e601583614309565b915061464982614608565b602082019050919050565b6000602082019050818103600083015261466d81614631565b9050919050565b7f5a65726f20616464726573732064657465637465640000000000000000000000600082015250565b60006146aa601583614309565b91506146b582614674565b602082019050919050565b600060208201905081810360008301526146d98161469d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061472757607f821691505b60208210810361473a576147396146e0565b5b50919050565b7f596f7520617265206e6f7420746865206f776e6572206f72207468652070696460008201527f20636f6e74726f6c6c6572000000000000000000000000000000000000000000602082015250565b600061479c602b83614309565b91506147a782614740565b604082019050919050565b600060208201905081810360008301526147cb8161478f565b9050919050565b7f4f6e6c792074686520726f757465722063616e2061636365737320746869732060008201527f66756e6374696f6e000000000000000000000000000000000000000000000000602082015250565b600061482e602883614309565b9150614839826147d2565b604082019050919050565b6000602082019050818103600083015261485d81614821565b9050919050565b600081519050614873816143ba565b92915050565b60006020828403121561488f5761488e61426e565b5b600061489d84828501614864565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006148e0826143b0565b91506148eb836143b0565b9250828203905081811115614903576149026148a6565b5b92915050565b7f755853442068617320746f20626520706f736974697665000000000000000000600082015250565b600061493f601783614309565b915061494a82614909565b602082019050919050565b6000602082019050818103600083015261496e81614932565b9050919050565b60008160011c9050919050565b6000808291508390505b60018511156149cc578086048111156149a8576149a76148a6565b5b60018516156149b75780820291505b80810290506149c585614975565b945061498c565b94509492505050565b6000826149e55760019050614aa1565b816149f35760009050614aa1565b8160018114614a095760028114614a1357614a42565b6001915050614aa1565b60ff841115614a2557614a246148a6565b5b8360020a915084821115614a3c57614a3b6148a6565b5b50614aa1565b5060208310610133831016604e8410600b8410161715614a775782820a905083811115614a7257614a716148a6565b5b614aa1565b614a848484846001614982565b92509050818404811115614a9b57614a9a6148a6565b5b81810290505b9392505050565b6000614ab3826143b0565b9150614abe83614506565b9250614aeb7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846149d5565b905092915050565b6000819050919050565b614b0681614af3565b8114614b1157600080fd5b50565b600081519050614b2381614afd565b92915050565b600060208284031215614b3f57614b3e61426e565b5b6000614b4d84828501614b14565b91505092915050565b6000614b61826143b0565b9150614b6c836143b0565b9250828202614b7a816143b0565b91508282048414831517614b9157614b906148a6565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000614bd2826143b0565b9150614bdd836143b0565b925082614bed57614bec614b98565b5b828204905092915050565b6000614c03826143b0565b9150614c0e836143b0565b9250828201905080821115614c2657614c256148a6565b5b92915050565b7f41646472657373206e6f6e6578697374616e7400000000000000000000000000600082015250565b6000614c62601383614309565b9150614c6d82614c2c565b602082019050919050565b60006020820190508181036000830152614c9181614c55565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000614cd2826143b0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614d0457614d036148a6565b5b600182019050919050565b7f436f6c6c61746572616c20526174696f20686173206265656e20706175736564600082015250565b6000614d45602083614309565b9150614d5082614d0f565b602082019050919050565b60006020820190508181036000830152614d7481614d38565b9050919050565b7f4d757374207761697420666f7220746865207265667265736820636f6f6c646f60008201527f776e2073696e6365206c61737420726566726573680000000000000000000000602082015250565b6000614dd7603583614309565b9150614de282614d7b565b604082019050919050565b60006020820190508181036000830152614e0681614dca565b9050919050565b7f4f6e6c792074686520736d61727420636f6e7472616374206f776e657220636160008201527f6e2061636365737320746869732066756e6374696f6e00000000000000000000602082015250565b6000614e69603683614309565b9150614e7482614e0d565b604082019050919050565b60006020820190508181036000830152614e9881614e5c565b9050919050565b614ea881614506565b8114614eb357600080fd5b50565b600081519050614ec581614e9f565b92915050565b600060208284031215614ee157614ee061426e565b5b6000614eef84828501614eb6565b91505092915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000614f54602583614309565b9150614f5f82614ef8565b604082019050919050565b60006020820190508181036000830152614f8381614f47565b9050919050565b7f4f6e6c792078736420706f6f6c732063616e2063616c6c20746869732066756e60008201527f6374696f6e000000000000000000000000000000000000000000000000000000602082015250565b6000614fe6602583614309565b9150614ff182614f8a565b604082019050919050565b6000602082019050818103600083015261501581614fd9565b9050919050565b7f4164647265737320616c72656164792065786973747300000000000000000000600082015250565b6000615052601683614309565b915061505d8261501c565b602082019050919050565b6000602082019050818103600083015261508181615045565b9050919050565b7f636170206c696d69742072656163686564000000000000000000000000000000600082015250565b60006150be601183614309565b91506150c982615088565b602082019050919050565b600060208201905081810360008301526150ed816150b1565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000615150602483614309565b915061515b826150f4565b604082019050919050565b6000602082019050818103600083015261517f81615143565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006151e2602283614309565b91506151ed82615186565b604082019050919050565b60006020820190508181036000830152615211816151d5565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b600061524e601d83614309565b915061525982615218565b602082019050919050565b6000602082019050818103600083015261527d81615241565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006152e0602583614309565b91506152eb82615284565b604082019050919050565b6000602082019050818103600083015261530f816152d3565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000615372602383614309565b915061537d82615316565b604082019050919050565b600060208201905081810360008301526153a181615365565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000615404602683614309565b915061540f826153a8565b604082019050919050565b60006020820190508181036000830152615433816153f7565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000615496602183614309565b91506154a18261543a565b604082019050919050565b600060208201905081810360008301526154c581615489565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000615528602283614309565b9150615533826154cc565b604082019050919050565b600060208201905081810360008301526155578161551b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60006dffffffffffffffffffffffffffff82169050919050565b6155b08161558d565b81146155bb57600080fd5b50565b6000815190506155cd816155a7565b92915050565b600063ffffffff82169050919050565b6155ec816155d3565b81146155f757600080fd5b50565b600081519050615609816155e3565b92915050565b6000806000606084860312156156285761562761426e565b5b6000615636868287016155be565b9350506020615647868287016155be565b9250506040615658868287016155fa565b9150509250925092565b7f494e56414c49442050524943452043484f4943452e204e6565647320746f206260008201527f65206569746865722030202858534429206f722031202842616e6b5829000000602082015250565b60006156be603d83614309565b91506156c982615662565b604082019050919050565b600060208201905081810360008301526156ed816156b1565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b600061572a601f83614309565b9150615735826156f4565b602082019050919050565b600060208201905081810360008301526157598161571d565b905091905056fe45524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220da63323af81d27aa46d3953066aa449c42888c50d3a0e979ed7ef8ff043b9ee764736f6c6343000812003300000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000021e19e0c9bab2400000000000000000000000000000000000000000000000108b2a2c2802909400000000000000000000000000000003e33bab8414bdb433e883785f91ede95f0f4dfe0000000000000000000000004b3607a868044ebd88d9326bca7e1d8ad51ae48a00000000000000000000000000000000000000000021165458500521280000000000000000000000000000000000000000000000000000000000000000000008585344546f6b656e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035853440000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106103a45760003560e01c806370a08231116101e9578063aa8076641161010f578063d2d97b06116100ad578063f0f442601161007c578063f0f4426014610a92578063f887ea4014610aae578063fb00f0ad14610acc578063fb6027b614610ae8576103a4565b8063d2d97b0614610a0a578063d914cd4b14610a28578063dd62ed3e14610a44578063e2daacca14610a74576103a4565b8063b4f56b26116100e9578063b4f56b2614610994578063bf9e7a12146109b0578063c03f7be3146109ce578063cbb3d808146109ec576103a4565b8063aa8076641461093e578063ae18bf231461095c578063b37d591c14610978576103a4565b806387a140c311610187578063a3a1d7cb11610156578063a3a1d7cb146108a4578063a457c2d7146108c2578063a8a778ae146108f2578063a9059cbb1461090e576103a4565b806387a140c31461083057806395d89b411461084e57806398ee20ab1461086c5780639d3688f814610888576103a4565b806379cc6790116101c357806379cc6790146107a85780637f759ffd146107c45780638503fce6146107e25780638767edbb14610800576103a4565b806370a0823114610752578063715018a614610782578063741d3c181461078c576103a4565b8063345ba24b116102ce57806341cb87fc1161026c57806351e238e31161023b57806351e238e3146106dc5780635bec29d3146106fa5780636140133b1461071857806361d027b314610734576103a4565b806341cb87fc1461066a57806342966c68146106865780634b5fcbc0146106a25780634c568bcf146106c0576103a4565b80633ec52178116102a85780633ec52178146106035780634003b6a9146106265780634013124a14610644578063408ab10f1461064e576103a4565b8063345ba24b1461059957806339509351146105b75780633b7d0946146105e7576103a4565b80632258750a116103465780632853fb10116103155780632853fb10146105215780632cb4f63e1461053f5780632eb9771b1461055d578063313ce5671461057b576103a4565b80632258750a1461049b57806323b872dd146104b957806325928ba1146104e95780632703a31114610505576103a4565b80630ac5eb72116103825780630ac5eb7214610413578063147216c81461043157806318160ddd146104615780631c5df1e51461047f576103a4565b806303bb91bb146103a957806306fdde03146103c5578063095ea7b3146103e3575b600080fd5b6103c360048036038101906103be91906142d1565b610b04565b005b6103cd610c7e565b6040516103da919061438e565b60405180910390f35b6103fd60048036038101906103f891906143e6565b610d0c565b60405161040a9190614441565b60405180910390f35b61041b610d2f565b604051610428919061446b565b60405180910390f35b61044b600480360381019061044691906142d1565b610d35565b6040516104589190614441565b60405180910390f35b610469610d55565b604051610476919061446b565b60405180910390f35b61049960048036038101906104949190614486565b610d5f565b005b6104a3610e88565b6040516104b0919061446b565b60405180910390f35b6104d360048036038101906104ce91906144b3565b610e8e565b6040516104e09190614441565b60405180910390f35b61050360048036038101906104fe9190614486565b610ebd565b005b61051f600480360381019061051a9190614486565b610fe6565b005b610529611270565b604051610536919061446b565b60405180910390f35b610547611276565b604051610554919061446b565b60405180910390f35b61056561127c565b604051610572919061446b565b60405180910390f35b610583611282565b6040516105909190614522565b60405180910390f35b6105a1611287565b6040516105ae919061446b565b60405180910390f35b6105d160048036038101906105cc91906143e6565b611353565b6040516105de9190614441565b60405180910390f35b61060160048036038101906105fc91906142d1565b61138a565b005b61060b61169d565b60405161061d9695949392919061453d565b60405180910390f35b61062e6117a6565b60405161063b919061446b565b60405180910390f35b61064c6117ac565b005b61066860048036038101906106639190614486565b61198d565b005b610684600480360381019061067f91906142d1565b611ab6565b005b6106a0600480360381019061069b9190614486565b611bf9565b005b6106aa611c0d565b6040516106b7919061446b565b60405180910390f35b6106da60048036038101906106d59190614486565b611c1e565b005b6106e4611d74565b6040516106f1919061446b565b60405180910390f35b610702611d7a565b60405161070f91906145ad565b60405180910390f35b610732600480360381019061072d9190614486565b611da0565b005b61073c611e71565b60405161074991906145ad565b60405180910390f35b61076c600480360381019061076791906142d1565b611e97565b604051610779919061446b565b60405180910390f35b61078a611edf565b005b6107a660048036038101906107a191906142d1565b611fb3565b005b6107c260048036038101906107bd91906143e6565b61223b565b005b6107cc61229d565b6040516107d9919061446b565b60405180910390f35b6107ea612369565b6040516107f7919061446b565b60405180910390f35b61081a60048036038101906108159190614486565b61237a565b60405161082791906145ad565b60405180910390f35b6108386123b9565b6040516108459190614441565b60405180910390f35b6108566123cc565b604051610863919061438e565b60405180910390f35b610886600480360381019061088191906142d1565b61245a565b005b6108a2600480360381019061089d91906142d1565b61259d565b005b6108ac612717565b6040516108b991906145ad565b60405180910390f35b6108dc60048036038101906108d791906143e6565b61273d565b6040516108e99190614441565b60405180910390f35b61090c600480360381019061090791906143e6565b6127b4565b005b610928600480360381019061092391906143e6565b6128ba565b6040516109359190614441565b60405180910390f35b6109466128dd565b60405161095391906145ad565b60405180910390f35b610976600480360381019061097191906142d1565b612903565b005b610992600480360381019061098d91906142d1565b612a46565b005b6109ae60048036038101906109a991906143e6565b612cce565b005b6109b8612dd4565b6040516109c591906145ad565b60405180910390f35b6109d6612dfa565b6040516109e3919061446b565b60405180910390f35b6109f4612e00565b604051610a01919061446b565b60405180910390f35b610a12612e06565b604051610a1f919061446b565b60405180910390f35b610a426004803603810190610a3d91906142d1565b612ea7565b005b610a5e6004803603810190610a5991906145c8565b61312e565b604051610a6b919061446b565b60405180910390f35b610a7c6131b5565b604051610a8991906145ad565b60405180910390f35b610aac6004803603810190610aa791906142d1565b6131db565b005b610ab661331e565b604051610ac391906145ad565b60405180910390f35b610ae66004803603810190610ae191906142d1565b613344565b005b610b026004803603810190610afd9190614486565b6134be565b005b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8b90614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610c03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfa906146c0565b60405180910390fd5b80601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f6de8d4b0cdd375f5b656c2bfb69c0aff15919fcc59b5ac0b2e5eb516e32f4f9f81604051610c7391906145ad565b60405180910390a150565b60068054610c8b9061470f565b80601f0160208091040260200160405190810160405280929190818152602001828054610cb79061470f565b8015610d045780601f10610cd957610100808354040283529160200191610d04565b820191906000526020600020905b815481529060010190602001808311610ce757829003601f168201915b505050505081565b600080610d176135ce565b9050610d248185856135d6565b600191505092915050565b60115481565b60146020528060005260406000206000915054906101000a900460ff1681565b6000600254905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610e085750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3e906147b2565b60405180910390fd5b806017819055507fc7443059c2ed485e2c9efe4e766bef9432a6f0ed6695741ab4afdffab3b9215781604051610e7d919061446b565b60405180910390a150565b601b5481565b600080610e996135ce565b9050610ea685828561379f565b610eb185858561382b565b60019150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610f665750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610fa5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9c906147b2565b60405180910390fd5b806016819055507f72375459ce00db9856e2794404802920ff3507dd3e2d34170755d82f0784bfbc81604051610fdb919061446b565b60405180910390a150565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611076576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106d90614844565b60405180910390fd5b80600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632c09ffdc6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111089190614879565b611110610d55565b61111a91906148d5565b1161115a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115190614955565b60405180910390fd5b611186601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682613aaa565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156111f057600080fd5b505af1158015611204573d6000803e3d6000fd5b505050503073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fd810700f8827f1f81697c0dbca6ecceaa70cd6730926b3acd476bdfddc1aec0a83604051611265919061446b565b60405180910390a350565b60195481565b60185481565b60155481565b601281565b6000600460149054906101000a900460ff16600a6112a59190614aa8565b620f4240600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b8152600401602060405180830381865afa158015611316573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133a9190614b29565b6113449190614b56565b61134e9190614bc7565b905090565b60008061135e6135ce565b905061137f818585611370858961312e565b61137a9190614bf8565b6135d6565b600191505092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461141a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141190614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611489576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611480906146c0565b60405180910390fd5b60011515601460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151461151c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151390614c78565b60405180910390fd5b601460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81549060ff021916905560005b601380549050811015611662578173ffffffffffffffffffffffffffffffffffffffff16601382815481106115a6576115a5614c98565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff160361164f5760006013828154811061160257611601614c98565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611662565b808061165a90614cc7565b91505061156e565b507f4106dfdaa577573db51c0ca93f766dbedfa0758faa2e7f5bcdb7c142be803c3f8160405161169291906145ad565b60405180910390a150565b6000806000806000806116b06000613c80565b6116ba6001613c80565b6116c2610d55565b6015546116cd612e06565b600460149054906101000a900460ff16600a6116e99190614aa8565b620f4240600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561175a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061177e9190614b29565b6117889190614b56565b6117929190614bc7565b955095509550955095509550909192939495565b60165481565b60001515601a60009054906101000a900460ff16151514611802576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f990614d5b565b60405180910390fd5b600061180c611c0d565b9050601754601b544261181f91906148d5565b1015611860576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161185790614ded565b60405180910390fd5b6019546018546118709190614bf8565b8111156118ab576016546015541161188f5760006015819055506118a6565b60165460155461189f91906148d5565b6015819055505b61190f565b6019546018546118bb91906148d5565b81101561190657620f42406016546015546118d69190614bf8565b106118ea57620f4240601581905550611901565b6016546015546118fa9190614bf8565b6015819055505b61190e565b42601b819055505b5b60006002601554620f424061192491906148d5565b61192e9190614bc7565b905061ce408111156119465780600e81905550611950565b61ce40600e819055505b7fb1200af9b3ac4dec88c9d01e1fb7cc7fa1f0fe55bf4afac1f30cc4fc2b2d1dd2601554604051611981919061446b565b60405180910390a15050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611a365750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611a75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6c906147b2565b60405180910390fd5b806018819055507f898a2c9df7982133daaa8cfd78b8c49c520cba03205eec6480552c19059f6e3a81604051611aab919061446b565b60405180910390a150565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3d90614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603611bb5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bac906146c0565b60405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611c0a611c046135ce565b82613aaa565b50565b6000611c196000613c80565b905090565b80600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632c09ffdc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611c8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cb09190614879565b611cb8610d55565b611cc291906148d5565b11611d02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf990614955565b60405180910390fd5b611d0c3382613aaa565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fd810700f8827f1f81697c0dbca6ecceaa70cd6730926b3acd476bdfddc1aec0a83604051611d69919061446b565b60405180910390a350565b60125481565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e30576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e2790614654565b60405180910390fd5b806019819055507fe9febe6aec89ff2870eeab6d13333c59cbed275b1d9a95f527c853d99ddb7cf481604051611e66919061446b565b60405180910390a150565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6690614e7f565b60405180910390fd5b6000600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036120b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a9906146c0565b60405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f0141d846040518163ffffffff1660e01b8152600401602060405180830381865afa1580156121c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121e79190614ecb565b600460146101000a81548160ff021916908360ff1602179055507f4e76cd2b10c38c98ffe935e9b3e851cf6d1078a0a6f487a0636af025eded51588160405161223091906145ad565b60405180910390a150565b600061227a826040518060600160405280602481526020016157616024913961226b866122666135ce565b61312e565b613fe19092919063ffffffff16565b905061228e836122886135ce565b836135d6565b6122988383613aaa565b505050565b6000600460159054906101000a900460ff16600a6122bb9190614aa8565b620f4240600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b8152600401602060405180830381865afa15801561232c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123509190614b29565b61235a9190614b56565b6123649190614bc7565b905090565b60006123756001613c80565b905090565b6013818154811061238a57600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601a60009054906101000a900460ff1681565b600580546123d99061470f565b80601f01602080910402602001604051908101604052809291908181526020018280546124059061470f565b80156124525780601f1061242757610100808354040283529160200191612452565b820191906000526020600020905b81548152906001019060200180831161243557829003601f168201915b505050505081565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146124ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124e190614e7f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1603612559576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612550906146c0565b60405180910390fd5b80600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461262d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161262490614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361269c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612693906146c0565b60405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f8aa057551fc4d51bb43d1efc7d5c24840b862ef53c1c14c10f63a6967920982f8160405161270c91906145ad565b60405180910390a150565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806127486135ce565b90506000612756828661312e565b90508381101561279b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161279290614f6a565b60405180910390fd5b6127a882868684036135d6565b60019250505092915050565b60011515601460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612847576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161283e90614ffc565b60405180910390fd5b6128518282614036565b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd810700f8827f1f81697c0dbca6ecceaa70cd6730926b3acd476bdfddc1aec0a836040516128ae919061446b565b60405180910390a35050565b6000806128c56135ce565b90506128d281858561382b565b600191505092915050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612993576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161298a90614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612a02576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129f9906146c0565b60405180910390fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612ad6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acd90614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612b45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b3c906146c0565b60405180910390fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f0141d846040518163ffffffff1660e01b8152600401602060405180830381865afa158015612c56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c7a9190614ecb565b600460156101000a81548160ff021916908360ff1602179055507fe36a86b9a4b971cf74ff19700543b61688a9e4f0250d4dc1984d98e83323cd6781604051612cc391906145ad565b60405180910390a150565b60011515601460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5890614ffc565b60405180910390fd5b612d6b8282614105565b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f4b5881170b234a82bb6ffb0c8055dbef290cce470b7d2dbaa17b6ae068560bdf83604051612dc8919061446b565b60405180910390a35050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60175481565b600e5481565b60008060009050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166317284c946040518163ffffffff1660e01b8152600401602060405180830381865afa158015612e7a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612e9e9190614879565b90508091505090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612f37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f2e90614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603612fa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f9d906146c0565b60405180910390fd5b60001515601460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514613039576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161303090615068565b60405180910390fd5b6001601460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506013819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f73cca62ab1b520c9715bf4e6c71e3e518c754e7148f65102f43289a7df0efea68160405161312391906145ad565b60405180910390a150565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461326b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161326290614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036132da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016132d1906146c0565b60405180910390fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146133d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016133cb90614654565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603613443576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161343a906146c0565b60405180910390fd5b80600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f8a4ef3e7d977f3fe331fc75dd5dde4c2381da896d74fa48faee49f6f8f548e24816040516134b391906145ad565b60405180910390a150565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461354e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161354590614654565b60405180910390fd5b6011548160125461355f9190614bf8565b1061359f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613596906150d4565b60405180910390fd5b6135cb600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682614105565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603613645576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161363c90615166565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036136b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016136ab906151f8565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051613792919061446b565b60405180910390a3505050565b60006137ab848461312e565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146138255781811015613817576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161380e90615264565b60405180910390fd5b61382484848484036135d6565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361389a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613891906152f6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603613909576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161390090615388565b60405180910390fd5b613914838383614264565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561399a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016139919061541a565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254613a2d9190614bf8565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051613a91919061446b565b60405180910390a3613aa4848484614269565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603613b19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613b10906154ac565b60405180910390fd5b613b2582600083614264565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015613bab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613ba29061553e565b60405180910390fd5b8181036000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160026000828254613c0291906148d5565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051613c67919061446b565b60405180910390a3613c7b83600084614269565b505050565b600080600460149054906101000a900460ff16600a613c9f9190614aa8565b620f4240600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638e15f4736040518163ffffffff1660e01b8152600401602060405180830381865afa158015613d10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613d349190614b29565b613d3e9190614b56565b613d489190614bc7565b90506000808060006001811115613d6257613d6161555e565b5b866001811115613d7557613d7461555e565b5b03613e6e57601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015613de7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e0b919061560f565b826dffffffffffffffffffffffffffff169250816dffffffffffffffffffffffffffff1691505080925081935050506000821480613e495750600081145b15613e5b576001945050505050613fdc565b8082613e679190614bc7565b9250613fc9565b600180811115613e8157613e8061555e565b5b866001811115613e9457613e9361555e565b5b03613f8d57600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b8152600401606060405180830381865afa158015613f06573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613f2a919061560f565b826dffffffffffffffffffffffffffff169250816dffffffffffffffffffffffffffff1691505080925081935050506000821480613f685750600081145b15613f7a576001945050505050613fdc565b8082613f869190614bc7565b9250613fc8565b6040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401613fbf906156d4565b60405180910390fd5b5b8284613fd59190614bc7565b9450505050505b919050565b6000838311158290614029576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401614020919061438e565b60405180910390fd5b5082840390509392505050565b6140408282613aaa565b6141018261404c6135ce565b6140fc8460405180606001604052806024815260200161576160249139600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006140b26135ce565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613fe19092919063ffffffff16565b6135d6565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603614174576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161416b90615740565b60405180910390fd5b61418060008383614264565b80600260008282546141929190614bf8565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546141e79190614bf8565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161424c919061446b565b60405180910390a361426060008383614269565b5050565b505050565b505050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061429e82614273565b9050919050565b6142ae81614293565b81146142b957600080fd5b50565b6000813590506142cb816142a5565b92915050565b6000602082840312156142e7576142e661426e565b5b60006142f5848285016142bc565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561433857808201518184015260208101905061431d565b60008484015250505050565b6000601f19601f8301169050919050565b6000614360826142fe565b61436a8185614309565b935061437a81856020860161431a565b61438381614344565b840191505092915050565b600060208201905081810360008301526143a88184614355565b905092915050565b6000819050919050565b6143c3816143b0565b81146143ce57600080fd5b50565b6000813590506143e0816143ba565b92915050565b600080604083850312156143fd576143fc61426e565b5b600061440b858286016142bc565b925050602061441c858286016143d1565b9150509250929050565b60008115159050919050565b61443b81614426565b82525050565b60006020820190506144566000830184614432565b92915050565b614465816143b0565b82525050565b6000602082019050614480600083018461445c565b92915050565b60006020828403121561449c5761449b61426e565b5b60006144aa848285016143d1565b91505092915050565b6000806000606084860312156144cc576144cb61426e565b5b60006144da868287016142bc565b93505060206144eb868287016142bc565b92505060406144fc868287016143d1565b9150509250925092565b600060ff82169050919050565b61451c81614506565b82525050565b60006020820190506145376000830184614513565b92915050565b600060c082019050614552600083018961445c565b61455f602083018861445c565b61456c604083018761445c565b614579606083018661445c565b614586608083018561445c565b61459360a083018461445c565b979650505050505050565b6145a781614293565b82525050565b60006020820190506145c2600083018461459e565b92915050565b600080604083850312156145df576145de61426e565b5b60006145ed858286016142bc565b92505060206145fe858286016142bc565b9150509250929050565b7f596f7520617265206e6f7420746865206f776e65720000000000000000000000600082015250565b600061463e601583614309565b915061464982614608565b602082019050919050565b6000602082019050818103600083015261466d81614631565b9050919050565b7f5a65726f20616464726573732064657465637465640000000000000000000000600082015250565b60006146aa601583614309565b91506146b582614674565b602082019050919050565b600060208201905081810360008301526146d98161469d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061472757607f821691505b60208210810361473a576147396146e0565b5b50919050565b7f596f7520617265206e6f7420746865206f776e6572206f72207468652070696460008201527f20636f6e74726f6c6c6572000000000000000000000000000000000000000000602082015250565b600061479c602b83614309565b91506147a782614740565b604082019050919050565b600060208201905081810360008301526147cb8161478f565b9050919050565b7f4f6e6c792074686520726f757465722063616e2061636365737320746869732060008201527f66756e6374696f6e000000000000000000000000000000000000000000000000602082015250565b600061482e602883614309565b9150614839826147d2565b604082019050919050565b6000602082019050818103600083015261485d81614821565b9050919050565b600081519050614873816143ba565b92915050565b60006020828403121561488f5761488e61426e565b5b600061489d84828501614864565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006148e0826143b0565b91506148eb836143b0565b9250828203905081811115614903576149026148a6565b5b92915050565b7f755853442068617320746f20626520706f736974697665000000000000000000600082015250565b600061493f601783614309565b915061494a82614909565b602082019050919050565b6000602082019050818103600083015261496e81614932565b9050919050565b60008160011c9050919050565b6000808291508390505b60018511156149cc578086048111156149a8576149a76148a6565b5b60018516156149b75780820291505b80810290506149c585614975565b945061498c565b94509492505050565b6000826149e55760019050614aa1565b816149f35760009050614aa1565b8160018114614a095760028114614a1357614a42565b6001915050614aa1565b60ff841115614a2557614a246148a6565b5b8360020a915084821115614a3c57614a3b6148a6565b5b50614aa1565b5060208310610133831016604e8410600b8410161715614a775782820a905083811115614a7257614a716148a6565b5b614aa1565b614a848484846001614982565b92509050818404811115614a9b57614a9a6148a6565b5b81810290505b9392505050565b6000614ab3826143b0565b9150614abe83614506565b9250614aeb7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846149d5565b905092915050565b6000819050919050565b614b0681614af3565b8114614b1157600080fd5b50565b600081519050614b2381614afd565b92915050565b600060208284031215614b3f57614b3e61426e565b5b6000614b4d84828501614b14565b91505092915050565b6000614b61826143b0565b9150614b6c836143b0565b9250828202614b7a816143b0565b91508282048414831517614b9157614b906148a6565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000614bd2826143b0565b9150614bdd836143b0565b925082614bed57614bec614b98565b5b828204905092915050565b6000614c03826143b0565b9150614c0e836143b0565b9250828201905080821115614c2657614c256148a6565b5b92915050565b7f41646472657373206e6f6e6578697374616e7400000000000000000000000000600082015250565b6000614c62601383614309565b9150614c6d82614c2c565b602082019050919050565b60006020820190508181036000830152614c9181614c55565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000614cd2826143b0565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614d0457614d036148a6565b5b600182019050919050565b7f436f6c6c61746572616c20526174696f20686173206265656e20706175736564600082015250565b6000614d45602083614309565b9150614d5082614d0f565b602082019050919050565b60006020820190508181036000830152614d7481614d38565b9050919050565b7f4d757374207761697420666f7220746865207265667265736820636f6f6c646f60008201527f776e2073696e6365206c61737420726566726573680000000000000000000000602082015250565b6000614dd7603583614309565b9150614de282614d7b565b604082019050919050565b60006020820190508181036000830152614e0681614dca565b9050919050565b7f4f6e6c792074686520736d61727420636f6e7472616374206f776e657220636160008201527f6e2061636365737320746869732066756e6374696f6e00000000000000000000602082015250565b6000614e69603683614309565b9150614e7482614e0d565b604082019050919050565b60006020820190508181036000830152614e9881614e5c565b9050919050565b614ea881614506565b8114614eb357600080fd5b50565b600081519050614ec581614e9f565b92915050565b600060208284031215614ee157614ee061426e565b5b6000614eef84828501614eb6565b91505092915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000614f54602583614309565b9150614f5f82614ef8565b604082019050919050565b60006020820190508181036000830152614f8381614f47565b9050919050565b7f4f6e6c792078736420706f6f6c732063616e2063616c6c20746869732066756e60008201527f6374696f6e000000000000000000000000000000000000000000000000000000602082015250565b6000614fe6602583614309565b9150614ff182614f8a565b604082019050919050565b6000602082019050818103600083015261501581614fd9565b9050919050565b7f4164647265737320616c72656164792065786973747300000000000000000000600082015250565b6000615052601683614309565b915061505d8261501c565b602082019050919050565b6000602082019050818103600083015261508181615045565b9050919050565b7f636170206c696d69742072656163686564000000000000000000000000000000600082015250565b60006150be601183614309565b91506150c982615088565b602082019050919050565b600060208201905081810360008301526150ed816150b1565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000615150602483614309565b915061515b826150f4565b604082019050919050565b6000602082019050818103600083015261517f81615143565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006151e2602283614309565b91506151ed82615186565b604082019050919050565b60006020820190508181036000830152615211816151d5565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b600061524e601d83614309565b915061525982615218565b602082019050919050565b6000602082019050818103600083015261527d81615241565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006152e0602583614309565b91506152eb82615284565b604082019050919050565b6000602082019050818103600083015261530f816152d3565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000615372602383614309565b915061537d82615316565b604082019050919050565b600060208201905081810360008301526153a181615365565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000615404602683614309565b915061540f826153a8565b604082019050919050565b60006020820190508181036000830152615433816153f7565b9050919050565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b6000615496602183614309565b91506154a18261543a565b604082019050919050565b600060208201905081810360008301526154c581615489565b9050919050565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b6000615528602283614309565b9150615533826154cc565b604082019050919050565b600060208201905081810360008301526155578161551b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60006dffffffffffffffffffffffffffff82169050919050565b6155b08161558d565b81146155bb57600080fd5b50565b6000815190506155cd816155a7565b92915050565b600063ffffffff82169050919050565b6155ec816155d3565b81146155f757600080fd5b50565b600081519050615609816155e3565b92915050565b6000806000606084860312156156285761562761426e565b5b6000615636868287016155be565b9350506020615647868287016155be565b9250506040615658868287016155fa565b9150509250925092565b7f494e56414c49442050524943452043484f4943452e204e6565647320746f206260008201527f65206569746865722030202858534429206f722031202842616e6b5829000000602082015250565b60006156be603d83614309565b91506156c982615662565b604082019050919050565b600060208201905081810360008301526156ed816156b1565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b600061572a601f83614309565b9150615735826156f4565b602082019050919050565b600060208201905081810360008301526157598161571d565b905091905056fe45524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220da63323af81d27aa46d3953066aa449c42888c50d3a0e979ed7ef8ff043b9ee764736f6c63430008120033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000021e19e0c9bab2400000000000000000000000000000000000000000000000108b2a2c2802909400000000000000000000000000000003e33bab8414bdb433e883785f91ede95f0f4dfe0000000000000000000000004b3607a868044ebd88d9326bca7e1d8ad51ae48a00000000000000000000000000000000000000000021165458500521280000000000000000000000000000000000000000000000000000000000000000000008585344546f6b656e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035853440000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _name (string): XSDToken
Arg [1] : _symbol (string): XSD
Arg [2] : _pool_amount (uint256): 10000000000000000000000
Arg [3] : _genesis_supply (uint256): 20000000000000000000000000
Arg [4] : _smartcontract_owner (address): 0x03E33BAB8414bDb433E883785f91EDE95f0F4dFe
Arg [5] : _treasury (address): 0x4b3607a868044EbD88d9326bCa7E1d8AD51AE48a
Arg [6] : _cap_rate (uint256): 40000000000000000000000000
-----Encoded View---------------
11 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [2] : 00000000000000000000000000000000000000000000021e19e0c9bab2400000
Arg [3] : 000000000000000000000000000000000000000000108b2a2c28029094000000
Arg [4] : 00000000000000000000000003e33bab8414bdb433e883785f91ede95f0f4dfe
Arg [5] : 0000000000000000000000004b3607a868044ebd88d9326bca7e1d8ad51ae48a
Arg [6] : 0000000000000000000000000000000000000000002116545850052128000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000008
Arg [8] : 585344546f6b656e000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [10] : 5853440000000000000000000000000000000000000000000000000000000000
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.