Source Code
More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 60,443 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Update Vault Deb... | 146760430 | 2 days ago | IN | 0 ETH | 0.000000047523 | ||||
| Update Vault Deb... | 146760426 | 2 days ago | IN | 0 ETH | 0.00000004751 | ||||
| Update Vault Deb... | 146760422 | 2 days ago | IN | 0 ETH | 0.000000047511 | ||||
| Update Vault Deb... | 146760418 | 2 days ago | IN | 0 ETH | 0.000000047556 | ||||
| Update Vault Deb... | 146760415 | 2 days ago | IN | 0 ETH | 0.00000004757 | ||||
| Update Vault Deb... | 146760411 | 2 days ago | IN | 0 ETH | 0.000000047568 | ||||
| Update Vault Deb... | 146760408 | 2 days ago | IN | 0 ETH | 0.000000047534 | ||||
| Withdraw Collate... | 146738439 | 3 days ago | IN | 0 ETH | 0.000000006947 | ||||
| Set Approval For... | 146582645 | 6 days ago | IN | 0 ETH | 0.000000001832 | ||||
| Update Vault Deb... | 146331511 | 12 days ago | IN | 0 ETH | 0.000000052865 | ||||
| Update Vault Deb... | 146331507 | 12 days ago | IN | 0 ETH | 0.000000052926 | ||||
| Update Vault Deb... | 146331504 | 12 days ago | IN | 0 ETH | 0.000000052956 | ||||
| Update Vault Deb... | 146331501 | 12 days ago | IN | 0 ETH | 0.000000052982 | ||||
| Update Vault Deb... | 146331498 | 12 days ago | IN | 0 ETH | 0.00000005301 | ||||
| Update Vault Deb... | 146331494 | 12 days ago | IN | 0 ETH | 0.000000062141 | ||||
| Update Vault Deb... | 146331491 | 12 days ago | IN | 0 ETH | 0.000000053048 | ||||
| Update Vault Deb... | 146331488 | 12 days ago | IN | 0 ETH | 0.000000062206 | ||||
| Update Vault Deb... | 146331485 | 12 days ago | IN | 0 ETH | 0.000000053096 | ||||
| Update Vault Deb... | 146331482 | 12 days ago | IN | 0 ETH | 0.000000053096 | ||||
| Update Vault Deb... | 146331478 | 12 days ago | IN | 0 ETH | 0.000000053134 | ||||
| Update Vault Deb... | 146331475 | 12 days ago | IN | 0 ETH | 0.000000053179 | ||||
| Update Vault Deb... | 146331471 | 12 days ago | IN | 0 ETH | 0.000000053219 | ||||
| Update Vault Deb... | 146331468 | 12 days ago | IN | 0 ETH | 0.000000053232 | ||||
| Update Vault Deb... | 146331464 | 12 days ago | IN | 0 ETH | 0.00000005329 | ||||
| Update Vault Deb... | 146331462 | 12 days ago | IN | 0 ETH | 0.000000053311 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 107543759 | 910 days ago | 0 ETH | ||||
| 107535071 | 910 days ago | 0 ETH | ||||
| 107535071 | 910 days ago | 0 ETH | ||||
| 107535071 | 910 days ago | 0 ETH | ||||
| 107529788 | 910 days ago | 0 ETH | ||||
| 107529683 | 910 days ago | 0 ETH | ||||
| 107529683 | 910 days ago | 0 ETH | ||||
| 107529683 | 910 days ago | 0 ETH | ||||
| 107492397 | 911 days ago | 0 ETH | ||||
| 107492371 | 911 days ago | 0 ETH | ||||
| 107492371 | 911 days ago | 0 ETH | ||||
| 107492371 | 911 days ago | 0 ETH | ||||
| 107492206 | 911 days ago | 0 ETH | ||||
| 107492206 | 911 days ago | 0 ETH | ||||
| 107492206 | 911 days ago | 0 ETH | ||||
| 107490038 | 911 days ago | 0 ETH | ||||
| 107482312 | 911 days ago | 0 ETH | ||||
| 107465784 | 912 days ago | 0 ETH | ||||
| 107465784 | 912 days ago | 0 ETH | ||||
| 107465784 | 912 days ago | 0 ETH | ||||
| 107465444 | 912 days ago | 0 ETH | ||||
| 107429306 | 913 days ago | 0 ETH | ||||
| 107427641 | 913 days ago | 0 ETH | ||||
| 107427641 | 913 days ago | 0 ETH | ||||
| 107427641 | 913 days ago | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
stableQiVault
Compiler Version
v0.8.11+commit.d7f03943
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import "@openzeppelin/contracts/access/Ownable.sol";
import "./fixedVault.sol";
/// @title Fixed Interest Vault
/// @notice Single collateral lending manager with fixed rate interest.
contract stableQiVault is fixedVault, Ownable {
/// @dev Used to restrain the fee. Can only be up to 5% of the amount.
uint256 constant FEE_MAX = 500;
string private oracleType;
constructor(
address ethPriceSourceAddress,
uint256 minimumCollateralPercentage,
string memory name,
string memory symbol,
address _mai,
address _collateral,
string memory baseURI
)
fixedVault(
ethPriceSourceAddress,
minimumCollateralPercentage,
name,
symbol,
_mai,
_collateral,
baseURI
)
{
createVault();
addFrontEnd(0);
}
event UpdatedClosingFee(uint256 newFee);
event UpdatedOpeningFee(uint256 newFee);
event WithdrawInterest(uint256 earned);
event UpdatedMinDebt(uint256 newMinDebt);
event UpdatedMaxDebt(uint256 newMaxDebt);
event UpdatedDebtRatio(uint256 _debtRatio);
event UpdatedGainRatio(uint256 _gainRatio);
event UpdatedEthPriceSource(address _ethPriceSourceAddress);
event AddedFrontEnd(uint256 promoter);
event RemovedFrontEnd(uint256 promoter);
event UpdatedFrontEnd(uint256 promoter, uint256 newFee);
event UpdatedFees(uint256 _adminFee, uint256 _refFee);
event UpdatedMinCollateralRatio(uint256 newMinCollateralRatio);
event UpdatedStabilityPool(address pool);
event UpdatedInterestRate(uint256 interestRate);
event BurnedToken(uint256 amount);
event UpdatedTokenURI(string uri);
event UpdatedAdmin(address newAdmin);
event UpdatedRef(address newRef);
event UpdatedOracleName(string oracle);
modifier onlyOperators() {
require(ref == msg.sender || adm == msg.sender || owner() == msg.sender, "Needs to be called by operators");
_;
}
modifier onlyAdmin() {
require(adm == msg.sender, "Needs to be called by admin");
_;
}
/// @param _oracle name of the oracle used by the contract
/// @notice sets the oracle name used by the contract. for visual purposes.
function updateOracleName(string memory _oracle) external onlyOwner {
oracleType = _oracle;
emit UpdatedOracleName(_oracle);
}
/// @param _gainRatio sets the bonus earned from a liquidator
/// @notice implements a setter for the bonus earned by a liquidator
/// @dev fails if the bonus is less than 1
function setGainRatio(uint256 _gainRatio) external onlyOwner {
require(_gainRatio >= 1000, "gainRatio cannot be less than or equal to 1000");
gainRatio = _gainRatio;
emit UpdatedGainRatio(gainRatio);
}
/// @param _debtRatio sets the ratio of debt paid back by a liquidator
/// @notice sets the ratio of the debt to be paid back
/// @dev it divides the debt. 1/debtRatio.
function setDebtRatio(uint256 _debtRatio) external onlyOwner {
require(debtRatio != 0, "Debt Ratio cannot be 0");
debtRatio = _debtRatio;
emit UpdatedDebtRatio(debtRatio);
}
/// @param ethPriceSourceAddress is the address that provides the price of the collateral
/// @notice sets the address used as oracle
/// @dev Oracle price feed is used in here. Interface's available in the at /interfaces/IPriceSourceAll.sol
function changeEthPriceSource(address ethPriceSourceAddress)
external
onlyOwner
{
require(ethPriceSourceAddress != address(0), "Ethpricesource cannot be zero address" );
ethPriceSource = IPriceSource(ethPriceSourceAddress);
emit UpdatedEthPriceSource(ethPriceSourceAddress);
}
/// @param _pool is the address that can execute liquidations
/// @notice sets the address used as stability pool for liquidations
/// @dev if not set to address(0) then _pool is the only address able to liquidate
function setStabilityPool(address _pool) external onlyOwner {
require(_pool != address(0), "StabilityPool cannot be zero address" );
stabilityPool = _pool;
emit UpdatedStabilityPool(stabilityPool);
}
/// @param _admin is the ratio earned by the address that maintains the market
/// @param _ref is the ratio earned by the address that provides the borrowable asset
/// @notice sets the interest rate split between the admin and ref
/// @dev if not set to address(0) then _pool is the only address able to liquidate
function setFees(uint256 _admin, uint256 _ref) external onlyOwner {
require((_admin+_ref)==TEN_THOUSAND, "setFees: must equal 10000.");
adminFee=_admin;
refFee=_ref;
emit UpdatedFees(adminFee, refFee);
}
/// @param minimumCollateralPercentage is the CDR that limits the amount borrowed
/// @notice sets the CDR
/// @dev only callable by owner of the contract
function setMinCollateralRatio(uint256 minimumCollateralPercentage)
external
onlyOwner
{
_minimumCollateralPercentage = minimumCollateralPercentage;
emit UpdatedMinCollateralRatio(_minimumCollateralPercentage);
}
/// @param _minDebt is minimum debt able to be borrowed by a vault.
/// @notice sets the minimum debt.
/// @dev dust protection
function setMinDebt(uint256 _minDebt)
external
onlyOwner
{
require(_minDebt >=0, "setMinDebt: must be over 0.");
minDebt = _minDebt;
emit UpdatedMinDebt(minDebt);
}
/// @param _maxDebt is maximum debt able to be borrowed by a vault.
/// @notice sets the maximum debt.
/// @dev whale and liquidity protection.
function setMaxDebt(uint256 _maxDebt)
external
onlyOwner
{
require(_maxDebt >=0, "setMaxDebt: must be over 0.");
maxDebt = _maxDebt;
emit UpdatedMaxDebt(maxDebt);
}
/// @param _ref is the address that provides the borrowable asset
/// @notice sets the address that earns interest for providing a borrowable asset
/// @dev cannot be address(0)
function setRef(address _ref) external onlyOwner {
require(_ref != address(0), "Reference Address cannot be zero");
ref = _ref;
emit UpdatedRef(ref);
}
/// @param _adm is the ratio earned by the address that maintains the market
/// @notice sets the address that earns interest for maintaining the market
/// @dev cannot be address(0)
function setAdmin(address _adm) external onlyOwner {
require(_adm != address(0), "Admin Address cannot be zero");
adm = _adm;
emit UpdatedAdmin(adm);
}
/// @param _openingFee is the fee charged to a vault when borrowing.
/// @notice sets opening fee.
/// @dev can only be up to 5% (FEE_MAX) of the amount.
function setOpeningFee(uint256 _openingFee) external onlyOwner {
require(_openingFee >= 0 && _openingFee <= FEE_MAX, "setOpeningFee: cannot be more than 5%");
openingFee = _openingFee;
// emit event
emit UpdatedOpeningFee(openingFee);
}
/// @param _closingFee is the fee charged to a vault when repaying.
/// @notice sets closing fee.
/// @dev can only be up to 5% (FEE_MAX) of the amount.
function setClosingFee(uint256 _closingFee) external onlyOwner {
require(_closingFee >= 0 && _closingFee <= FEE_MAX, "setClosingFee: cannot be more than 5%");
closingFee = _closingFee;
// emit event
emit UpdatedClosingFee(closingFee);
}
/// @param _promoter is a front end for the contract
/// @notice adds a front end to earn opening/closing fees from borrowing/repaying.
/// @dev can only be up to 5% (FEE_MAX) of the amount.
function addFrontEnd(uint256 _promoter) public onlyOwner {
require(_exists(_promoter), "addFrontEnd: Vault does not exist");
require(promoter[_promoter] == 0, "addFrontEnd: already added");
promoter[_promoter] = TEN_THOUSAND;
emit AddedFrontEnd(_promoter);
}
/// @param _promoter is a front end for the contract
/// @param cashback is the amount of fee not taken from a user.
/// @notice updates the cashback variable for a given front end
/// @dev can only be updated by the front end vault's owner
function updateFrontEnd(uint256 _promoter, uint256 cashback) external frontExists(_promoter) onlyVaultOwner(_promoter) {
require(cashback > 0 && cashback <= TEN_THOUSAND, "updateFrontEnd: cannot be 0");
promoter[_promoter] = cashback;
emit UpdatedFrontEnd(_promoter, cashback);
}
/// @param _promoter is a front end for the contract
/// @notice removes the ability for a front end to earn fees
function removeFrontEnd(uint256 _promoter) external frontExists(_promoter) onlyOwner {
require(_exists(_promoter), "removeFrontEnd: Vault does not exist");
require(promoter[_promoter] > 0, "removeFrontEnd: not a front end");
promoter[_promoter] = 0;
emit RemovedFrontEnd(_promoter);
}
/// @notice withdraws earned interest by vault.
function withdrawInterest() external onlyOperators nonReentrant {
uint256 adm_fee = maiDebt*adminFee / TEN_THOUSAND;
// Transfer
mai.transfer(ref, (maiDebt-adm_fee) ); // cheaper and equivalent.
mai.transfer(adm, adm_fee);
emit WithdrawInterest(maiDebt);
maiDebt = 0;
}
/// @param _iR is the fixed interest charged by a vault
/// @notice sets the interest charged by a vault.
function setInterestRate(uint256 _iR) external onlyOwner {
iR = _iR;
emit UpdatedInterestRate(iR);
}
/// @param amountToken is the amount of borrowable asset that is removed from the debt ceiling.
/// @notice removes debt ceiling from the vault.
/// @dev returns the asset to the owner so it can be redeployed at a later time.
function burn(uint256 amountToken) external onlyAdmin {
// Burn
require(amountToken < mai.balanceOf(address(this)), "burn: Balance not enough");
mai.transfer(ref, amountToken);
emit BurnedToken(amountToken);
}
/// @param _uri is the url for the nft metadata
/// @notice updates the metadata
/// @dev it currently uses an ipfs json
function setTokenURI(string calldata _uri) external onlyOwner {
uri = _uri;
emit UpdatedTokenURI(uri);
}
function setRouter(address _router) external onlyOwner {
router=_router;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "../interfaces/IPriceSourceAll.sol";
import "../token/MyVaultV4.sol";
contract fixedVault is ReentrancyGuard, VaultNFTv4 {
using SafeERC20 for ERC20;
/// @dev Constants used across the contract.
uint256 constant TEN_THOUSAND = 10000;
uint256 constant ONE_YEAR = 31556952;
uint256 constant THOUSAND = 1000;
IPriceSource public ethPriceSource;
uint256 public _minimumCollateralPercentage;
uint256 public vaultCount;
uint256 public closingFee;
uint256 public openingFee;
uint256 public minDebt;
uint256 public maxDebt;
uint256 constant public tokenPeg = 1e8; // $1
uint256 public iR;
mapping(uint256 => uint256) public vaultCollateral;
mapping(uint256 => uint256) public accumulatedVaultDebt;
mapping(uint256 => uint256) public lastInterest;
mapping(uint256 => uint256) public promoter;
uint256 public adminFee; // 10% of the earned interest
uint256 public refFee; // 90% of the earned interest
uint256 public debtRatio;
uint256 public gainRatio;
ERC20 public collateral;
ERC20 public mai;
uint256 public decimalDifferenceRaisedToTen;
uint256 public priceSourceDecimals;
uint256 public totalBorrowed;
mapping(address => uint256) public maticDebt;
uint256 public maiDebt;
address public stabilityPool;
address public adm;
address public ref;
address public router;
uint8 public version = 7;
event CreateVault(uint256 vaultID, address creator);
event DestroyVault(uint256 vaultID);
event DepositCollateral(uint256 vaultID, uint256 amount);
event WithdrawCollateral(uint256 vaultID, uint256 amount);
event BorrowToken(uint256 vaultID, uint256 amount);
event PayBackToken(uint256 vaultID, uint256 amount, uint256 closingFee);
event LiquidateVault(
uint256 vaultID,
address owner,
address buyer,
uint256 debtRepaid,
uint256 collateralLiquidated,
uint256 closingFee
);
event BoughtRiskyDebtVault(uint256 riskyVault, uint256 newVault, address riskyVaultBuyer, uint256 amountPaidtoBuy);
constructor(
address ethPriceSourceAddress,
uint256 minimumCollateralPercentage,
string memory name,
string memory symbol,
address _mai,
address _collateral,
string memory baseURI
) VaultNFTv4(name, symbol, baseURI) {
require(ethPriceSourceAddress != address(0));
require(minimumCollateralPercentage != 0);
closingFee = 50; // 0.5%
openingFee = 0; // 0.0%
ethPriceSource = IPriceSource(ethPriceSourceAddress);
stabilityPool = address(0);
maxDebt = 500000 ether; //Keeping maxDebt at 500K * 10^(18)
debtRatio = 2; // 1/2, pay back 50%
gainRatio = 1100; // /10 so 1.1
_minimumCollateralPercentage = minimumCollateralPercentage;
collateral = ERC20(_collateral);
mai = ERC20(_mai);
priceSourceDecimals = 8;
/*
This works only for collaterals with decimals < 18
*/
decimalDifferenceRaisedToTen =
10**(mai.decimals() - collateral.decimals());
adm = msg.sender;
ref = msg.sender;
}
modifier onlyVaultOwner(uint256 vaultID) {
require(_exists(vaultID), "Vault does not exist");
require(ownerOf(vaultID) == msg.sender, "Vault is not owned by you");
_;
}
modifier onlyRouter() {
require(
router == address(0) || msg.sender == router,
"must use router"
);
_;
}
modifier vaultExists(uint256 vaultID) {
require(_exists(vaultID), "Vault does not exist");
_;
}
modifier frontExists(uint256 vaultID) {
require(_exists(vaultID), "front end vault does not exist");
require(promoter[vaultID] <= TEN_THOUSAND && promoter[vaultID] > 0, "Front end not added");
_;
}
/// @notice Return the current debt available to borrow.
/// @dev checks the outstanding balance of the borrowable asset within the contract.
/// @return available balance of borrowable asset.
function getDebtCeiling() public view returns (uint256) {
return mai.balanceOf(address(this));
}
/// @param vaultID is the token id of the vault being checked.
/// @notice Returns true if a vault exists
/// @dev the erc721 spec allows users to burn/destroy their nft
/// @return boolean if the vault exists
function exists(uint256 vaultID) external view returns (bool) {
return _exists(vaultID);
}
/// @notice Returns the total value locked in the vault, based on the oracle price.
/// @return uint256 total value locked in vault
function getTotalValueLocked() external view returns (uint256) {
return ( getEthPriceSource() * decimalDifferenceRaisedToTen * collateral.balanceOf(address(this)) ) ; //extra 1e8, to get fraction in ui
// 1e8 * 1eDelta
}
/// @notice Return the fee charged when repaying a vault.
/// @return uint256 is the fee charged to a vault when repaying.
function getClosingFee() external view returns (uint256) {
return closingFee;
}
/// @notice Return the peg maintained by the vault.
/// @return uint256 is the value with 8 decimals used to calculate borrowable debt.
function getTokenPriceSource() public view returns (uint256) {
return tokenPeg;
}
/// @notice Return the collateral value
/// @return uint256 is the value retrieved from the oracle used
/// to calculate the available borrowable amounts.
function getEthPriceSource() public view returns (uint256) {
return ethPriceSource.latestAnswer();
}
/// @param vaultID is the token id of the vault being checked.
/// @notice Returns the debt owned by the vault and the interest accrued over time.
/// @return uint256 fee earned in the time between updates
/// @return uint256 debt owed by the vault for further calculation.
function _vaultDebtAndFee(uint256 vaultID)
internal
view
returns (uint256, uint256)
{
uint256 currentTime = block.timestamp;
uint256 debt = accumulatedVaultDebt[vaultID];
uint256 fee = 0;
if (lastInterest[vaultID] != 0 && iR > 0) {
uint256 timeDelta = currentTime - lastInterest[vaultID];
uint256 feeAccrued = (((iR * debt) * timeDelta) / ONE_YEAR) / TEN_THOUSAND;
fee = feeAccrued;
debt = feeAccrued + debt;
}
return (fee, debt);
}
/// @param vaultID is the token id of the vault being checked.
/// @notice Returns the debt owned by the vault without tracking the interest
/// @return uint256 debt owed by the vault for further calculation.
function vaultDebt(uint256 vaultID) public view returns (uint256) {
(, uint256 debt) = _vaultDebtAndFee(vaultID);
return debt;
}
/// @param vaultID is the token id of the vault being checked.
/// @notice Adds the interest charged to the vault over the previous time called.
/// @return uint256 latest vault debt
function updateVaultDebt(uint256 vaultID) public returns (uint256) {
(uint256 fee, uint256 debt) = _vaultDebtAndFee(vaultID);
maiDebt = maiDebt + fee;
totalBorrowed = totalBorrowed + fee;
if(iR > 0) {
lastInterest[vaultID] = block.timestamp;
}
// we can just update the current vault debt here instead
accumulatedVaultDebt[vaultID] = debt;
return debt;
}
/// @param _collateral is the amount of collateral tokens to be valued.
/// @param _debt is the debt owed by the vault.
/// @notice Returns collateral value and debt based on the oracle prices
/// @return uint256 coolateral value * 100. used to calculate the CDR
/// @return uint256 debt value. Uses token price source to derive.
function calculateCollateralProperties(uint256 _collateral, uint256 _debt)
private
view
returns (uint256, uint256)
{
require(getEthPriceSource() != 0);
require(getTokenPriceSource() != 0);
uint256 collateralValue = _collateral *
getEthPriceSource() *
decimalDifferenceRaisedToTen;
require(collateralValue >= _collateral);
uint256 debtValue = _debt * getTokenPriceSource();
require(debtValue >= _debt);
uint256 collateralValueTimes100 = collateralValue * 100;
require(collateralValueTimes100 > collateralValue);
return (collateralValueTimes100, debtValue);
}
/// @param _collateral is the amount of collateral tokens held by vault.
/// @param debt is the debt owed by the vault.
/// @notice Calculates if the CDR is valid before taking a further action with a user
/// @return boolean describing if the new CDR is valid.
function isValidCollateral(uint256 _collateral, uint256 debt)
public
view
returns (bool)
{
(
uint256 collateralValueTimes100,
uint256 debtValue
) = calculateCollateralProperties(_collateral, debt);
uint256 collateralPercentage = collateralValueTimes100 / debtValue;
return collateralPercentage >= _minimumCollateralPercentage;
}
/// @param fee is the amount of basis points (BP) to charge
/// @param amount is the total value to calculate the BPs from
/// @param promoFee is the fee charged by the front end
/// @notice Returns fee to charge based on the collateral amount
/// @return uint256 fee to charge the collateral.
/// @dev fee can be called on web app to compare charges.
function calculateFee(
uint256 fee,
uint256 amount,
uint256 promoFee
) public view returns (uint256) {
uint256 _fee;
if (promoFee>0) {
_fee = ((amount * fee * getTokenPriceSource() * promoFee) /
(getEthPriceSource() * TEN_THOUSAND * TEN_THOUSAND));
} else {
_fee = (amount * fee * getTokenPriceSource()) /
(getEthPriceSource() * TEN_THOUSAND);
}
return _fee / decimalDifferenceRaisedToTen;
}
/// @notice Creates a new ERC721 Vault NFT
/// @return uint256 the token id of the vault created.
function createVault() public returns (uint256) {
uint256 id = vaultCount;
vaultCount = vaultCount + 1;
require(vaultCount >= id);
_mint(msg.sender, id);
emit CreateVault(id, msg.sender);
return id;
}
/// @notice Destroys an ERC721 Vault NFT
/// @param vaultID the vault ID to destroy
/// @dev vault must not have any debt owed to be able to be destroyed.
function destroyVault(uint256 vaultID)
external
onlyVaultOwner(vaultID)
nonReentrant
{
require(vaultDebt(vaultID) == 0, "Vault has outstanding debt");
if (vaultCollateral[vaultID] != 0) {
// withdraw leftover collateral
collateral.safeTransfer(ownerOf(vaultID), vaultCollateral[vaultID]);
}
_burn(vaultID);
delete vaultCollateral[vaultID];
delete accumulatedVaultDebt[vaultID];
delete lastInterest[vaultID];
emit DestroyVault(vaultID);
}
/// @param vaultID is the token id of the vault being interacted with.
/// @param amount is the amount of collateral to deposit from msg.sender
/// @notice Adds collateral to a specific vault by token id
/// @dev Any address can deposit into a vault
function depositCollateral(uint256 vaultID, uint256 amount)
external
vaultExists(vaultID)
onlyRouter
{
uint256 newCollateral = vaultCollateral[vaultID] + (amount);
require(newCollateral >= vaultCollateral[vaultID]);
vaultCollateral[vaultID] = newCollateral;
collateral.safeTransferFrom(msg.sender, address(this), amount);
emit DepositCollateral(vaultID, amount);
}
/// @param vaultID is the token id of the vault being interacted with.
/// @param amount is the amount of collateral to withdraw
/// @notice withdraws collateral to a specific vault by token id
/// @dev If there is debt, then it can only withdraw up to the min CDR.
function withdrawCollateral(uint256 vaultID, uint256 amount)
external
onlyVaultOwner(vaultID)
nonReentrant
{
require(
vaultCollateral[vaultID] >= amount,
"Vault does not have enough collateral"
);
uint256 newCollateral = vaultCollateral[vaultID] - amount;
uint256 debt = updateVaultDebt(vaultID);
if (debt != 0) {
require(
isValidCollateral(newCollateral, debt),
"Withdrawal would put vault below minimum collateral percentage"
);
}
vaultCollateral[vaultID] = newCollateral;
collateral.safeTransfer(msg.sender, amount);
emit WithdrawCollateral(vaultID, amount);
}
/// @param vaultID is the token id of the vault being interacted with.
/// @param amount is the amount of borrowable asset to borrow
/// @notice borrows asset based on the collateral held and the price of the collateral.
/// @dev Borrowing is limited by the CDR of the vault
/// If there's opening fee, it will be charged here.
function borrowToken(
uint256 vaultID,
uint256 amount,
uint256 _front
) external
frontExists(_front)
onlyVaultOwner(vaultID)
nonReentrant
{
require(amount > 0, "Must borrow non-zero amount");
require(
amount <= getDebtCeiling(),
"borrowToken: Cannot mint over available supply."
);
uint256 newDebt = updateVaultDebt(vaultID) + amount;
require(newDebt<=maxDebt, "borrowToken: max loan cap reached.");
require(newDebt > vaultDebt(vaultID));
require(
isValidCollateral(vaultCollateral[vaultID], newDebt),
"Borrow would put vault below minimum collateral percentage"
);
require(
((vaultDebt(vaultID)) + amount) >= minDebt,
"Vault debt can't be under minDebt"
);
accumulatedVaultDebt[vaultID] = newDebt;
uint256 _openingFee = calculateFee(openingFee, newDebt, promoter[_front]);
vaultCollateral[vaultID] = vaultCollateral[vaultID] - (_openingFee);
vaultCollateral[_front] = vaultCollateral[_front] + (_openingFee);
// mai
mai.safeTransfer(msg.sender, amount);
totalBorrowed = totalBorrowed + (amount);
emit BorrowToken(vaultID, amount);
}
function paybackTokenAll(
uint256 vaultID,
uint256 deadline,
uint256 _front
) external frontExists(_front) vaultExists(vaultID) onlyRouter {
require(
deadline >= block.timestamp,
"paybackTokenAll: deadline expired."
);
uint256 _amount = updateVaultDebt(vaultID);
payBackToken(vaultID, _amount, _front);
}
/// @param vaultID is the token id of the vault being interacted with.
/// @param amount is the amount of borrowable asset to repay
/// @param _front is the front end that will get the opening
/// @notice payback asset to close loan.
/// @dev If there is debt, then it can only withdraw up to the min CDR.
function payBackToken(
uint256 vaultID,
uint256 amount,
uint256 _front
) public frontExists(_front) vaultExists(vaultID) onlyRouter {
require(mai.balanceOf(msg.sender) >= amount, "Token balance too low");
uint256 vaultDebtNow = updateVaultDebt(vaultID);
require(
vaultDebtNow >= amount,
"Vault debt less than amount to pay back"
);
require(
((vaultDebtNow) - amount) >= minDebt || amount == (vaultDebtNow),
"Vault debt can't be under minDebt"
);
uint256 _closingFee = calculateFee(
closingFee,
amount,
promoter[_front]
);
accumulatedVaultDebt[vaultID] = vaultDebtNow - amount;
vaultCollateral[vaultID] = vaultCollateral[vaultID] - _closingFee;
vaultCollateral[_front] = vaultCollateral[_front] + _closingFee;
totalBorrowed = totalBorrowed - amount;
//mai
mai.safeTransferFrom(msg.sender, address(this), amount);
emit PayBackToken(vaultID, amount, _closingFee);
}
/// @notice withdraws liquidator earnings.
/// @dev reverts if there's no collateral to withdraw.
function getPaid() external nonReentrant {
require(maticDebt[msg.sender] != 0, "Don't have anything for you.");
uint256 amount = maticDebt[msg.sender];
maticDebt[msg.sender] = 0;
collateral.safeTransfer(msg.sender, amount);
}
/// @param pay is address of the person to getPaid
/// @notice withdraws liquidator earnings.
/// @dev reverts if there's no collateral to withdraw.
function getPaid(address pay) external nonReentrant {
require(maticDebt[pay] != 0, "Don't have anything for you.");
uint256 amount = maticDebt[pay];
maticDebt[pay] = 0;
collateral.safeTransfer(pay, amount);
}
/// @param vaultID is the token id of the vault being interacted with.
/// @notice Calculates cost to liquidate a vault
/// @dev Can be used to calculate balance required to liquidate a vault.
function checkCost(uint256 vaultID) public view returns (uint256) {
uint256 vaultDebtNow = vaultDebt(vaultID);
if (
vaultCollateral[vaultID] == 0 ||
vaultDebtNow == 0 ||
!checkLiquidation(vaultID)
) {
return 0;
}
(,
uint256 debtValue
) = calculateCollateralProperties(
vaultCollateral[vaultID],
vaultDebtNow
);
if (debtValue == 0) {
return 0;
}
debtValue = debtValue / (10**priceSourceDecimals);
uint256 halfDebt = debtValue / debtRatio; //debtRatio (2)
if (halfDebt <= minDebt) {
halfDebt = debtValue;
}
return (halfDebt);
}
/// @param vaultID is the token id of the vault being interacted with.
/// @notice Calculates collateral to extract when liquidating a vault
/// @dev Can be used to calculate earnings from liquidating a vault.
function checkExtract(uint256 vaultID) public view returns (uint256) {
if (vaultCollateral[vaultID] == 0 || !checkLiquidation(vaultID)) {
return 0;
}
uint256 vaultDebtNow = vaultDebt(vaultID);
(, uint256 debtValue) = calculateCollateralProperties(
vaultCollateral[vaultID],
vaultDebtNow
);
uint256 halfDebt = debtValue / debtRatio; //debtRatio (2)
if (halfDebt == 0) {
return 0;
}
if ((halfDebt) / (10**priceSourceDecimals) <= minDebt) {
// full liquidation if under the min debt.
return (debtValue * ( gainRatio)) / (THOUSAND) / (getEthPriceSource()) / decimalDifferenceRaisedToTen;
} else {
return (halfDebt * (gainRatio)) / THOUSAND / (getEthPriceSource()) / decimalDifferenceRaisedToTen;
}
}
/// @param vaultID is the token id of the vault being interacted with.
/// @notice Calculates the collateral percentage of a vault.
function checkCollateralPercentage(uint256 vaultID)
public
view
vaultExists(vaultID)
returns (uint256)
{
uint256 vaultDebtNow = vaultDebt(vaultID);
if (vaultCollateral[vaultID] == 0 || vaultDebtNow == 0) {
return 0;
}
(
uint256 collateralValueTimes100,
uint256 debtValue
) = calculateCollateralProperties(
vaultCollateral[vaultID],
vaultDebtNow
);
return collateralValueTimes100 / (debtValue);
}
/// @param vaultID is the token id of the vault being interacted with.
/// @notice Calculates if a vault is liquidatable.
/// @return bool if vault is liquidatable or not.
function checkLiquidation(uint256 vaultID)
public
view
vaultExists(vaultID)
returns (bool)
{
uint256 vaultDebtNow = vaultDebt(vaultID);
if (vaultCollateral[vaultID] == 0 || vaultDebtNow == 0) {
return false;
}
(
uint256 collateralValueTimes100,
uint256 debtValue
) = calculateCollateralProperties(
vaultCollateral[vaultID],
vaultDebtNow
);
uint256 collateralPercentage = collateralValueTimes100 / (debtValue);
if (collateralPercentage < _minimumCollateralPercentage) {
return true;
} else {
return false;
}
}
/// @param vaultID is the token id of the vault being interacted with.
/// @notice Calculates if a vault is risky and can be bought.
/// @return bool if vault is risky or not.
function checkRiskyVault(uint256 vaultID) public view vaultExists(vaultID) returns (bool) {
uint256 vaultDebtNow = vaultDebt(vaultID);
if (vaultCollateral[vaultID] == 0 || vaultDebtNow == 0) {
return false;
}
(
uint256 collateralValueTimes100,
uint256 debtValue
) = calculateCollateralProperties(
vaultCollateral[vaultID],
vaultDebtNow
);
uint256 collateralPercentage = collateralValueTimes100 / (debtValue);
if ((collateralPercentage*10) <= gainRatio) {
return true;
} else {
return false;
}
}
/// @param vaultID is the token id of the vault being interacted with.
/// @notice Pays back the part of the debt owed by the vault and removes a
/// comparable amount of collateral plus bonus
/// @dev if vault CDR is under the bonus ratio,
/// then it will only be able to be bought through buy risky.
/// Amount to pay back is based on debtRatio variable.
function liquidateVault(uint256 vaultID, uint256 _front)
external
frontExists(_front)
vaultExists(vaultID)
{
require(
stabilityPool == address(0) || msg.sender == stabilityPool,
"liquidation is disabled for public"
);
uint256 vaultDebtNow = updateVaultDebt(vaultID);
(
uint256 collateralValueTimes100,
uint256 debtValue
) = calculateCollateralProperties(
vaultCollateral[vaultID],
vaultDebtNow
);
require(vaultDebtNow != 0, "Vault debt is 0");
uint256 collateralPercentage = collateralValueTimes100 / (debtValue);
require(
collateralPercentage < _minimumCollateralPercentage,
"Vault is not below minimum collateral percentage"
);
require(collateralPercentage * 10 > gainRatio , "Vault is not above gain ratio");
debtValue = debtValue / (10**priceSourceDecimals);
uint256 halfDebt = debtValue / (debtRatio); //debtRatio (2)
if (halfDebt <= minDebt) {
halfDebt = debtValue;
}
require(
mai.balanceOf(msg.sender) >= halfDebt,
"Token balance too low to pay off outstanding debt"
);
totalBorrowed = totalBorrowed - (halfDebt);
uint256 maticExtract = checkExtract(vaultID);
accumulatedVaultDebt[vaultID] = vaultDebtNow - (halfDebt); // we paid back half of its debt.
uint256 _closingFee = calculateFee(closingFee, halfDebt, promoter[_front]);
vaultCollateral[vaultID] = vaultCollateral[vaultID] - (_closingFee);
vaultCollateral[_front] = vaultCollateral[_front] + (_closingFee);
// deduct the amount from the vault's collateral
vaultCollateral[vaultID] = vaultCollateral[vaultID] - (maticExtract);
// let liquidator take the collateral
maticDebt[msg.sender] = maticDebt[msg.sender] + (maticExtract);
//mai
mai.safeTransferFrom(msg.sender, address(this), halfDebt);
emit LiquidateVault(
vaultID,
ownerOf(vaultID),
msg.sender,
halfDebt,
maticExtract,
_closingFee
);
}
/// @param vaultID is the token id of the vault being interacted with.
/// @notice Pays back the debt owed to bring it back to min CDR.
/// And transfers ownership of it to the liquidator with a new vault
/// @return uint256 new vault created with the debt and collateral.
/// @dev this function can only be called if vault CDR is under the bonus ratio.
/// address who calls it will now own the debt and the collateral.
function buyRiskDebtVault(uint256 vaultID) external vaultExists(vaultID) returns(uint256) {
require(
stabilityPool == address(0) || msg.sender == stabilityPool,
"buy risky is disabled for public"
); uint256 vaultDebtNow = updateVaultDebt(vaultID);
require(vaultDebtNow != 0, "Vault debt is 0");
(
uint256 collateralValueTimes100,
uint256 debtValue
) = calculateCollateralProperties(
vaultCollateral[vaultID],
vaultDebtNow
);
uint256 collateralPercentage = collateralValueTimes100 / (debtValue);
require(
(collateralPercentage*10) <= gainRatio,
"Vault is not below risky collateral percentage"
);
uint256 maiDebtTobePaid = (debtValue / (10**priceSourceDecimals)) -
(collateralValueTimes100 /
( _minimumCollateralPercentage * (10**priceSourceDecimals)));
//have enough MAI to bring vault to X CDR (presumably min)
require(mai.balanceOf(msg.sender) >= maiDebtTobePaid, "Not enough mai to buy the risky vault");
//mai
mai.safeTransferFrom(msg.sender, address(this), maiDebtTobePaid);
totalBorrowed = totalBorrowed - (maiDebtTobePaid);
// newVault for msg.sender
uint256 newVault = createVault();
// updating vault collateral and debt details for the transfer of risky vault
vaultCollateral[newVault] = vaultCollateral[vaultID];
accumulatedVaultDebt[newVault] = vaultDebtNow - maiDebtTobePaid;
lastInterest[newVault] = block.timestamp;
// resetting the vaultID vault info
delete vaultCollateral[vaultID];
delete accumulatedVaultDebt[vaultID];
// lastInterest of vaultID would be block.timestamp, not reseting its timestamp
emit BoughtRiskyDebtVault(vaultID, newVault, msg.sender, maiDebtTobePaid);
return newVault;
}
}// 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 v4.4.1 (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// 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
// 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.11;
interface IPriceSource {
function latestRoundData() external view returns (uint256);
function latestAnswer() external view returns (uint256);
function decimals() external view returns (uint8);
}// contracts/MyVaultNFT.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.11;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
contract VaultNFTv4 is ERC721, ERC721Enumerable {
string public uri;
function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal override(ERC721, ERC721Enumerable) {
super._beforeTokenTransfer(from, to, tokenId);
}
function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) {
return super.supportsInterface(interfaceId);
}
constructor(string memory name, string memory symbol, string memory _uri)
ERC721(name, symbol)
{
uri = _uri;
}
function tokenURI(uint256 tokenId) public override view returns (string memory) {
require(_exists(tokenId));
return uri;
}
}// 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
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// 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: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/ERC721.sol)
pragma solidity ^0.8.0;
import "./IERC721.sol";
import "./IERC721Receiver.sol";
import "./extensions/IERC721Metadata.sol";
import "../../utils/Address.sol";
import "../../utils/Context.sol";
import "../../utils/Strings.sol";
import "../../utils/introspection/ERC165.sol";
/**
* @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including
* the Metadata extension, but not including the Enumerable extension, which is available separately as
* {ERC721Enumerable}.
*/
contract ERC721 is Context, ERC165, IERC721, IERC721Metadata {
using Address for address;
using Strings for uint256;
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
return
interfaceId == type(IERC721).interfaceId ||
interfaceId == type(IERC721Metadata).interfaceId ||
super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721-balanceOf}.
*/
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
/**
* @dev See {IERC721-ownerOf}.
*/
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
/**
* @dev See {IERC721Metadata-name}.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev See {IERC721Metadata-symbol}.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev See {IERC721Metadata-tokenURI}.
*/
function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");
string memory baseURI = _baseURI();
return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : "";
}
/**
* @dev Base URI for computing {tokenURI}. If set, the resulting URI for each
* token will be the concatenation of the `baseURI` and the `tokenId`. Empty
* by default, can be overridden in child contracts.
*/
function _baseURI() internal view virtual returns (string memory) {
return "";
}
/**
* @dev See {IERC721-approve}.
*/
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
/**
* @dev See {IERC721-getApproved}.
*/
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
/**
* @dev See {IERC721-setApprovalForAll}.
*/
function setApprovalForAll(address operator, bool approved) public virtual override {
_setApprovalForAll(_msgSender(), operator, approved);
}
/**
* @dev See {IERC721-isApprovedForAll}.
*/
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
/**
* @dev See {IERC721-transferFrom}.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
/**
* @dev See {IERC721-safeTransferFrom}.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* `_data` is additional data, it has no specified format and it is sent in call to `to`.
*
* This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.
* implement alternative mechanisms to perform token transfer, such as signature-based.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer");
}
/**
* @dev Returns whether `tokenId` exists.
*
* Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.
*
* Tokens start existing when they are minted (`_mint`),
* and stop existing when they are burned (`_burn`).
*/
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
/**
* @dev Returns whether `spender` is allowed to manage `tokenId`.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
}
/**
* @dev Safely mints `tokenId` and transfers it to `to`.
*
* Requirements:
*
* - `tokenId` must not exist.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function _safeMint(address to, uint256 tokenId) internal virtual {
_safeMint(to, tokenId, "");
}
/**
* @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
*/
function _safeMint(
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_mint(to, tokenId);
require(
_checkOnERC721Received(address(0), to, tokenId, _data),
"ERC721: transfer to non ERC721Receiver implementer"
);
}
/**
* @dev Mints `tokenId` and transfers it to `to`.
*
* WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible
*
* Requirements:
*
* - `tokenId` must not exist.
* - `to` cannot be the zero address.
*
* Emits a {Transfer} event.
*/
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_beforeTokenTransfer(address(0), to, tokenId);
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
_afterTokenTransfer(address(0), to, tokenId);
}
/**
* @dev Destroys `tokenId`.
* The approval is cleared when the token is burned.
*
* Requirements:
*
* - `tokenId` must exist.
*
* Emits a {Transfer} event.
*/
function _burn(uint256 tokenId) internal virtual {
address owner = ERC721.ownerOf(tokenId);
_beforeTokenTransfer(owner, address(0), tokenId);
// Clear approvals
_approve(address(0), tokenId);
_balances[owner] -= 1;
delete _owners[tokenId];
emit Transfer(owner, address(0), tokenId);
_afterTokenTransfer(owner, address(0), tokenId);
}
/**
* @dev Transfers `tokenId` from `from` to `to`.
* As opposed to {transferFrom}, this imposes no restrictions on msg.sender.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
*
* Emits a {Transfer} event.
*/
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer from incorrect owner");
require(to != address(0), "ERC721: transfer to the zero address");
_beforeTokenTransfer(from, to, tokenId);
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
_afterTokenTransfer(from, to, tokenId);
}
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits a {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
/**
* @dev Approve `operator` to operate on all of `owner` tokens
*
* Emits a {ApprovalForAll} event.
*/
function _setApprovalForAll(
address owner,
address operator,
bool approved
) internal virtual {
require(owner != operator, "ERC721: approve to caller");
_operatorApprovals[owner][operator] = approved;
emit ApprovalForAll(owner, operator, approved);
}
/**
* @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.
* The call is not executed if the target address is not a contract.
*
* @param from address representing the previous owner of the given token ID
* @param to target address that will receive the tokens
* @param tokenId uint256 ID of the token to be transferred
* @param _data bytes optional data to send along with the call
* @return bool whether the call correctly returned the expected magic value
*/
function _checkOnERC721Received(
address from,
address to,
uint256 tokenId,
bytes memory _data
) private returns (bool) {
if (to.isContract()) {
try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {
return retval == IERC721Receiver.onERC721Received.selector;
} catch (bytes memory reason) {
if (reason.length == 0) {
revert("ERC721: transfer to non ERC721Receiver implementer");
} else {
assembly {
revert(add(32, reason), mload(reason))
}
}
}
} else {
return true;
}
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` 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 tokenId
) 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.
* - `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 tokenId
) internal virtual {}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/ERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../ERC721.sol";
import "./IERC721Enumerable.sol";
/**
* @dev This implements an optional extension of {ERC721} defined in the EIP that adds
* enumerability of all the token ids in the contract as well as all token ids owned by each
* account.
*/
abstract contract ERC721Enumerable is ERC721, IERC721Enumerable {
// Mapping from owner to list of owned token IDs
mapping(address => mapping(uint256 => uint256)) private _ownedTokens;
// Mapping from token ID to index of the owner tokens list
mapping(uint256 => uint256) private _ownedTokensIndex;
// Array with all token ids, used for enumeration
uint256[] private _allTokens;
// Mapping from token id to position in the allTokens array
mapping(uint256 => uint256) private _allTokensIndex;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC721) returns (bool) {
return interfaceId == type(IERC721Enumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev See {IERC721Enumerable-tokenOfOwnerByIndex}.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) {
require(index < ERC721.balanceOf(owner), "ERC721Enumerable: owner index out of bounds");
return _ownedTokens[owner][index];
}
/**
* @dev See {IERC721Enumerable-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _allTokens.length;
}
/**
* @dev See {IERC721Enumerable-tokenByIndex}.
*/
function tokenByIndex(uint256 index) public view virtual override returns (uint256) {
require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds");
return _allTokens[index];
}
/**
* @dev Hook that is called before any token transfer. This includes minting
* and burning.
*
* Calling conditions:
*
* - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be
* transferred to `to`.
* - When `from` is zero, `tokenId` will be minted for `to`.
* - When `to` is zero, ``from``'s `tokenId` will be burned.
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override {
super._beforeTokenTransfer(from, to, tokenId);
if (from == address(0)) {
_addTokenToAllTokensEnumeration(tokenId);
} else if (from != to) {
_removeTokenFromOwnerEnumeration(from, tokenId);
}
if (to == address(0)) {
_removeTokenFromAllTokensEnumeration(tokenId);
} else if (to != from) {
_addTokenToOwnerEnumeration(to, tokenId);
}
}
/**
* @dev Private function to add a token to this extension's ownership-tracking data structures.
* @param to address representing the new owner of the given token ID
* @param tokenId uint256 ID of the token to be added to the tokens list of the given address
*/
function _addTokenToOwnerEnumeration(address to, uint256 tokenId) private {
uint256 length = ERC721.balanceOf(to);
_ownedTokens[to][length] = tokenId;
_ownedTokensIndex[tokenId] = length;
}
/**
* @dev Private function to add a token to this extension's token tracking data structures.
* @param tokenId uint256 ID of the token to be added to the tokens list
*/
function _addTokenToAllTokensEnumeration(uint256 tokenId) private {
_allTokensIndex[tokenId] = _allTokens.length;
_allTokens.push(tokenId);
}
/**
* @dev Private function to remove a token from this extension's ownership-tracking data structures. Note that
* while the token is not assigned a new owner, the `_ownedTokensIndex` mapping is _not_ updated: this allows for
* gas optimizations e.g. when performing a transfer operation (avoiding double writes).
* This has O(1) time complexity, but alters the order of the _ownedTokens array.
* @param from address representing the previous owner of the given token ID
* @param tokenId uint256 ID of the token to be removed from the tokens list of the given address
*/
function _removeTokenFromOwnerEnumeration(address from, uint256 tokenId) private {
// To prevent a gap in from's tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = ERC721.balanceOf(from) - 1;
uint256 tokenIndex = _ownedTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary
if (tokenIndex != lastTokenIndex) {
uint256 lastTokenId = _ownedTokens[from][lastTokenIndex];
_ownedTokens[from][tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_ownedTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
}
// This also deletes the contents at the last position of the array
delete _ownedTokensIndex[tokenId];
delete _ownedTokens[from][lastTokenIndex];
}
/**
* @dev Private function to remove a token from this extension's token tracking data structures.
* This has O(1) time complexity, but alters the order of the _allTokens array.
* @param tokenId uint256 ID of the token to be removed from the tokens list
*/
function _removeTokenFromAllTokensEnumeration(uint256 tokenId) private {
// To prevent a gap in the tokens array, we store the last token in the index of the token to delete, and
// then delete the last slot (swap and pop).
uint256 lastTokenIndex = _allTokens.length - 1;
uint256 tokenIndex = _allTokensIndex[tokenId];
// When the token to delete is the last token, the swap operation is unnecessary. However, since this occurs so
// rarely (when the last minted token is burnt) that we still do the swap here to avoid the gas cost of adding
// an 'if' statement (like in _removeTokenFromOwnerEnumeration)
uint256 lastTokenId = _allTokens[lastTokenIndex];
_allTokens[tokenIndex] = lastTokenId; // Move the last token to the slot of the to-delete token
_allTokensIndex[lastTokenId] = tokenIndex; // Update the moved token's index
// This also deletes the contents at the last position of the array
delete _allTokensIndex[tokenId];
_allTokens.pop();
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)
pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)
pragma solidity ^0.8.0;
/**
* @title ERC721 token receiver interface
* @dev Interface for any contract that wants to support safeTransfers
* from ERC721 asset contracts.
*/
interface IERC721Receiver {
/**
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
* by `operator` from `from`, this function is called.
*
* It must return its Solidity selector to confirm the token transfer.
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.
*
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
*/
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Metadata is IERC721 {
/**
* @dev Returns the token collection name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token collection symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
*/
function tokenURI(uint256 tokenId) external view returns (string memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"ethPriceSourceAddress","type":"address"},{"internalType":"uint256","name":"minimumCollateralPercentage","type":"uint256"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"symbol","type":"string"},{"internalType":"address","name":"_mai","type":"address"},{"internalType":"address","name":"_collateral","type":"address"},{"internalType":"string","name":"baseURI","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"promoter","type":"uint256"}],"name":"AddedFrontEnd","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"vaultID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BorrowToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"riskyVault","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newVault","type":"uint256"},{"indexed":false,"internalType":"address","name":"riskyVaultBuyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountPaidtoBuy","type":"uint256"}],"name":"BoughtRiskyDebtVault","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"BurnedToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"vaultID","type":"uint256"},{"indexed":false,"internalType":"address","name":"creator","type":"address"}],"name":"CreateVault","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"vaultID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositCollateral","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"vaultID","type":"uint256"}],"name":"DestroyVault","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"vaultID","type":"uint256"},{"indexed":false,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"uint256","name":"debtRepaid","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"collateralLiquidated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"closingFee","type":"uint256"}],"name":"LiquidateVault","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"vaultID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"closingFee","type":"uint256"}],"name":"PayBackToken","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"promoter","type":"uint256"}],"name":"RemovedFrontEnd","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"UpdatedAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"UpdatedClosingFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_debtRatio","type":"uint256"}],"name":"UpdatedDebtRatio","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_ethPriceSourceAddress","type":"address"}],"name":"UpdatedEthPriceSource","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_adminFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_refFee","type":"uint256"}],"name":"UpdatedFees","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"promoter","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"UpdatedFrontEnd","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_gainRatio","type":"uint256"}],"name":"UpdatedGainRatio","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"interestRate","type":"uint256"}],"name":"UpdatedInterestRate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMaxDebt","type":"uint256"}],"name":"UpdatedMaxDebt","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMinCollateralRatio","type":"uint256"}],"name":"UpdatedMinCollateralRatio","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMinDebt","type":"uint256"}],"name":"UpdatedMinDebt","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newFee","type":"uint256"}],"name":"UpdatedOpeningFee","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"oracle","type":"string"}],"name":"UpdatedOracleName","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newRef","type":"address"}],"name":"UpdatedRef","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"pool","type":"address"}],"name":"UpdatedStabilityPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"uri","type":"string"}],"name":"UpdatedTokenURI","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"vaultID","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawCollateral","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"earned","type":"uint256"}],"name":"WithdrawInterest","type":"event"},{"inputs":[],"name":"_minimumCollateralPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"accumulatedVaultDebt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promoter","type":"uint256"}],"name":"addFrontEnd","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"adm","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultID","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"_front","type":"uint256"}],"name":"borrowToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountToken","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultID","type":"uint256"}],"name":"buyRiskDebtVault","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fee","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"promoFee","type":"uint256"}],"name":"calculateFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"ethPriceSourceAddress","type":"address"}],"name":"changeEthPriceSource","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultID","type":"uint256"}],"name":"checkCollateralPercentage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultID","type":"uint256"}],"name":"checkCost","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultID","type":"uint256"}],"name":"checkExtract","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultID","type":"uint256"}],"name":"checkLiquidation","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultID","type":"uint256"}],"name":"checkRiskyVault","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"closingFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collateral","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"createVault","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"debtRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimalDifferenceRaisedToTen","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultID","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"depositCollateral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultID","type":"uint256"}],"name":"destroyVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"ethPriceSource","outputs":[{"internalType":"contract IPriceSource","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultID","type":"uint256"}],"name":"exists","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"gainRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getClosingFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDebtCeiling","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getEthPriceSource","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"pay","type":"address"}],"name":"getPaid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getPaid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getTokenPriceSource","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTotalValueLocked","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"iR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_collateral","type":"uint256"},{"internalType":"uint256","name":"debt","type":"uint256"}],"name":"isValidCollateral","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"lastInterest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultID","type":"uint256"},{"internalType":"uint256","name":"_front","type":"uint256"}],"name":"liquidateVault","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mai","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maiDebt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maticDebt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDebt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minDebt","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":"openingFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultID","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"_front","type":"uint256"}],"name":"payBackToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultID","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint256","name":"_front","type":"uint256"}],"name":"paybackTokenAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"priceSourceDecimals","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"promoter","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ref","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"refFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promoter","type":"uint256"}],"name":"removeFrontEnd","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":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_adm","type":"address"}],"name":"setAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_closingFee","type":"uint256"}],"name":"setClosingFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_debtRatio","type":"uint256"}],"name":"setDebtRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_admin","type":"uint256"},{"internalType":"uint256","name":"_ref","type":"uint256"}],"name":"setFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_gainRatio","type":"uint256"}],"name":"setGainRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_iR","type":"uint256"}],"name":"setInterestRate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_maxDebt","type":"uint256"}],"name":"setMaxDebt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"minimumCollateralPercentage","type":"uint256"}],"name":"setMinCollateralRatio","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minDebt","type":"uint256"}],"name":"setMinDebt","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_openingFee","type":"uint256"}],"name":"setOpeningFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_ref","type":"address"}],"name":"setRef","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_router","type":"address"}],"name":"setRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pool","type":"address"}],"name":"setStabilityPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_uri","type":"string"}],"name":"setTokenURI","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stabilityPool","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"tokenOfOwnerByIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenPeg","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalBorrowed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_promoter","type":"uint256"},{"internalType":"uint256","name":"cashback","type":"uint256"}],"name":"updateFrontEnd","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_oracle","type":"string"}],"name":"updateOracleName","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultID","type":"uint256"}],"name":"updateVaultDebt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"vaultCollateral","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"vaultCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultID","type":"uint256"}],"name":"vaultDebt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"vaultID","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawCollateral","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawInterest","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040526026805460ff60a01b1916600760a01b1790553480156200002457600080fd5b506040516200686b3803806200686b833981016040819052620000479162000af7565b868686868686868484828282600160008190555081600190805190602001906200007392919062000967565b5080516200008990600290602084019062000967565b50508151620000a19150600b90602084019062000967565b505050506001600160a01b038716620000b957600080fd5b85620000c457600080fd5b6032600f556000601055600c80546001600160a01b03808a166001600160a01b03199283161790925560238054821690556969e10de76676d08000006012556002601a5561044c601b55600d889055601c80548584169083168117909155601d8054938716939092169290921790556008601f556040805163313ce56760e01b8152905163313ce567916004818101926020929091908290030181865afa15801562000174573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200019a919062000bcb565b601d60009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001ee573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000214919062000bcb565b62000220919062000c0d565b6200022d90600a62000d32565b601e55505060248054336001600160a01b03199182168117909255602580549091169091179055506200027093506200026a925062000294915050565b62000298565b6200027a620002ea565b5062000287600062000358565b5050505050505062000de1565b3390565b602780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600e54600090620002fd81600162000d43565b600e8190558111156200030f57600080fd5b6200031b3382620004d7565b604080518281523360208201527f8b6c1d05c678fa59695e26465a85918ce0fc63a88f74af53d1daef8f0a9c7804910160405180910390a1919050565b6027546001600160a01b03163314620003b85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6000818152600360205260409020546001600160a01b0316620004285760405162461bcd60e51b815260206004820152602160248201527f61646446726f6e74456e643a205661756c7420646f6573206e6f7420657869736044820152601d60fa1b6064820152608401620003af565b60008181526017602052604090205415620004865760405162461bcd60e51b815260206004820152601a60248201527f61646446726f6e74456e643a20616c72656164792061646465640000000000006044820152606401620003af565b600081815260176020526040908190206127109055517f9d7c7013bbd38c45562efb3f7031f740c1f8b8886dbbf421142755ed68339f4c90620004cc9083815260200190565b60405180910390a150565b6001600160a01b0382166200052f5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401620003af565b6000818152600360205260409020546001600160a01b031615620005965760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401620003af565b620005a4600083836200062d565b6001600160a01b0382166000908152600460205260408120805460019290620005cf90849062000d43565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b620006458383836200064a60201b6200422d1760201c565b505050565b620006628383836200064560201b6200114d1760201c565b6001600160a01b038316620006c057620006ba81600980546000838152600a60205260408120829055600182018355919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0155565b620006e6565b816001600160a01b0316836001600160a01b031614620006e657620006e6838262000726565b6001600160a01b03821662000700576200064581620007d3565b826001600160a01b0316826001600160a01b03161462000645576200064582826200088d565b600060016200074084620008de60201b620023461760201c565b6200074c919062000d5e565b600083815260086020526040902054909150808214620007a0576001600160a01b03841660009081526007602090815260408083208584528252808320548484528184208190558352600890915290208190555b5060009182526008602090815260408084208490556001600160a01b039094168352600781528383209183525290812055565b600954600090620007e79060019062000d5e565b6000838152600a60205260408120546009805493945090928490811062000812576200081262000d78565b90600052602060002001549050806009838154811062000836576200083662000d78565b6000918252602080832090910192909255828152600a9091526040808220849055858252812055600980548062000871576200087162000d8e565b6001900381819060005260206000200160009055905550505050565b6000620008a583620008de60201b620023461760201c565b6001600160a01b039093166000908152600760209081526040808320868452825280832085905593825260089052919091209190915550565b60006001600160a01b0382166200094b5760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401620003af565b506001600160a01b031660009081526004602052604090205490565b828054620009759062000da4565b90600052602060002090601f016020900481019282620009995760008555620009e4565b82601f10620009b457805160ff1916838001178555620009e4565b82800160010185558215620009e4579182015b82811115620009e4578251825591602001919060010190620009c7565b50620009f2929150620009f6565b5090565b5b80821115620009f25760008155600101620009f7565b80516001600160a01b038116811462000a2557600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011262000a5257600080fd5b81516001600160401b038082111562000a6f5762000a6f62000a2a565b604051601f8301601f19908116603f0116810190828211818310171562000a9a5762000a9a62000a2a565b8160405283815260209250868385880101111562000ab757600080fd5b600091505b8382101562000adb578582018301518183018401529082019062000abc565b8382111562000aed5760008385830101525b9695505050505050565b600080600080600080600060e0888a03121562000b1357600080fd5b62000b1e8862000a0d565b602089015160408a015191985096506001600160401b038082111562000b4357600080fd5b62000b518b838c0162000a40565b965060608a015191508082111562000b6857600080fd5b62000b768b838c0162000a40565b955062000b8660808b0162000a0d565b945062000b9660a08b0162000a0d565b935060c08a015191508082111562000bad57600080fd5b5062000bbc8a828b0162000a40565b91505092959891949750929550565b60006020828403121562000bde57600080fd5b815160ff8116811462000bf057600080fd5b9392505050565b634e487b7160e01b600052601160045260246000fd5b600060ff821660ff84168082101562000c2a5762000c2a62000bf7565b90039392505050565b600181815b8085111562000c7457816000190482111562000c585762000c5862000bf7565b8085161562000c6657918102915b93841c939080029062000c38565b509250929050565b60008262000c8d5750600162000d2c565b8162000c9c5750600062000d2c565b816001811462000cb5576002811462000cc05762000ce0565b600191505062000d2c565b60ff84111562000cd45762000cd462000bf7565b50506001821b62000d2c565b5060208310610133831016604e8410600b841016171562000d05575081810a62000d2c565b62000d11838362000c33565b806000190482111562000d285762000d2862000bf7565b0290505b92915050565b600062000bf060ff84168362000c7c565b6000821982111562000d595762000d5962000bf7565b500190565b60008282101562000d735762000d7362000bf7565b500390565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b600181811c9082168062000db957607f821691505b6020821081141562000ddb57634e487b7160e01b600052602260045260246000fd5b50919050565b615a7a8062000df16000396000f3fe608060405234801561001057600080fd5b506004361061052f5760003560e01c80638da5cb5b116102af578063cc02ce2211610172578063e0df5b6f116100d9578063ece1373211610092578063ece1373214610b90578063f17336d714610ba3578063f1c91fa614610bac578063f2fde38b14610bb5578063f887ea4014610bc8578063ffc73da714610bdb57600080fd5b8063e0df5b6f14610b14578063e5f4dc9214610b27578063e985e9c514610b30578063eac989f814610b6c578063eb6a887d14610b74578063ec2e0ab314610b8757600080fd5b8063d0064c001161012b578063d0064c0014610a92578063d310f49b14610a9b578063d4a9b2c514610aae578063d73464cc14610ace578063d8dfeb4514610aee578063df98784614610b0157600080fd5b8063cc02ce2214610a46578063cd44db1b14610a59578063cdfedd6314610a63578063cea55f5714610a6e578063cf41d6f814610a77578063cf5f0f3c14610a7f57600080fd5b8063a57ff50311610216578063b3229a63116101cf578063b3229a63146109de578063b86f6aef146109f1578063b88d4fde14610a04578063c0d7865514610a17578063c71abb3214610a2a578063c87b56dd14610a3357600080fd5b8063a57ff50314610989578063a5e9883714610992578063a7c6a1001461099a578063a9c904b5146109a3578063b165ff0b146109b6578063b26025aa146109d657600080fd5b806397a41b8e1161026857806397a41b8e1461091f57806397ff37b91461093257806398c3f2db1461095257806398d721e01461095a578063a0be06f91461096d578063a22cb4651461097657600080fd5b80638da5cb5b146108c55780639035e4cb146108d657806393ee476a146108e957806394cd4ba7146108fc578063952cc86a1461090457806395d89b411461091757600080fd5b806342f371c6116103f75780636352211e1161035e57806370a082311161031757806370a0823114610868578063715018a61461087b578063728bbbb514610883578063767a7b051461088c57806385e290a31461089f57806386375994146108b257600080fd5b80636352211e146107f657806363b8817c146108095780636526941b1461081c578063687e8c171461082f5780636bc855cc14610842578063704b6c021461085557600080fd5b806356572ac0116103b057806356572ac01461078f578063570b2b84146107a25780635d12928b146107b55780635f84f302146107bd5780635ff09ac2146107d05780636234dc21146107e357600080fd5b806342f371c6146107145780634c19386c146107275780634f558e79146107305780634f6ccce7146107435780635357b9891461075657806354fd4d501461076957600080fd5b806321a78f681161049b5780633128ef27116104545780633128ef27146106a257806338536275146106b55780633db99177146106c857806340803854146106db57806342842e0e146106ee57806342966c681461070157600080fd5b806321a78f681461063757806323b872dd1461064a578063241a545a1461065d5780632df87573146106665780632f745c5914610686578063311f392a1461069957600080fd5b8063081812fc116104ed578063081812fc146105cc578063095ea7b3146105df5780630b78f9c0146105f257806311b4a8321461060557806318160ddd146106265780631c883e7b1461062e57600080fd5b806263750c1461053457806301ffc9a71461053e578063048c661d1461056657806304d7aef21461059157806306fdde03146105a457806307960532146105b9575b600080fd5b61053c610bee565b005b61055161054c36600461511a565b610e2e565b60405190151581526020015b60405180910390f35b602354610579906001600160a01b031681565b6040516001600160a01b03909116815260200161055d565b602454610579906001600160a01b031681565b6105ac610e3f565b60405161055d919061518f565b61053c6105c73660046151be565b610ed1565b6105796105da3660046151d9565b610fb4565b61053c6105ed3660046151f2565b61103c565b61053c61060036600461521c565b611152565b6106186106133660046151d9565b61121e565b60405190815260200161055d565b600954610618565b610618600f5481565b602554610579906001600160a01b031681565b61053c61065836600461523e565b6112d0565b61061860135481565b6106186106743660046151d9565b60156020526000908152604090205481565b6106186106943660046151f2565b611301565b610618601b5481565b61053c6106b036600461527a565b611397565b61053c6106c33660046151d9565b6116b8565b61053c6106d63660046151d9565b611717565b61053c6106e93660046151d9565b6117d6565b61053c6106fc36600461523e565b611900565b61053c61070f3660046151d9565b61191b565b600c54610579906001600160a01b031681565b61061860205481565b61055161073e3660046151d9565b611ad9565b6106186107513660046151d9565b611ae4565b61061861076436600461527a565b611b77565b60265461077d90600160a01b900460ff1681565b60405160ff909116815260200161055d565b61061861079d3660046151d9565b611c28565b601d54610579906001600160a01b031681565b610618611d22565b61053c6107cb3660046151d9565b611d8b565b61053c6107de3660046151d9565b611dea565b61053c6107f13660046151d9565b611f82565b6105796108043660046151d9565b611fe1565b61053c6108173660046151be565b612058565b61053c61082a3660046151d9565b61211c565b61055161083d36600461521c565b61217b565b61053c6108503660046151be565b6121aa565b61053c6108633660046151be565b612278565b6106186108763660046151be565b612346565b61053c6123cd565b61061860105481565b61053c61089a36600461521c565b612403565b61053c6108ad3660046151d9565b612605565b61053c6108c03660046151d9565b612786565b6027546001600160a01b0316610579565b6106186108e43660046151d9565b612845565b6106186108f73660046151d9565b612bbc565b610618612c23565b61053c61091236600461521c565b612c95565b6105ac613179565b61053c61092d36600461527a565b613188565b6106186109403660046151d9565b60166020526000908152604090205481565b610618613567565b61053c6109683660046151be565b6135b1565b61061860185481565b61053c6109843660046152b4565b61368b565b610618601e5481565b600f54610618565b610618600e5481565b61053c6109b1366004615377565b61369a565b6106186109c43660046151be565b60216020526000908152604090205481565b610618613707565b6105516109ec3660046151d9565b613793565b6105516109ff3660046151d9565b61384d565b61053c610a123660046153c0565b6138f0565b61053c610a253660046151be565b613928565b610618601f5481565b6105ac610a413660046151d9565b613974565b61053c610a5436600461521c565b613a1a565b6305f5e100610618565b6106186305f5e10081565b610618601a5481565b61053c613b8f565b61053c610a8d36600461527a565b613c47565b61061860125481565b610618610aa93660046151d9565b613d95565b610618610abc3660046151d9565b60146020526000908152604090205481565b610618610adc3660046151d9565b60176020526000908152604090205481565b601c54610579906001600160a01b031681565b610618610b0f3660046151d9565b613da1565b61053c610b2236600461543c565b613e33565b610618600d5481565b610551610b3e3660046154ae565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b6105ac613e9a565b61053c610b823660046151d9565b613f28565b61061860195481565b61053c610b9e36600461521c565b613fcf565b61061860115481565b61061860225481565b61053c610bc33660046151be565b6140ca565b602654610579906001600160a01b031681565b61053c610be93660046151d9565b614165565b6025546001600160a01b0316331480610c1157506024546001600160a01b031633145b80610c35575033610c2a6027546001600160a01b031690565b6001600160a01b0316145b610c865760405162461bcd60e51b815260206004820152601f60248201527f4e6565647320746f2062652063616c6c6564206279206f70657261746f72730060448201526064015b60405180910390fd5b60026000541415610ca95760405162461bcd60e51b8152600401610c7d906154e1565b6002600090815560185460225461271091610cc39161552e565b610ccd919061554d565b601d546025546022549293506001600160a01b039182169263a9059cbb9290911690610cfa90859061556f565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610d45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d699190615586565b50601d546024805460405163a9059cbb60e01b81526001600160a01b0391821660048201529182018490529091169063a9059cbb906044016020604051808303816000875af1158015610dc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de49190615586565b507fc73fb14682b9d51008c1faff296cc9b351c0597de5e25b4ffa158f47f8254e4c602254604051610e1891815260200190565b60405180910390a1506000602281905560019055565b6000610e39826142e5565b92915050565b606060018054610e4e906155a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610e7a906155a3565b8015610ec75780601f10610e9c57610100808354040283529160200191610ec7565b820191906000526020600020905b815481529060010190602001808311610eaa57829003601f168201915b5050505050905090565b6027546001600160a01b03163314610efb5760405162461bcd60e51b8152600401610c7d906155d8565b6001600160a01b038116610f5f5760405162461bcd60e51b815260206004820152602560248201527f4574687072696365736f757263652063616e6e6f74206265207a65726f206164604482015264647265737360d81b6064820152608401610c7d565b600c80546001600160a01b0319166001600160a01b0383169081179091556040519081527fc525e5fed1508c998d3f14bf52f933df1dd16dbf48e2944c426be721e268b755906020015b60405180910390a150565b6000610fbf8261430a565b6110205760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c7d565b506000908152600560205260409020546001600160a01b031690565b600061104782611fe1565b9050806001600160a01b0316836001600160a01b031614156110b55760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610c7d565b336001600160a01b03821614806110d157506110d18133610b3e565b6111435760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610c7d565b61114d8383614327565b505050565b6027546001600160a01b0316331461117c5760405162461bcd60e51b8152600401610c7d906155d8565b612710611189828461560d565b146111d65760405162461bcd60e51b815260206004820152601a60248201527f736574466565733a206d75737420657175616c2031303030302e0000000000006044820152606401610c7d565b6018829055601981905560408051838152602081018390527f4d32f38862d5eb71edfefb7955873bd55920dc98159b6f53f8be62fbf0bebb4b91015b60405180910390a15050565b60008061122a83613d95565b6000848152601460205260409020549091501580611246575080155b8061125757506112558361384d565b155b156112655750600092915050565b60008381526014602052604081205461127e9083614395565b91505080611290575060009392505050565b601f5461129e90600a615709565b6112a8908261554d565b90506000601a54826112ba919061554d565b905060115481116112c85750805b949350505050565b6112da338261441e565b6112f65760405162461bcd60e51b8152600401610c7d90615715565b61114d838383614507565b600061130c83612346565b821061136e5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610c7d565b506001600160a01b03919091166000908152600760209081526040808320938352929052205490565b806113a18161430a565b6113bd5760405162461bcd60e51b8152600401610c7d90615766565b600081815260176020526040902054612710108015906113ea575060008181526017602052604090205415155b6114065760405162461bcd60e51b8152600401610c7d9061579d565b836114108161430a565b61142c5760405162461bcd60e51b8152600401610c7d906157ca565b6026546001600160a01b0316158061144e57506026546001600160a01b031633145b61146a5760405162461bcd60e51b8152600401610c7d906157f8565b601d546040516370a0823160e01b815233600482015285916001600160a01b0316906370a0823190602401602060405180830381865afa1580156114b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d69190615821565b101561151c5760405162461bcd60e51b8152602060048201526015602482015274546f6b656e2062616c616e636520746f6f206c6f7760581b6044820152606401610c7d565b600061152786612bbc565b9050848110156115895760405162461bcd60e51b815260206004820152602760248201527f5661756c742064656274206c657373207468616e20616d6f756e7420746f20706044820152666179206261636b60c81b6064820152608401610c7d565b601154611596868361556f565b1015806115a257508085145b6115be5760405162461bcd60e51b8152600401610c7d9061583a565b600f5460008581526017602052604081205490916115dd918890611b77565b90506115e9868361556f565b60008881526015602090815260408083209390935560149052205461160f90829061556f565b60008881526014602052604080822092909255868152205461163290829061560d565b6000868152601460209081526040909120919091555461165390879061556f565b602055601d5461166e906001600160a01b03163330896146ae565b60408051888152602081018890529081018290527f31f96762af4051f367185773cc2f55bfb112a6c114b3407ded1f321a9eb199ac9060600160405180910390a150505050505050565b6027546001600160a01b031633146116e25760405162461bcd60e51b8152600401610c7d906155d8565b600d8190556040518181527fc0880963f3abc486dbb8b8f04ba4ce47c5b5cd3c59b6b7655f6011da0bf3365090602001610fa9565b6027546001600160a01b031633146117415760405162461bcd60e51b8152600401610c7d906155d8565b6101f48111156117a15760405162461bcd60e51b815260206004820152602560248201527f736574436c6f73696e674665653a2063616e6e6f74206265206d6f7265207468604482015264616e20352560d81b6064820152608401610c7d565b600f8190556040518181527fc1b83121984ef8e824a0babc08fc162077c0716a4dc307121f306e6dfb13806c90602001610fa9565b6027546001600160a01b031633146118005760405162461bcd60e51b8152600401610c7d906155d8565b6118098161430a565b61185f5760405162461bcd60e51b815260206004820152602160248201527f61646446726f6e74456e643a205661756c7420646f6573206e6f7420657869736044820152601d60fa1b6064820152608401610c7d565b600081815260176020526040902054156118bb5760405162461bcd60e51b815260206004820152601a60248201527f61646446726f6e74456e643a20616c72656164792061646465640000000000006044820152606401610c7d565b600081815260176020526040908190206127109055517f9d7c7013bbd38c45562efb3f7031f740c1f8b8886dbbf421142755ed68339f4c90610fa99083815260200190565b61114d838383604051806020016040528060008152506138f0565b6024546001600160a01b031633146119755760405162461bcd60e51b815260206004820152601b60248201527f4e6565647320746f2062652063616c6c65642062792061646d696e00000000006044820152606401610c7d565b601d546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156119bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e19190615821565b8110611a2f5760405162461bcd60e51b815260206004820152601860248201527f6275726e3a2042616c616e6365206e6f7420656e6f75676800000000000000006044820152606401610c7d565b601d5460255460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810184905291169063a9059cbb906044016020604051808303816000875af1158015611a84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa89190615586565b506040518181527fb1f67ade07cda330ac167f4fcc4c01b94fdfc04d401cf85e487f0a5b8b98e75f90602001610fa9565b6000610e398261430a565b6000611aef60095490565b8210611b525760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610c7d565b60098281548110611b6557611b6561587b565b90600052602060002001549050919050565b6000808215611bd55761271080611b8c613567565b611b96919061552e565b611ba0919061552e565b836305f5e100611bb0888861552e565b611bba919061552e565b611bc4919061552e565b611bce919061554d565b9050611c10565b612710611be0613567565b611bea919061552e565b6305f5e100611bf9878761552e565b611c03919061552e565b611c0d919061554d565b90505b601e54611c1d908261554d565b9150505b9392505050565b6000818152601460205260408120541580611c495750611c478261384d565b155b15611c5657506000919050565b6000611c6183613d95565b60008481526014602052604081205491925090611c7e9083614395565b9150506000601a5482611c91919061554d565b905080611ca357506000949350505050565b601154601f54611cb490600a615709565b611cbe908361554d565b11611d0657601e54611cce613567565b6103e8601b5485611cdf919061552e565b611ce9919061554d565b611cf3919061554d565b611cfd919061554d565b95945050505050565b601e54611d11613567565b6103e8601b5484611cdf919061552e565b600e54600090611d3381600161560d565b600e819055811115611d4457600080fd5b611d4e3382614719565b604080518281523360208201527f8b6c1d05c678fa59695e26465a85918ce0fc63a88f74af53d1daef8f0a9c7804910160405180910390a1919050565b6027546001600160a01b03163314611db55760405162461bcd60e51b8152600401610c7d906155d8565b60138190556040518181527f323264e3ca065ee856fe1b11204d8896a783bccf148380ac5d7362eb5c4c36a890602001610fa9565b80611df48161430a565b611e105760405162461bcd60e51b8152600401610c7d90615766565b60008181526017602052604090205461271010801590611e3d575060008181526017602052604090205415155b611e595760405162461bcd60e51b8152600401610c7d9061579d565b6027546001600160a01b03163314611e835760405162461bcd60e51b8152600401610c7d906155d8565b611e8c8261430a565b611ee45760405162461bcd60e51b8152602060048201526024808201527f72656d6f766546726f6e74456e643a205661756c7420646f6573206e6f7420656044820152631e1a5cdd60e21b6064820152608401610c7d565b600082815260176020526040902054611f3f5760405162461bcd60e51b815260206004820152601f60248201527f72656d6f766546726f6e74456e643a206e6f7420612066726f6e7420656e64006044820152606401610c7d565b60008281526017602052604080822091909155517f9b9f950fb3755096dbbe8b1519e73f7c6d1a0507f514fced444919530c00d719906112129084815260200190565b6027546001600160a01b03163314611fac5760405162461bcd60e51b8152600401610c7d906155d8565b60118190556040518181527f4533506fbaba6b18743358b6e6fb9392e8cb21757487b68d232a01b140bbec0190602001610fa9565b6000818152600360205260408120546001600160a01b031680610e395760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610c7d565b6002600054141561207b5760405162461bcd60e51b8152600401610c7d906154e1565b600260009081556001600160a01b0382168152602160205260409020546120e45760405162461bcd60e51b815260206004820152601c60248201527f446f6e2774206861766520616e797468696e6720666f7220796f752e000000006044820152606401610c7d565b6001600160a01b0380821660009081526021602052604081208054919055601c54909161211391168383614858565b50506001600055565b6027546001600160a01b031633146121465760405162461bcd60e51b8152600401610c7d906155d8565b60128190556040518181527f1dd8f42ee4750a70f6662d1383372472422592497256d506437e35b3fa914d9b90602001610fa9565b600080600061218a8585614395565b9092509050600061219b828461554d565b600d5411159695505050505050565b6027546001600160a01b031633146121d45760405162461bcd60e51b8152600401610c7d906155d8565b6001600160a01b03811661222a5760405162461bcd60e51b815260206004820181905260248201527f5265666572656e636520416464726573732063616e6e6f74206265207a65726f6044820152606401610c7d565b602580546001600160a01b0319166001600160a01b0383169081179091556040519081527f8ed6553fa1e634b0152cd3539c572bee8c662e446820646d73a0e1b47776af9390602001610fa9565b6027546001600160a01b031633146122a25760405162461bcd60e51b8152600401610c7d906155d8565b6001600160a01b0381166122f85760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20416464726573732063616e6e6f74206265207a65726f000000006044820152606401610c7d565b602480546001600160a01b0319166001600160a01b0383169081179091556040519081527ffce52dd00c7849a7f2602c1f189745238d6a2db16fabf54376ce24cc2fa3d57f90602001610fa9565b60006001600160a01b0382166123b15760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610c7d565b506001600160a01b031660009081526004602052604090205490565b6027546001600160a01b031633146123f75760405162461bcd60e51b8152600401610c7d906155d8565b6124016000614888565b565b8161240d8161430a565b6124295760405162461bcd60e51b8152600401610c7d906157ca565b3361243382611fe1565b6001600160a01b0316146124595760405162461bcd60e51b8152600401610c7d90615891565b6002600054141561247c5760405162461bcd60e51b8152600401610c7d906154e1565b60026000908155838152601460205260409020548211156124ed5760405162461bcd60e51b815260206004820152602560248201527f5661756c7420646f6573206e6f74206861766520656e6f75676820636f6c6c616044820152641d195c985b60da1b6064820152608401610c7d565b60008381526014602052604081205461250790849061556f565b9050600061251485612bbc565b9050801561259857612526828261217b565b6125985760405162461bcd60e51b815260206004820152603e60248201527f5769746864726177616c20776f756c6420707574207661756c742062656c6f7760448201527f206d696e696d756d20636f6c6c61746572616c2070657263656e7461676500006064820152608401610c7d565b6000858152601460205260409020829055601c546125c0906001600160a01b03163386614858565b60408051868152602081018690527f6c0ea3bea9dd66afa8f9d39d6eb93d833466190330813b42835efc650dca4cb9910160405180910390a150506001600055505050565b8061260f8161430a565b61262b5760405162461bcd60e51b8152600401610c7d906157ca565b3361263582611fe1565b6001600160a01b03161461265b5760405162461bcd60e51b8152600401610c7d90615891565b6002600054141561267e5760405162461bcd60e51b8152600401610c7d906154e1565b600260005561268c82613d95565b156126d95760405162461bcd60e51b815260206004820152601a60248201527f5661756c7420686173206f75747374616e64696e6720646562740000000000006044820152606401610c7d565b6000828152601460205260409020541561271b5761271b6126f983611fe1565b600084815260146020526040902054601c546001600160a01b03169190614858565b612724826148da565b600082815260146020908152604080832083905560158252808320839055601682528083209290925590518381527f4fe08624ee65b341c38ab9693d216b909d4ddee1bc8d3fe0fea14026c361b465910160405180910390a150506001600055565b6027546001600160a01b031633146127b05760405162461bcd60e51b8152600401610c7d906155d8565b6101f48111156128105760405162461bcd60e51b815260206004820152602560248201527f7365744f70656e696e674665653a2063616e6e6f74206265206d6f7265207468604482015264616e20352560d81b6064820152608401610c7d565b60108190556040518181527fc4ced91ca77dc4287a54d9bd9b15c69b3aba262e30eba7c93301c48606019c9490602001610fa9565b6000816128518161430a565b61286d5760405162461bcd60e51b8152600401610c7d906157ca565b6023546001600160a01b0316158061288f57506023546001600160a01b031633145b6128db5760405162461bcd60e51b815260206004820181905260248201527f627579207269736b792069732064697361626c656420666f72207075626c69636044820152606401610c7d565b60006128e684612bbc565b9050806129275760405162461bcd60e51b815260206004820152600f60248201526e05661756c742064656274206973203608c1b6044820152606401610c7d565b60008481526014602052604081205481906129429084614395565b90925090506000612953828461554d565b601b5490915061296482600a61552e565b11156129c95760405162461bcd60e51b815260206004820152602e60248201527f5661756c74206973206e6f742062656c6f77207269736b7920636f6c6c61746560448201526d72616c2070657263656e7461676560901b6064820152608401610c7d565b6000601f54600a6129da9190615709565b600d546129e7919061552e565b6129f1908561554d565b601f546129ff90600a615709565b612a09908561554d565b612a13919061556f565b601d546040516370a0823160e01b815233600482015291925082916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612a60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a849190615821565b1015612ae05760405162461bcd60e51b815260206004820152602560248201527f4e6f7420656e6f756768206d616920746f2062757920746865207269736b79206044820152641d985d5b1d60da1b6064820152608401610c7d565b601d54612af8906001600160a01b03163330846146ae565b80602054612b06919061556f565b6020556000612b13611d22565b60008a815260146020526040808220548383529120559050612b35828761556f565b600082815260156020818152604080842094909455601681528383204290558c8352601481528383208390559081528282209190915581518b815290810183905233818301526060810184905290517fa4cf7276e26bb566de2c7540759e85736eb743807343fd27e6e679b20e8814419181900360800190a1965050505050505b50919050565b6000806000612bca84614981565b9150915081602254612bdc919061560d565b602255602054612bed90839061560d565b60205560135415612c0a5760008481526016602052604090204290555b6000938452601560205260409093208390555090919050565b601d546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015612c6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c909190615821565b905090565b80612c9f8161430a565b612cbb5760405162461bcd60e51b8152600401610c7d90615766565b60008181526017602052604090205461271010801590612ce8575060008181526017602052604090205415155b612d045760405162461bcd60e51b8152600401610c7d9061579d565b82612d0e8161430a565b612d2a5760405162461bcd60e51b8152600401610c7d906157ca565b6023546001600160a01b03161580612d4c57506023546001600160a01b031633145b612da35760405162461bcd60e51b815260206004820152602260248201527f6c69717569646174696f6e2069732064697361626c656420666f72207075626c604482015261696360f01b6064820152608401610c7d565b6000612dae85612bbc565b600086815260146020526040812054919250908190612dcd9084614395565b915091508260001415612e145760405162461bcd60e51b815260206004820152600f60248201526e05661756c742064656274206973203608c1b6044820152606401610c7d565b6000612e20828461554d565b9050600d548110612e8c5760405162461bcd60e51b815260206004820152603060248201527f5661756c74206973206e6f742062656c6f77206d696e696d756d20636f6c6c6160448201526f746572616c2070657263656e7461676560801b6064820152608401610c7d565b601b54612e9a82600a61552e565b11612ee75760405162461bcd60e51b815260206004820152601d60248201527f5661756c74206973206e6f742061626f7665206761696e20726174696f0000006044820152606401610c7d565b601f54612ef590600a615709565b612eff908361554d565b91506000601a5483612f11919061554d565b90506011548111612f1f5750815b601d546040516370a0823160e01b815233600482015282916001600160a01b0316906370a0823190602401602060405180830381865afa158015612f67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f8b9190615821565b1015612ff35760405162461bcd60e51b815260206004820152603160248201527f546f6b656e2062616c616e636520746f6f206c6f7720746f20706179206f6666604482015270081bdd5d1cdd185b991a5b99c81919589d607a1b6064820152608401610c7d565b80602054613001919061556f565b602055600061300f8a611c28565b905061301b828761556f565b60008b815260156020908152604080832093909355600f548c8352601790915291812054909161304c918590611b77565b60008c81526014602052604090205490915061306990829061556f565b60008c815260146020526040808220929092558b8152205461308c90829061560d565b60008b815260146020526040808220929092558c815220546130af90839061556f565b60008c8152601460209081526040808320939093553382526021905220546130d890839061560d565b33600081815260216020526040902091909155601d54613105916001600160a01b039091169030866146ae565b7f4d151d3a98b83151d51917640c221f8c8e3c054422ea1b48dcbbd57e3f4210d58b6131308d611fe1565b604080519283526001600160a01b0390911660208301523390820152606081018590526080810184905260a0810183905260c00160405180910390a15050505050505050505050565b606060028054610e4e906155a3565b806131928161430a565b6131ae5760405162461bcd60e51b8152600401610c7d90615766565b600081815260176020526040902054612710108015906131db575060008181526017602052604090205415155b6131f75760405162461bcd60e51b8152600401610c7d9061579d565b836132018161430a565b61321d5760405162461bcd60e51b8152600401610c7d906157ca565b3361322782611fe1565b6001600160a01b03161461324d5760405162461bcd60e51b8152600401610c7d90615891565b600260005414156132705760405162461bcd60e51b8152600401610c7d906154e1565b6002600055836132c25760405162461bcd60e51b815260206004820152601b60248201527f4d75737420626f72726f77206e6f6e2d7a65726f20616d6f756e7400000000006044820152606401610c7d565b6132ca612c23565b8411156133315760405162461bcd60e51b815260206004820152602f60248201527f626f72726f77546f6b656e3a2043616e6e6f74206d696e74206f76657220617660448201526e30b4b630b136329039bab838363c9760891b6064820152608401610c7d565b60008461333d87612bbc565b613347919061560d565b90506012548111156133a65760405162461bcd60e51b815260206004820152602260248201527f626f72726f77546f6b656e3a206d6178206c6f616e2063617020726561636865604482015261321760f11b6064820152608401610c7d565b6133af86613d95565b81116133ba57600080fd5b6000868152601460205260409020546133d3908261217b565b6134455760405162461bcd60e51b815260206004820152603a60248201527f426f72726f7720776f756c6420707574207661756c742062656c6f77206d696e60448201527f696d756d20636f6c6c61746572616c2070657263656e746167650000000000006064820152608401610c7d565b6011548561345288613d95565b61345c919061560d565b101561347a5760405162461bcd60e51b8152600401610c7d9061583a565b600086815260156020908152604080832084905560105487845260179092528220546134a891908490611b77565b6000888152601460205260409020549091506134c590829061556f565b6000888152601460205260408082209290925586815220546134e890829061560d565b600086815260146020526040902055601d5461350e906001600160a01b03163388614858565b8560205461351c919061560d565b6020908155604080518981529182018890527f3e08df88d8e28f37df9bf227d3142ac506a364403445661a60891a49ed6792ca910160405180910390a1505060016000555050505050565b600c54604080516350d25bcd60e01b815290516000926001600160a01b0316916350d25bcd9160048083019260209291908290030181865afa158015612c6c573d6000803e3d6000fd5b6027546001600160a01b031633146135db5760405162461bcd60e51b8152600401610c7d906155d8565b6001600160a01b03811661363d5760405162461bcd60e51b8152602060048201526024808201527f53746162696c697479506f6f6c2063616e6e6f74206265207a65726f206164646044820152637265737360e01b6064820152608401610c7d565b602380546001600160a01b0319166001600160a01b0383169081179091556040519081527f0644c4f539d7f787d2287c12d9425e80aefc8bdae99c70af4ca66fb0742577e890602001610fa9565b613696338383614a26565b5050565b6027546001600160a01b031633146136c45760405162461bcd60e51b8152600401610c7d906155d8565b80516136d7906028906020840190614ff7565b507f0d82453dd4ad18b5ce3db08c34a39340ad2bf15046a7d0e86aa075483eb121d881604051610fa9919061518f565b601c546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015613750573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137749190615821565b601e5461377f613567565b613789919061552e565b612c90919061552e565b60008161379f8161430a565b6137bb5760405162461bcd60e51b8152600401610c7d906157ca565b60006137c684613d95565b60008581526014602052604090205490915015806137e2575080155b156137f1576000925050612bb6565b600084815260146020526040812054819061380c9084614395565b9092509050600061381d828461554d565b601b5490915061382e82600a61552e565b11613840576001955050505050612bb6565b6000955050505050612bb6565b6000816138598161430a565b6138755760405162461bcd60e51b8152600401610c7d906157ca565b600061388084613d95565b600085815260146020526040902054909150158061389c575080155b156138ab576000925050612bb6565b60008481526014602052604081205481906138c69084614395565b909250905060006138d7828461554d565b9050600d54811015613840576001955050505050612bb6565b6138fa338361441e565b6139165760405162461bcd60e51b8152600401610c7d90615715565b61392284848484614af5565b50505050565b6027546001600160a01b031633146139525760405162461bcd60e51b8152600401610c7d906155d8565b602680546001600160a01b0319166001600160a01b0392909216919091179055565b606061397f8261430a565b61398857600080fd5b600b8054613995906155a3565b80601f01602080910402602001604051908101604052809291908181526020018280546139c1906155a3565b8015613a0e5780601f106139e357610100808354040283529160200191613a0e565b820191906000526020600020905b8154815290600101906020018083116139f157829003601f168201915b50505050509050919050565b81613a248161430a565b613a405760405162461bcd60e51b8152600401610c7d90615766565b60008181526017602052604090205461271010801590613a6d575060008181526017602052604090205415155b613a895760405162461bcd60e51b8152600401610c7d9061579d565b82613a938161430a565b613aaf5760405162461bcd60e51b8152600401610c7d906157ca565b33613ab982611fe1565b6001600160a01b031614613adf5760405162461bcd60e51b8152600401610c7d90615891565b600083118015613af157506127108311155b613b3d5760405162461bcd60e51b815260206004820152601b60248201527f75706461746546726f6e74456e643a2063616e6e6f74206265203000000000006044820152606401610c7d565b60008481526017602090815260409182902085905581518681529081018590527fbfdd5aecf44aa804bf11f070a41765d280dab82adbfd1c55e1e85b7d5b7920b491015b60405180910390a150505050565b60026000541415613bb25760405162461bcd60e51b8152600401610c7d906154e1565b6002600090815533815260216020526040902054613c125760405162461bcd60e51b815260206004820152601c60248201527f446f6e2774206861766520616e797468696e6720666f7220796f752e000000006044820152606401610c7d565b3360008181526021602052604081208054919055601c549091613c3f916001600160a01b03169083614858565b506001600055565b80613c518161430a565b613c6d5760405162461bcd60e51b8152600401610c7d90615766565b60008181526017602052604090205461271010801590613c9a575060008181526017602052604090205415155b613cb65760405162461bcd60e51b8152600401610c7d9061579d565b83613cc08161430a565b613cdc5760405162461bcd60e51b8152600401610c7d906157ca565b6026546001600160a01b03161580613cfe57506026546001600160a01b031633145b613d1a5760405162461bcd60e51b8152600401610c7d906157f8565b42841015613d755760405162461bcd60e51b815260206004820152602260248201527f7061796261636b546f6b656e416c6c3a20646561646c696e6520657870697265604482015261321760f11b6064820152608401610c7d565b6000613d8086612bbc565b9050613d8d868286611397565b505050505050565b6000806112c883614981565b600081613dad8161430a565b613dc95760405162461bcd60e51b8152600401610c7d906157ca565b6000613dd484613d95565b6000858152601460205260409020549091501580613df0575080155b15613dff576000925050612bb6565b6000848152601460205260408120548190613e1a9084614395565b9092509050613e29818361554d565b9695505050505050565b6027546001600160a01b03163314613e5d5760405162461bcd60e51b8152600401610c7d906155d8565b613e69600b838361507b565b507ffda45751019c07e08a3ebf7d73a4aea1a6c36bee12d87089096012911a756ab5600b60405161121291906158c8565b600b8054613ea7906155a3565b80601f0160208091040260200160405190810160405280929190818152602001828054613ed3906155a3565b8015613f205780601f10613ef557610100808354040283529160200191613f20565b820191906000526020600020905b815481529060010190602001808311613f0357829003601f168201915b505050505081565b6027546001600160a01b03163314613f525760405162461bcd60e51b8152600401610c7d906155d8565b601a54613f9a5760405162461bcd60e51b815260206004820152601660248201527504465627420526174696f2063616e6e6f7420626520360541b6044820152606401610c7d565b601a8190556040518181527f199e93b2fae27b389e2d09761871573f60121b8521be96b8f28c83bf94846ac290602001610fa9565b81613fd98161430a565b613ff55760405162461bcd60e51b8152600401610c7d906157ca565b6026546001600160a01b0316158061401757506026546001600160a01b031633145b6140335760405162461bcd60e51b8152600401610c7d906157f8565b60008381526014602052604081205461404d90849061560d565b60008581526014602052604090205490915081101561406b57600080fd5b6000848152601460205260409020819055601c54614094906001600160a01b03163330866146ae565b60408051858152602081018590527f52c4e7127ec34e8fc95f09ce2d06b4f00acca12ccbcdfb246ef67ee6aefe068d9101613b81565b6027546001600160a01b031633146140f45760405162461bcd60e51b8152600401610c7d906155d8565b6001600160a01b0381166141595760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c7d565b61416281614888565b50565b6027546001600160a01b0316331461418f5760405162461bcd60e51b8152600401610c7d906155d8565b6103e88110156141f85760405162461bcd60e51b815260206004820152602e60248201527f6761696e526174696f2063616e6e6f74206265206c657373207468616e206f7260448201526d020657175616c20746f20313030360941b6064820152608401610c7d565b601b8190556040518181527fb6d384ad48d9c5c042c81fa0f88d8061ef87b38475101d6aa5f9ae5a8274a64e90602001610fa9565b6001600160a01b0383166142885761428381600980546000838152600a60205260408120829055600182018355919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0155565b6142ab565b816001600160a01b0316836001600160a01b0316146142ab576142ab8382614b28565b6001600160a01b0382166142c25761114d81614bc5565b826001600160a01b0316826001600160a01b03161461114d5761114d8282614c74565b60006001600160e01b0319821663780e9d6360e01b1480610e395750610e3982614cb8565b6000908152600360205260409020546001600160a01b0316151590565b600081815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061435c82611fe1565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806143a0613567565b6143a957600080fd5b6000601e546143b6613567565b6143c0908761552e565b6143ca919061552e565b9050848110156143d957600080fd5b60006143e96305f5e1008661552e565b9050848110156143f857600080fd5b600061440583606461552e565b905082811161441357600080fd5b969095509350505050565b60006144298261430a565b61448a5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c7d565b600061449583611fe1565b9050806001600160a01b0316846001600160a01b031614806144dc57506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b806112c85750836001600160a01b03166144f584610fb4565b6001600160a01b031614949350505050565b826001600160a01b031661451a82611fe1565b6001600160a01b03161461457e5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610c7d565b6001600160a01b0382166145e05760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c7d565b6145eb838383614d08565b6145f6600082614327565b6001600160a01b038316600090815260046020526040812080546001929061461f90849061556f565b90915550506001600160a01b038216600090815260046020526040812080546001929061464d90849061560d565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6040516001600160a01b03808516602483015283166044820152606481018290526139229085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614d13565b6001600160a01b03821661476f5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c7d565b6147788161430a565b156147c55760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c7d565b6147d160008383614d08565b6001600160a01b03821660009081526004602052604081208054600192906147fa90849061560d565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6040516001600160a01b03831660248201526044810182905261114d90849063a9059cbb60e01b906064016146e2565b602780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006148e582611fe1565b90506148f381600084614d08565b6148fe600083614327565b6001600160a01b038116600090815260046020526040812080546001929061492790849061556f565b909155505060008281526003602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000818152601560209081526040808320546016909252822054829142918390158015906149b157506000601354115b15614a1c576000868152601660205260408120546149cf908561556f565b905060006127106301e1855883866013546149ea919061552e565b6149f4919061552e565b6149fe919061554d565b614a08919061554d565b9250829050614a17848261560d565b935050505b9590945092505050565b816001600160a01b0316836001600160a01b03161415614a885760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c7d565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b614b00848484614507565b614b0c84848484614de5565b6139225760405162461bcd60e51b8152600401610c7d90615970565b60006001614b3584612346565b614b3f919061556f565b600083815260086020526040902054909150808214614b92576001600160a01b03841660009081526007602090815260408083208584528252808320548484528184208190558352600890915290208190555b5060009182526008602090815260408084208490556001600160a01b039094168352600781528383209183525290812055565b600954600090614bd79060019061556f565b6000838152600a602052604081205460098054939450909284908110614bff57614bff61587b565b906000526020600020015490508060098381548110614c2057614c2061587b565b6000918252602080832090910192909255828152600a90915260408082208490558582528120556009805480614c5857614c586159c2565b6001900381819060005260206000200160009055905550505050565b6000614c7f83612346565b6001600160a01b039093166000908152600760209081526040808320868452825280832085905593825260089052919091209190915550565b60006001600160e01b031982166380ac58cd60e01b1480614ce957506001600160e01b03198216635b5e139f60e01b145b80610e3957506301ffc9a760e01b6001600160e01b0319831614610e39565b61114d83838361422d565b6000614d68826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614ee39092919063ffffffff16565b80519091501561114d5780806020019051810190614d869190615586565b61114d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610c7d565b60006001600160a01b0384163b15614ed857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290614e299033908990889088906004016159d8565b6020604051808303816000875af1925050508015614e64575060408051601f3d908101601f19168201909252614e6191810190615a0b565b60015b614ebe573d808015614e92576040519150601f19603f3d011682016040523d82523d6000602084013e614e97565b606091505b508051614eb65760405162461bcd60e51b8152600401610c7d90615970565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506112c8565b506001949350505050565b60606112c88484600085856001600160a01b0385163b614f455760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610c7d565b600080866001600160a01b03168587604051614f619190615a28565b60006040518083038185875af1925050503d8060008114614f9e576040519150601f19603f3d011682016040523d82523d6000602084013e614fa3565b606091505b5091509150614fb3828286614fbe565b979650505050505050565b60608315614fcd575081611c21565b825115614fdd5782518084602001fd5b8160405162461bcd60e51b8152600401610c7d919061518f565b828054615003906155a3565b90600052602060002090601f016020900481019282615025576000855561506b565b82601f1061503e57805160ff191683800117855561506b565b8280016001018555821561506b579182015b8281111561506b578251825591602001919060010190615050565b506150779291506150ef565b5090565b828054615087906155a3565b90600052602060002090601f0160209004810192826150a9576000855561506b565b82601f106150c25782800160ff1982351617855561506b565b8280016001018555821561506b579182015b8281111561506b5782358255916020019190600101906150d4565b5b8082111561507757600081556001016150f0565b6001600160e01b03198116811461416257600080fd5b60006020828403121561512c57600080fd5b8135611c2181615104565b60005b8381101561515257818101518382015260200161513a565b838111156139225750506000910152565b6000815180845261517b816020860160208601615137565b601f01601f19169290920160200192915050565b602081526000611c216020830184615163565b80356001600160a01b03811681146151b957600080fd5b919050565b6000602082840312156151d057600080fd5b611c21826151a2565b6000602082840312156151eb57600080fd5b5035919050565b6000806040838503121561520557600080fd5b61520e836151a2565b946020939093013593505050565b6000806040838503121561522f57600080fd5b50508035926020909101359150565b60008060006060848603121561525357600080fd5b61525c846151a2565b925061526a602085016151a2565b9150604084013590509250925092565b60008060006060848603121561528f57600080fd5b505081359360208301359350604090920135919050565b801515811461416257600080fd5b600080604083850312156152c757600080fd5b6152d0836151a2565b915060208301356152e0816152a6565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff8084111561531c5761531c6152eb565b604051601f8501601f19908116603f01168101908282118183101715615344576153446152eb565b8160405280935085815286868601111561535d57600080fd5b858560208301376000602087830101525050509392505050565b60006020828403121561538957600080fd5b813567ffffffffffffffff8111156153a057600080fd5b8201601f810184136153b157600080fd5b6112c884823560208401615301565b600080600080608085870312156153d657600080fd5b6153df856151a2565b93506153ed602086016151a2565b925060408501359150606085013567ffffffffffffffff81111561541057600080fd5b8501601f8101871361542157600080fd5b61543087823560208401615301565b91505092959194509250565b6000806020838503121561544f57600080fd5b823567ffffffffffffffff8082111561546757600080fd5b818501915085601f83011261547b57600080fd5b81358181111561548a57600080fd5b86602082850101111561549c57600080fd5b60209290920196919550909350505050565b600080604083850312156154c157600080fd5b6154ca836151a2565b91506154d8602084016151a2565b90509250929050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561554857615548615518565b500290565b60008261556a57634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561558157615581615518565b500390565b60006020828403121561559857600080fd5b8151611c21816152a6565b600181811c908216806155b757607f821691505b60208210811415612bb657634e487b7160e01b600052602260045260246000fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561562057615620615518565b500190565b600181815b8085111561566057816000190482111561564657615646615518565b8085161561565357918102915b93841c939080029061562a565b509250929050565b60008261567757506001610e39565b8161568457506000610e39565b816001811461569a57600281146156a4576156c0565b6001915050610e39565b60ff8411156156b5576156b5615518565b50506001821b610e39565b5060208310610133831016604e8410600b84101617156156e3575081810a610e39565b6156ed8383615625565b806000190482111561570157615701615518565b029392505050565b6000611c218383615668565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601e908201527f66726f6e7420656e64207661756c7420646f6573206e6f742065786973740000604082015260600190565b602080825260139082015272119c9bdb9d08195b99081b9bdd081859191959606a1b604082015260600190565b60208082526014908201527315985d5b1d08191bd95cc81b9bdd08195e1a5cdd60621b604082015260600190565b6020808252600f908201526e36bab9ba103ab9b2903937baba32b960891b604082015260600190565b60006020828403121561583357600080fd5b5051919050565b60208082526021908201527f5661756c7420646562742063616e277420626520756e646572206d696e4465626040820152601d60fa1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60208082526019908201527f5661756c74206973206e6f74206f776e656420627920796f7500000000000000604082015260600190565b600060208083526000845481600182811c9150808316806158ea57607f831692505b85831081141561590857634e487b7160e01b85526022600452602485fd5b878601838152602001818015615925576001811461593657615961565b60ff19861682528782019650615961565b60008b81526020902060005b8681101561595b57815484820152908501908901615942565b83019750505b50949998505050505050505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613e2990830184615163565b600060208284031215615a1d57600080fd5b8151611c2181615104565b60008251615a3a818460208701615137565b919091019291505056fea2646970667358221220a32b230f4f713d160a5f7cae503b1a0745c211b2d12dab1f73bbd30f88c0ab4764736f6c634300080b0033000000000000000000000000639fe6ab55c921f74e7fac1ee960c0b6293ba612000000000000000000000000000000000000000000000000000000000000009b00000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000dfa46478f9e5ea86d57387849598dbfb2e964b020000000000000000000000004200000000000000000000000000000000000042000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000124f7074696d69736d204d4149205661756c74000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000054f504d56540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d5a426f38344478626b485a6d6b43504d79704e7559377867436877556157737a4d3556384173706a6f6533760000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061052f5760003560e01c80638da5cb5b116102af578063cc02ce2211610172578063e0df5b6f116100d9578063ece1373211610092578063ece1373214610b90578063f17336d714610ba3578063f1c91fa614610bac578063f2fde38b14610bb5578063f887ea4014610bc8578063ffc73da714610bdb57600080fd5b8063e0df5b6f14610b14578063e5f4dc9214610b27578063e985e9c514610b30578063eac989f814610b6c578063eb6a887d14610b74578063ec2e0ab314610b8757600080fd5b8063d0064c001161012b578063d0064c0014610a92578063d310f49b14610a9b578063d4a9b2c514610aae578063d73464cc14610ace578063d8dfeb4514610aee578063df98784614610b0157600080fd5b8063cc02ce2214610a46578063cd44db1b14610a59578063cdfedd6314610a63578063cea55f5714610a6e578063cf41d6f814610a77578063cf5f0f3c14610a7f57600080fd5b8063a57ff50311610216578063b3229a63116101cf578063b3229a63146109de578063b86f6aef146109f1578063b88d4fde14610a04578063c0d7865514610a17578063c71abb3214610a2a578063c87b56dd14610a3357600080fd5b8063a57ff50314610989578063a5e9883714610992578063a7c6a1001461099a578063a9c904b5146109a3578063b165ff0b146109b6578063b26025aa146109d657600080fd5b806397a41b8e1161026857806397a41b8e1461091f57806397ff37b91461093257806398c3f2db1461095257806398d721e01461095a578063a0be06f91461096d578063a22cb4651461097657600080fd5b80638da5cb5b146108c55780639035e4cb146108d657806393ee476a146108e957806394cd4ba7146108fc578063952cc86a1461090457806395d89b411461091757600080fd5b806342f371c6116103f75780636352211e1161035e57806370a082311161031757806370a0823114610868578063715018a61461087b578063728bbbb514610883578063767a7b051461088c57806385e290a31461089f57806386375994146108b257600080fd5b80636352211e146107f657806363b8817c146108095780636526941b1461081c578063687e8c171461082f5780636bc855cc14610842578063704b6c021461085557600080fd5b806356572ac0116103b057806356572ac01461078f578063570b2b84146107a25780635d12928b146107b55780635f84f302146107bd5780635ff09ac2146107d05780636234dc21146107e357600080fd5b806342f371c6146107145780634c19386c146107275780634f558e79146107305780634f6ccce7146107435780635357b9891461075657806354fd4d501461076957600080fd5b806321a78f681161049b5780633128ef27116104545780633128ef27146106a257806338536275146106b55780633db99177146106c857806340803854146106db57806342842e0e146106ee57806342966c681461070157600080fd5b806321a78f681461063757806323b872dd1461064a578063241a545a1461065d5780632df87573146106665780632f745c5914610686578063311f392a1461069957600080fd5b8063081812fc116104ed578063081812fc146105cc578063095ea7b3146105df5780630b78f9c0146105f257806311b4a8321461060557806318160ddd146106265780631c883e7b1461062e57600080fd5b806263750c1461053457806301ffc9a71461053e578063048c661d1461056657806304d7aef21461059157806306fdde03146105a457806307960532146105b9575b600080fd5b61053c610bee565b005b61055161054c36600461511a565b610e2e565b60405190151581526020015b60405180910390f35b602354610579906001600160a01b031681565b6040516001600160a01b03909116815260200161055d565b602454610579906001600160a01b031681565b6105ac610e3f565b60405161055d919061518f565b61053c6105c73660046151be565b610ed1565b6105796105da3660046151d9565b610fb4565b61053c6105ed3660046151f2565b61103c565b61053c61060036600461521c565b611152565b6106186106133660046151d9565b61121e565b60405190815260200161055d565b600954610618565b610618600f5481565b602554610579906001600160a01b031681565b61053c61065836600461523e565b6112d0565b61061860135481565b6106186106743660046151d9565b60156020526000908152604090205481565b6106186106943660046151f2565b611301565b610618601b5481565b61053c6106b036600461527a565b611397565b61053c6106c33660046151d9565b6116b8565b61053c6106d63660046151d9565b611717565b61053c6106e93660046151d9565b6117d6565b61053c6106fc36600461523e565b611900565b61053c61070f3660046151d9565b61191b565b600c54610579906001600160a01b031681565b61061860205481565b61055161073e3660046151d9565b611ad9565b6106186107513660046151d9565b611ae4565b61061861076436600461527a565b611b77565b60265461077d90600160a01b900460ff1681565b60405160ff909116815260200161055d565b61061861079d3660046151d9565b611c28565b601d54610579906001600160a01b031681565b610618611d22565b61053c6107cb3660046151d9565b611d8b565b61053c6107de3660046151d9565b611dea565b61053c6107f13660046151d9565b611f82565b6105796108043660046151d9565b611fe1565b61053c6108173660046151be565b612058565b61053c61082a3660046151d9565b61211c565b61055161083d36600461521c565b61217b565b61053c6108503660046151be565b6121aa565b61053c6108633660046151be565b612278565b6106186108763660046151be565b612346565b61053c6123cd565b61061860105481565b61053c61089a36600461521c565b612403565b61053c6108ad3660046151d9565b612605565b61053c6108c03660046151d9565b612786565b6027546001600160a01b0316610579565b6106186108e43660046151d9565b612845565b6106186108f73660046151d9565b612bbc565b610618612c23565b61053c61091236600461521c565b612c95565b6105ac613179565b61053c61092d36600461527a565b613188565b6106186109403660046151d9565b60166020526000908152604090205481565b610618613567565b61053c6109683660046151be565b6135b1565b61061860185481565b61053c6109843660046152b4565b61368b565b610618601e5481565b600f54610618565b610618600e5481565b61053c6109b1366004615377565b61369a565b6106186109c43660046151be565b60216020526000908152604090205481565b610618613707565b6105516109ec3660046151d9565b613793565b6105516109ff3660046151d9565b61384d565b61053c610a123660046153c0565b6138f0565b61053c610a253660046151be565b613928565b610618601f5481565b6105ac610a413660046151d9565b613974565b61053c610a5436600461521c565b613a1a565b6305f5e100610618565b6106186305f5e10081565b610618601a5481565b61053c613b8f565b61053c610a8d36600461527a565b613c47565b61061860125481565b610618610aa93660046151d9565b613d95565b610618610abc3660046151d9565b60146020526000908152604090205481565b610618610adc3660046151d9565b60176020526000908152604090205481565b601c54610579906001600160a01b031681565b610618610b0f3660046151d9565b613da1565b61053c610b2236600461543c565b613e33565b610618600d5481565b610551610b3e3660046154ae565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205460ff1690565b6105ac613e9a565b61053c610b823660046151d9565b613f28565b61061860195481565b61053c610b9e36600461521c565b613fcf565b61061860115481565b61061860225481565b61053c610bc33660046151be565b6140ca565b602654610579906001600160a01b031681565b61053c610be93660046151d9565b614165565b6025546001600160a01b0316331480610c1157506024546001600160a01b031633145b80610c35575033610c2a6027546001600160a01b031690565b6001600160a01b0316145b610c865760405162461bcd60e51b815260206004820152601f60248201527f4e6565647320746f2062652063616c6c6564206279206f70657261746f72730060448201526064015b60405180910390fd5b60026000541415610ca95760405162461bcd60e51b8152600401610c7d906154e1565b6002600090815560185460225461271091610cc39161552e565b610ccd919061554d565b601d546025546022549293506001600160a01b039182169263a9059cbb9290911690610cfa90859061556f565b6040516001600160e01b031960e085901b1681526001600160a01b03909216600483015260248201526044016020604051808303816000875af1158015610d45573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d699190615586565b50601d546024805460405163a9059cbb60e01b81526001600160a01b0391821660048201529182018490529091169063a9059cbb906044016020604051808303816000875af1158015610dc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de49190615586565b507fc73fb14682b9d51008c1faff296cc9b351c0597de5e25b4ffa158f47f8254e4c602254604051610e1891815260200190565b60405180910390a1506000602281905560019055565b6000610e39826142e5565b92915050565b606060018054610e4e906155a3565b80601f0160208091040260200160405190810160405280929190818152602001828054610e7a906155a3565b8015610ec75780601f10610e9c57610100808354040283529160200191610ec7565b820191906000526020600020905b815481529060010190602001808311610eaa57829003601f168201915b5050505050905090565b6027546001600160a01b03163314610efb5760405162461bcd60e51b8152600401610c7d906155d8565b6001600160a01b038116610f5f5760405162461bcd60e51b815260206004820152602560248201527f4574687072696365736f757263652063616e6e6f74206265207a65726f206164604482015264647265737360d81b6064820152608401610c7d565b600c80546001600160a01b0319166001600160a01b0383169081179091556040519081527fc525e5fed1508c998d3f14bf52f933df1dd16dbf48e2944c426be721e268b755906020015b60405180910390a150565b6000610fbf8261430a565b6110205760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c7d565b506000908152600560205260409020546001600160a01b031690565b600061104782611fe1565b9050806001600160a01b0316836001600160a01b031614156110b55760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610c7d565b336001600160a01b03821614806110d157506110d18133610b3e565b6111435760405162461bcd60e51b815260206004820152603860248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760448201527f6e6572206e6f7220617070726f76656420666f7220616c6c00000000000000006064820152608401610c7d565b61114d8383614327565b505050565b6027546001600160a01b0316331461117c5760405162461bcd60e51b8152600401610c7d906155d8565b612710611189828461560d565b146111d65760405162461bcd60e51b815260206004820152601a60248201527f736574466565733a206d75737420657175616c2031303030302e0000000000006044820152606401610c7d565b6018829055601981905560408051838152602081018390527f4d32f38862d5eb71edfefb7955873bd55920dc98159b6f53f8be62fbf0bebb4b91015b60405180910390a15050565b60008061122a83613d95565b6000848152601460205260409020549091501580611246575080155b8061125757506112558361384d565b155b156112655750600092915050565b60008381526014602052604081205461127e9083614395565b91505080611290575060009392505050565b601f5461129e90600a615709565b6112a8908261554d565b90506000601a54826112ba919061554d565b905060115481116112c85750805b949350505050565b6112da338261441e565b6112f65760405162461bcd60e51b8152600401610c7d90615715565b61114d838383614507565b600061130c83612346565b821061136e5760405162461bcd60e51b815260206004820152602b60248201527f455243373231456e756d657261626c653a206f776e657220696e646578206f7560448201526a74206f6620626f756e647360a81b6064820152608401610c7d565b506001600160a01b03919091166000908152600760209081526040808320938352929052205490565b806113a18161430a565b6113bd5760405162461bcd60e51b8152600401610c7d90615766565b600081815260176020526040902054612710108015906113ea575060008181526017602052604090205415155b6114065760405162461bcd60e51b8152600401610c7d9061579d565b836114108161430a565b61142c5760405162461bcd60e51b8152600401610c7d906157ca565b6026546001600160a01b0316158061144e57506026546001600160a01b031633145b61146a5760405162461bcd60e51b8152600401610c7d906157f8565b601d546040516370a0823160e01b815233600482015285916001600160a01b0316906370a0823190602401602060405180830381865afa1580156114b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d69190615821565b101561151c5760405162461bcd60e51b8152602060048201526015602482015274546f6b656e2062616c616e636520746f6f206c6f7760581b6044820152606401610c7d565b600061152786612bbc565b9050848110156115895760405162461bcd60e51b815260206004820152602760248201527f5661756c742064656274206c657373207468616e20616d6f756e7420746f20706044820152666179206261636b60c81b6064820152608401610c7d565b601154611596868361556f565b1015806115a257508085145b6115be5760405162461bcd60e51b8152600401610c7d9061583a565b600f5460008581526017602052604081205490916115dd918890611b77565b90506115e9868361556f565b60008881526015602090815260408083209390935560149052205461160f90829061556f565b60008881526014602052604080822092909255868152205461163290829061560d565b6000868152601460209081526040909120919091555461165390879061556f565b602055601d5461166e906001600160a01b03163330896146ae565b60408051888152602081018890529081018290527f31f96762af4051f367185773cc2f55bfb112a6c114b3407ded1f321a9eb199ac9060600160405180910390a150505050505050565b6027546001600160a01b031633146116e25760405162461bcd60e51b8152600401610c7d906155d8565b600d8190556040518181527fc0880963f3abc486dbb8b8f04ba4ce47c5b5cd3c59b6b7655f6011da0bf3365090602001610fa9565b6027546001600160a01b031633146117415760405162461bcd60e51b8152600401610c7d906155d8565b6101f48111156117a15760405162461bcd60e51b815260206004820152602560248201527f736574436c6f73696e674665653a2063616e6e6f74206265206d6f7265207468604482015264616e20352560d81b6064820152608401610c7d565b600f8190556040518181527fc1b83121984ef8e824a0babc08fc162077c0716a4dc307121f306e6dfb13806c90602001610fa9565b6027546001600160a01b031633146118005760405162461bcd60e51b8152600401610c7d906155d8565b6118098161430a565b61185f5760405162461bcd60e51b815260206004820152602160248201527f61646446726f6e74456e643a205661756c7420646f6573206e6f7420657869736044820152601d60fa1b6064820152608401610c7d565b600081815260176020526040902054156118bb5760405162461bcd60e51b815260206004820152601a60248201527f61646446726f6e74456e643a20616c72656164792061646465640000000000006044820152606401610c7d565b600081815260176020526040908190206127109055517f9d7c7013bbd38c45562efb3f7031f740c1f8b8886dbbf421142755ed68339f4c90610fa99083815260200190565b61114d838383604051806020016040528060008152506138f0565b6024546001600160a01b031633146119755760405162461bcd60e51b815260206004820152601b60248201527f4e6565647320746f2062652063616c6c65642062792061646d696e00000000006044820152606401610c7d565b601d546040516370a0823160e01b81523060048201526001600160a01b03909116906370a0823190602401602060405180830381865afa1580156119bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e19190615821565b8110611a2f5760405162461bcd60e51b815260206004820152601860248201527f6275726e3a2042616c616e6365206e6f7420656e6f75676800000000000000006044820152606401610c7d565b601d5460255460405163a9059cbb60e01b81526001600160a01b0391821660048201526024810184905291169063a9059cbb906044016020604051808303816000875af1158015611a84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa89190615586565b506040518181527fb1f67ade07cda330ac167f4fcc4c01b94fdfc04d401cf85e487f0a5b8b98e75f90602001610fa9565b6000610e398261430a565b6000611aef60095490565b8210611b525760405162461bcd60e51b815260206004820152602c60248201527f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60448201526b7574206f6620626f756e647360a01b6064820152608401610c7d565b60098281548110611b6557611b6561587b565b90600052602060002001549050919050565b6000808215611bd55761271080611b8c613567565b611b96919061552e565b611ba0919061552e565b836305f5e100611bb0888861552e565b611bba919061552e565b611bc4919061552e565b611bce919061554d565b9050611c10565b612710611be0613567565b611bea919061552e565b6305f5e100611bf9878761552e565b611c03919061552e565b611c0d919061554d565b90505b601e54611c1d908261554d565b9150505b9392505050565b6000818152601460205260408120541580611c495750611c478261384d565b155b15611c5657506000919050565b6000611c6183613d95565b60008481526014602052604081205491925090611c7e9083614395565b9150506000601a5482611c91919061554d565b905080611ca357506000949350505050565b601154601f54611cb490600a615709565b611cbe908361554d565b11611d0657601e54611cce613567565b6103e8601b5485611cdf919061552e565b611ce9919061554d565b611cf3919061554d565b611cfd919061554d565b95945050505050565b601e54611d11613567565b6103e8601b5484611cdf919061552e565b600e54600090611d3381600161560d565b600e819055811115611d4457600080fd5b611d4e3382614719565b604080518281523360208201527f8b6c1d05c678fa59695e26465a85918ce0fc63a88f74af53d1daef8f0a9c7804910160405180910390a1919050565b6027546001600160a01b03163314611db55760405162461bcd60e51b8152600401610c7d906155d8565b60138190556040518181527f323264e3ca065ee856fe1b11204d8896a783bccf148380ac5d7362eb5c4c36a890602001610fa9565b80611df48161430a565b611e105760405162461bcd60e51b8152600401610c7d90615766565b60008181526017602052604090205461271010801590611e3d575060008181526017602052604090205415155b611e595760405162461bcd60e51b8152600401610c7d9061579d565b6027546001600160a01b03163314611e835760405162461bcd60e51b8152600401610c7d906155d8565b611e8c8261430a565b611ee45760405162461bcd60e51b8152602060048201526024808201527f72656d6f766546726f6e74456e643a205661756c7420646f6573206e6f7420656044820152631e1a5cdd60e21b6064820152608401610c7d565b600082815260176020526040902054611f3f5760405162461bcd60e51b815260206004820152601f60248201527f72656d6f766546726f6e74456e643a206e6f7420612066726f6e7420656e64006044820152606401610c7d565b60008281526017602052604080822091909155517f9b9f950fb3755096dbbe8b1519e73f7c6d1a0507f514fced444919530c00d719906112129084815260200190565b6027546001600160a01b03163314611fac5760405162461bcd60e51b8152600401610c7d906155d8565b60118190556040518181527f4533506fbaba6b18743358b6e6fb9392e8cb21757487b68d232a01b140bbec0190602001610fa9565b6000818152600360205260408120546001600160a01b031680610e395760405162461bcd60e51b815260206004820152602960248201527f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460448201526832b73a103a37b5b2b760b91b6064820152608401610c7d565b6002600054141561207b5760405162461bcd60e51b8152600401610c7d906154e1565b600260009081556001600160a01b0382168152602160205260409020546120e45760405162461bcd60e51b815260206004820152601c60248201527f446f6e2774206861766520616e797468696e6720666f7220796f752e000000006044820152606401610c7d565b6001600160a01b0380821660009081526021602052604081208054919055601c54909161211391168383614858565b50506001600055565b6027546001600160a01b031633146121465760405162461bcd60e51b8152600401610c7d906155d8565b60128190556040518181527f1dd8f42ee4750a70f6662d1383372472422592497256d506437e35b3fa914d9b90602001610fa9565b600080600061218a8585614395565b9092509050600061219b828461554d565b600d5411159695505050505050565b6027546001600160a01b031633146121d45760405162461bcd60e51b8152600401610c7d906155d8565b6001600160a01b03811661222a5760405162461bcd60e51b815260206004820181905260248201527f5265666572656e636520416464726573732063616e6e6f74206265207a65726f6044820152606401610c7d565b602580546001600160a01b0319166001600160a01b0383169081179091556040519081527f8ed6553fa1e634b0152cd3539c572bee8c662e446820646d73a0e1b47776af9390602001610fa9565b6027546001600160a01b031633146122a25760405162461bcd60e51b8152600401610c7d906155d8565b6001600160a01b0381166122f85760405162461bcd60e51b815260206004820152601c60248201527f41646d696e20416464726573732063616e6e6f74206265207a65726f000000006044820152606401610c7d565b602480546001600160a01b0319166001600160a01b0383169081179091556040519081527ffce52dd00c7849a7f2602c1f189745238d6a2db16fabf54376ce24cc2fa3d57f90602001610fa9565b60006001600160a01b0382166123b15760405162461bcd60e51b815260206004820152602a60248201527f4552433732313a2062616c616e636520717565727920666f7220746865207a65604482015269726f206164647265737360b01b6064820152608401610c7d565b506001600160a01b031660009081526004602052604090205490565b6027546001600160a01b031633146123f75760405162461bcd60e51b8152600401610c7d906155d8565b6124016000614888565b565b8161240d8161430a565b6124295760405162461bcd60e51b8152600401610c7d906157ca565b3361243382611fe1565b6001600160a01b0316146124595760405162461bcd60e51b8152600401610c7d90615891565b6002600054141561247c5760405162461bcd60e51b8152600401610c7d906154e1565b60026000908155838152601460205260409020548211156124ed5760405162461bcd60e51b815260206004820152602560248201527f5661756c7420646f6573206e6f74206861766520656e6f75676820636f6c6c616044820152641d195c985b60da1b6064820152608401610c7d565b60008381526014602052604081205461250790849061556f565b9050600061251485612bbc565b9050801561259857612526828261217b565b6125985760405162461bcd60e51b815260206004820152603e60248201527f5769746864726177616c20776f756c6420707574207661756c742062656c6f7760448201527f206d696e696d756d20636f6c6c61746572616c2070657263656e7461676500006064820152608401610c7d565b6000858152601460205260409020829055601c546125c0906001600160a01b03163386614858565b60408051868152602081018690527f6c0ea3bea9dd66afa8f9d39d6eb93d833466190330813b42835efc650dca4cb9910160405180910390a150506001600055505050565b8061260f8161430a565b61262b5760405162461bcd60e51b8152600401610c7d906157ca565b3361263582611fe1565b6001600160a01b03161461265b5760405162461bcd60e51b8152600401610c7d90615891565b6002600054141561267e5760405162461bcd60e51b8152600401610c7d906154e1565b600260005561268c82613d95565b156126d95760405162461bcd60e51b815260206004820152601a60248201527f5661756c7420686173206f75747374616e64696e6720646562740000000000006044820152606401610c7d565b6000828152601460205260409020541561271b5761271b6126f983611fe1565b600084815260146020526040902054601c546001600160a01b03169190614858565b612724826148da565b600082815260146020908152604080832083905560158252808320839055601682528083209290925590518381527f4fe08624ee65b341c38ab9693d216b909d4ddee1bc8d3fe0fea14026c361b465910160405180910390a150506001600055565b6027546001600160a01b031633146127b05760405162461bcd60e51b8152600401610c7d906155d8565b6101f48111156128105760405162461bcd60e51b815260206004820152602560248201527f7365744f70656e696e674665653a2063616e6e6f74206265206d6f7265207468604482015264616e20352560d81b6064820152608401610c7d565b60108190556040518181527fc4ced91ca77dc4287a54d9bd9b15c69b3aba262e30eba7c93301c48606019c9490602001610fa9565b6000816128518161430a565b61286d5760405162461bcd60e51b8152600401610c7d906157ca565b6023546001600160a01b0316158061288f57506023546001600160a01b031633145b6128db5760405162461bcd60e51b815260206004820181905260248201527f627579207269736b792069732064697361626c656420666f72207075626c69636044820152606401610c7d565b60006128e684612bbc565b9050806129275760405162461bcd60e51b815260206004820152600f60248201526e05661756c742064656274206973203608c1b6044820152606401610c7d565b60008481526014602052604081205481906129429084614395565b90925090506000612953828461554d565b601b5490915061296482600a61552e565b11156129c95760405162461bcd60e51b815260206004820152602e60248201527f5661756c74206973206e6f742062656c6f77207269736b7920636f6c6c61746560448201526d72616c2070657263656e7461676560901b6064820152608401610c7d565b6000601f54600a6129da9190615709565b600d546129e7919061552e565b6129f1908561554d565b601f546129ff90600a615709565b612a09908561554d565b612a13919061556f565b601d546040516370a0823160e01b815233600482015291925082916001600160a01b03909116906370a0823190602401602060405180830381865afa158015612a60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a849190615821565b1015612ae05760405162461bcd60e51b815260206004820152602560248201527f4e6f7420656e6f756768206d616920746f2062757920746865207269736b79206044820152641d985d5b1d60da1b6064820152608401610c7d565b601d54612af8906001600160a01b03163330846146ae565b80602054612b06919061556f565b6020556000612b13611d22565b60008a815260146020526040808220548383529120559050612b35828761556f565b600082815260156020818152604080842094909455601681528383204290558c8352601481528383208390559081528282209190915581518b815290810183905233818301526060810184905290517fa4cf7276e26bb566de2c7540759e85736eb743807343fd27e6e679b20e8814419181900360800190a1965050505050505b50919050565b6000806000612bca84614981565b9150915081602254612bdc919061560d565b602255602054612bed90839061560d565b60205560135415612c0a5760008481526016602052604090204290555b6000938452601560205260409093208390555090919050565b601d546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015612c6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612c909190615821565b905090565b80612c9f8161430a565b612cbb5760405162461bcd60e51b8152600401610c7d90615766565b60008181526017602052604090205461271010801590612ce8575060008181526017602052604090205415155b612d045760405162461bcd60e51b8152600401610c7d9061579d565b82612d0e8161430a565b612d2a5760405162461bcd60e51b8152600401610c7d906157ca565b6023546001600160a01b03161580612d4c57506023546001600160a01b031633145b612da35760405162461bcd60e51b815260206004820152602260248201527f6c69717569646174696f6e2069732064697361626c656420666f72207075626c604482015261696360f01b6064820152608401610c7d565b6000612dae85612bbc565b600086815260146020526040812054919250908190612dcd9084614395565b915091508260001415612e145760405162461bcd60e51b815260206004820152600f60248201526e05661756c742064656274206973203608c1b6044820152606401610c7d565b6000612e20828461554d565b9050600d548110612e8c5760405162461bcd60e51b815260206004820152603060248201527f5661756c74206973206e6f742062656c6f77206d696e696d756d20636f6c6c6160448201526f746572616c2070657263656e7461676560801b6064820152608401610c7d565b601b54612e9a82600a61552e565b11612ee75760405162461bcd60e51b815260206004820152601d60248201527f5661756c74206973206e6f742061626f7665206761696e20726174696f0000006044820152606401610c7d565b601f54612ef590600a615709565b612eff908361554d565b91506000601a5483612f11919061554d565b90506011548111612f1f5750815b601d546040516370a0823160e01b815233600482015282916001600160a01b0316906370a0823190602401602060405180830381865afa158015612f67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f8b9190615821565b1015612ff35760405162461bcd60e51b815260206004820152603160248201527f546f6b656e2062616c616e636520746f6f206c6f7720746f20706179206f6666604482015270081bdd5d1cdd185b991a5b99c81919589d607a1b6064820152608401610c7d565b80602054613001919061556f565b602055600061300f8a611c28565b905061301b828761556f565b60008b815260156020908152604080832093909355600f548c8352601790915291812054909161304c918590611b77565b60008c81526014602052604090205490915061306990829061556f565b60008c815260146020526040808220929092558b8152205461308c90829061560d565b60008b815260146020526040808220929092558c815220546130af90839061556f565b60008c8152601460209081526040808320939093553382526021905220546130d890839061560d565b33600081815260216020526040902091909155601d54613105916001600160a01b039091169030866146ae565b7f4d151d3a98b83151d51917640c221f8c8e3c054422ea1b48dcbbd57e3f4210d58b6131308d611fe1565b604080519283526001600160a01b0390911660208301523390820152606081018590526080810184905260a0810183905260c00160405180910390a15050505050505050505050565b606060028054610e4e906155a3565b806131928161430a565b6131ae5760405162461bcd60e51b8152600401610c7d90615766565b600081815260176020526040902054612710108015906131db575060008181526017602052604090205415155b6131f75760405162461bcd60e51b8152600401610c7d9061579d565b836132018161430a565b61321d5760405162461bcd60e51b8152600401610c7d906157ca565b3361322782611fe1565b6001600160a01b03161461324d5760405162461bcd60e51b8152600401610c7d90615891565b600260005414156132705760405162461bcd60e51b8152600401610c7d906154e1565b6002600055836132c25760405162461bcd60e51b815260206004820152601b60248201527f4d75737420626f72726f77206e6f6e2d7a65726f20616d6f756e7400000000006044820152606401610c7d565b6132ca612c23565b8411156133315760405162461bcd60e51b815260206004820152602f60248201527f626f72726f77546f6b656e3a2043616e6e6f74206d696e74206f76657220617660448201526e30b4b630b136329039bab838363c9760891b6064820152608401610c7d565b60008461333d87612bbc565b613347919061560d565b90506012548111156133a65760405162461bcd60e51b815260206004820152602260248201527f626f72726f77546f6b656e3a206d6178206c6f616e2063617020726561636865604482015261321760f11b6064820152608401610c7d565b6133af86613d95565b81116133ba57600080fd5b6000868152601460205260409020546133d3908261217b565b6134455760405162461bcd60e51b815260206004820152603a60248201527f426f72726f7720776f756c6420707574207661756c742062656c6f77206d696e60448201527f696d756d20636f6c6c61746572616c2070657263656e746167650000000000006064820152608401610c7d565b6011548561345288613d95565b61345c919061560d565b101561347a5760405162461bcd60e51b8152600401610c7d9061583a565b600086815260156020908152604080832084905560105487845260179092528220546134a891908490611b77565b6000888152601460205260409020549091506134c590829061556f565b6000888152601460205260408082209290925586815220546134e890829061560d565b600086815260146020526040902055601d5461350e906001600160a01b03163388614858565b8560205461351c919061560d565b6020908155604080518981529182018890527f3e08df88d8e28f37df9bf227d3142ac506a364403445661a60891a49ed6792ca910160405180910390a1505060016000555050505050565b600c54604080516350d25bcd60e01b815290516000926001600160a01b0316916350d25bcd9160048083019260209291908290030181865afa158015612c6c573d6000803e3d6000fd5b6027546001600160a01b031633146135db5760405162461bcd60e51b8152600401610c7d906155d8565b6001600160a01b03811661363d5760405162461bcd60e51b8152602060048201526024808201527f53746162696c697479506f6f6c2063616e6e6f74206265207a65726f206164646044820152637265737360e01b6064820152608401610c7d565b602380546001600160a01b0319166001600160a01b0383169081179091556040519081527f0644c4f539d7f787d2287c12d9425e80aefc8bdae99c70af4ca66fb0742577e890602001610fa9565b613696338383614a26565b5050565b6027546001600160a01b031633146136c45760405162461bcd60e51b8152600401610c7d906155d8565b80516136d7906028906020840190614ff7565b507f0d82453dd4ad18b5ce3db08c34a39340ad2bf15046a7d0e86aa075483eb121d881604051610fa9919061518f565b601c546040516370a0823160e01b81523060048201526000916001600160a01b0316906370a0823190602401602060405180830381865afa158015613750573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137749190615821565b601e5461377f613567565b613789919061552e565b612c90919061552e565b60008161379f8161430a565b6137bb5760405162461bcd60e51b8152600401610c7d906157ca565b60006137c684613d95565b60008581526014602052604090205490915015806137e2575080155b156137f1576000925050612bb6565b600084815260146020526040812054819061380c9084614395565b9092509050600061381d828461554d565b601b5490915061382e82600a61552e565b11613840576001955050505050612bb6565b6000955050505050612bb6565b6000816138598161430a565b6138755760405162461bcd60e51b8152600401610c7d906157ca565b600061388084613d95565b600085815260146020526040902054909150158061389c575080155b156138ab576000925050612bb6565b60008481526014602052604081205481906138c69084614395565b909250905060006138d7828461554d565b9050600d54811015613840576001955050505050612bb6565b6138fa338361441e565b6139165760405162461bcd60e51b8152600401610c7d90615715565b61392284848484614af5565b50505050565b6027546001600160a01b031633146139525760405162461bcd60e51b8152600401610c7d906155d8565b602680546001600160a01b0319166001600160a01b0392909216919091179055565b606061397f8261430a565b61398857600080fd5b600b8054613995906155a3565b80601f01602080910402602001604051908101604052809291908181526020018280546139c1906155a3565b8015613a0e5780601f106139e357610100808354040283529160200191613a0e565b820191906000526020600020905b8154815290600101906020018083116139f157829003601f168201915b50505050509050919050565b81613a248161430a565b613a405760405162461bcd60e51b8152600401610c7d90615766565b60008181526017602052604090205461271010801590613a6d575060008181526017602052604090205415155b613a895760405162461bcd60e51b8152600401610c7d9061579d565b82613a938161430a565b613aaf5760405162461bcd60e51b8152600401610c7d906157ca565b33613ab982611fe1565b6001600160a01b031614613adf5760405162461bcd60e51b8152600401610c7d90615891565b600083118015613af157506127108311155b613b3d5760405162461bcd60e51b815260206004820152601b60248201527f75706461746546726f6e74456e643a2063616e6e6f74206265203000000000006044820152606401610c7d565b60008481526017602090815260409182902085905581518681529081018590527fbfdd5aecf44aa804bf11f070a41765d280dab82adbfd1c55e1e85b7d5b7920b491015b60405180910390a150505050565b60026000541415613bb25760405162461bcd60e51b8152600401610c7d906154e1565b6002600090815533815260216020526040902054613c125760405162461bcd60e51b815260206004820152601c60248201527f446f6e2774206861766520616e797468696e6720666f7220796f752e000000006044820152606401610c7d565b3360008181526021602052604081208054919055601c549091613c3f916001600160a01b03169083614858565b506001600055565b80613c518161430a565b613c6d5760405162461bcd60e51b8152600401610c7d90615766565b60008181526017602052604090205461271010801590613c9a575060008181526017602052604090205415155b613cb65760405162461bcd60e51b8152600401610c7d9061579d565b83613cc08161430a565b613cdc5760405162461bcd60e51b8152600401610c7d906157ca565b6026546001600160a01b03161580613cfe57506026546001600160a01b031633145b613d1a5760405162461bcd60e51b8152600401610c7d906157f8565b42841015613d755760405162461bcd60e51b815260206004820152602260248201527f7061796261636b546f6b656e416c6c3a20646561646c696e6520657870697265604482015261321760f11b6064820152608401610c7d565b6000613d8086612bbc565b9050613d8d868286611397565b505050505050565b6000806112c883614981565b600081613dad8161430a565b613dc95760405162461bcd60e51b8152600401610c7d906157ca565b6000613dd484613d95565b6000858152601460205260409020549091501580613df0575080155b15613dff576000925050612bb6565b6000848152601460205260408120548190613e1a9084614395565b9092509050613e29818361554d565b9695505050505050565b6027546001600160a01b03163314613e5d5760405162461bcd60e51b8152600401610c7d906155d8565b613e69600b838361507b565b507ffda45751019c07e08a3ebf7d73a4aea1a6c36bee12d87089096012911a756ab5600b60405161121291906158c8565b600b8054613ea7906155a3565b80601f0160208091040260200160405190810160405280929190818152602001828054613ed3906155a3565b8015613f205780601f10613ef557610100808354040283529160200191613f20565b820191906000526020600020905b815481529060010190602001808311613f0357829003601f168201915b505050505081565b6027546001600160a01b03163314613f525760405162461bcd60e51b8152600401610c7d906155d8565b601a54613f9a5760405162461bcd60e51b815260206004820152601660248201527504465627420526174696f2063616e6e6f7420626520360541b6044820152606401610c7d565b601a8190556040518181527f199e93b2fae27b389e2d09761871573f60121b8521be96b8f28c83bf94846ac290602001610fa9565b81613fd98161430a565b613ff55760405162461bcd60e51b8152600401610c7d906157ca565b6026546001600160a01b0316158061401757506026546001600160a01b031633145b6140335760405162461bcd60e51b8152600401610c7d906157f8565b60008381526014602052604081205461404d90849061560d565b60008581526014602052604090205490915081101561406b57600080fd5b6000848152601460205260409020819055601c54614094906001600160a01b03163330866146ae565b60408051858152602081018590527f52c4e7127ec34e8fc95f09ce2d06b4f00acca12ccbcdfb246ef67ee6aefe068d9101613b81565b6027546001600160a01b031633146140f45760405162461bcd60e51b8152600401610c7d906155d8565b6001600160a01b0381166141595760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610c7d565b61416281614888565b50565b6027546001600160a01b0316331461418f5760405162461bcd60e51b8152600401610c7d906155d8565b6103e88110156141f85760405162461bcd60e51b815260206004820152602e60248201527f6761696e526174696f2063616e6e6f74206265206c657373207468616e206f7260448201526d020657175616c20746f20313030360941b6064820152608401610c7d565b601b8190556040518181527fb6d384ad48d9c5c042c81fa0f88d8061ef87b38475101d6aa5f9ae5a8274a64e90602001610fa9565b6001600160a01b0383166142885761428381600980546000838152600a60205260408120829055600182018355919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af0155565b6142ab565b816001600160a01b0316836001600160a01b0316146142ab576142ab8382614b28565b6001600160a01b0382166142c25761114d81614bc5565b826001600160a01b0316826001600160a01b03161461114d5761114d8282614c74565b60006001600160e01b0319821663780e9d6360e01b1480610e395750610e3982614cb8565b6000908152600360205260409020546001600160a01b0316151590565b600081815260056020526040902080546001600160a01b0319166001600160a01b038416908117909155819061435c82611fe1565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000806143a0613567565b6143a957600080fd5b6000601e546143b6613567565b6143c0908761552e565b6143ca919061552e565b9050848110156143d957600080fd5b60006143e96305f5e1008661552e565b9050848110156143f857600080fd5b600061440583606461552e565b905082811161441357600080fd5b969095509350505050565b60006144298261430a565b61448a5760405162461bcd60e51b815260206004820152602c60248201527f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610c7d565b600061449583611fe1565b9050806001600160a01b0316846001600160a01b031614806144dc57506001600160a01b0380821660009081526006602090815260408083209388168352929052205460ff165b806112c85750836001600160a01b03166144f584610fb4565b6001600160a01b031614949350505050565b826001600160a01b031661451a82611fe1565b6001600160a01b03161461457e5760405162461bcd60e51b815260206004820152602560248201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060448201526437bbb732b960d91b6064820152608401610c7d565b6001600160a01b0382166145e05760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610c7d565b6145eb838383614d08565b6145f6600082614327565b6001600160a01b038316600090815260046020526040812080546001929061461f90849061556f565b90915550506001600160a01b038216600090815260046020526040812080546001929061464d90849061560d565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b0386811691821790925591518493918716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b6040516001600160a01b03808516602483015283166044820152606481018290526139229085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152614d13565b6001600160a01b03821661476f5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610c7d565b6147788161430a565b156147c55760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610c7d565b6147d160008383614d08565b6001600160a01b03821660009081526004602052604081208054600192906147fa90849061560d565b909155505060008181526003602052604080822080546001600160a01b0319166001600160a01b03861690811790915590518392907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6040516001600160a01b03831660248201526044810182905261114d90849063a9059cbb60e01b906064016146e2565b602780546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60006148e582611fe1565b90506148f381600084614d08565b6148fe600083614327565b6001600160a01b038116600090815260046020526040812080546001929061492790849061556f565b909155505060008281526003602052604080822080546001600160a01b0319169055518391906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b6000818152601560209081526040808320546016909252822054829142918390158015906149b157506000601354115b15614a1c576000868152601660205260408120546149cf908561556f565b905060006127106301e1855883866013546149ea919061552e565b6149f4919061552e565b6149fe919061554d565b614a08919061554d565b9250829050614a17848261560d565b935050505b9590945092505050565b816001600160a01b0316836001600160a01b03161415614a885760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610c7d565b6001600160a01b03838116600081815260066020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b614b00848484614507565b614b0c84848484614de5565b6139225760405162461bcd60e51b8152600401610c7d90615970565b60006001614b3584612346565b614b3f919061556f565b600083815260086020526040902054909150808214614b92576001600160a01b03841660009081526007602090815260408083208584528252808320548484528184208190558352600890915290208190555b5060009182526008602090815260408084208490556001600160a01b039094168352600781528383209183525290812055565b600954600090614bd79060019061556f565b6000838152600a602052604081205460098054939450909284908110614bff57614bff61587b565b906000526020600020015490508060098381548110614c2057614c2061587b565b6000918252602080832090910192909255828152600a90915260408082208490558582528120556009805480614c5857614c586159c2565b6001900381819060005260206000200160009055905550505050565b6000614c7f83612346565b6001600160a01b039093166000908152600760209081526040808320868452825280832085905593825260089052919091209190915550565b60006001600160e01b031982166380ac58cd60e01b1480614ce957506001600160e01b03198216635b5e139f60e01b145b80610e3957506301ffc9a760e01b6001600160e01b0319831614610e39565b61114d83838361422d565b6000614d68826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316614ee39092919063ffffffff16565b80519091501561114d5780806020019051810190614d869190615586565b61114d5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610c7d565b60006001600160a01b0384163b15614ed857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290614e299033908990889088906004016159d8565b6020604051808303816000875af1925050508015614e64575060408051601f3d908101601f19168201909252614e6191810190615a0b565b60015b614ebe573d808015614e92576040519150601f19603f3d011682016040523d82523d6000602084013e614e97565b606091505b508051614eb65760405162461bcd60e51b8152600401610c7d90615970565b805181602001fd5b6001600160e01b031916630a85bd0160e11b1490506112c8565b506001949350505050565b60606112c88484600085856001600160a01b0385163b614f455760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610c7d565b600080866001600160a01b03168587604051614f619190615a28565b60006040518083038185875af1925050503d8060008114614f9e576040519150601f19603f3d011682016040523d82523d6000602084013e614fa3565b606091505b5091509150614fb3828286614fbe565b979650505050505050565b60608315614fcd575081611c21565b825115614fdd5782518084602001fd5b8160405162461bcd60e51b8152600401610c7d919061518f565b828054615003906155a3565b90600052602060002090601f016020900481019282615025576000855561506b565b82601f1061503e57805160ff191683800117855561506b565b8280016001018555821561506b579182015b8281111561506b578251825591602001919060010190615050565b506150779291506150ef565b5090565b828054615087906155a3565b90600052602060002090601f0160209004810192826150a9576000855561506b565b82601f106150c25782800160ff1982351617855561506b565b8280016001018555821561506b579182015b8281111561506b5782358255916020019190600101906150d4565b5b8082111561507757600081556001016150f0565b6001600160e01b03198116811461416257600080fd5b60006020828403121561512c57600080fd5b8135611c2181615104565b60005b8381101561515257818101518382015260200161513a565b838111156139225750506000910152565b6000815180845261517b816020860160208601615137565b601f01601f19169290920160200192915050565b602081526000611c216020830184615163565b80356001600160a01b03811681146151b957600080fd5b919050565b6000602082840312156151d057600080fd5b611c21826151a2565b6000602082840312156151eb57600080fd5b5035919050565b6000806040838503121561520557600080fd5b61520e836151a2565b946020939093013593505050565b6000806040838503121561522f57600080fd5b50508035926020909101359150565b60008060006060848603121561525357600080fd5b61525c846151a2565b925061526a602085016151a2565b9150604084013590509250925092565b60008060006060848603121561528f57600080fd5b505081359360208301359350604090920135919050565b801515811461416257600080fd5b600080604083850312156152c757600080fd5b6152d0836151a2565b915060208301356152e0816152a6565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b600067ffffffffffffffff8084111561531c5761531c6152eb565b604051601f8501601f19908116603f01168101908282118183101715615344576153446152eb565b8160405280935085815286868601111561535d57600080fd5b858560208301376000602087830101525050509392505050565b60006020828403121561538957600080fd5b813567ffffffffffffffff8111156153a057600080fd5b8201601f810184136153b157600080fd5b6112c884823560208401615301565b600080600080608085870312156153d657600080fd5b6153df856151a2565b93506153ed602086016151a2565b925060408501359150606085013567ffffffffffffffff81111561541057600080fd5b8501601f8101871361542157600080fd5b61543087823560208401615301565b91505092959194509250565b6000806020838503121561544f57600080fd5b823567ffffffffffffffff8082111561546757600080fd5b818501915085601f83011261547b57600080fd5b81358181111561548a57600080fd5b86602082850101111561549c57600080fd5b60209290920196919550909350505050565b600080604083850312156154c157600080fd5b6154ca836151a2565b91506154d8602084016151a2565b90509250929050565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600081600019048311821515161561554857615548615518565b500290565b60008261556a57634e487b7160e01b600052601260045260246000fd5b500490565b60008282101561558157615581615518565b500390565b60006020828403121561559857600080fd5b8151611c21816152a6565b600181811c908216806155b757607f821691505b60208210811415612bb657634e487b7160e01b600052602260045260246000fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000821982111561562057615620615518565b500190565b600181815b8085111561566057816000190482111561564657615646615518565b8085161561565357918102915b93841c939080029061562a565b509250929050565b60008261567757506001610e39565b8161568457506000610e39565b816001811461569a57600281146156a4576156c0565b6001915050610e39565b60ff8411156156b5576156b5615518565b50506001821b610e39565b5060208310610133831016604e8410600b84101617156156e3575081810a610e39565b6156ed8383615625565b806000190482111561570157615701615518565b029392505050565b6000611c218383615668565b60208082526031908201527f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f6040820152701ddb995c881b9bdc88185c1c1c9bdd9959607a1b606082015260800190565b6020808252601e908201527f66726f6e7420656e64207661756c7420646f6573206e6f742065786973740000604082015260600190565b602080825260139082015272119c9bdb9d08195b99081b9bdd081859191959606a1b604082015260600190565b60208082526014908201527315985d5b1d08191bd95cc81b9bdd08195e1a5cdd60621b604082015260600190565b6020808252600f908201526e36bab9ba103ab9b2903937baba32b960891b604082015260600190565b60006020828403121561583357600080fd5b5051919050565b60208082526021908201527f5661756c7420646562742063616e277420626520756e646572206d696e4465626040820152601d60fa1b606082015260800190565b634e487b7160e01b600052603260045260246000fd5b60208082526019908201527f5661756c74206973206e6f74206f776e656420627920796f7500000000000000604082015260600190565b600060208083526000845481600182811c9150808316806158ea57607f831692505b85831081141561590857634e487b7160e01b85526022600452602485fd5b878601838152602001818015615925576001811461593657615961565b60ff19861682528782019650615961565b60008b81526020902060005b8681101561595b57815484820152908501908901615942565b83019750505b50949998505050505050505050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b634e487b7160e01b600052603160045260246000fd5b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090613e2990830184615163565b600060208284031215615a1d57600080fd5b8151611c2181615104565b60008251615a3a818460208701615137565b919091019291505056fea2646970667358221220a32b230f4f713d160a5f7cae503b1a0745c211b2d12dab1f73bbd30f88c0ab4764736f6c634300080b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000639fe6ab55c921f74e7fac1ee960c0b6293ba612000000000000000000000000000000000000000000000000000000000000009b00000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000dfa46478f9e5ea86d57387849598dbfb2e964b020000000000000000000000004200000000000000000000000000000000000042000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000000124f7074696d69736d204d4149205661756c74000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000054f504d56540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035697066733a2f2f516d5a426f38344478626b485a6d6b43504d79704e7559377867436877556157737a4d3556384173706a6f6533760000000000000000000000
-----Decoded View---------------
Arg [0] : ethPriceSourceAddress (address): 0x639Fe6ab55C921f74e7fac1ee960C0B6293ba612
Arg [1] : minimumCollateralPercentage (uint256): 155
Arg [2] : name (string): Optimism MAI Vault
Arg [3] : symbol (string): OPMVT
Arg [4] : _mai (address): 0xdFA46478F9e5EA86d57387849598dbFB2e964b02
Arg [5] : _collateral (address): 0x4200000000000000000000000000000000000042
Arg [6] : baseURI (string): ipfs://QmZBo84DxbkHZmkCPMypNuY7xgChwUaWszM5V8Aspjoe3v
-----Encoded View---------------
14 Constructor Arguments found :
Arg [0] : 000000000000000000000000639fe6ab55c921f74e7fac1ee960c0b6293ba612
Arg [1] : 000000000000000000000000000000000000000000000000000000000000009b
Arg [2] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [4] : 000000000000000000000000dfa46478f9e5ea86d57387849598dbfb2e964b02
Arg [5] : 0000000000000000000000004200000000000000000000000000000000000042
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000160
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000012
Arg [8] : 4f7074696d69736d204d4149205661756c740000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000005
Arg [10] : 4f504d5654000000000000000000000000000000000000000000000000000000
Arg [11] : 0000000000000000000000000000000000000000000000000000000000000035
Arg [12] : 697066733a2f2f516d5a426f38344478626b485a6d6b43504d79704e75593778
Arg [13] : 67436877556157737a4d3556384173706a6f6533760000000000000000000000
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$2,509.34
Net Worth in ETH
0.85692
Token Allocations
OP
58.45%
USDC
25.81%
SFRXETH
15.74%
Multichain Portfolio | 35 Chains
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.