More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 25 from a total of 190,184 transactions
| Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Repay Borrow | 27924881 | 2 days ago | IN | 0.00000024 ETH | 0.00000049 | ||||
| Transfer | 27795146 | 5 days ago | IN | 0 ETH | 0.00000238 | ||||
| Transfer | 27795128 | 5 days ago | IN | 0 ETH | 0.00000238 | ||||
| Transfer | 27439918 | 12 days ago | IN | 0 ETH | 0.00000014 | ||||
| Transfer | 26989047 | 22 days ago | IN | 0 ETH | 0.00000039 | ||||
| Transfer | 26988710 | 22 days ago | IN | 0 ETH | 0.00000021 | ||||
| Redeem Underlyin... | 26988668 | 22 days ago | IN | 0 ETH | 0.00000007 | ||||
| Redeem | 26503438 | 31 days ago | IN | 0 ETH | 0.0000037 | ||||
| Redeem Underlyin... | 26503363 | 31 days ago | IN | 0 ETH | 0.00000013 | ||||
| Redeem | 26418937 | 32 days ago | IN | 0 ETH | 0.00000017 | ||||
| Redeem | 26340513 | 34 days ago | IN | 0 ETH | 0.00000023 | ||||
| Redeem | 26339850 | 34 days ago | IN | 0 ETH | 0.00000024 | ||||
| Redeem Underlyin... | 26338282 | 34 days ago | IN | 0 ETH | 0.00000024 | ||||
| Redeem Underlyin... | 26338281 | 34 days ago | IN | 0 ETH | 0.00000024 | ||||
| Mint | 26338279 | 34 days ago | IN | 0.031 ETH | 0.00000012 | ||||
| Redeem | 26318114 | 34 days ago | IN | 0 ETH | 0.00000022 | ||||
| Redeem | 26000126 | 40 days ago | IN | 0 ETH | 0.00000016 | ||||
| Approve | 25998031 | 40 days ago | IN | 0 ETH | 0.00000006 | ||||
| Redeem Underlyin... | 25974206 | 40 days ago | IN | 0 ETH | 0.00000014 | ||||
| Redeem Underlyin... | 25974205 | 40 days ago | IN | 0 ETH | 0.00000017 | ||||
| Repay Borrow | 25974202 | 40 days ago | IN | 0 ETH | 0.00000028 | ||||
| Redeem Underlyin... | 25974166 | 40 days ago | IN | 0 ETH | 0.00000016 | ||||
| Redeem Underlyin... | 25974165 | 40 days ago | IN | 0 ETH | 0.00000016 | ||||
| Repay Borrow | 25974163 | 40 days ago | IN | 0 ETH | 0.00000027 | ||||
| Borrow | 25447968 | 49 days ago | IN | 0 ETH | 0.00000008 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 26988668 | 22 days ago | 4 wei | ||||
| 26338281 | 34 days ago | 0.03099999 ETH | ||||
| 25974205 | 40 days ago | 0 ETH | ||||
| 25974165 | 40 days ago | 0 ETH | ||||
| 25073908 | 55 days ago | 0.0002 ETH | ||||
| 24698682 | 63 days ago | 0.00001002 ETH | ||||
| 24689435 | 63 days ago | 0.00000003 ETH | ||||
| 24604302 | 65 days ago | 0.02553462 ETH | ||||
| 24604287 | 65 days ago | 0.00188755 ETH | ||||
| 24604227 | 65 days ago | 0.0354833 ETH | ||||
| 24604220 | 65 days ago | 0.00045898 ETH | ||||
| 24485847 | 67 days ago | 0 ETH | ||||
| 24446498 | 68 days ago | 0.00000003 ETH | ||||
| 24369925 | 69 days ago | 0.00054319 ETH | ||||
| 24369695 | 69 days ago | 0.00009999 ETH | ||||
| 24369606 | 69 days ago | 0.00046999 ETH | ||||
| 24369543 | 69 days ago | 0.00038308 ETH | ||||
| 24369514 | 69 days ago | 0.00048643 ETH | ||||
| 24369484 | 69 days ago | 0.00059777 ETH | ||||
| 24369454 | 69 days ago | 0.00049265 ETH | ||||
| 24369390 | 69 days ago | 0.00039297 ETH | ||||
| 24369359 | 69 days ago | 0.00032016 ETH | ||||
| 23740623 | 81 days ago | 0 ETH | ||||
| 23383498 | 88 days ago | 0.00000001 ETH | ||||
| 23144135 | 92 days ago | 0.00000247 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
REther
Compiler Version
v0.8.23+commit.f704f362
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.10;
import "./RToken.sol";
/**
* @title Compound's CEther Contract
* @notice RToken which wraps Ether
* @author Compound
*/
contract REther is RToken {
address public underlying = address(0);
/**
* @notice Construct a new CEther money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate, scaled by 1e18
* @param name_ ERC-20 name of this token
* @param symbol_ ERC-20 symbol of this token
* @param decimals_ ERC-20 decimal precision of this token
* @param admin_ Address of the administrator of this token
*/
constructor(
ComptrollerInterface comptroller_,
InterestRateModel interestRateModel_,
uint256 initialExchangeRateMantissa_,
string memory name_,
string memory symbol_,
uint8 decimals_,
address payable admin_
) {
// Creator of the contract is admin during initialization
admin = payable(msg.sender);
initialize(comptroller_, interestRateModel_, initialExchangeRateMantissa_, name_, symbol_, decimals_);
// Set the proper admin now that initialization is done
admin = admin_;
}
/**
* User Interface **
*/
/**
* @notice Sender supplies assets into the market and receives cTokens in exchange
* @dev Reverts upon any failure
*/
function mint() external payable {
mintInternal(msg.value);
}
/**
* @notice Sender redeems cTokens in exchange for the underlying asset
* @dev Accrues interest whether or not the operation succeeds, unless reverted
* @param redeemTokens The number of cTokens to redeem into underlying
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function redeem(uint256 redeemTokens) external returns (Error) {
redeemInternal(redeemTokens);
return Error.NO_ERROR;
}
/**
* @notice Sender redeems cTokens in exchange for a specified amount of underlying asset
* @dev Accrues interest whether or not the operation succeeds, unless reverted
* @param redeemAmount The amount of underlying to redeem
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function redeemUnderlying(uint256 redeemAmount) external returns (Error) {
redeemUnderlyingInternal(redeemAmount);
return Error.NO_ERROR;
}
/**
* @notice Sender borrows assets from the protocol to their own address
* @param borrowAmount The amount of the underlying asset to borrow
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function borrow(uint256 borrowAmount) external returns (Error) {
borrowInternal(borrowAmount);
return Error.NO_ERROR;
}
/**
* @notice Sender repays their own borrow
* @dev Reverts upon any failure
*/
function repayBorrow() external payable {
repayBorrowInternal(msg.value);
}
/// @notice Indicator that this is a ETH Derivative
function isEthDerivative() public view virtual override returns (bool) {
return true;
}
/**
* @notice Sender repays a borrow belonging to borrower
* @dev Reverts upon any failure
* @param borrower the account with the debt being payed off
*/
function repayBorrowBehalf(address borrower) external payable {
repayBorrowBehalfInternal(borrower, msg.value);
}
/**
* @notice The sender liquidates the borrowers collateral.
* The collateral seized is transferred to the liquidator.
* @dev Reverts upon any failure
* @param borrower The borrower of this rToken to be liquidated
* @param rfTokenCollateral The market in which to seize collateral from the borrower
*/
function liquidateBorrow(address borrower, RToken rfTokenCollateral) external payable {
liquidateBorrowInternal(borrower, msg.value, rfTokenCollateral);
}
/**
* @notice The sender adds to reserves.
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function _addReserves() external payable returns (uint256) {
return _addReservesInternal(msg.value);
}
/**
* @notice Send Ether to CEther to mint
*/
receive() external payable {
mintInternal(msg.value);
}
/**
* Safe Token **
*/
/**
* @notice Gets balance of this contract in terms of Ether, before this message
* @dev This excludes the value of the current message, if any
* @return The quantity of Ether owned by this contract
*/
function getCashPrior() internal view override returns (uint256) {
return address(this).balance - msg.value;
}
/**
* @notice A public function to sweep accidental ERC-20 transfers to this contract. Tokens are sent to admin (timelock)
*/
function sweepToken() external {
require(msg.sender == admin, "REther::sweepToken: only admin can sweep tokens");
uint256 balance = address(this).balance;
require(balance > 0, "No ether left to send");
(bool sent,) = payable(admin).call{value: balance}("");
require(sent, "Failed to send Ether");
}
/**
* @notice Perform the actual transfer in, which is a no-op
* @param from Address sending the Ether
* @param amount Amount of Ether being sent
* @return The actual amount of Ether transferred
*/
function doTransferIn(address from, uint256 amount) internal override returns (uint256) {
// Sanity checks
require(msg.sender == from, "sender mismatch");
require(msg.value == amount, "value mismatch");
return amount;
}
function doTransferOut(address payable to, uint256 amount) internal virtual override {
/* Send the Ether, with minimal gas and revert on failure */
to.transfer(amount);
}
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.23;
import "./ComptrollerInterface.sol";
import "./RTokenInterfaces.sol";
import "./ErrorReporter.sol";
import "./Exponential.sol";
import "./EIP20Interface.sol";
import "./irm/InterestRateModel.sol";
/**
* @title RToken Contract
* @notice Abstract base for RTokens
*/
abstract contract RToken is RTokenInterface, Exponential, TokenErrorReporter {
/**
* @notice Initialize the money market
* @param comptroller_ The address of the Comptroller
* @param interestRateModel_ The address of the interest rate model
* @param initialExchangeRateMantissa_ The initial exchange rate, scaled by 1e18
* @param name_ EIP-20 name of this token
* @param symbol_ EIP-20 symbol of this token
* @param decimals_ EIP-20 decimal precision of this token
*/
function initialize(
ComptrollerInterface comptroller_,
InterestRateModel interestRateModel_,
uint256 initialExchangeRateMantissa_,
string memory name_,
string memory symbol_,
uint8 decimals_
) public {
require(msg.sender == admin, "only admin may initialize the market");
require(accrualBlockNumber == 0 && borrowIndex == 0, "market may only be initialized once");
// Set initial exchange rate
initialExchangeRateMantissa = initialExchangeRateMantissa_;
require(initialExchangeRateMantissa > 0, "initial exchange rate must be greater than zero.");
// Set the comptroller
uint256 err = _setComptroller(comptroller_);
require(err == uint256(Error.NO_ERROR), "setting comptroller failed");
// Initialize block timestamp and borrow index (block timestamp mocks depend on comptroller being set)
accrualBlockNumber = getBlockNumber();
borrowIndex = mantissaOne;
// Set the interest rate model (depends on block timestamp / borrow index)
err = _setInterestRateModelFresh(interestRateModel_);
require(err == uint256(Error.NO_ERROR), "setting interest rate model failed");
name = name_;
symbol = symbol_;
decimals = decimals_;
// The counter starts true to prevent changing it from zero to non-zero (i.e. smaller cost/refund)
_notEntered = true;
}
/**
* @notice Transfer `tokens` tokens from `src` to `dst` by `spender`
* @dev Called by both `transfer` and `transferFrom` internally
* @param spender The address of the account performing the transfer
* @param src The address of the source account
* @param dst The address of the destination account
* @param tokens The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferTokens(address spender, address src, address dst, uint256 tokens) internal returns (uint256) {
/* Fail if transfer not allowed */
uint256 allowed = comptroller.transferAllowed(address(this), src, dst, tokens);
if (allowed != 0) {
return failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.TRANSFER_COMPTROLLER_REJECTION, allowed);
}
/* Do not allow self-transfers */
if (src == dst) {
return fail(Error.BAD_INPUT, FailureInfo.TRANSFER_NOT_ALLOWED);
}
/* Get the allowance, infinite for the account owner */
uint256 startingAllowance = 0;
if (spender == src) {
startingAllowance = type(uint256).max;
} else {
startingAllowance = transferAllowances[src][spender];
}
/* Do the calculations, checking for {under,over}flow */
MathError mathErr;
uint256 allowanceNew;
uint256 srcTokensNew;
uint256 dstTokensNew;
(mathErr, allowanceNew) = subUInt(startingAllowance, tokens);
if (mathErr != MathError.NO_ERROR) {
return fail(Error.MATH_ERROR, FailureInfo.TRANSFER_NOT_ALLOWED);
}
(mathErr, srcTokensNew) = subUInt(accountTokens[src], tokens);
if (mathErr != MathError.NO_ERROR) {
return fail(Error.MATH_ERROR, FailureInfo.TRANSFER_NOT_ENOUGH);
}
(mathErr, dstTokensNew) = addUInt(accountTokens[dst], tokens);
if (mathErr != MathError.NO_ERROR) {
return fail(Error.MATH_ERROR, FailureInfo.TRANSFER_TOO_MUCH);
}
/////////////////////////
// EFFECTS & INTERACTIONS
// (No safe failures beyond this point)
accountTokens[src] = srcTokensNew;
accountTokens[dst] = dstTokensNew;
/* Eat some of the allowance (if necessary) */
if (startingAllowance != type(uint256).max) {
transferAllowances[src][spender] = allowanceNew;
}
/* We emit a Transfer event */
emit Transfer(src, dst, tokens);
// unused function
// comptroller.transferVerify(address(this), src, dst, tokens);
return uint256(Error.NO_ERROR);
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param amount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint256 amount) external override nonReentrant returns (bool) {
return transferTokens(msg.sender, msg.sender, dst, amount) == uint256(Error.NO_ERROR);
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param amount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint256 amount) external override nonReentrant returns (bool) {
return transferTokens(msg.sender, src, dst, amount) == uint256(Error.NO_ERROR);
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param amount The number of tokens that are approved (uint.max means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint256 amount) external override returns (bool) {
address src = msg.sender;
transferAllowances[src][spender] = amount;
emit Approval(src, spender, amount);
return true;
}
/// @notice Indicator that this is a ETH Derivative
function isEthDerivative() public view virtual override returns (bool) {
return false;
}
/**
* @notice Get the current allowance from `owner` for `spender`
* @param owner The address of the account which owns the tokens to be spent
* @param spender The address of the account which may transfer tokens
* @return The number of tokens allowed to be spent (uint.max means infinite)
*/
function allowance(address owner, address spender) external view override returns (uint256) {
return transferAllowances[owner][spender];
}
/**
* @notice Get the token balance of the `owner`
* @param owner The address of the account to query
* @return The number of tokens owned by `owner`
*/
function balanceOf(address owner) external view override returns (uint256) {
return accountTokens[owner];
}
/**
* @notice Get the underlying balance of the `owner`
* @dev This also accrues interest in a transaction
* @param owner The address of the account to query
* @return The amount of underlying owned by `owner`
*/
function balanceOfUnderlying(address owner) external override returns (uint256) {
Exp memory exchangeRate = Exp({mantissa: exchangeRateCurrent()});
(MathError mErr, uint256 balance) = mulScalarTruncate(exchangeRate, accountTokens[owner]);
require(mErr == MathError.NO_ERROR, "balance could not be calculated");
return balance;
}
/**
* @notice Get a snapshot of the account's balances, and the cached exchange rate
* @dev This is used by comptroller to more efficiently perform liquidity checks.
* @param account Address of the account to snapshot
* @return (possible error, token balance, borrow balance, exchange rate mantissa)
*/
function getAccountSnapshot(address account) external view override returns (uint256, uint256, uint256, uint256) {
uint256 rTokenBalance = accountTokens[account];
uint256 borrowBalance;
uint256 exchangeRateMantissa;
MathError mErr;
(mErr, borrowBalance) = borrowBalanceStoredInternal(account);
if (mErr != MathError.NO_ERROR) {
return (uint256(Error.MATH_ERROR), 0, 0, 0);
}
(mErr, exchangeRateMantissa) = exchangeRateStoredInternal();
if (mErr != MathError.NO_ERROR) {
return (uint256(Error.MATH_ERROR), 0, 0, 0);
}
return (uint256(Error.NO_ERROR), rTokenBalance, borrowBalance, exchangeRateMantissa);
}
/**
* @dev Function to simply retrieve block timestamp
* This exists mainly for inheriting test contracts to stub this result.
*/
function getBlockNumber() internal view virtual returns (uint256) {
return block.number;
}
/**
* @notice Returns the current per-timestamp borrow interest rate for this rToken
* @return The borrow interest rate per timestamp, scaled by 1e18
*/
function borrowRatePerBlock() external view override returns (uint256) {
return interestRateModel.getBorrowRate(getCashPrior(), totalBorrows, totalReserves);
}
/**
* @notice Returns the current per-timestamp supply interest rate for this rToken
* @return The supply interest rate per timestamp, scaled by 1e18
*/
function supplyRatePerBlock() external view override returns (uint256) {
return interestRateModel.getSupplyRate(getCashPrior(), totalBorrows, totalReserves, reserveFactorMantissa);
}
/**
* @notice Returns the current total borrows plus accrued interest
* @return The total borrows with interest
*/
function totalBorrowsCurrent() external override nonReentrant returns (uint256) {
require(accrueInterest() == uint256(Error.NO_ERROR), "accrue interest failed");
return totalBorrows;
}
/**
* @notice Accrue interest to updated borrowIndex and then calculate account's borrow balance using the updated borrowIndex
* @param account The address whose balance should be calculated after updating borrowIndex
* @return The calculated balance
*/
function borrowBalanceCurrent(address account) external override nonReentrant returns (uint256) {
require(accrueInterest() == uint256(Error.NO_ERROR), "accrue interest failed");
return borrowBalanceStored(account);
}
/**
* @notice Return the borrow balance of account based on stored data
* @param account The address whose balance should be calculated
* @return The calculated balance
*/
function borrowBalanceStored(address account) public view override returns (uint256) {
(MathError err, uint256 result) = borrowBalanceStoredInternal(account);
require(err == MathError.NO_ERROR, "borrowBalanceStored: borrowBalanceStoredInternal failed");
return result;
}
/**
* @notice Return the borrow balance of account based on stored data
* @param account The address whose balance should be calculated
* @return (error code, the calculated balance or 0 if error code is non-zero)
*/
function borrowBalanceStoredInternal(address account) internal view returns (MathError, uint256) {
/* Note: we do not assert that the market is up to date */
MathError mathErr;
uint256 principalTimesIndex;
uint256 result;
/* Get borrowBalance and borrowIndex */
BorrowSnapshot storage borrowSnapshot = accountBorrows[account];
/* If borrowBalance = 0 then borrowIndex is likely also 0.
* Rather than failing the calculation with a division by 0, we immediately return 0 in this case.
*/
if (borrowSnapshot.principal == 0) {
return (MathError.NO_ERROR, 0);
}
/* Calculate new borrow balance using the interest index:
* recentBorrowBalance = borrower.borrowBalance * market.borrowIndex / borrower.borrowIndex
*/
(mathErr, principalTimesIndex) = mulUInt(borrowSnapshot.principal, borrowIndex);
if (mathErr != MathError.NO_ERROR) {
return (mathErr, 0);
}
(mathErr, result) = divUInt(principalTimesIndex, borrowSnapshot.interestIndex);
if (mathErr != MathError.NO_ERROR) {
return (mathErr, 0);
}
return (MathError.NO_ERROR, result);
}
/**
* @notice Accrue interest then return the up-to-date exchange rate
* @return Calculated exchange rate scaled by 1e18
*/
function exchangeRateCurrent() public override nonReentrant returns (uint256) {
require(accrueInterest() == uint256(Error.NO_ERROR), "accrue interest failed");
return exchangeRateStored();
}
/**
* @notice Calculates the exchange rate from the underlying to the RToken
* @dev This function does not accrue interest before calculating the exchange rate
* @return Calculated exchange rate scaled by 1e18
*/
function exchangeRateStored() public view override returns (uint256) {
(MathError err, uint256 result) = exchangeRateStoredInternal();
require(err == MathError.NO_ERROR, "exchangeRateStored: exchangeRateStoredInternal failed");
return result;
}
/**
* @notice Calculates the exchange rate from the underlying to the RToken
* @dev This function does not accrue interest before calculating the exchange rate
* @return (error code, calculated exchange rate scaled by 1e18)
*/
function exchangeRateStoredInternal() internal view virtual returns (MathError, uint256) {
uint256 _totalSupply = totalSupply;
if (_totalSupply == 0) {
/*
* If there are no tokens minted:
* exchangeRate = initialExchangeRate
*/
return (MathError.NO_ERROR, initialExchangeRateMantissa);
} else {
/*
* Otherwise:
* exchangeRate = (totalCash + totalBorrows - totalReserves) / totalSupply
*/
uint256 totalCash = getCashPrior();
uint256 cashPlusBorrowsMinusReserves;
Exp memory exchangeRate;
MathError mathErr;
(mathErr, cashPlusBorrowsMinusReserves) = addThenSubUInt(totalCash, totalBorrows, totalReserves);
if (mathErr != MathError.NO_ERROR) {
return (mathErr, 0);
}
(mathErr, exchangeRate) = getExp(cashPlusBorrowsMinusReserves, _totalSupply);
if (mathErr != MathError.NO_ERROR) {
return (mathErr, 0);
}
return (MathError.NO_ERROR, exchangeRate.mantissa);
}
}
/**
* @notice Get cash balance of this rToken in the underlying asset
* @return The quantity of underlying asset owned by this contract
*/
function getCash() external view override returns (uint256) {
return getCashPrior();
}
/**
* @notice Applies accrued interest to total borrows and reserves
* @dev This calculates interest accrued from the last checkpointed block
* up to the current block and writes new checkpoint to storage.
*/
function accrueInterest() public virtual override returns (uint256) {
/* Remember the initial block timestamp */
uint256 currentBlockNumber = getBlockNumber();
uint256 accrualBlockNumberPrior = accrualBlockNumber;
/* Short-circuit accumulating 0 interest */
if (accrualBlockNumberPrior == currentBlockNumber) {
return uint256(Error.NO_ERROR);
}
/* Read the previous values out of storage */
uint256 cashPrior = getCashPrior();
uint256 borrowsPrior = totalBorrows;
uint256 reservesPrior = totalReserves;
uint256 borrowIndexPrior = borrowIndex;
/* Calculate the current borrow interest rate */
uint256 borrowRateMantissa = interestRateModel.getBorrowRate(cashPrior, borrowsPrior, reservesPrior);
require(borrowRateMantissa <= borrowRateMaxMantissa, "borrow rate is absurdly high");
/* Calculate the number of blocks elapsed since the last accrual */
(MathError mathErr, uint256 blockDelta) = subUInt(currentBlockNumber, accrualBlockNumberPrior);
require(mathErr == MathError.NO_ERROR, "could not calculate block delta");
/*
* Calculate the interest accumulated into borrows and reserves and the new index:
* simpleInterestFactor = borrowRate * blockDelta
* interestAccumulated = simpleInterestFactor * totalBorrows
* totalBorrowsNew = interestAccumulated + totalBorrows
* totalReservesNew = interestAccumulated * reserveFactor + totalReserves
* borrowIndexNew = simpleInterestFactor * borrowIndex + borrowIndex
*/
Exp memory simpleInterestFactor;
uint256 interestAccumulated;
uint256 totalBorrowsNew;
uint256 totalReservesNew;
uint256 borrowIndexNew;
(mathErr, simpleInterestFactor) = mulScalar(Exp({mantissa: borrowRateMantissa}), blockDelta);
if (mathErr != MathError.NO_ERROR) {
return failOpaque(
Error.MATH_ERROR,
FailureInfo.ACCRUE_INTEREST_SIMPLE_INTEREST_FACTOR_CALCULATION_FAILED,
uint256(mathErr)
);
}
(mathErr, interestAccumulated) = mulScalarTruncate(simpleInterestFactor, borrowsPrior);
if (mathErr != MathError.NO_ERROR) {
return failOpaque(
Error.MATH_ERROR, FailureInfo.ACCRUE_INTEREST_ACCUMULATED_INTEREST_CALCULATION_FAILED, uint256(mathErr)
);
}
(mathErr, totalBorrowsNew) = addUInt(interestAccumulated, borrowsPrior);
if (mathErr != MathError.NO_ERROR) {
return failOpaque(
Error.MATH_ERROR, FailureInfo.ACCRUE_INTEREST_NEW_TOTAL_BORROWS_CALCULATION_FAILED, uint256(mathErr)
);
}
(mathErr, totalReservesNew) =
mulScalarTruncateAddUInt(Exp({mantissa: reserveFactorMantissa}), interestAccumulated, reservesPrior);
if (mathErr != MathError.NO_ERROR) {
return failOpaque(
Error.MATH_ERROR, FailureInfo.ACCRUE_INTEREST_NEW_TOTAL_RESERVES_CALCULATION_FAILED, uint256(mathErr)
);
}
(mathErr, borrowIndexNew) = mulScalarTruncateAddUInt(simpleInterestFactor, borrowIndexPrior, borrowIndexPrior);
if (mathErr != MathError.NO_ERROR) {
return failOpaque(
Error.MATH_ERROR, FailureInfo.ACCRUE_INTEREST_NEW_BORROW_INDEX_CALCULATION_FAILED, uint256(mathErr)
);
}
/////////////////////////
// EFFECTS & INTERACTIONS
// (No safe failures beyond this point)
/* We write the previously calculated values into storage */
accrualBlockNumber = currentBlockNumber;
borrowIndex = borrowIndexNew;
totalBorrows = totalBorrowsNew;
totalReserves = totalReservesNew;
/* We emit an AccrueInterest event */
emit AccrueInterest(cashPrior, interestAccumulated, borrowIndexNew, totalBorrowsNew);
return uint256(Error.NO_ERROR);
}
/**
* @notice Sender supplies assets into the market and receives rTokens in exchange
* @dev Accrues interest whether or not the operation succeeds, unless reverted
* @param mintAmount The amount of the underlying asset to supply
* @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual mint amount.
*/
function mintInternal(uint256 mintAmount) internal nonReentrant returns (uint256, uint256) {
uint256 error = accrueInterest();
if (error != uint256(Error.NO_ERROR)) {
// accrueInterest emits logs on errors, but we still want to log the fact that an attempted borrow failed
return (fail(Error(error), FailureInfo.MINT_ACCRUE_INTEREST_FAILED), 0);
}
// mintFresh emits the actual Mint event if successful and logs on errors, so we don't need to
return mintFresh(msg.sender, mintAmount);
}
struct MintLocalVars {
Error err;
MathError mathErr;
uint256 exchangeRateMantissa;
uint256 mintTokens;
uint256 totalSupplyNew;
uint256 accountTokensNew;
uint256 actualMintAmount;
}
/**
* @notice User supplies assets into the market and receives rTokens in exchange
* @dev Assumes interest has already been accrued up to the current block
* @param minter The address of the account which is supplying the assets
* @param mintAmount The amount of the underlying asset to supply
* @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual mint amount.
*/
function mintFresh(address minter, uint256 mintAmount) internal returns (uint256, uint256) {
/* Fail if mint not allowed */
uint256 allowed = comptroller.mintAllowed(address(this), minter, mintAmount);
if (allowed != 0) {
return (failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.MINT_COMPTROLLER_REJECTION, allowed), 0);
}
/* Verify market's block timestamp equals current block timestamp */
if (accrualBlockNumber != getBlockNumber()) {
return (fail(Error.MARKET_NOT_FRESH, FailureInfo.MINT_FRESHNESS_CHECK), 0);
}
MintLocalVars memory vars;
(vars.mathErr, vars.exchangeRateMantissa) = exchangeRateStoredInternal();
if (vars.mathErr != MathError.NO_ERROR) {
return (failOpaque(Error.MATH_ERROR, FailureInfo.MINT_EXCHANGE_RATE_READ_FAILED, uint256(vars.mathErr)), 0);
}
/////////////////////////
// EFFECTS & INTERACTIONS
// (No safe failures beyond this point)
/*
* We call `doTransferIn` for the minter and the mintAmount.
* Note: The rToken must handle variations between ERC-20 and GLMR underlying.
* `doTransferIn` reverts if anything goes wrong, since we can't be sure if
* side-effects occurred. The function returns the amount actually transferred,
* in case of a fee. On success, the rToken holds an additional `actualMintAmount`
* of cash.
*/
vars.actualMintAmount = doTransferIn(minter, mintAmount);
/*
* We get the current exchange rate and calculate the number of rTokens to be minted:
* mintTokens = actualMintAmount / exchangeRate
*/
(vars.mathErr, vars.mintTokens) =
divScalarByExpTruncate(vars.actualMintAmount, Exp({mantissa: vars.exchangeRateMantissa}));
require(vars.mathErr == MathError.NO_ERROR, "MINT_EXCHANGE_CALCULATION_FAILED");
/*
* We calculate the new total supply of rTokens and minter token balance, checking for overflow:
* totalSupplyNew = totalSupply + mintTokens
* accountTokensNew = accountTokens[minter] + mintTokens
*/
(vars.mathErr, vars.totalSupplyNew) = addUInt(totalSupply, vars.mintTokens);
require(vars.mathErr == MathError.NO_ERROR, "MINT_NEW_TOTAL_SUPPLY_CALCULATION_FAILED");
(vars.mathErr, vars.accountTokensNew) = addUInt(accountTokens[minter], vars.mintTokens);
require(vars.mathErr == MathError.NO_ERROR, "MINT_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED");
/* We write previously calculated values into storage */
totalSupply = vars.totalSupplyNew;
accountTokens[minter] = vars.accountTokensNew;
/* We emit a Mint event, and a Transfer event */
emit Mint(minter, vars.actualMintAmount, vars.mintTokens);
emit Transfer(address(this), minter, vars.mintTokens);
/* We call the defense hook */
// unused function
// comptroller.mintVerify(address(this), minter, vars.actualMintAmount, vars.mintTokens);
comptroller.enterAllMarkets(minter);
return (uint256(Error.NO_ERROR), vars.actualMintAmount);
}
/**
* @notice Sender redeems rTokens in exchange for the underlying asset
* @dev Accrues interest whether or not the operation succeeds, unless reverted
* @param redeemTokens The number of rTokens to redeem into underlying
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function redeemInternal(uint256 redeemTokens) internal nonReentrant returns (uint256) {
uint256 error = accrueInterest();
if (error != uint256(Error.NO_ERROR)) {
// accrueInterest emits logs on errors, but we still want to log the fact that an attempted redeem failed
return fail(Error(error), FailureInfo.REDEEM_ACCRUE_INTEREST_FAILED);
}
// redeemFresh emits redeem-specific logs on errors, so we don't need to
return redeemFresh(payable(msg.sender), redeemTokens, 0);
}
/**
* @notice Sender redeems rTokens in exchange for a specified amount of underlying asset
* @dev Accrues interest whether or not the operation succeeds, unless reverted
* @param redeemAmount The amount of underlying to receive from redeeming rTokens
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function redeemUnderlyingInternal(uint256 redeemAmount) internal nonReentrant returns (uint256) {
uint256 error = accrueInterest();
if (error != uint256(Error.NO_ERROR)) {
// accrueInterest emits logs on errors, but we still want to log the fact that an attempted redeem failed
return fail(Error(error), FailureInfo.REDEEM_ACCRUE_INTEREST_FAILED);
}
// redeemFresh emits redeem-specific logs on errors, so we don't need to
return redeemFresh(payable(msg.sender), 0, redeemAmount);
}
struct RedeemLocalVars {
Error err;
MathError mathErr;
uint256 exchangeRateMantissa;
uint256 redeemTokens;
uint256 redeemAmount;
uint256 totalSupplyNew;
uint256 accountTokensNew;
}
/**
* @notice User redeems rTokens in exchange for the underlying asset
* @dev Assumes interest has already been accrued up to the current block
* @param redeemer The address of the account which is redeeming the tokens
* @param redeemTokensIn The number of rTokens to redeem into underlying (only one of redeemTokensIn or redeemAmountIn may be non-zero)
* @param redeemAmountIn The number of underlying tokens to receive from redeeming rTokens (only one of redeemTokensIn or redeemAmountIn may be non-zero)
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function redeemFresh(address payable redeemer, uint256 redeemTokensIn, uint256 redeemAmountIn)
internal
returns (uint256)
{
require(redeemTokensIn == 0 || redeemAmountIn == 0, "one of redeemTokensIn or redeemAmountIn must be zero");
// check market balance min balance
uint256 totalCash = getCashPrior();
if (totalCash < minRedemptionCashRequire) {
return fail(Error.MARKET_LIQUIDITY_LOW, FailureInfo.REDEEM_MIN_BALANCE_NOT_MET);
}
RedeemLocalVars memory vars;
/* exchangeRate = invoke Exchange Rate Stored() */
Exp memory exchangeRate = Exp({mantissa: exchangeRateStored()});
/* If redeemTokensIn > 0: */
if (redeemTokensIn > 0) {
/*
* We calculate the exchange rate and the amount of underlying to be redeemed:
* redeemTokens = redeemTokensIn
* redeemAmount = redeemTokensIn x exchangeRateCurrent
*/
vars.redeemTokens = redeemTokensIn;
vars.redeemAmount = mul_ScalarTruncate(exchangeRate, redeemTokensIn);
} else {
/*
* We get the current exchange rate and calculate the amount to be redeemed:
* redeemTokens = redeemAmountIn / exchangeRate
* redeemAmount = redeemAmountIn
*/
vars.redeemTokens = div_(redeemAmountIn, exchangeRate);
vars.redeemAmount = mul_ScalarTruncate(exchangeRate, vars.redeemTokens);
}
/* Fail if redeem not allowed */
uint256 allowed = comptroller.redeemAllowed(address(this), redeemer, vars.redeemTokens);
if (allowed != 0) {
return failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.REDEEM_COMPTROLLER_REJECTION, allowed);
}
/* Verify market's block timestamp equals current block timestamp */
if (accrualBlockNumber != getBlockNumber()) {
return fail(Error.MARKET_NOT_FRESH, FailureInfo.REDEEM_FRESHNESS_CHECK);
}
/*
* We calculate the new total supply and redeemer balance, checking for underflow:
* totalSupplyNew = totalSupply - redeemTokens
* accountTokensNew = accountTokens[redeemer] - redeemTokens
*/
(vars.mathErr, vars.totalSupplyNew) = subUInt(totalSupply, vars.redeemTokens);
if (vars.mathErr != MathError.NO_ERROR) {
return failOpaque(
Error.MATH_ERROR, FailureInfo.REDEEM_NEW_TOTAL_SUPPLY_CALCULATION_FAILED, uint256(vars.mathErr)
);
}
(vars.mathErr, vars.accountTokensNew) = subUInt(accountTokens[redeemer], vars.redeemTokens);
if (vars.mathErr != MathError.NO_ERROR) {
return failOpaque(
Error.MATH_ERROR, FailureInfo.REDEEM_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED, uint256(vars.mathErr)
);
}
/* Fail gracefully if protocol has insufficient cash */
if (getCashPrior() < vars.redeemAmount) {
return fail(Error.TOKEN_INSUFFICIENT_CASH, FailureInfo.REDEEM_TRANSFER_OUT_NOT_POSSIBLE);
}
/////////////////////////
// EFFECTS & INTERACTIONS
// (No safe failures beyond this point)
/* We write previously calculated values into storage */
totalSupply = vars.totalSupplyNew;
accountTokens[redeemer] = vars.accountTokensNew;
/* We emit a Transfer event, and a Redeem event */
emit Transfer(redeemer, address(this), vars.redeemTokens);
emit Redeem(redeemer, vars.redeemAmount, vars.redeemTokens);
/* We call the defense hook */
comptroller.redeemVerify(address(this), redeemer, vars.redeemAmount, vars.redeemTokens);
/*
* We invoke doTransferOut for the redeemer and the redeemAmount.
* Note: The rToken must handle variations between ERC-20 and GLMR underlying.
* On success, the rToken has redeemAmount less of cash.
* doTransferOut reverts if anything goes wrong, since we can't be sure if side effects occurred.
*/
doTransferOut(redeemer, vars.redeemAmount);
return uint256(Error.NO_ERROR);
}
/**
* @notice Sender borrows assets from the protocol to their own address
* @param borrowAmount The amount of the underlying asset to borrow
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function borrowInternal(uint256 borrowAmount) internal nonReentrant returns (uint256) {
uint256 error = accrueInterest();
if (error != uint256(Error.NO_ERROR)) {
// accrueInterest emits logs on errors, but we still want to log the fact that an attempted borrow failed
return fail(Error(error), FailureInfo.BORROW_ACCRUE_INTEREST_FAILED);
}
// borrowFresh emits borrow-specific logs on errors, so we don't need to
return borrowFresh(payable(msg.sender), borrowAmount);
}
struct BorrowLocalVars {
MathError mathErr;
uint256 accountBorrows;
uint256 accountBorrowsNew;
uint256 totalBorrowsNew;
}
/**
* @notice Users borrow assets from the protocol to their own address
* @param borrowAmount The amount of the underlying asset to borrow
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function borrowFresh(address payable borrower, uint256 borrowAmount) internal returns (uint256) {
/* Fail if borrow not allowed */
uint256 allowed = comptroller.borrowAllowed(address(this), borrower, borrowAmount);
if (allowed != 0) {
return failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.BORROW_COMPTROLLER_REJECTION, allowed);
}
/* Verify market's block timestamp equals current block timestamp */
if (accrualBlockNumber != getBlockNumber()) {
return fail(Error.MARKET_NOT_FRESH, FailureInfo.BORROW_FRESHNESS_CHECK);
}
/* Fail gracefully if protocol has insufficient underlying cash */
if (getCashPrior() < borrowAmount) {
return fail(Error.TOKEN_INSUFFICIENT_CASH, FailureInfo.BORROW_CASH_NOT_AVAILABLE);
}
BorrowLocalVars memory vars;
/*
* We calculate the new borrower and total borrow balances, failing on overflow:
* accountBorrowsNew = accountBorrows + borrowAmount
* totalBorrowsNew = totalBorrows + borrowAmount
*/
(vars.mathErr, vars.accountBorrows) = borrowBalanceStoredInternal(borrower);
if (vars.mathErr != MathError.NO_ERROR) {
return failOpaque(
Error.MATH_ERROR, FailureInfo.BORROW_ACCUMULATED_BALANCE_CALCULATION_FAILED, uint256(vars.mathErr)
);
}
(vars.mathErr, vars.accountBorrowsNew) = addUInt(vars.accountBorrows, borrowAmount);
if (vars.mathErr != MathError.NO_ERROR) {
return failOpaque(
Error.MATH_ERROR,
FailureInfo.BORROW_NEW_ACCOUNT_BORROW_BALANCE_CALCULATION_FAILED,
uint256(vars.mathErr)
);
}
(vars.mathErr, vars.totalBorrowsNew) = addUInt(totalBorrows, borrowAmount);
if (vars.mathErr != MathError.NO_ERROR) {
return failOpaque(
Error.MATH_ERROR, FailureInfo.BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED, uint256(vars.mathErr)
);
}
/////////////////////////
// EFFECTS & INTERACTIONS
// (No safe failures beyond this point)
/* We write the previously calculated values into storage */
accountBorrows[borrower].principal = vars.accountBorrowsNew;
accountBorrows[borrower].interestIndex = borrowIndex;
totalBorrows = vars.totalBorrowsNew;
/* We emit a Borrow event */
emit Borrow(borrower, borrowAmount, vars.accountBorrowsNew, vars.totalBorrowsNew);
/*
* We invoke doTransferOut for the borrower and the borrowAmount.
* Note: The rToken must handle variations between ERC-20 and GLMR underlying.
* On success, the rToken borrowAmount less of cash.
* doTransferOut reverts if anything goes wrong, since we can't be sure if side effects occurred.
*/
doTransferOut(borrower, borrowAmount);
/* We call the defense hook */
// unused function
// comptroller.borrowVerify(address(this), borrower, borrowAmount);
return uint256(Error.NO_ERROR);
}
/**
* @notice Sender repays their own borrow
* @param repayAmount The amount to repay
* @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount.
*/
function repayBorrowInternal(uint256 repayAmount) internal nonReentrant returns (uint256, uint256) {
uint256 error = accrueInterest();
if (error != uint256(Error.NO_ERROR)) {
// accrueInterest emits logs on errors, but we still want to log the fact that an attempted borrow failed
return (fail(Error(error), FailureInfo.REPAY_BORROW_ACCRUE_INTEREST_FAILED), 0);
}
// repayBorrowFresh emits repay-borrow-specific logs on errors, so we don't need to
return repayBorrowFresh(msg.sender, msg.sender, repayAmount);
}
/**
* @notice Sender repays a borrow belonging to borrower
* @param borrower the account with the debt being payed off
* @param repayAmount The amount to repay
* @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount.
*/
function repayBorrowBehalfInternal(address borrower, uint256 repayAmount)
internal
nonReentrant
returns (uint256, uint256)
{
uint256 error = accrueInterest();
if (error != uint256(Error.NO_ERROR)) {
// accrueInterest emits logs on errors, but we still want to log the fact that an attempted borrow failed
return (fail(Error(error), FailureInfo.REPAY_BEHALF_ACCRUE_INTEREST_FAILED), 0);
}
// repayBorrowFresh emits repay-borrow-specific logs on errors, so we don't need to
return repayBorrowFresh(msg.sender, borrower, repayAmount);
}
struct RepayBorrowLocalVars {
Error err;
MathError mathErr;
uint256 repayAmount;
uint256 borrowerIndex;
uint256 accountBorrows;
uint256 accountBorrowsNew;
uint256 totalBorrowsNew;
uint256 actualRepayAmount;
}
/**
* @notice Borrows are repaid by another user (possibly the borrower).
* @param payer the account paying off the borrow
* @param borrower the account with the debt being payed off
* @param repayAmount the amount of underlying tokens being returned
* @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount.
*/
function repayBorrowFresh(address payer, address borrower, uint256 repayAmount)
internal
returns (uint256, uint256)
{
/* Fail if repayBorrow not allowed */
uint256 allowed = comptroller.repayBorrowAllowed(address(this), payer, borrower, repayAmount);
if (allowed != 0) {
return (failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.REPAY_BORROW_COMPTROLLER_REJECTION, allowed), 0);
}
/* Verify market's block timestamp equals current block timestamp */
if (accrualBlockNumber != getBlockNumber()) {
return (fail(Error.MARKET_NOT_FRESH, FailureInfo.REPAY_BORROW_FRESHNESS_CHECK), 0);
}
RepayBorrowLocalVars memory vars;
/* We remember the original borrowerIndex for verification purposes */
vars.borrowerIndex = accountBorrows[borrower].interestIndex;
/* We fetch the amount the borrower owes, with accumulated interest */
(vars.mathErr, vars.accountBorrows) = borrowBalanceStoredInternal(borrower);
if (vars.mathErr != MathError.NO_ERROR) {
return (
failOpaque(
Error.MATH_ERROR,
FailureInfo.REPAY_BORROW_ACCUMULATED_BALANCE_CALCULATION_FAILED,
uint256(vars.mathErr)
),
0
);
}
/* If repayAmount == uint.max, repayAmount = accountBorrows */
if (repayAmount == type(uint256).max) {
vars.repayAmount = vars.accountBorrows;
} else {
vars.repayAmount = repayAmount;
}
/////////////////////////
// EFFECTS & INTERACTIONS
// (No safe failures beyond this point)
/*
* We call doTransferIn for the payer and the repayAmount
* Note: The rToken must handle variations between ERC-20 and GLMR underlying.
* On success, the rToken holds an additional repayAmount of cash.
* doTransferIn reverts if anything goes wrong, since we can't be sure if side effects occurred.
* it returns the amount actually transferred, in case of a fee.
*/
vars.actualRepayAmount = doTransferIn(payer, vars.repayAmount);
/*
* We calculate the new borrower and total borrow balances, failing on underflow:
* accountBorrowsNew = accountBorrows - actualRepayAmount
* totalBorrowsNew = totalBorrows - actualRepayAmount
*/
(vars.mathErr, vars.accountBorrowsNew) = subUInt(vars.accountBorrows, vars.actualRepayAmount);
require(vars.mathErr == MathError.NO_ERROR, "REPAY_BORROW_NEW_ACCOUNT_BORROW_BALANCE_CALCULATION_FAILED");
(vars.mathErr, vars.totalBorrowsNew) = subUInt(totalBorrows, vars.actualRepayAmount);
require(vars.mathErr == MathError.NO_ERROR, "REPAY_BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED");
/* We write the previously calculated values into storage */
accountBorrows[borrower].principal = vars.accountBorrowsNew;
accountBorrows[borrower].interestIndex = borrowIndex;
totalBorrows = vars.totalBorrowsNew;
/* We emit a RepayBorrow event */
emit RepayBorrow(payer, borrower, vars.actualRepayAmount, vars.accountBorrowsNew, vars.totalBorrowsNew);
/* We call the defense hook */
// unused function
// comptroller.repayBorrowVerify(address(this), payer, borrower, vars.actualRepayAmount, vars.borrowerIndex);
return (uint256(Error.NO_ERROR), vars.actualRepayAmount);
}
/**
* @notice The sender liquidates the borrowers collateral.
* The collateral seized is transferred to the liquidator.
* @param borrower The borrower of this rToken to be liquidated
* @param rTokenCollateral The market in which to seize collateral from the borrower
* @param repayAmount The amount of the underlying borrowed asset to repay
* @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount.
*/
function liquidateBorrowInternal(address borrower, uint256 repayAmount, RTokenInterface rTokenCollateral)
internal
nonReentrant
returns (uint256, uint256)
{
uint256 error = accrueInterest();
if (error != uint256(Error.NO_ERROR)) {
// accrueInterest emits logs on errors, but we still want to log the fact that an attempted liquidation failed
return (fail(Error(error), FailureInfo.LIQUIDATE_ACCRUE_BORROW_INTEREST_FAILED), 0);
}
error = rTokenCollateral.accrueInterest();
if (error != uint256(Error.NO_ERROR)) {
// accrueInterest emits logs on errors, but we still want to log the fact that an attempted liquidation failed
return (fail(Error(error), FailureInfo.LIQUIDATE_ACCRUE_COLLATERAL_INTEREST_FAILED), 0);
}
// liquidateBorrowFresh emits borrow-specific logs on errors, so we don't need to
return liquidateBorrowFresh(msg.sender, borrower, repayAmount, rTokenCollateral);
}
/**
* @notice The liquidator liquidates the borrowers collateral.
* The collateral seized is transferred to the liquidator.
* @param borrower The borrower of this rToken to be liquidated
* @param liquidator The address repaying the borrow and seizing collateral
* @param rTokenCollateral The market in which to seize collateral from the borrower
* @param repayAmount The amount of the underlying borrowed asset to repay
* @return (uint, uint) An error code (0=success, otherwise a failure, see ErrorReporter.sol), and the actual repayment amount.
*/
function liquidateBorrowFresh(
address liquidator,
address borrower,
uint256 repayAmount,
RTokenInterface rTokenCollateral
) internal returns (uint256, uint256) {
/* Fail if liquidate not allowed */
uint256 allowed = comptroller.liquidateBorrowAllowed(
address(this), address(rTokenCollateral), liquidator, borrower, repayAmount
);
if (allowed != 0) {
return (failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.LIQUIDATE_COMPTROLLER_REJECTION, allowed), 0);
}
/* Verify market's block timestamp equals current block timestamp */
if (accrualBlockNumber != getBlockNumber()) {
return (fail(Error.MARKET_NOT_FRESH, FailureInfo.LIQUIDATE_FRESHNESS_CHECK), 0);
}
/* Verify rTokenCollateral market's block timestamp equals current block timestamp */
if (rTokenCollateral.accrualBlockNumber() != getBlockNumber()) {
return (fail(Error.MARKET_NOT_FRESH, FailureInfo.LIQUIDATE_COLLATERAL_FRESHNESS_CHECK), 0);
}
/* Fail if borrower = liquidator */
if (borrower == liquidator) {
return (fail(Error.INVALID_ACCOUNT_PAIR, FailureInfo.LIQUIDATE_LIQUIDATOR_IS_BORROWER), 0);
}
/* Fail if repayAmount = 0 */
if (repayAmount == 0) {
return (fail(Error.INVALID_CLOSE_AMOUNT_REQUESTED, FailureInfo.LIQUIDATE_CLOSE_AMOUNT_IS_ZERO), 0);
}
/* Fail if repayAmount = uint.max */
if (repayAmount == type(uint256).max) {
return (fail(Error.INVALID_CLOSE_AMOUNT_REQUESTED, FailureInfo.LIQUIDATE_CLOSE_AMOUNT_IS_UINT_MAX), 0);
}
/* Fail if repayBorrow fails */
(uint256 repayBorrowError, uint256 actualRepayAmount) = repayBorrowFresh(liquidator, borrower, repayAmount);
if (repayBorrowError != uint256(Error.NO_ERROR)) {
return (fail(Error(repayBorrowError), FailureInfo.LIQUIDATE_REPAY_BORROW_FRESH_FAILED), 0);
}
/////////////////////////
// EFFECTS & INTERACTIONS
// (No safe failures beyond this point)
/* We calculate the number of collateral tokens that will be seized */
(uint256 amountSeizeError, uint256 seizeTokens) =
comptroller.liquidateCalculateSeizeTokens(address(this), address(rTokenCollateral), actualRepayAmount);
require(amountSeizeError == uint256(Error.NO_ERROR), "LIQUIDATE_COMPTROLLER_CALCULATE_AMOUNT_SEIZE_FAILED");
/* Revert if borrower collateral token balance < seizeTokens */
require(rTokenCollateral.balanceOf(borrower) >= seizeTokens, "LIQUIDATE_SEIZE_TOO_MUCH");
// If this is also the collateral, run seizeInternal to avoid re-entrancy, otherwise make an external call
uint256 seizeError;
if (address(rTokenCollateral) == address(this)) {
seizeError = seizeInternal(address(this), liquidator, borrower, seizeTokens);
} else {
seizeError = rTokenCollateral.seize(liquidator, borrower, seizeTokens);
}
/* Revert if seize tokens fails (since we cannot be sure of side effects) */
require(seizeError == uint256(Error.NO_ERROR), "token seizure failed");
/* We emit a LiquidateBorrow event */
emit LiquidateBorrow(liquidator, borrower, actualRepayAmount, address(rTokenCollateral), seizeTokens);
/* We call the defense hook */
// unused function
// comptroller.liquidateBorrowVerify(address(this), address(rTokenCollateral), liquidator, borrower, actualRepayAmount, seizeTokens);
return (uint256(Error.NO_ERROR), actualRepayAmount);
}
/**
* @notice Transfers collateral tokens (this market) to the liquidator.
* @dev Will fail unless called by another rToken during the process of liquidation.
* Its absolutely critical to use msg.sender as the borrowed rToken and not a parameter.
* @param liquidator The account receiving seized collateral
* @param borrower The account having collateral seized
* @param seizeTokens The number of rTokens to seize
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function seize(address liquidator, address borrower, uint256 seizeTokens)
external
override
nonReentrant
returns (uint256)
{
return seizeInternal(msg.sender, liquidator, borrower, seizeTokens);
}
struct SeizeInternalLocalVars {
MathError mathErr;
uint256 borrowerTokensNew;
uint256 liquidatorTokensNew;
uint256 liquidatorSeizeTokens;
uint256 protocolSeizeTokens;
uint256 protocolSeizeAmount;
uint256 exchangeRateMantissa;
uint256 totalReservesNew;
uint256 totalSupplyNew;
}
/**
* @notice Transfers collateral tokens (this market) to the liquidator.
* @dev Called only during an in-kind liquidation, or by liquidateBorrow during the liquidation of another RToken.
* Its absolutely critical to use msg.sender as the seizer rToken and not a parameter.
* @param seizerToken The contract seizing the collateral (i.e. borrowed rToken)
* @param liquidator The account receiving seized collateral
* @param borrower The account having collateral seized
* @param seizeTokens The number of rTokens to seize
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function seizeInternal(address seizerToken, address liquidator, address borrower, uint256 seizeTokens)
internal
returns (uint256)
{
/* Fail if seize not allowed */
uint256 allowed = comptroller.seizeAllowed(address(this), seizerToken, liquidator, borrower, seizeTokens);
if (allowed != 0) {
return failOpaque(Error.COMPTROLLER_REJECTION, FailureInfo.LIQUIDATE_SEIZE_COMPTROLLER_REJECTION, allowed);
}
/* Fail if borrower = liquidator */
if (borrower == liquidator) {
return fail(Error.INVALID_ACCOUNT_PAIR, FailureInfo.LIQUIDATE_SEIZE_LIQUIDATOR_IS_BORROWER);
}
SeizeInternalLocalVars memory vars;
/*
* We calculate the new borrower and liquidator token balances, failing on underflow/overflow:
* borrowerTokensNew = accountTokens[borrower] - seizeTokens
* liquidatorTokensNew = accountTokens[liquidator] + seizeTokens
*/
(vars.mathErr, vars.borrowerTokensNew) = subUInt(accountTokens[borrower], seizeTokens);
if (vars.mathErr != MathError.NO_ERROR) {
return failOpaque(
Error.MATH_ERROR, FailureInfo.LIQUIDATE_SEIZE_BALANCE_DECREMENT_FAILED, uint256(vars.mathErr)
);
}
vars.protocolSeizeTokens = mul_(seizeTokens, Exp({mantissa: protocolSeizeShareMantissa}));
vars.liquidatorSeizeTokens = sub_(seizeTokens, vars.protocolSeizeTokens);
(vars.mathErr, vars.exchangeRateMantissa) = exchangeRateStoredInternal();
require(vars.mathErr == MathError.NO_ERROR, "exchange rate math error");
vars.protocolSeizeAmount =
mul_ScalarTruncate(Exp({mantissa: vars.exchangeRateMantissa}), vars.protocolSeizeTokens);
vars.totalReservesNew = add_(totalReserves, vars.protocolSeizeAmount);
vars.totalSupplyNew = sub_(totalSupply, vars.protocolSeizeTokens);
(vars.mathErr, vars.liquidatorTokensNew) = addUInt(accountTokens[liquidator], vars.liquidatorSeizeTokens);
if (vars.mathErr != MathError.NO_ERROR) {
return failOpaque(
Error.MATH_ERROR, FailureInfo.LIQUIDATE_SEIZE_BALANCE_INCREMENT_FAILED, uint256(vars.mathErr)
);
}
/////////////////////////
// EFFECTS & INTERACTIONS
// (No safe failures beyond this point)
/* We write the previously calculated values into storage */
totalReserves = vars.totalReservesNew;
totalSupply = vars.totalSupplyNew;
accountTokens[borrower] = vars.borrowerTokensNew;
accountTokens[liquidator] = vars.liquidatorTokensNew;
/* Emit a Transfer event */
emit Transfer(borrower, liquidator, vars.liquidatorSeizeTokens);
emit Transfer(borrower, address(this), vars.protocolSeizeTokens);
emit ReservesAdded(address(this), vars.protocolSeizeAmount, vars.totalReservesNew);
/* We call the defense hook */
// unused function
// comptroller.seizeVerify(address(this), seizerToken, liquidator, borrower, seizeTokens);
return uint256(Error.NO_ERROR);
}
/**
* Admin Functions **
*/
/**
* @notice Begins transfer of admin rights. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.
* @dev Admin function to begin change of admin. The newPendingAdmin must call `_acceptAdmin` to finalize the transfer.
* @param newPendingAdmin New pending admin.
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function _setPendingAdmin(address payable newPendingAdmin) external virtual override returns (uint256) {
// Check caller = admin
if (msg.sender != admin) {
return fail(Error.UNAUTHORIZED, FailureInfo.SET_PENDING_ADMIN_OWNER_CHECK);
}
// Save current value, if any, for inclusion in log
address oldPendingAdmin = pendingAdmin;
// Store pendingAdmin with value newPendingAdmin
pendingAdmin = newPendingAdmin;
// Emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin)
emit NewPendingAdmin(oldPendingAdmin, newPendingAdmin);
return uint256(Error.NO_ERROR);
}
/**
* @notice Accepts transfer of admin rights. msg.sender must be pendingAdmin
* @dev Admin function for pending admin to accept role and update admin
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function _acceptAdmin() external override returns (uint256) {
// Check caller is pendingAdmin and pendingAdmin ≠ address(0)
if (msg.sender != pendingAdmin || msg.sender == address(0)) {
return fail(Error.UNAUTHORIZED, FailureInfo.ACCEPT_ADMIN_PENDING_ADMIN_CHECK);
}
// Save current values for inclusion in log
address oldAdmin = admin;
address oldPendingAdmin = pendingAdmin;
// Store admin with value pendingAdmin
admin = pendingAdmin;
// Clear the pending value
pendingAdmin = payable(address(0));
emit NewAdmin(oldAdmin, admin);
emit NewPendingAdmin(oldPendingAdmin, pendingAdmin);
return uint256(Error.NO_ERROR);
}
/**
* @notice Sets a new comptroller for the market
* @dev Admin function to set a new comptroller
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function _setComptroller(ComptrollerInterface newComptroller) public override returns (uint256) {
// Check caller is admin
if (msg.sender != admin) {
return fail(Error.UNAUTHORIZED, FailureInfo.SET_COMPTROLLER_OWNER_CHECK);
}
ComptrollerInterface oldComptroller = comptroller;
// Ensure invoke comptroller.isComptroller() returns true
require(newComptroller.isComptroller(), "marker method returned false");
// Set market's comptroller to newComptroller
comptroller = newComptroller;
// Emit NewComptroller(oldComptroller, newComptroller)
emit NewComptroller(oldComptroller, newComptroller);
return uint256(Error.NO_ERROR);
}
/**
* @notice accrues interest and sets a new reserve factor for the protocol using _setReserveFactorFresh
* @dev Admin function to accrue interest and set a new reserve factor
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function _setReserveFactor(uint256 newReserveFactorMantissa) external override nonReentrant returns (uint256) {
uint256 error = accrueInterest();
if (error != uint256(Error.NO_ERROR)) {
// accrueInterest emits logs on errors, but on top of that we want to log the fact that an attempted reserve factor change failed.
return fail(Error(error), FailureInfo.SET_RESERVE_FACTOR_ACCRUE_INTEREST_FAILED);
}
// _setReserveFactorFresh emits reserve-factor-specific logs on errors, so we don't need to.
return _setReserveFactorFresh(newReserveFactorMantissa);
}
/**
* @notice Sets a new reserve factor for the protocol (*requires fresh interest accrual)
* @dev Admin function to set a new reserve factor
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function _setReserveFactorFresh(uint256 newReserveFactorMantissa) internal returns (uint256) {
// Check caller is admin
if (msg.sender != admin) {
return fail(Error.UNAUTHORIZED, FailureInfo.SET_RESERVE_FACTOR_ADMIN_CHECK);
}
// Verify market's block timestamp equals current block timestamp
if (accrualBlockNumber != getBlockNumber()) {
return fail(Error.MARKET_NOT_FRESH, FailureInfo.SET_RESERVE_FACTOR_FRESH_CHECK);
}
// Check newReserveFactor ≤ maxReserveFactor
if (newReserveFactorMantissa > reserveFactorMaxMantissa) {
return fail(Error.BAD_INPUT, FailureInfo.SET_RESERVE_FACTOR_BOUNDS_CHECK);
}
uint256 oldReserveFactorMantissa = reserveFactorMantissa;
reserveFactorMantissa = newReserveFactorMantissa;
emit NewReserveFactor(oldReserveFactorMantissa, newReserveFactorMantissa);
return uint256(Error.NO_ERROR);
}
/**
* @notice Accrues interest and reduces reserves by transferring from msg.sender
* @param addAmount Amount of addition to reserves
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function _addReservesInternal(uint256 addAmount) internal nonReentrant returns (uint256) {
uint256 error = accrueInterest();
if (error != uint256(Error.NO_ERROR)) {
// accrueInterest emits logs on errors, but on top of that we want to log the fact that an attempted reduce reserves failed.
return fail(Error(error), FailureInfo.ADD_RESERVES_ACCRUE_INTEREST_FAILED);
}
// _addReservesFresh emits reserve-addition-specific logs on errors, so we don't need to.
(error,) = _addReservesFresh(addAmount);
return error;
}
/**
* @notice Add reserves by transferring from caller
* @dev Requires fresh interest accrual
* @param addAmount Amount of addition to reserves
* @return (uint, uint) An error code (0=success, otherwise a failure (see ErrorReporter.sol for details)) and the actual amount added, net token fees
*/
function _addReservesFresh(uint256 addAmount) internal returns (uint256, uint256) {
// totalReserves + actualAddAmount
uint256 totalReservesNew;
uint256 actualAddAmount;
// We fail gracefully unless market's block timestamp equals current block timestamp
if (accrualBlockNumber != getBlockNumber()) {
return (fail(Error.MARKET_NOT_FRESH, FailureInfo.ADD_RESERVES_FRESH_CHECK), actualAddAmount);
}
/////////////////////////
// EFFECTS & INTERACTIONS
// (No safe failures beyond this point)
/*
* We call doTransferIn for the caller and the addAmount
* Note: The rToken must handle variations between ERC-20 and GLMR underlying.
* On success, the rToken holds an additional addAmount of cash.
* doTransferIn reverts if anything goes wrong, since we can't be sure if side effects occurred.
* it returns the amount actually transferred, in case of a fee.
*/
actualAddAmount = doTransferIn(msg.sender, addAmount);
totalReservesNew = totalReserves + actualAddAmount;
/* Revert on overflow */
require(totalReservesNew >= totalReserves, "add reserves unexpected overflow");
// Store reserves[n+1] = reserves[n] + actualAddAmount
totalReserves = totalReservesNew;
/* Emit NewReserves(admin, actualAddAmount, reserves[n+1]) */
emit ReservesAdded(msg.sender, actualAddAmount, totalReservesNew);
/* Return (NO_ERROR, actualAddAmount) */
return (uint256(Error.NO_ERROR), actualAddAmount);
}
/**
* @notice Accrues interest and reduces reserves by transferring to admin
* @param reduceAmount Amount of reduction to reserves
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function _reduceReserves(uint256 reduceAmount) external override nonReentrant returns (uint256) {
uint256 error = accrueInterest();
if (error != uint256(Error.NO_ERROR)) {
// accrueInterest emits logs on errors, but on top of that we want to log the fact that an attempted reduce reserves failed.
return fail(Error(error), FailureInfo.REDUCE_RESERVES_ACCRUE_INTEREST_FAILED);
}
// _reduceReservesFresh emits reserve-reduction-specific logs on errors, so we don't need to.
return _reduceReservesFresh(reduceAmount);
}
/**
* @notice Reduces reserves by transferring to admin
* @dev Requires fresh interest accrual
* @param reduceAmount Amount of reduction to reserves
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function _reduceReservesFresh(uint256 reduceAmount) internal returns (uint256) {
// totalReserves - reduceAmount
uint256 totalReservesNew;
// Check caller is admin
if (msg.sender != admin) {
return fail(Error.UNAUTHORIZED, FailureInfo.REDUCE_RESERVES_ADMIN_CHECK);
}
// We fail gracefully unless market's block timestamp equals current block timestamp
if (accrualBlockNumber != getBlockNumber()) {
return fail(Error.MARKET_NOT_FRESH, FailureInfo.REDUCE_RESERVES_FRESH_CHECK);
}
// Fail gracefully if protocol has insufficient underlying cash
if (getCashPrior() < reduceAmount) {
return fail(Error.TOKEN_INSUFFICIENT_CASH, FailureInfo.REDUCE_RESERVES_CASH_NOT_AVAILABLE);
}
// Check reduceAmount ≤ reserves[n] (totalReserves)
if (reduceAmount > totalReserves) {
return fail(Error.BAD_INPUT, FailureInfo.REDUCE_RESERVES_VALIDATION);
}
/////////////////////////
// EFFECTS & INTERACTIONS
// (No safe failures beyond this point)
totalReservesNew = totalReserves - reduceAmount;
// We checked reduceAmount <= totalReserves above, so this should never revert.
require(totalReservesNew <= totalReserves, "reduce reserves unexpected underflow");
// Store reserves[n+1] = reserves[n] - reduceAmount
totalReserves = totalReservesNew;
// doTransferOut reverts if anything goes wrong, since we can't be sure if side effects occurred.
doTransferOut(admin, reduceAmount);
emit ReservesReduced(admin, reduceAmount, totalReservesNew);
return uint256(Error.NO_ERROR);
}
/**
* @notice accrues interest and updates the interest rate model using _setInterestRateModelFresh
* @dev Admin function to accrue interest and update the interest rate model
* @param newInterestRateModel the new interest rate model to use
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function _setInterestRateModel(InterestRateModel newInterestRateModel) public override returns (uint256) {
uint256 error = accrueInterest();
if (error != uint256(Error.NO_ERROR)) {
// accrueInterest emits logs on errors, but on top of that we want to log the fact that an attempted change of interest rate model failed
return fail(Error(error), FailureInfo.SET_INTEREST_RATE_MODEL_ACCRUE_INTEREST_FAILED);
}
// _setInterestRateModelFresh emits interest-rate-model-update-specific logs on errors, so we don't need to.
return _setInterestRateModelFresh(newInterestRateModel);
}
/**
* @notice updates the interest rate model (*requires fresh interest accrual)
* @dev Admin function to update the interest rate model
* @param newInterestRateModel the new interest rate model to use
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function _setInterestRateModelFresh(InterestRateModel newInterestRateModel) internal returns (uint256) {
// Used to store old model for use in the event that is emitted on success
InterestRateModel oldInterestRateModel;
// Check caller is admin
if (msg.sender != admin) {
return fail(Error.UNAUTHORIZED, FailureInfo.SET_INTEREST_RATE_MODEL_OWNER_CHECK);
}
// We fail gracefully unless market's block timestamp equals current block timestamp
if (accrualBlockNumber != getBlockNumber()) {
return fail(Error.MARKET_NOT_FRESH, FailureInfo.SET_INTEREST_RATE_MODEL_FRESH_CHECK);
}
// Track the market's current interest rate model
oldInterestRateModel = interestRateModel;
// Ensure invoke newInterestRateModel.isInterestRateModel() returns true
require(newInterestRateModel.isInterestRateModel(), "marker method returned false");
// Set the interest rate model to newInterestRateModel
interestRateModel = newInterestRateModel;
// Emit NewMarketInterestRateModel(oldInterestRateModel, newInterestRateModel)
emit NewMarketInterestRateModel(oldInterestRateModel, newInterestRateModel);
return uint256(Error.NO_ERROR);
}
/**
* @notice accrues interest and updates the protocol seize share using _setProtocolSeizeShareFresh
* @dev Admin function to accrue interest and update the protocol seize share
* @param newProtocolSeizeShareMantissa the new protocol seize share to use
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function _setProtocolSeizeShare(uint256 newProtocolSeizeShareMantissa)
external
override
nonReentrant
returns (uint256)
{
uint256 error = accrueInterest();
if (error != uint256(Error.NO_ERROR)) {
// accrueInterest emits logs on errors, but on top of that we want to log the fact that an attempted change of protocol seize share failed
return fail(Error(error), FailureInfo.SET_PROTOCOL_SEIZE_SHARE_ACCRUE_INTEREST_FAILED);
}
// _setProtocolSeizeShareFresh emits protocol-seize-share-update-specific logs on errors, so we don't need to.
return _setProtocolSeizeShareFresh(newProtocolSeizeShareMantissa);
}
/**
* @notice updates the protocol seize share (*requires fresh interest accrual)
* @dev Admin function to update the protocol seize share
* @param newProtocolSeizeShareMantissa the new protocol seize share to use
* @return uint 0=success, otherwise a failure (see ErrorReporter.sol for details)
*/
function _setProtocolSeizeShareFresh(uint256 newProtocolSeizeShareMantissa) internal returns (uint256) {
// Used to store old share for use in the event that is emitted on success
uint256 oldProtocolSeizeShareMantissa;
// Check caller is admin
if (msg.sender != admin) {
return fail(Error.UNAUTHORIZED, FailureInfo.SET_PROTOCOL_SEIZE_SHARE_OWNER_CHECK);
}
// We fail gracefully unless market's block timestamp equals current block timestamp
if (accrualBlockNumber != getBlockNumber()) {
return fail(Error.MARKET_NOT_FRESH, FailureInfo.SET_PROTOCOL_SEIZE_SHARE_FRESH_CHECK);
}
// Track the market's current protocol seize share
oldProtocolSeizeShareMantissa = protocolSeizeShareMantissa;
// Set the protocol seize share to newProtocolSeizeShareMantissa
protocolSeizeShareMantissa = newProtocolSeizeShareMantissa;
// Emit NewProtocolSeizeShareMantissa(oldProtocolSeizeShareMantissa, newProtocolSeizeShareMantissa)
emit NewProtocolSeizeShare(oldProtocolSeizeShareMantissa, newProtocolSeizeShareMantissa);
return uint256(Error.NO_ERROR);
}
/**
* Safe Token **
*/
/**
* @notice Gets balance of this contract in terms of the underlying
* @dev This excludes the value of the current message, if any
* @return The quantity of underlying owned by this contract
*/
function getCashPrior() internal view virtual returns (uint256);
/**
* @dev Performs a transfer in, reverting upon failure. Returns the amount actually transferred to the protocol, in case of a fee.
* This may revert due to insufficient balance or insufficient allowance.
*/
function doTransferIn(address from, uint256 amount) internal virtual returns (uint256);
/**
* @dev Performs a transfer out, ideally returning an explanatory error code upon failure tather than reverting.
* If caller has not called checked protocol's balance, may revert due to insufficient cash held in the contract.
* If caller has checked protocol's balance, and verified it is >= amount, this should not revert in normal conditions.
*/
function doTransferOut(address payable to, uint256 amount) internal virtual;
/**
* Reentrancy Guard **
*/
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
*/
modifier nonReentrant() {
require(_notEntered, "re-entered");
_notEntered = false;
_;
_notEntered = true; // get a gas-refund post-Istanbul
}
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.23;
abstract contract ComptrollerInterface {
/// @notice Indicator that this is a Comptroller contract (for inspection)
bool public constant isComptroller = true;
/**
* Assets You Are In **
*/
function enterMarkets(address[] calldata rTokens) external virtual returns (uint256[] memory);
function exitMarket(address rToken) external virtual returns (uint256);
/**
* Policy Hooks **
*/
function mintAllowed(address rToken, address minter, uint256 mintAmount) external virtual returns (uint256);
function redeemAllowed(address rToken, address redeemer, uint256 redeemTokens) external virtual returns (uint256);
// Do not remove, still used by RToken
function redeemVerify(address rToken, address redeemer, uint256 redeemAmount, uint256 redeemTokens)
external
pure
virtual;
function borrowAllowed(address rToken, address borrower, uint256 borrowAmount) external virtual returns (uint256);
function enterAllMarkets(address account) external virtual returns (uint256[] memory);
function repayBorrowAllowed(address rToken, address payer, address borrower, uint256 repayAmount)
external
virtual
returns (uint256);
function liquidateBorrowAllowed(
address rTokenBorrowed,
address rTokenCollateral,
address liquidator,
address borrower,
uint256 repayAmount
) external view virtual returns (uint256);
function seizeAllowed(
address rTokenCollateral,
address rTokenBorrowed,
address liquidator,
address borrower,
uint256 seizeTokens
) external virtual returns (uint256);
function transferAllowed(address rToken, address src, address dst, uint256 transferTokens)
external
virtual
returns (uint256);
/**
* Liquidity/Liquidation Calculations **
*/
function liquidateCalculateSeizeTokens(address rTokenBorrowed, address rTokenCollateral, uint256 repayAmount)
external
view
virtual
returns (uint256, uint256);
}
// The hooks that were patched out of the comptroller to make room for the supply caps, if we need them
abstract contract ComptrollerInterfaceWithAllVerificationHooks is ComptrollerInterface {
function mintVerify(address rToken, address minter, uint256 mintAmount, uint256 mintTokens) external virtual;
// Included in ComptrollerInterface already
// function redeemVerify(address rToken, address redeemer, uint redeemAmount, uint redeemTokens) virtual external;
function borrowVerify(address rToken, address borrower, uint256 borrowAmount) external virtual;
function repayBorrowVerify(
address rToken,
address payer,
address borrower,
uint256 repayAmount,
uint256 borrowerIndex
) external virtual;
function liquidateBorrowVerify(
address rTokenBorrowed,
address rTokenCollateral,
address liquidator,
address borrower,
uint256 repayAmount,
uint256 seizeTokens
) external virtual;
function seizeVerify(
address rTokenCollateral,
address rTokenBorrowed,
address liquidator,
address borrower,
uint256 seizeTokens
) external virtual;
function transferVerify(address rToken, address src, address dst, uint256 transferTokens) external virtual;
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.23;
import "./ComptrollerInterface.sol";
import "./irm/InterestRateModel.sol";
import "./EIP20NonStandardInterface.sol";
import "./ErrorReporter.sol";
contract RTokenStorage {
/// @dev Guard variable for re-entrancy checks
bool internal _notEntered;
/// @notice EIP-20 token name for this token
string public name;
/// @notice EIP-20 token symbol for this token
string public symbol;
/// @notice EIP-20 token decimals for this token
uint8 public decimals;
/// @notice Maximum borrow rate that can ever be applied (.0005% / block)
uint256 internal constant borrowRateMaxMantissa = 0.0005e16;
// @notice Maximum fraction of interest that can be set aside for reserves
uint256 internal constant reserveFactorMaxMantissa = 1e18;
// @notice Maximum fraction of redemption factor that can be set aside for reserves
uint256 internal constant redemptionReserveFactorMaxMantissa = 0.05 ether;
uint256 internal constant minRedemptionCashRequire = 1 wei;
/// @notice Administrator for this contract
address payable public admin;
/// @notice Pending administrator for this contract
address payable public pendingAdmin;
/// @notice Contract which oversees inter-rToken operations
ComptrollerInterface public comptroller;
/// @notice Model which tells what the current interest rate should be
InterestRateModel public interestRateModel;
// @notice Initial exchange rate used when minting the first RTokens (used when totalSupply = 0)
uint256 internal initialExchangeRateMantissa;
/// @notice Fraction of interest currently set aside for reserves
uint256 public reserveFactorMantissa;
/// @notice Block number that interest was last accrued at
uint256 public accrualBlockNumber;
/// @notice Accumulator of the total earned interest rate since the opening of the market
uint256 public borrowIndex;
/// @notice Total amount of outstanding borrows of the underlying in this market
uint256 public totalBorrows;
/// @notice Total amount of reserves of the underlying held in this market
uint256 public totalReserves;
/// @notice Total number of tokens in circulation
uint256 public totalSupply;
/// @notice Official record of token balances for each account
mapping(address => uint256) internal accountTokens;
/// @notice Approved token transfer amounts on behalf of others
mapping(address => mapping(address => uint256)) internal transferAllowances;
/**
* @notice Container for borrow balance information
* @member principal Total balance (with accrued interest), after applying the most recent balance-changing action
* @member interestIndex Global borrowIndex as of the most recent balance-changing action
*/
struct BorrowSnapshot {
uint256 principal;
uint256 interestIndex;
}
// @notice Mapping of account addresses to outstanding borrow balances
mapping(address => BorrowSnapshot) internal accountBorrows;
/// @notice Share of seized collateral that is added to reserves
uint256 public protocolSeizeShareMantissa;
}
abstract contract RTokenInterface is RTokenStorage {
/// @notice Indicator that this is a RToken contract (for inspection)
bool public constant isRToken = true;
/**
* Market Events **
*/
/// @notice Event emitted when interest is accrued
event AccrueInterest(uint256 cashPrior, uint256 interestAccumulated, uint256 borrowIndex, uint256 totalBorrows);
/// @notice Event emitted when tokens are minted
event Mint(address minter, uint256 mintAmount, uint256 mintTokens);
/// @notice Event emitted when tokens are redeemed
event Redeem(address redeemer, uint256 redeemAmount, uint256 redeemTokens);
/// @notice Event emitted when underlying is borrowed
event Borrow(address borrower, uint256 borrowAmount, uint256 accountBorrows, uint256 totalBorrows);
/// @notice Event emitted when a borrow is repaid
event RepayBorrow(
address payer, address borrower, uint256 repayAmount, uint256 accountBorrows, uint256 totalBorrows
);
/// @notice Event emitted when a borrow is liquidated
event LiquidateBorrow(
address liquidator, address borrower, uint256 repayAmount, address rTokenCollateral, uint256 seizeTokens
);
/**
* Admin Events **
*/
/// @notice Event emitted when pendingAdmin is changed
event NewPendingAdmin(address oldPendingAdmin, address newPendingAdmin);
/// @notice Event emitted when pendingAdmin is accepted, which means admin is updated
event NewAdmin(address oldAdmin, address newAdmin);
/// @notice Event emitted when comptroller is changed
event NewComptroller(ComptrollerInterface oldComptroller, ComptrollerInterface newComptroller);
/// @notice Event emitted when interestRateModel is changed
event NewMarketInterestRateModel(InterestRateModel oldInterestRateModel, InterestRateModel newInterestRateModel);
/// @notice Event emitted when the reserve factor is changed
event NewReserveFactor(uint256 oldReserveFactorMantissa, uint256 newReserveFactorMantissa);
/// @notice Event emitted when the redemption reserve factor is changed
event NewRedemptionReserveFactor(uint256 oldRedemptionReserveFactor, uint256 newRedemptionReserveFactor);
/// @notice Event emitted when the protocol seize share is changed
event NewProtocolSeizeShare(uint256 oldProtocolSeizeShareMantissa, uint256 newProtocolSeizeShareMantissa);
/// @notice Event emitted when the reserves are added
event ReservesAdded(address benefactor, uint256 addAmount, uint256 newTotalReserves);
/// @notice Event emitted when the reserves are reduced
event ReservesReduced(address admin, uint256 reduceAmount, uint256 newTotalReserves);
/// @notice EIP20 Transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice EIP20 Approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* User Interface **
*/
function isEthDerivative() external view virtual returns (bool);
function transfer(address dst, uint256 amount) external virtual returns (bool);
function transferFrom(address src, address dst, uint256 amount) external virtual returns (bool);
function approve(address spender, uint256 amount) external virtual returns (bool);
function allowance(address owner, address spender) external view virtual returns (uint256);
function balanceOf(address owner) external view virtual returns (uint256);
function balanceOfUnderlying(address owner) external virtual returns (uint256);
function getAccountSnapshot(address account) external view virtual returns (uint256, uint256, uint256, uint256);
function borrowRatePerBlock() external view virtual returns (uint256);
function supplyRatePerBlock() external view virtual returns (uint256);
function totalBorrowsCurrent() external virtual returns (uint256);
function borrowBalanceCurrent(address account) external virtual returns (uint256);
function borrowBalanceStored(address account) external view virtual returns (uint256);
function exchangeRateCurrent() external virtual returns (uint256);
function exchangeRateStored() external view virtual returns (uint256);
function getCash() external view virtual returns (uint256);
function accrueInterest() external virtual returns (uint256);
function seize(address liquidator, address borrower, uint256 seizeTokens) external virtual returns (uint256);
/**
* Admin Functions **
*/
function _setPendingAdmin(address payable newPendingAdmin) external virtual returns (uint256);
function _acceptAdmin() external virtual returns (uint256);
function _setComptroller(ComptrollerInterface newComptroller) external virtual returns (uint256);
function _setReserveFactor(uint256 newReserveFactorMantissa) external virtual returns (uint256);
function _reduceReserves(uint256 reduceAmount) external virtual returns (uint256);
function _setInterestRateModel(InterestRateModel newInterestRateModel) external virtual returns (uint256);
function _setProtocolSeizeShare(uint256 newProtocolSeizeShareMantissa) external virtual returns (uint256);
}
contract RErc20Storage {
/// @notice Underlying asset for this RToken
address public underlying;
}
abstract contract RErc20Interface is RErc20Storage {
/**
* User Interface **
*/
function mint(uint256 mintAmount) external virtual returns (uint256);
function mintWithPermit(uint256 mintAmount, uint256 deadline, uint8 v, bytes32 r, bytes32 s)
external
virtual
returns (uint256);
function redeem(uint256 redeemTokens) external virtual returns (uint256);
function redeemUnderlying(uint256 redeemAmount) external virtual returns (uint256);
function borrow(uint256 borrowAmount) external virtual returns (uint256);
function repayBorrow(uint256 repayAmount) external virtual returns (uint256);
function repayBorrowBehalf(address borrower, uint256 repayAmount) external virtual returns (uint256);
function liquidateBorrow(address borrower, uint256 repayAmount, RTokenInterface rTokenCollateral)
external
virtual
returns (uint256);
function sweepToken(EIP20NonStandardInterface token) external virtual;
/**
* Admin Functions **
*/
function _addReserves(uint256 addAmount) external virtual returns (uint256);
}
contract RDelegationStorage {
/// @notice Implementation address for this contract
address public implementation;
}
abstract contract RDelegatorInterface is RDelegationStorage {
/// @notice Emitted when implementation is changed
event NewImplementation(address oldImplementation, address newImplementation);
/**
* @notice Called by the admin to update the implementation of the delegator
* @param implementation_ The address of the new implementation for delegation
* @param allowResign Flag to indicate whether to call _resignImplementation on the old implementation
* @param becomeImplementationData The encoded bytes data to be passed to _becomeImplementation
*/
function _setImplementation(address implementation_, bool allowResign, bytes memory becomeImplementationData)
external
virtual;
}
abstract contract RDelegateInterface is RDelegationStorage {
/**
* @notice Called by the delegator on a delegate to initialize it for duty
* @dev Should revert if any issues arise which make it unfit for delegation
* @param data The encoded bytes data for any initialization
*/
function _becomeImplementation(bytes memory data) external virtual;
/// @notice Called by the delegator on a delegate to forfeit its responsibility
function _resignImplementation() external virtual;
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.23;
contract ComptrollerErrorReporter {
enum Error {
NO_ERROR,
UNAUTHORIZED,
COMPTROLLER_MISMATCH,
INSUFFICIENT_SHORTFALL,
INSUFFICIENT_LIQUIDITY,
INVALID_CLOSE_FACTOR,
INVALID_COLLATERAL_FACTOR,
INVALID_LIQUIDATION_INCENTIVE,
MARKET_NOT_ENTERED, // no longer possible
MARKET_NOT_LISTED,
MARKET_ALREADY_LISTED,
MATH_ERROR,
NONZERO_BORROW_BALANCE,
PRICE_ERROR,
REJECTION,
SNAPSHOT_ERROR,
TOO_MANY_ASSETS,
TOO_MUCH_REPAY
}
enum FailureInfo {
ACCEPT_ADMIN_PENDING_ADMIN_CHECK,
ACCEPT_PENDING_IMPLEMENTATION_ADDRESS_CHECK,
EXIT_MARKET_BALANCE_OWED,
EXIT_MARKET_REJECTION,
SET_CLOSE_FACTOR_OWNER_CHECK,
SET_CLOSE_FACTOR_VALIDATION,
SET_COLLATERAL_FACTOR_OWNER_CHECK,
SET_COLLATERAL_FACTOR_NO_EXISTS,
SET_COLLATERAL_FACTOR_VALIDATION,
SET_COLLATERAL_FACTOR_WITHOUT_PRICE,
SET_IMPLEMENTATION_OWNER_CHECK,
SET_LIQUIDATION_INCENTIVE_OWNER_CHECK,
SET_LIQUIDATION_INCENTIVE_VALIDATION,
SET_MAX_ASSETS_OWNER_CHECK,
SET_PENDING_ADMIN_OWNER_CHECK,
SET_PENDING_IMPLEMENTATION_OWNER_CHECK,
SET_PRICE_ORACLE_OWNER_CHECK,
SUPPORT_MARKET_EXISTS,
SUPPORT_MARKET_OWNER_CHECK,
SET_PAUSE_GUARDIAN_OWNER_CHECK,
SET_GAS_AMOUNT_OWNER_CHECK
}
/**
* @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary
* contract-specific code that enables us to report opaque error codes from upgradeable contracts.
**/
event Failure(uint error, uint info, uint detail);
/**
* @dev use this when reporting a known error from the money market or a non-upgradeable collaborator
*/
function fail(Error err, FailureInfo info) internal returns (uint) {
emit Failure(uint(err), uint(info), 0);
return uint(err);
}
/**
* @dev use this when reporting an opaque error from an upgradeable collaborator contract
*/
function failOpaque(Error err, FailureInfo info, uint opaqueError) internal returns (uint) {
emit Failure(uint(err), uint(info), opaqueError);
return uint(err);
}
}
contract TokenErrorReporter {
enum Error {
NO_ERROR,
UNAUTHORIZED,
BAD_INPUT,
COMPTROLLER_REJECTION,
COMPTROLLER_CALCULATION_ERROR,
INTEREST_RATE_MODEL_ERROR,
INVALID_ACCOUNT_PAIR,
INVALID_CLOSE_AMOUNT_REQUESTED,
INVALID_COLLATERAL_FACTOR,
MATH_ERROR,
MARKET_NOT_FRESH,
MARKET_NOT_LISTED,
MARKET_LIQUIDITY_LOW,
TOKEN_INSUFFICIENT_ALLOWANCE,
TOKEN_INSUFFICIENT_BALANCE,
TOKEN_INSUFFICIENT_CASH,
TOKEN_TRANSFER_IN_FAILED,
TOKEN_TRANSFER_OUT_FAILED
}
/*
* Note: FailureInfo (but not Error) is kept in alphabetical order
* This is because FailureInfo grows significantly faster, and
* the order of Error has some meaning, while the order of FailureInfo
* is entirely arbitrary.
*/
enum FailureInfo {
ACCEPT_ADMIN_PENDING_ADMIN_CHECK,
ACCRUE_INTEREST_ACCUMULATED_INTEREST_CALCULATION_FAILED,
ACCRUE_INTEREST_BORROW_RATE_CALCULATION_FAILED,
ACCRUE_INTEREST_NEW_BORROW_INDEX_CALCULATION_FAILED,
ACCRUE_INTEREST_NEW_TOTAL_BORROWS_CALCULATION_FAILED,
ACCRUE_INTEREST_NEW_TOTAL_RESERVES_CALCULATION_FAILED,
ACCRUE_INTEREST_SIMPLE_INTEREST_FACTOR_CALCULATION_FAILED,
BORROW_ACCUMULATED_BALANCE_CALCULATION_FAILED,
BORROW_ACCRUE_INTEREST_FAILED,
BORROW_CASH_NOT_AVAILABLE,
BORROW_FRESHNESS_CHECK,
BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED,
BORROW_NEW_ACCOUNT_BORROW_BALANCE_CALCULATION_FAILED,
BORROW_MARKET_NOT_LISTED,
BORROW_COMPTROLLER_REJECTION,
LIQUIDATE_ACCRUE_BORROW_INTEREST_FAILED,
LIQUIDATE_ACCRUE_COLLATERAL_INTEREST_FAILED,
LIQUIDATE_COLLATERAL_FRESHNESS_CHECK,
LIQUIDATE_COMPTROLLER_REJECTION,
LIQUIDATE_COMPTROLLER_CALCULATE_AMOUNT_SEIZE_FAILED,
LIQUIDATE_CLOSE_AMOUNT_IS_UINT_MAX,
LIQUIDATE_CLOSE_AMOUNT_IS_ZERO,
LIQUIDATE_FRESHNESS_CHECK,
LIQUIDATE_LIQUIDATOR_IS_BORROWER,
LIQUIDATE_REPAY_BORROW_FRESH_FAILED,
LIQUIDATE_SEIZE_BALANCE_INCREMENT_FAILED,
LIQUIDATE_SEIZE_BALANCE_DECREMENT_FAILED,
LIQUIDATE_SEIZE_COMPTROLLER_REJECTION,
LIQUIDATE_SEIZE_LIQUIDATOR_IS_BORROWER,
LIQUIDATE_SEIZE_TOO_MUCH,
MINT_ACCRUE_INTEREST_FAILED,
MINT_COMPTROLLER_REJECTION,
MINT_EXCHANGE_CALCULATION_FAILED,
MINT_EXCHANGE_RATE_READ_FAILED,
MINT_FRESHNESS_CHECK,
MINT_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED,
MINT_NEW_TOTAL_SUPPLY_CALCULATION_FAILED,
MINT_TRANSFER_IN_FAILED,
MINT_TRANSFER_IN_NOT_POSSIBLE,
REDEEM_MIN_BALANCE_NOT_MET,
REDEEM_ACCRUE_INTEREST_FAILED,
REDEEM_COMPTROLLER_REJECTION,
REDEEM_EXCHANGE_TOKENS_CALCULATION_FAILED,
REDEEM_EXCHANGE_AMOUNT_CALCULATION_FAILED,
REDEEM_RESERVE_FEE_AMOUNT_CALCULATION_FAILED,
REDEEM_EXCHANGE_RATE_READ_FAILED,
REDEEM_FRESHNESS_CHECK,
REDEEM_NEW_ACCOUNT_BALANCE_CALCULATION_FAILED,
REDEEM_NEW_TOTAL_SUPPLY_CALCULATION_FAILED,
REDEEM_TRANSFER_OUT_NOT_POSSIBLE,
REDUCE_RESERVES_ACCRUE_INTEREST_FAILED,
REDUCE_RESERVES_ADMIN_CHECK,
REDUCE_RESERVES_CASH_NOT_AVAILABLE,
REDUCE_RESERVES_FRESH_CHECK,
REDUCE_RESERVES_VALIDATION,
REPAY_BEHALF_ACCRUE_INTEREST_FAILED,
REPAY_BORROW_ACCRUE_INTEREST_FAILED,
REPAY_BORROW_ACCUMULATED_BALANCE_CALCULATION_FAILED,
REPAY_BORROW_COMPTROLLER_REJECTION,
REPAY_BORROW_FRESHNESS_CHECK,
REPAY_BORROW_NEW_ACCOUNT_BORROW_BALANCE_CALCULATION_FAILED,
REPAY_BORROW_NEW_TOTAL_BALANCE_CALCULATION_FAILED,
REPAY_BORROW_TRANSFER_IN_NOT_POSSIBLE,
SET_COLLATERAL_FACTOR_OWNER_CHECK,
SET_COLLATERAL_FACTOR_VALIDATION,
SET_COMPTROLLER_OWNER_CHECK,
SET_INTEREST_RATE_MODEL_ACCRUE_INTEREST_FAILED,
SET_INTEREST_RATE_MODEL_FRESH_CHECK,
SET_INTEREST_RATE_MODEL_OWNER_CHECK,
SET_MAX_ASSETS_OWNER_CHECK,
SET_ORACLE_MARKET_NOT_LISTED,
SET_PENDING_ADMIN_OWNER_CHECK,
SET_RESERVE_FACTOR_ACCRUE_INTEREST_FAILED,
SET_RESERVE_FACTOR_ADMIN_CHECK,
SET_RESERVE_FACTOR_FRESH_CHECK,
SET_RESERVE_FACTOR_BOUNDS_CHECK,
SET_REDEMPTION_RESERVE_FACTOR_ADMIN_CHECK,
SET_REDEMPTION_RESERVE_FACTOR_FRESH_CHECK,
SET_REDEMPTION_RESERVE_FACTOR_BOUNDS_CHECK,
TRANSFER_COMPTROLLER_REJECTION,
TRANSFER_NOT_ALLOWED,
TRANSFER_NOT_ENOUGH,
TRANSFER_TOO_MUCH,
ADD_RESERVES_ACCRUE_INTEREST_FAILED,
ADD_RESERVES_FRESH_CHECK,
ADD_RESERVES_TRANSFER_IN_NOT_POSSIBLE,
SET_PROTOCOL_SEIZE_SHARE_ACCRUE_INTEREST_FAILED,
SET_PROTOCOL_SEIZE_SHARE_OWNER_CHECK,
SET_PROTOCOL_SEIZE_SHARE_FRESH_CHECK
}
/**
* @dev `error` corresponds to enum Error; `info` corresponds to enum FailureInfo, and `detail` is an arbitrary
* contract-specific code that enables us to report opaque error codes from upgradeable contracts.
**/
event Failure(uint error, uint info, uint detail);
/**
* @dev use this when reporting a known error from the money market or a non-upgradeable collaborator
*/
function fail(Error err, FailureInfo info) internal returns (uint) {
emit Failure(uint(err), uint(info), 0);
return uint(err);
}
/**
* @dev use this when reporting an opaque error from an upgradeable collaborator contract
*/
function failOpaque(Error err, FailureInfo info, uint opaqueError) internal returns (uint) {
emit Failure(uint(err), uint(info), opaqueError);
return uint(err);
}
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.23;
import "./CarefulMath.sol";
import "./ExponentialNoError.sol";
/**
* @title Exponential module for storing fixed-precision decimals
* @dev Legacy contract for compatibility reasons with existing contracts that still use MathError
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.
*/
contract Exponential is CarefulMath, ExponentialNoError {
/**
* @dev Creates an exponential from numerator and denominator values.
* Note: Returns an error if (`num` * 10e18) > MAX_INT,
* or if `denom` is zero.
*/
function getExp(uint num, uint denom) pure internal returns (MathError, Exp memory) {
(MathError err0, uint scaledNumerator) = mulUInt(num, expScale);
if (err0 != MathError.NO_ERROR) {
return (err0, Exp({mantissa: 0}));
}
(MathError err1, uint rational) = divUInt(scaledNumerator, denom);
if (err1 != MathError.NO_ERROR) {
return (err1, Exp({mantissa: 0}));
}
return (MathError.NO_ERROR, Exp({mantissa: rational}));
}
/**
* @dev Adds two exponentials, returning a new exponential.
*/
function addExp(Exp memory a, Exp memory b) pure internal returns (MathError, Exp memory) {
(MathError error, uint result) = addUInt(a.mantissa, b.mantissa);
return (error, Exp({mantissa: result}));
}
/**
* @dev Subtracts two exponentials, returning a new exponential.
*/
function subExp(Exp memory a, Exp memory b) pure internal returns (MathError, Exp memory) {
(MathError error, uint result) = subUInt(a.mantissa, b.mantissa);
return (error, Exp({mantissa: result}));
}
/**
* @dev Multiply an Exp by a scalar, returning a new Exp.
*/
function mulScalar(Exp memory a, uint scalar) pure internal returns (MathError, Exp memory) {
(MathError err0, uint scaledMantissa) = mulUInt(a.mantissa, scalar);
if (err0 != MathError.NO_ERROR) {
return (err0, Exp({mantissa: 0}));
}
return (MathError.NO_ERROR, Exp({mantissa: scaledMantissa}));
}
/**
* @dev Multiply an Exp by a scalar, then truncate to return an unsigned integer.
*/
function mulScalarTruncate(Exp memory a, uint scalar) pure internal returns (MathError, uint) {
(MathError err, Exp memory product) = mulScalar(a, scalar);
if (err != MathError.NO_ERROR) {
return (err, 0);
}
return (MathError.NO_ERROR, truncate(product));
}
/**
* @dev Multiply an Exp by a scalar, truncate, then add an to an unsigned integer, returning an unsigned integer.
*/
function mulScalarTruncateAddUInt(Exp memory a, uint scalar, uint addend) pure internal returns (MathError, uint) {
(MathError err, Exp memory product) = mulScalar(a, scalar);
if (err != MathError.NO_ERROR) {
return (err, 0);
}
return addUInt(truncate(product), addend);
}
/**
* @dev Divide an Exp by a scalar, returning a new Exp.
*/
function divScalar(Exp memory a, uint scalar) pure internal returns (MathError, Exp memory) {
(MathError err0, uint descaledMantissa) = divUInt(a.mantissa, scalar);
if (err0 != MathError.NO_ERROR) {
return (err0, Exp({mantissa: 0}));
}
return (MathError.NO_ERROR, Exp({mantissa: descaledMantissa}));
}
/**
* @dev Divide a scalar by an Exp, returning a new Exp.
*/
function divScalarByExp(uint scalar, Exp memory divisor) pure internal returns (MathError, Exp memory) {
/*
We are doing this as:
getExp(mulUInt(expScale, scalar), divisor.mantissa)
How it works:
Exp = a / b;
Scalar = s;
`s / (a / b)` = `b * s / a` and since for an Exp `a = mantissa, b = expScale`
*/
(MathError err0, uint numerator) = mulUInt(expScale, scalar);
if (err0 != MathError.NO_ERROR) {
return (err0, Exp({mantissa: 0}));
}
return getExp(numerator, divisor.mantissa);
}
/**
* @dev Divide a scalar by an Exp, then truncate to return an unsigned integer.
*/
function divScalarByExpTruncate(uint scalar, Exp memory divisor) pure internal returns (MathError, uint) {
(MathError err, Exp memory fraction) = divScalarByExp(scalar, divisor);
if (err != MathError.NO_ERROR) {
return (err, 0);
}
return (MathError.NO_ERROR, truncate(fraction));
}
/**
* @dev Multiplies two exponentials, returning a new exponential.
*/
function mulExp(Exp memory a, Exp memory b) pure internal returns (MathError, Exp memory) {
(MathError err0, uint doubleScaledProduct) = mulUInt(a.mantissa, b.mantissa);
if (err0 != MathError.NO_ERROR) {
return (err0, Exp({mantissa: 0}));
}
// We add half the scale before dividing so that we get rounding instead of truncation.
// See "Listing 6" and text above it at https://accu.org/index.php/journals/1717
// Without this change, a result like 6.6...e-19 will be truncated to 0 instead of being rounded to 1e-18.
(MathError err1, uint doubleScaledProductWithHalfScale) = addUInt(halfExpScale, doubleScaledProduct);
if (err1 != MathError.NO_ERROR) {
return (err1, Exp({mantissa: 0}));
}
(MathError err2, uint product) = divUInt(doubleScaledProductWithHalfScale, expScale);
// The only error `div` can return is MathError.DIVISION_BY_ZERO but we control `expScale` and it is not zero.
assert(err2 == MathError.NO_ERROR);
return (MathError.NO_ERROR, Exp({mantissa: product}));
}
/**
* @dev Multiplies two exponentials given their mantissas, returning a new exponential.
*/
function mulExp(uint a, uint b) pure internal returns (MathError, Exp memory) {
return mulExp(Exp({mantissa: a}), Exp({mantissa: b}));
}
/**
* @dev Multiplies three exponentials, returning a new exponential.
*/
function mulExp3(Exp memory a, Exp memory b, Exp memory c) pure internal returns (MathError, Exp memory) {
(MathError err, Exp memory ab) = mulExp(a, b);
if (err != MathError.NO_ERROR) {
return (err, ab);
}
return mulExp(ab, c);
}
/**
* @dev Divides two exponentials, returning a new exponential.
* (a/scale) / (b/scale) = (a/scale) * (scale/b) = a/b,
* which we can scale as an Exp by calling getExp(a.mantissa, b.mantissa)
*/
function divExp(Exp memory a, Exp memory b) pure internal returns (MathError, Exp memory) {
return getExp(a.mantissa, b.mantissa);
}
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.23;
/**
* @title ERC 20 Token Standard Interface
* https://eips.ethereum.org/EIPS/eip-20
*/
interface EIP20Interface {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
/**
* @notice Get the total number of tokens in circulation
* @return The supply of tokens
*/
function totalSupply() external view returns (uint256);
/**
* @notice Gets the balance of the specified address
* @param owner The address from which the balance will be retrieved
* @return balance The balance
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param amount The number of tokens to transfer
* @return success Whether or not the transfer succeeded
*/
function transfer(address dst, uint256 amount) external returns (bool success);
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param amount The number of tokens to transfer
* @return success Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint256 amount) external returns (bool success);
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param amount The number of tokens that are approved (-1 means infinite)
* @return success Whether or not the approval succeeded
*/
function approve(address spender, uint256 amount) external returns (bool success);
/**
* @notice Get the current allowance from `owner` for `spender`
* @param owner The address of the account which owns the tokens to be spent
* @param spender The address of the account which may transfer tokens
* @return remaining The number of tokens allowed to be spent (-1 means infinite)
*/
function allowance(address owner, address spender) external view returns (uint256 remaining);
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(address indexed owner, address indexed spender, uint256 amount);
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.23;
/**
* @title InterestRateModel Interface
*/
abstract contract InterestRateModel {
/// @notice Indicator that this is an InterestRateModel contract (for inspection)
bool public constant isInterestRateModel = true;
/**
* @notice Calculates the current borrow interest rate per block
* @param cash The total amount of cash the market has
* @param borrows The total amount of borrows the market has outstanding
* @param reserves The total amount of reserves the market has
* @return The borrow rate per block (as a percentage, and scaled by 1e18)
*/
function getBorrowRate(
uint cash,
uint borrows,
uint reserves
) external view virtual returns (uint);
/**
* @notice Calculates the current supply interest rate per block
* @param cash The total amount of cash the market has
* @param borrows The total amount of borrows the market has outstanding
* @param reserves The total amount of reserves the market has
* @param reserveFactorMantissa The current reserve factor the market has
* @return The supply rate per block (as a percentage, and scaled by 1e18)
*/
function getSupplyRate(
uint cash,
uint borrows,
uint reserves,
uint reserveFactorMantissa
) external view virtual returns (uint);
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.23;
/**
* @title EIP20NonStandardInterface
* @dev Version of ERC20 with no return values for `transfer` and `transferFrom`
* See https://medium.com/coinmonks/missing-return-value-bug-at-least-130-tokens-affected-d67bf08521ca
*/
interface EIP20NonStandardInterface {
/**
* @notice Get the total number of tokens in circulation
* @return The supply of tokens
*/
function totalSupply() external view returns (uint256);
/**
* @notice Gets the balance of the specified address
* @param owner The address from which the balance will be retrieved
* @return balance The balance
*/
function balanceOf(address owner) external view returns (uint256 balance);
///
/// !!!!!!!!!!!!!!
/// !!! NOTICE !!! `transfer` does not return a value, in violation of the ERC-20 specification
/// !!!!!!!!!!!!!!
///
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param amount The number of tokens to transfer
*/
function transfer(address dst, uint256 amount) external;
///
/// !!!!!!!!!!!!!!
/// !!! NOTICE !!! `transferFrom` does not return a value, in violation of the ERC-20 specification
/// !!!!!!!!!!!!!!
///
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param amount The number of tokens to transfer
*/
function transferFrom(address src, address dst, uint256 amount) external;
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param amount The number of tokens that are approved
* @return success Whether or not the approval succeeded
*/
function approve(address spender, uint256 amount) external returns (bool success);
/**
* @notice Get the current allowance from `owner` for `spender`
* @param owner The address of the account which owns the tokens to be spent
* @param spender The address of the account which may transfer tokens
* @return remaining The number of tokens allowed to be spent
*/
function allowance(address owner, address spender) external view returns (uint256 remaining);
event Transfer(address indexed from, address indexed to, uint256 amount);
event Approval(address indexed owner, address indexed spender, uint256 amount);
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.23;
/**
* @title Careful Math
*/
contract CarefulMath {
/**
* @dev Possible error codes that we can return
*/
enum MathError {
NO_ERROR,
DIVISION_BY_ZERO,
INTEGER_OVERFLOW,
INTEGER_UNDERFLOW
}
/**
* @dev Multiplies two numbers, returns an error on overflow.
*/
function mulUInt(uint a, uint b) internal pure returns (MathError, uint) {
if (a == 0) {
return (MathError.NO_ERROR, 0);
}
uint c = a * b;
if (c / a != b) {
return (MathError.INTEGER_OVERFLOW, 0);
} else {
return (MathError.NO_ERROR, c);
}
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function divUInt(uint a, uint b) internal pure returns (MathError, uint) {
if (b == 0) {
return (MathError.DIVISION_BY_ZERO, 0);
}
return (MathError.NO_ERROR, a / b);
}
/**
* @dev Subtracts two numbers, returns an error on overflow (i.e. if subtrahend is greater than minuend).
*/
function subUInt(uint a, uint b) internal pure returns (MathError, uint) {
if (b <= a) {
return (MathError.NO_ERROR, a - b);
} else {
return (MathError.INTEGER_UNDERFLOW, 0);
}
}
/**
* @dev Adds two numbers, returns an error on overflow.
*/
function addUInt(uint a, uint b) internal pure returns (MathError, uint) {
uint c = a + b;
if (c >= a) {
return (MathError.NO_ERROR, c);
} else {
return (MathError.INTEGER_OVERFLOW, 0);
}
}
/**
* @dev add a and b and then subtract c
*/
function addThenSubUInt(uint a, uint b, uint c) internal pure returns (MathError, uint) {
(MathError err0, uint sum) = addUInt(a, b);
if (err0 != MathError.NO_ERROR) {
return (err0, 0);
}
return subUInt(sum, c);
}
}// SPDX-License-Identifier: BSD-3-Clause
pragma solidity 0.8.23;
/**
* @title Exponential module for storing fixed-precision decimals
* @notice Exp is a struct which stores decimals with a fixed precision of 18 decimal places.
* Thus, if we wanted to store the 5.1, mantissa would store 5.1e18. That is:
* `Exp({mantissa: 5100000000000000000})`.
*/
contract ExponentialNoError {
uint constant expScale = 1e18;
uint constant doubleScale = 1e36;
uint constant halfExpScale = expScale/2;
uint constant mantissaOne = expScale;
struct Exp {
uint mantissa;
}
struct Double {
uint mantissa;
}
/**
* @dev Truncates the given exp to a whole number value.
* For example, truncate(Exp{mantissa: 15 * expScale}) = 15
*/
function truncate(Exp memory exp) pure internal returns (uint) {
// Note: We are not using careful math here as we're performing a division that cannot fail
return exp.mantissa / expScale;
}
/**
* @dev Multiply an Exp by a scalar, then truncate to return an unsigned integer.
*/
function mul_ScalarTruncate(Exp memory a, uint scalar) pure internal returns (uint) {
Exp memory product = mul_(a, scalar);
return truncate(product);
}
/**
* @dev Multiply an Exp by a scalar, truncate, then add an to an unsigned integer, returning an unsigned integer.
*/
function mul_ScalarTruncateAddUInt(Exp memory a, uint scalar, uint addend) pure internal returns (uint) {
Exp memory product = mul_(a, scalar);
return add_(truncate(product), addend);
}
/**
* @dev Checks if first Exp is less than second Exp.
*/
function lessThanExp(Exp memory left, Exp memory right) pure internal returns (bool) {
return left.mantissa < right.mantissa;
}
/**
* @dev Checks if left Exp <= right Exp.
*/
function lessThanOrEqualExp(Exp memory left, Exp memory right) pure internal returns (bool) {
return left.mantissa <= right.mantissa;
}
/**
* @dev Checks if left Exp > right Exp.
*/
function greaterThanExp(Exp memory left, Exp memory right) pure internal returns (bool) {
return left.mantissa > right.mantissa;
}
/**
* @dev returns true if Exp is exactly zero
*/
function isZeroExp(Exp memory value) pure internal returns (bool) {
return value.mantissa == 0;
}
function safe224(uint n, string memory errorMessage) pure internal returns (uint224) {
require(n < 2**224, errorMessage);
return uint224(n);
}
function safe32(uint n, string memory errorMessage) pure internal returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function add_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
return Exp({mantissa: add_(a.mantissa, b.mantissa)});
}
function add_(Double memory a, Double memory b) pure internal returns (Double memory) {
return Double({mantissa: add_(a.mantissa, b.mantissa)});
}
function add_(uint a, uint b) pure internal returns (uint) {
return add_(a, b, "addition overflow");
}
function add_(uint a, uint b, string memory errorMessage) pure internal returns (uint) {
uint c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
return Exp({mantissa: sub_(a.mantissa, b.mantissa)});
}
function sub_(Double memory a, Double memory b) pure internal returns (Double memory) {
return Double({mantissa: sub_(a.mantissa, b.mantissa)});
}
function sub_(uint a, uint b) pure internal returns (uint) {
return sub_(a, b, "subtraction underflow");
}
function sub_(uint a, uint b, string memory errorMessage) pure internal returns (uint) {
require(b <= a, errorMessage);
return a - b;
}
function mul_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
return Exp({mantissa: mul_(a.mantissa, b.mantissa) / expScale});
}
function mul_(Exp memory a, uint b) pure internal returns (Exp memory) {
return Exp({mantissa: mul_(a.mantissa, b)});
}
function mul_(uint a, Exp memory b) pure internal returns (uint) {
return mul_(a, b.mantissa) / expScale;
}
function mul_(Double memory a, Double memory b) pure internal returns (Double memory) {
return Double({mantissa: mul_(a.mantissa, b.mantissa) / doubleScale});
}
function mul_(Double memory a, uint b) pure internal returns (Double memory) {
return Double({mantissa: mul_(a.mantissa, b)});
}
function mul_(uint a, Double memory b) pure internal returns (uint) {
return mul_(a, b.mantissa) / doubleScale;
}
function mul_(uint a, uint b) pure internal returns (uint) {
return mul_(a, b, "multiplication overflow");
}
function mul_(uint a, uint b, string memory errorMessage) pure internal returns (uint) {
if (a == 0 || b == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, errorMessage);
return c;
}
function div_(Exp memory a, Exp memory b) pure internal returns (Exp memory) {
return Exp({mantissa: div_(mul_(a.mantissa, expScale), b.mantissa)});
}
function div_(Exp memory a, uint b) pure internal returns (Exp memory) {
return Exp({mantissa: div_(a.mantissa, b)});
}
function div_(uint a, Exp memory b) pure internal returns (uint) {
return div_(mul_(a, expScale), b.mantissa);
}
function div_(Double memory a, Double memory b) pure internal returns (Double memory) {
return Double({mantissa: div_(mul_(a.mantissa, doubleScale), b.mantissa)});
}
function div_(Double memory a, uint b) pure internal returns (Double memory) {
return Double({mantissa: div_(a.mantissa, b)});
}
function div_(uint a, Double memory b) pure internal returns (uint) {
return div_(mul_(a, doubleScale), b.mantissa);
}
function div_(uint a, uint b) pure internal returns (uint) {
return div_(a, b, "divide by zero");
}
function div_(uint a, uint b, string memory errorMessage) pure internal returns (uint) {
require(b > 0, errorMessage);
return a / b;
}
function fraction(uint a, uint b) pure internal returns (Double memory) {
return Double({mantissa: div_(mul_(a, doubleScale), b)});
}
}{
"remappings": [
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "paris",
"viaIR": true,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract ComptrollerInterface","name":"comptroller_","type":"address"},{"internalType":"contract InterestRateModel","name":"interestRateModel_","type":"address"},{"internalType":"uint256","name":"initialExchangeRateMantissa_","type":"uint256"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"},{"internalType":"address payable","name":"admin_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"cashPrior","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"interestAccumulated","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"borrowIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalBorrows","type":"uint256"}],"name":"AccrueInterest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"uint256","name":"borrowAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"accountBorrows","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalBorrows","type":"uint256"}],"name":"Borrow","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"error","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"info","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"detail","type":"uint256"}],"name":"Failure","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"liquidator","type":"address"},{"indexed":false,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"uint256","name":"repayAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"rTokenCollateral","type":"address"},{"indexed":false,"internalType":"uint256","name":"seizeTokens","type":"uint256"}],"name":"LiquidateBorrow","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"minter","type":"address"},{"indexed":false,"internalType":"uint256","name":"mintAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"mintTokens","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"NewAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract ComptrollerInterface","name":"oldComptroller","type":"address"},{"indexed":false,"internalType":"contract ComptrollerInterface","name":"newComptroller","type":"address"}],"name":"NewComptroller","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"contract InterestRateModel","name":"oldInterestRateModel","type":"address"},{"indexed":false,"internalType":"contract InterestRateModel","name":"newInterestRateModel","type":"address"}],"name":"NewMarketInterestRateModel","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldPendingAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newPendingAdmin","type":"address"}],"name":"NewPendingAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldProtocolSeizeShareMantissa","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newProtocolSeizeShareMantissa","type":"uint256"}],"name":"NewProtocolSeizeShare","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldRedemptionReserveFactor","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newRedemptionReserveFactor","type":"uint256"}],"name":"NewRedemptionReserveFactor","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldReserveFactorMantissa","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newReserveFactorMantissa","type":"uint256"}],"name":"NewReserveFactor","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"redeemer","type":"address"},{"indexed":false,"internalType":"uint256","name":"redeemAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"redeemTokens","type":"uint256"}],"name":"Redeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"payer","type":"address"},{"indexed":false,"internalType":"address","name":"borrower","type":"address"},{"indexed":false,"internalType":"uint256","name":"repayAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"accountBorrows","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalBorrows","type":"uint256"}],"name":"RepayBorrow","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"benefactor","type":"address"},{"indexed":false,"internalType":"uint256","name":"addAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTotalReserves","type":"uint256"}],"name":"ReservesAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"admin","type":"address"},{"indexed":false,"internalType":"uint256","name":"reduceAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTotalReserves","type":"uint256"}],"name":"ReservesReduced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"_acceptAdmin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"_addReserves","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"reduceAmount","type":"uint256"}],"name":"_reduceReserves","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ComptrollerInterface","name":"newComptroller","type":"address"}],"name":"_setComptroller","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract InterestRateModel","name":"newInterestRateModel","type":"address"}],"name":"_setInterestRateModel","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"newPendingAdmin","type":"address"}],"name":"_setPendingAdmin","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newProtocolSeizeShareMantissa","type":"uint256"}],"name":"_setProtocolSeizeShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newReserveFactorMantissa","type":"uint256"}],"name":"_setReserveFactor","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"accrualBlockNumber","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accrueInterest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"admin","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOfUnderlying","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"borrowAmount","type":"uint256"}],"name":"borrow","outputs":[{"internalType":"enum TokenErrorReporter.Error","name":"","type":"uint8"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"borrowBalanceCurrent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"borrowBalanceStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"borrowIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"borrowRatePerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"comptroller","outputs":[{"internalType":"contract ComptrollerInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exchangeRateCurrent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"exchangeRateStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getAccountSnapshot","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCash","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ComptrollerInterface","name":"comptroller_","type":"address"},{"internalType":"contract InterestRateModel","name":"interestRateModel_","type":"address"},{"internalType":"uint256","name":"initialExchangeRateMantissa_","type":"uint256"},{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"interestRateModel","outputs":[{"internalType":"contract InterestRateModel","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isEthDerivative","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isRToken","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"borrower","type":"address"},{"internalType":"contract RToken","name":"rfTokenCollateral","type":"address"}],"name":"liquidateBorrow","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"mint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingAdmin","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"protocolSeizeShareMantissa","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"redeemTokens","type":"uint256"}],"name":"redeem","outputs":[{"internalType":"enum TokenErrorReporter.Error","name":"","type":"uint8"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"redeemAmount","type":"uint256"}],"name":"redeemUnderlying","outputs":[{"internalType":"enum TokenErrorReporter.Error","name":"","type":"uint8"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"repayBorrow","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"borrower","type":"address"}],"name":"repayBorrowBehalf","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"reserveFactorMantissa","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"liquidator","type":"address"},{"internalType":"address","name":"borrower","type":"address"},{"internalType":"uint256","name":"seizeTokens","type":"uint256"}],"name":"seize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"supplyRatePerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"sweepToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalBorrows","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalBorrowsCurrent","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalReserves","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":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"src","type":"address"},{"internalType":"address","name":"dst","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"underlying","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
608060409080825234620005b757620059748038038091620000228285620005bc565b8339810160e082820312620005b7578151916001600160a01b038084168403620005b75760209384830151938285168503620005b75783870151606085015190966001600160401b03929091838111620005b7578162000084918801620005e0565b90608087015190848211620005b757620000a0918801620005e0565b9660a08701519660ff8816809803620005b75760c00151948686168603620005b757601280546001600160a01b031916905560038054610100600160a81b03191633600881811b610100600160a81b0390811693909317808555939d929a9293901c9091169003620005675760095415806200055c575b156200050c578060075515620004af576200013290620006bd565b6200046b57620001529043600955670de0b6b3a7640000600a55620007c3565b6200041c5780519683881162000332576001978854928984811c9416801562000411575b8585101462000311578190601f94858111620003bb575b508590858311600114620003545760009262000348575b5050600019828c1b1c191690891b1788555b80519384116200033257600254928884811c9416801562000327575b8185101462000311578383869511620002b6575b50809284116001146200024a57506000926200023e575b505060001982881b1c191690851b176002555b84549360ff19600054161760005560081b169160018060a81b03191617179055516150939081620008c18239f35b015190503880620001fd565b9190889450601f198416600260005283600020936000905b8282106200029c575050841162000283575b505050811b0160025562000210565b0151600019838a1b60f8161c1916905538808062000274565b8484015186558b9790950194938401939081019062000262565b90919293506002600052816000208480870160051c82019284881062000307575b9187968c92969594930160051c01915b828110620002f7575050620001e6565b600081558796508b9101620002e7565b92508192620002d7565b634e487b7160e01b600052602260045260246000fd5b93607f1693620001d2565b634e487b7160e01b600052604160045260246000fd5b015190503880620001a4565b908b9350601f1983169184600052876000209260005b89828210620003a457505084116200038b575b505050811b018855620001b6565b0151600019838e1b60f8161c191690553880806200037d565b8385015186558f979095019493840193016200036a565b9091508a600052856000208580850160051c82019288861062000407575b918d91869594930160051c01915b828110620003f75750506200018d565b600081558594508d9101620003e7565b92508192620003d9565b93607f169362000176565b885162461bcd60e51b815260048101839052602260248201527f73657474696e6720696e7465726573742072617465206d6f64656c206661696c604482015261195960f21b6064820152608490fd5b895162461bcd60e51b815260048101849052601a60248201527f73657474696e6720636f6d7074726f6c6c6572206661696c65640000000000006044820152606490fd5b8a5162461bcd60e51b815260048101859052603060248201527f696e697469616c2065786368616e67652072617465206d75737420626520677260448201526f32b0ba32b9103a3430b7103d32b9379760811b6064820152608490fd5b8b5162461bcd60e51b815260048101869052602360248201527f6d61726b6574206d6179206f6e6c7920626520696e697469616c697a6564206f6044820152626e636560e81b6064820152608490fd5b50600a541562000117565b8b5162461bcd60e51b8152600481018690526024808201527f6f6e6c792061646d696e206d617920696e697469616c697a6520746865206d616044820152631c9ad95d60e21b6064820152608490fd5b600080fd5b601f909101601f19168101906001600160401b038211908210176200033257604052565b919080601f84011215620005b75782516001600160401b0381116200033257602090604051926200061b83601f19601f8501160185620005bc565b818452828287010111620005b75760005b8181106200064257508260009394955001015290565b85810183015184820184015282016200062c565b90816020910312620005b757518015158103620005b75790565b156200067857565b60405162461bcd60e51b815260206004820152601c60248201527f6d61726b6572206d6574686f642072657475726e65642066616c7365000000006044820152606490fd5b6003546001600160a01b039060081c811633036200079457600554604051623f1ee960e11b8152928216602084600481845afa9283156200078857620007316040947f7ac369dbd14fa5ea3f473ed67cc9d598964a77501540ba6751eb0b3decf5870d9660009162000752575b5062000670565b6001600160a01b0319831682176005558351921682526020820152a1600090565b62000779915060203d60201162000780575b620007708183620005bc565b81019062000656565b386200072a565b503d62000764565b6040513d6000823e3d90fd5b5050600080516020620059548339815191526060604051600181526041602082015260006040820152a1600190565b6003546001600160a01b039060081c811633036200089157600954430362000862576006546040516310c8fc9560e11b8152928216602084600481845afa9283156200078857620008416040947fedffc32e068c7c95dfd4bdfd5c4d939a084d6b11c4199eac8436ed234d72f9269660009162000752575062000670565b6001600160a01b0319831682176006558351921682526020820152a1600090565b5050600080516020620059548339815191526060604051600a81526043602082015260006040820152a1600a90565b5050600080516020620059548339815191526060604051600181526044602082015260006040820152a160019056fe608060408181526004918236101561002a575b505050361561002057600080fd5b61002861162e565b005b600092833560e01c91826306fdde031461139d57508163095ea7b31461132c5781631249c58b14611315578163173b9904146112f657816317bfdfbc146112af57816318160ddd14611290578163182df0f51461127357816323b872dd146112395781632678224714611211578163313ce567146111ef5781633630a6b514610d9e5781633af9e669146111315781633b1d21a2146111165781634576b5db146110f057816347bd3718146110d15781634e4d9fea146110a4578163532cce1814610f655781635fe3b56714610f3c578163601a0bf114610f035781636752e70214610ee45781636c540baf14610ec55781636f307dc314610e9c57816370a0823114610e6457816373acee9814610e145781638303084614610ddb578163852a12e314610da3578163895dabad14610d9e5781638f840ddd14610d7f57816395d89b4114610c9f57816395dd919314610c7957816399d8c1b414610766578163a6afed9514610749578163a9059cbb146106f5578163aa5af0fd146106d6578163aae40a2a14610688578163ae9d70b014610623578163b2a02ff1146105e9578163b71d1a0c146105b8578163bd6d894d1461059b578163c37f68e21461054c578163c5ebeaec14610514578163db006a75146104cf578163dd62ed3e14610486578163e597461914610440578163e9c714f214610423578163f2b3abbd146103f6578163f3fdb15a146103cd578163f851a440146103a0578163f8f9da28146102ea578163fca7820b146102ad575063fcb641471461026b5780610012565b816003193601126102a9579060209181549161028960ff841661165d565b60ff199283168155600161029c346131ea565b9382541617905551908152f35b5080fd5b919050346102e65760203660031901126102e65782600161029c60209554946102d860ff871661165d565b60ff1995861684553561203a565b8280fd5b919050346102e657826003193601126102e657602060018060a01b03600654164790600b5491600c54956103428651978895869485946315f2405360e01b865285016040919493926060820195825260208201520152565b03915afa91821561039657839261035e575b6020838351908152f35b9091506020813d60201161038e575b8161037a602093836114de565b810103126102e65760209250519038610354565b3d915061036d565b81513d85823e3d90fd5b5050346102a957816003193601126102a957600354905160089190911c6001600160a01b03168152602090f35b5050346102a957816003193601126102a95760065490516001600160a01b039091168152602090f35b5050346102a95760203660031901126102a95760209061041c610417611549565b611fef565b9051908152f35b5050346102a957816003193601126102a95760209061041c611ee8565b836020366003190112610483576001610457611549565b61047883549161046960ff841661165d565b60ff19928316855534906130a9565b505082541617815580f35b80fd5b5050346102a957806003193601126102a957806020926104a4611549565b6104ac611564565b6001600160a01b039182168352600f865283832091168252845220549051908152f35b8383346102a95760203660031901126102a95760016020936105078454916104f960ff841661165d565b60ff19928316865535613090565b5083541617825551908152f35b8383346102a95760203660031901126102a957600160209361050784549161053e60ff841661165d565b60ff19928316865535613044565b5050346102a95760203660031901126102a9576105979061057361056e611549565b611e56565b93519283526020830191909152604082015260608101919091529081906080820190565b0390f35b5050346102a957816003193601126102a95760209061041c611e1d565b9050346102e65760203660031901126102e65735916001600160a01b0383168303610483575061041c602092611d7a565b5050346102a95761029c9060209260016106023661157a565b9084969296549661061560ff891661165d565b60ff19978816865533612c0b565b919050346102e657826003193601126102e657600654600b54600c546008548451635c0b440b60e11b8152479681019687526020808801949094526040870192909252606086015293909184916001600160a01b039091169082908190608001610342565b50503660031901126104835761069c611549565b6024356001600160a01b03811691908290036102e6576104786001928454926106c760ff851661165d565b60ff1993841686553490612af8565b5050346102a957816003193601126102a957602090600a549051908152f35b5050346102a957806003193601126102a95790602091610713611549565b91600161073b82549461072860ff871661165d565b60ff199586168455602435903380612178565b159382541617905551908152f35b5050346102a957816003193601126102a95760209061041c6119e8565b919050346102e65760c03660031901126102e657610782611549565b9061078b611564565b90604490813592606480359367ffffffffffffffff94858111610c75576107b59036908a016115e7565b93608435868111610c71576107cd9036908b016115e7565b9360a4359860ff8a16809a03610c6d576003805490999060081c6001600160a01b03163303610c20576009541580610c16575b15610bc9578060075515610b6f57610817906117d1565b610b2d576108349043600955670de0b6b3a7640000600a556128a2565b610ae1575050508151958387116109da57600196806108538954611442565b94601f95868111610a74575b506020908683116001146109f8578b926109ed575b505060001982881b1c191690881b1787555b81519384116109da575090829161089e600254611442565b82811161096a575b5060209183116001146108ec5787926108e1575b505060001982841b1c191690841b176002555b60ff19918282541617905582541617815580f35b0151905038806108ba565b600288528693507f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace9190601f198416895b8181106109525750841161093a575b505050811b016002556108cd565b015160001983861b60f8161c1916905538808061092c565b8284015185558996909401936020938401930161091d565b90919250600288527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace8380860160051c820192602087106109d1575b9186958a929594930160051c01915b8281106109c35750506108a6565b8a81558695508991016109b5565b925081926109a6565b634e487b7160e01b885260419052602487fd5b015190503880610874565b8a8c528a93507fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf69190601f1984168d5b818110610a5c57508411610a44575b505050811b018755610886565b0151600019838a1b60f8161c19169055388080610a37565b8284015185558d969094019360209384019301610a28565b909150898b527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf68680850160051c82019260208610610ad8575b918c91869594930160051c01915b828110610aca57505061085f565b8d81558594508c9101610abc565b92508192610aae565b6084927f73657474696e6720696e7465726573742072617465206d6f64656c206661696c8a93602061195960f21b94519562461bcd60e51b875286015260226024860152840152820152fd5b505162461bcd60e51b81526020818a0152601a60248201527f73657474696e6720636f6d7074726f6c6c6572206661696c656400000000000091810191909152fd5b825162461bcd60e51b81526020818d0152603060248201527f696e697469616c2065786368616e67652072617465206d757374206265206772818601526f32b0ba32b9103a3430b7103d32b9379760811b81870152608490fd5b835162461bcd60e51b81526020818e0152602360248201527f6d61726b6574206d6179206f6e6c7920626520696e697469616c697a6564206f81870152626e636560e81b81880152608490fd5b50600a5415610800565b835162461bcd60e51b81526020818e01526024808201527f6f6e6c792061646d696e206d617920696e697469616c697a6520746865206d6181870152631c9ad95d60e21b81880152608490fd5b8b80fd5b8a80fd5b8980fd5b5050346102a95760203660031901126102a95760209061041c610c9a611549565b611963565b8284346104835780600319360112610483578151908060025490610cc282611442565b80855291602091600191828116908115610d525750600114610cfa575b6105978688610cf0828903836114de565b5191829182611500565b9350600284527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace5b838510610d3f57505050508101602001610cf08261059786610cdf565b8054868601840152938201938101610d22565b905061059797955086935060209250610cf094915060ff191682840152151560051b820101929486610cdf565b5050346102a957816003193601126102a957602090600c549051908152f35b6115af565b8383346102a95760203660031901126102a9576001602093610507845491610dcd60ff841661165d565b60ff19928316865535612803565b919050346102e65760203660031901126102e65782600161029c6020955494610e0660ff871661165d565b60ff19958616845535611918565b5050346102a957816003193601126102a95790602091815491610e3960ff841661165d565b60ff199283168155610e52610e4c6119e8565b15611696565b6001600b549382541617905551908152f35b5050346102a95760203660031901126102a95760209181906001600160a01b03610e8c611549565b168152600e845220549051908152f35b5050346102a957816003193601126102a95760125490516001600160a01b039091168152602090f35b5050346102a957816003193601126102a9576020906009549051908152f35b5050346102a957816003193601126102a9576020906011549051908152f35b919050346102e65760203660031901126102e65782600161029c6020955494610f2e60ff871661165d565b60ff199586168455356118ca565b5050346102a957816003193601126102a95760055490516001600160a01b039091168152602090f35b919050346102e657826003193601126102e65760035460081c6001600160a01b031633819003611049574790811561100e578480809381935af13d15611009573d610faf816115cb565b90610fbc845192836114de565b81528460203d92013e5b15610fcf578280f35b906020606492519162461bcd60e51b835282015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152fd5b610fc6565b825162461bcd60e51b81526020818601526015602482015274139bc8195d1a195c881b19599d081d1bc81cd95b99605a1b6044820152606490fd5b815162461bcd60e51b8152602081850152602f60248201527f5245746865723a3a7377656570546f6b656e3a206f6e6c792061646d696e206360448201526e616e20737765657020746f6b656e7360881b6064820152608490fd5b838060031936011261048357600181546110c060ff821661165d565b60ff19908116835561047834612542565b5050346102a957816003193601126102a957602090600b549051908152f35b5050346102a95760203660031901126102a95760209061041c611111611549565b6117d1565b5050346102a957816003193601126102a95751478152602090f35b839150346102a95760203660031901126102a957611181611150611549565b611158611e1d565b908551916111658361147c565b82526001600160a01b03168452600e6020528484205490612436565b92828210156111dc5750611199575060209151908152f35b606490602084519162461bcd60e51b8352820152601f60248201527f62616c616e636520636f756c64206e6f742062652063616c63756c61746564006044820152fd5b634e487b7160e01b815260218352602490fd5b5050346102a957816003193601126102a95760209060ff600354169051908152f35b9050346102e657826003193601126102e6575490516001600160a01b03909116815260209150f35b5050346102a95761073b9060209260016112523661157a565b9084969296549661126560ff891661165d565b60ff19978816865533612178565b5050346102a957816003193601126102a95760209061041c6116db565b5050346102a957816003193601126102a957602090600d549051908152f35b5050346102a95760203660031901126102a957906020916112ce611549565b91600161029c8254946112e360ff871661165d565b60ff199586168455610c9a610e4c6119e8565b5050346102a957816003193601126102a9576020906008549051908152f35b83806003193601126104835761132961162e565b80f35b5050346102a957806003193601126102a9576020918161134a611549565b91602435918291338152600f87528181209460018060a01b0316948582528752205582519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925843392a35160018152f35b839085346104835780600319360112610483578060018054906113bf82611442565b8086529260209260018116908115610d5257506001146113ea576105978688610cf0828903836114de565b9350600184527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b83851061142f57505050508101602001610cf08261059786610cdf565b8054868601840152938201938101611412565b90600182811c92168015611472575b602083101461145c57565b634e487b7160e01b600052602260045260246000fd5b91607f1691611451565b6020810190811067ffffffffffffffff82111761149857604052565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff811161149857604052565b6040810190811067ffffffffffffffff82111761149857604052565b90601f8019910116810190811067ffffffffffffffff82111761149857604052565b6020808252825181830181905290939260005b82811061153557505060409293506000838284010152601f8019910116010190565b818101860151848201604001528501611513565b600435906001600160a01b038216820361155f57565b600080fd5b602435906001600160a01b038216820361155f57565b606090600319011261155f576001600160a01b0390600435828116810361155f5791602435908116810361155f579060443590565b3461155f57600036600319011261155f57602060405160018152f35b67ffffffffffffffff811161149857601f01601f191660200190565b81601f8201121561155f578035906115fe826115cb565b9261160c60405194856114de565b8284526020838301011161155f57816000926020809301838601378301015290565b600160005461163f60ff821661165d565b60ff1990811660005561165134612085565b50506000541617600055565b1561166457565b60405162461bcd60e51b815260206004820152600a6024820152691c994b595b9d195c995960b21b6044820152606490fd5b1561169d57565b60405162461bcd60e51b81526020600482015260166024820152751858d8dc9d59481a5b9d195c995cdd0819985a5b195960521b6044820152606490fd5b6116e36120d8565b906004811015611757576116f45790565b60405162461bcd60e51b815260206004820152603560248201527f65786368616e67655261746553746f7265643a2065786368616e67655261746560448201527414dd1bdc9959125b9d195c9b985b0819985a5b1959605a1b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9081602091031261155f5751801515810361155f5790565b1561178c57565b60405162461bcd60e51b815260206004820152601c60248201527f6d61726b6572206d6574686f642072657475726e65642066616c7365000000006044820152606490fd5b6003546001600160a01b039060081c8116330361189c57600554604051623f1ee960e11b8152928216602084600481845afa928315611890576118406040947f7ac369dbd14fa5ea3f473ed67cc9d598964a77501540ba6751eb0b3decf5870d96600091611861575b50611785565b6001600160a01b0319831682176005558351921682526020820152a1600090565b611883915060203d602011611889575b61187b81836114de565b81019061176d565b3861183a565b503d611871565b6040513d6000823e3d90fd5b505060008051602061501e8339815191526060604051600181526041602082015260006040820152a1600190565b6118d26119e8565b90816118e5576118e29150612592565b90565b5060128110156117575760008051602061501e83398151915260606040518381526032602082015260006040820152a190565b6119206119e8565b9081611930576118e2915061274f565b5060128110156117575760008051602061501e83398151915260606040518381526056602082015260006040820152a190565b61196c9061282f565b9060048110156117575761197d5790565b60405162461bcd60e51b815260206004820152603760248201527f626f72726f7742616c616e636553746f7265643a20626f72726f7742616c616e60448201527f636553746f726564496e7465726e616c206661696c65640000000000000000006064820152608490fd5b60098054438114611d73576119fd3447612469565b600b54600c54600a54600654604080516315f2405360e01b8152600480820188905260248201879052604482018690529597949594919392602092908390839060649082906001600160a01b03165afa918215611d6857600092611d39575b5065048c273950008211611cf657611a749043612997565b919086811015611c0257611cb35790611aa89160008651611a948161147c565b52855190611aa18261147c565b81526129b7565b929085811015611c9e5780611c715750611ac28884612436565b989086811015611c025780611c435750611adc9089612a9e565b969086811015611c025780611c175750611b079089600854875190611b008261147c565b8152612ac0565b939086811015611c025780611bd457509080611b2292612ac0565b9480821015611bbf575080611b9357505090611b8b9392917f4dec04e750ca11537cabcd8a9eab06494de08da3735bc8871cd41250e190bc049743905582600a5583600b55600c5551948594859094939260609260808301968352602083015260408201520152565b0390a1600090565b935093505060008051602061501e8339815191529450606093506003815193878552840152820152a190565b602190634e487b7160e01b6000525260246000fd5b9550505093505060008051602061501e8339815191529450606093506005815193878552840152820152a190565b602187634e487b7160e01b6000525260246000fd5b9593505050935060008051602061501e833981519152955060609450815193878552840152820152a190565b9550505093505060008051602061501e8339815191529450606093506001815193878552840152820152a190565b94505093505060008051602061501e8339815191529450606093506006815193878552840152820152a190565b602186634e487b7160e01b6000525260246000fd5b845162461bcd60e51b8152808701849052601f60248201527f636f756c64206e6f742063616c63756c61746520626c6f636b2064656c7461006044820152606490fd5b845162461bcd60e51b8152808701849052601c60248201527f626f72726f772072617465206973206162737572646c792068696768000000006044820152606490fd5b9091508281813d8311611d61575b611d5181836114de565b8101031261155f57519038611a5c565b503d611d47565b85513d6000823e3d90fd5b5050600090565b6003546001600160a01b039060081c81163303611def57600480548383166001600160a01b031982161790915560408051929091166001600160a01b03908116835290921660208201527fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a99181908101611b8b565b505060008051602061501e8339815191526060604051600181526047602082015260006040820152a1600190565b60005490611e2d60ff831661165d565b60ff19918216600055611e41610e4c6119e8565b6001611e4b6116db565b926000541617600055565b6001600160a01b0381166000908152600e60205260408120549291611e7a9061282f565b92906004811015611ed457611ec757611e916120d8565b92906004811015611eb357611ea65793929190565b6009945092508291508190565b634e487b7160e01b82526021600452602482fd5b9150915060099180918190565b634e487b7160e01b83526021600452602483fd5b6004546001600160a01b03808216338114801590611fe7575b611fb85760038054610100600160a81b03600886811b91909116610100600160a81b0319831617928390556001600160a01b03199095166004556040805191861c85166001600160a01b0390811683529290951c9093161660208301527fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a992917ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc908390a1815190815260006020820152a1600090565b50505060008051602061501e8339815191526060604051600181526000602082015260006040820152a1600190565b503315611f01565b611ff76119e8565b9081612007576118e291506128a2565b5060128110156117575760008051602061501e83398151915260606040518381526042602082015260006040820152a190565b6120426119e8565b9081612052576118e291506130fa565b5060128110156117575760008051602061501e83398151915260606040518381526048602082015260006040820152a190565b61208d6119e8565b90816120a25761209e915033613282565b9091565b5060128110156117575760008051602061501e8339815191526060604051838152601e602082015260006040820152a190600090565b600d54806120e95750600754600091565b906120f43447612469565b91612116604051936121058561147c565b6000809552600b54600c549161372b565b60048293921015612164578261215e576121309250613757565b90600481101561214a578061214457505190565b90509190565b634e487b7160e01b84526021600452602484fd5b50509190565b634e487b7160e01b85526021600452602485fd5b600554604080516317b9b84b60e31b8152306004808301919091526001600160a01b03868116602484015280881660448401526064830189905290979381169660209493928581806084810103816000809d5af190811561242c5789916123fb575b50806123c85750811695811694858714612396571684810361237d57600019905b6122058483612997565b92908a81101561236a5761233757868952600e865261222785858b2054612997565b9a9081811015612324576122f057888a52600e875261224986868c2054612a9e565b91808210156122dd57506122a957899a8860008051602061503e833981519152999a9b52600e8852858c2055898b52848b20556000190361228f575b505051908152a390565b868952600f85528289209089528452818820553880612285565b5050505060008051602061501e833981519152965080929450606095935060529150519360098552840152820152a1600990565b634e487b7160e01b8c526021905260248bfd5b5050505060008051602061501e833981519152965080929450606095935060519150519360098552840152820152a1600990565b634e487b7160e01b8b526021825260248bfd5b50505060008051602061501e833981519152965080929450606095935060509150519360098552840152820152a1600990565b634e487b7160e01b8a5260218b5260248afd5b848752600f8452818720818852845281872054906121fb565b505060008051602061501e833981519152965080929450606095935060509150519360028552840152820152a1600290565b9550505060008051602061501e83398151915296506060955080929450604f9150519360038552840152820152a1600390565b90508581813d8311612425575b61241281836114de565b810103126124215751386121da565b8880fd5b503d612408565b84513d8b823e3d90fd5b90612440916129b7565b6004821015611757578161246257670de0b6b3a7640000915051049060009190565b5090600090565b9190820391821161247657565b634e487b7160e01b600052601160045260246000fd5b60128110156117575760008051602061501e83398151915260606040518381526028602082015260006040820152a190565b60008051602061501e8339815191526060604051600c81526027602082015260006040820152a1600c90565b60008051602061501e8339815191526060604051600a8152602e602082015260006040820152a1600a90565b60008051602061501e8339815191526060604051600f81526031602082015260006040820152a1600f90565b61254a6119e8565b908161255c5761209e915033336137ef565b5060128110156117575760008051602061501e83398151915260606040518381526038602082015260006040820152a190600090565b6003546001600160a01b03919060081c8216338190036127205760095443036126f157816125c03447612469565b106126c257600c5490818311612692576125da8383612469565b918211612641577f3bad0c59cf2f06e7314077049f48a93578cd16f5ef92329f1dab1420a99c177e9361261484611b8b9385600c55613bf6565b60035460081c169160405193849384604091949392606082019560018060a01b0316825260208201520152565b60405162461bcd60e51b8152602060048201526024808201527f72656475636520726573657276657320756e657870656374656420756e646572604482015263666c6f7760e01b6064820152608490fd5b5050505060008051602061501e8339815191526060604051600281526036602082015260006040820152a1600290565b50505060008051602061501e8339815191526060604051600f81526034602082015260006040820152a1600f90565b50505060008051602061501e8339815191526060604051600a81526035602082015260006040820152a1600a90565b50505060008051602061501e8339815191526060604051600181526033602082015260006040820152a1600190565b60035460081c6001600160a01b031633036127d65760095443036127a95760407ff5815f353a60e815cce7553e4f60c533a59d26b1b5504ea4b6db8d60da3e4da291601154908060115582519182526020820152a1600090565b5060008051602061501e8339815191526060604051600a81526058602082015260006040820152a1600a90565b5060008051602061501e8339815191526060604051600181526057602082015260006040820152a1600190565b61280b6119e8565b908161281c576118e2915033613c22565b506012811015611757576118e29061248c565b6001600160a01b031660009081526010602052604081208054919291801561289c57600a5461285d916143e2565b90600481101561216457806128955750600161287b92015490614407565b92906004811015611eb3578061289057509190565b925090565b9150509190565b50508190565b6003546001600160a01b039060081c8116330361296957600954430361293b576006546040516310c8fc9560e11b8152928216602084600481845afa9283156118905761291a6040947fedffc32e068c7c95dfd4bdfd5c4d939a084d6b11c4199eac8436ed234d72f926966000916118615750611785565b6001600160a01b0319831682176006558351921682526020820152a1600090565b505060008051602061501e8339815191526060604051600a81526043602082015260006040820152a1600a90565b505060008051602061501e8339815191526060604051600181526044602082015260006040820152a1600190565b908181116129ad576129a891612469565b600091565b5050600390600090565b906129d19160006040516129ca8161147c565b52516143e2565b9190600481101561175757806129f75750604051916129ef8361147c565b825260009190565b6040519250612a058361147c565b600083529190565b606060008051602061501e833981519152916040519060038252602960208301526040820152a1600390565b606060008051602061501e833981519152916040519060098252603060208301526040820152a1600990565b606060008051602061501e833981519152916040519060098252602f60208301526040820152a1600990565b9190820180921161247657565b9190612aaa9083612a91565b918210612ab75760009190565b60029150600090565b90612aca916129b7565b919060048110156117575780612aef5750670de0b6b3a764000061209e925104612a9e565b91505090600090565b929190612b036119e8565b80612bc5575060405163a6afed9560e01b815260009490602081600481896001600160a01b0389165af1908115612bba578691612b84575b5080612b4e575061209e93945033614421565b925050506012811015611ed45760008051602061501e833981519152606060405183815260106020820152856040820152a19190565b90506020813d602011612bb2575b81612b9f602093836114de565b81010312612bae575138612b3b565b8580fd5b3d9150612b92565b6040513d88823e3d90fd5b929350505060128110156117575760008051602061501e8339815191526060604051838152600f602082015260006040820152a190600090565b60048210156117575752565b60055460405163d02f735160e01b81523060048201526001600160a01b039283166024820152838316604482015284831660648201526084810186905292939290602090829060a490829060009087165af190811561189057600091613012575b5080612fe0575080831681831614612fb05760405192610120840184811067ffffffffffffffff821117611498576040526000845260006020850152600060408501526000606085015260006080850152600060a0850152600060c0850152600060e085015261010084019460008652828416600052600e602052612d04612cf982604060002054612997565b602088015286612bff565b8451600481101561175757612f7457612d53612d469160115480604051612d2a8161147c565b52670de0b6b3a7640000938491612d3f614e9a565b9084614fef565b04908160808901526149b1565b6060860152612d6e612d636120d8565b60c088015286612bff565b8451600481101561175757612f2f57612d9f60c086015160405190612d928261147c565b8152608087015190614efb565b51048060a0860152612deb600c5491612de260405191612dbe836114c2565b60118352706164646974696f6e206f766572666c6f7760781b602084015284612a91565b92831015614ed3565b60e0850152612e01600d546080860151906149b1565b8552818116600052600e602052612e30612e25604060002054606087015190612a9e565b604087015285612bff565b8351600481101561175757612ef4577fa91e67c5ea634cd43a12c5a482724b03de01e85ca68702a53d0c2f45cb7c1dc59460e0850151600c5551600d556020840151828416600052600e602052604060002055604084015182821660005260406000205560608401516040519081528260008051602061503e83398151915292169082602085871692a3602060808501519260405193845230941692a360a081015160e0909101516040805130815260208101939093528201528060608101611b8b565b505050905051600481101561175757606060008051602061501e833981519152916040519060098252601960208301526040820152a1600990565b60405162461bcd60e51b815260206004820152601860248201527f65786368616e67652072617465206d617468206572726f7200000000000000006044820152606490fd5b50505050905051600481101561175757606060008051602061501e833981519152916040519060098252601a60208301526040820152a1600990565b5050505060008051602061501e833981519152606060405160068152601c602082015260006040820152a1600690565b91505060008051602061501e8339815191529250606091506040519060038252601b60208301526040820152a1600390565b90506020813d60201161303c575b8161302d602093836114de565b8101031261155f575138612c6c565b3d9150613020565b61304c6119e8565b908161305d576118e29150336149f5565b5060128110156117575760008051602061501e83398151915260606040518381526008602082015260006040820152a190565b6130986119e8565b908161281c576118e2915033613f6f565b906130b26119e8565b91826130c35761209e9250336137ef565b505060128110156117575760008051602061501e83398151915260606040518381526037602082015260006040820152a190600090565b60035460081c6001600160a01b031633036131bd57600954430361319057670de0b6b3a764000081116131635760407faaa68312e2ea9d50e16af5068410ab56e1a1fd06037b1a35664812c30f82146091600854908060085582519182526020820152a1600090565b5060008051602061501e833981519152606060405160028152604b602082015260006040820152a1600290565b5060008051602061501e8339815191526060604051600a8152604a602082015260006040820152a1600a90565b5060008051602061501e8339815191526060604051600181526049602082015260006040820152a1600190565b6131f26119e8565b9081613206576132029150614d28565b5090565b5060128110156117575760008051602061501e83398151915260606040518381526053602082015260006040820152a190565b6040519060e0820182811067ffffffffffffffff821117611498576040528160c06000918281528260208201528260408201528260608201528260808201528260a08201520152565b60055460408051634ef4c3e160e01b8152306004808301919091526001600160a01b0380861660248401526044830187905293841696959460209491928581806064810103816000809d5af19081156137215789916136f4575b50806136c5575087600954430361369657506132f6613239565b956132ff6120d8565b979091613315888301938884019a8b5284612bff565b82518681101561363557613648579061335361333685949361336296614e0a565b60c083019a818c52519089519161334c8361147c565b8252614e90565b94906060830195865283612bff565b815186811015613635576135f4579061339291613383600d54865190612a9e565b93906080830194855283612bff565b81518781101561358d576135a0579160a0916133d385946133c68f8c90600e8f9c809c9b169c8d8352522054885190612a9e565b9590910194855282612bff565b518781101561358d576135365751600d5551848b52600e8852868b20558751825187516001600160a01b039390931683526020830191909152604082015289959493869390926024928491907f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f90606090a151875190815260008051602061503e8339815191528a3092a3600554169185519687938492631ea016b760e21b8452878401525af1801561352c5761348d575b505050505190565b3d8088853e61349c81856114de565b830192848185031261352857805167ffffffffffffffff91828211610c7557019184601f8401121561242157825191821161351557508481819260051b9451906134e8838701836114de565b81520192820101928311613511578301905b8282101561348557815181529083019083016134fa565b8680fd5b634e487b7160e01b895260419052602488fd5b8780fd5b82513d89823e3d90fd5b875162461bcd60e51b81528088018a9052602b60248201527f4d494e545f4e45575f4143434f554e545f42414c414e43455f43414c43554c4160448201526a151253d397d1905253115160aa1b6064820152608490fd5b634e487b7160e01b8d526021885260248dfd5b875162461bcd60e51b81528088018a9052602860248201527f4d494e545f4e45575f544f54414c5f535550504c595f43414c43554c4154494f6044820152671397d1905253115160c21b6064820152608490fd5b60648689808a519262461bcd60e51b845283015260248201527f4d494e545f45584348414e47455f43414c43554c4154494f4e5f4641494c45446044820152fd5b634e487b7160e01b8c526021875260248cfd5b50505194955050508083101561368357509160609183602160008051602061501e83398151915295519360098552840152820152a160099190565b634e487b7160e01b865260219052602485fd5b9250505060008051602061501e8339815191529350816022606094935193600a8552840152820152a1600a9190565b9250505060008051602061501e833981519152935081601f60609493519360038552840152820152a160039190565b90508581813d831161371a575b61370b81836114de565b810103126124215751386132dc565b503d613701565b85513d8b823e3d90fd5b9061373591612a9e565b60048293921015611757578261374f5761209e9250612997565b505090600090565b9190613773604051936137698561147c565b6000809552614380565b6004829392101561216457826137c05761378d9250614407565b92906004811015611eb357806137b15750604051926137ab8461147c565b83529190565b6040519350906137ab8461147c565b5050604051926137ab8461147c565b81156137d9570490565b634e487b7160e01b600052601260045260246000fd5b600554604051631200453160e11b8152306004808301919091526001600160a01b038481166024840152858116604484015260648301879052939493909260209183916084918391600091165af190811561189057600091613bc4575b5080613b8f57506009544303613b5c5760405193610100850185811067ffffffffffffffff821117613b47576040526000855260006020860152600060408601526000606086015260006080860152600060a0860152600060c0860152600060e08601526138ea6138dc60018060a01b03851694856000526010602052600160406000200154606089015261282f565b608088015260208701612bff565b602085015182811015613b3257613aef576000198103613ae55750608084015160408501525b613942613934613924604087015186614e0a565b8060e08801526080870151612997565b60a087015260208601612bff565b602084015181811015613a6657613a7b57613975613967600b5460e087015190612997565b60c087015260208601612bff565b602084015181811015613a6657613a08575060a083927f1a2a22cb034d26d1854bdc6666a5b91fe25efbbb5dcad3b0355478d6f5c362a1928260e096015181600052601060205260406000209081556001600a5491015560c08501519081600b5586860151848701519160405194600180881b031685526020850152604084015260608301526080820152a10151600091565b60849060206040519162461bcd60e51b8352820152603160248201527f52455041595f424f52524f575f4e45575f544f54414c5f42414c414e43455f43604482015270105310d55310551253d397d19052531151607a1b6064820152fd5b602182634e487b7160e01b6000525260246000fd5b60849060206040519162461bcd60e51b8352820152603a60248201527f52455041595f424f52524f575f4e45575f4143434f554e545f424f52524f575f60448201527f42414c414e43455f43414c43554c4154494f4e5f4641494c45440000000000006064820152fd5b6040850152613910565b509290506020915001519080821015611bbf5750606060008051602061501e833981519152916040519060098252603960208301526040820152a1600990600090565b602183634e487b7160e01b6000525260246000fd5b604183634e487b7160e01b6000525260246000fd5b5050505060008051602061501e8339815191526060604051600a8152603b602082015260006040820152a1600a90600090565b91505060008051602061501e8339815191529250606091506040519060038252603a60208301526040820152a1600390600090565b90506020813d602011613bee575b81613bdf602093836114de565b8101031261155f57513861384c565b3d9150613bd2565b6000808093819382908215613c18575b6001600160a01b031690f11561189057565b6108fc9150613c06565b9091906001613c313447612469565b10613f6457613c3e613239565b90613c476116db565b91613c6a604095865194613c5a8661147c565b8552613c64614e9a565b90614f78565b92670de0b6b3a7640000613cc2613cb58351895197613c88896114c2565b600e8952613cb06020996d646976696465206279207a65726f60901b8b820152831515614ed3565b6137cf565b6060850193818552614efb565b5104608083019081526005548251885163eabe7d9160e01b8152306004808301919091526001600160a01b038881166024840152604483019390935292821697939592939192908281806064810103816000809d5af1908115613f5a578991613f2d575b5080613f1957506009544303613f0757613d44600d54865190612997565b91613d598482019260a0830194855283612bff565b815186811015613ef457613ed4579160c091613d8c8695946133c68f8e9a998e169a8b8152600e895220548b5190612997565b80518681101561363557613ea05750613da53447612469565b885111613e8c5751600d5551848952600e82528a8920558360008051602061503e8339815191528651928c519384523093a3845184518a516001600160a01b0389168152602081019290925260408201527fe5b754fb1abb7f01b499791d0b820ae3b6af3424ac1c59768edb53f4ec31a92990606090a16005541684519351813b1561352857916084918894938b5196879586946351dff98960e01b865230908601526024850152604484015260648301525afa958615613e8357506118e2939495613e74575b505190613bf6565b613e7d906114ae565b38613e6c565b513d85823e3d90fd5b5050505050505050505090506118e2612516565b985050505050959650505050519180831015613ec15750506118e290612a65565b634e487b7160e01b825260219052602490fd5b5096505050509495505050519180831015613ec15750506118e290612a39565b634e487b7160e01b8b526021875260248bfd5b505050505050505090506118e26124ea565b9750505050505050506118e2919250612a0d565b90508281813d8311613f53575b613f4481836114de565b81010312612421575138613d26565b503d613f3a565b8b513d8b823e3d90fd5b5090506118e26124be565b600090821580159081614365575b15614303576001613f8e3447612469565b106142f757613f9b613239565b93613fa46116db565b90604092835192613fb48461147c565b8352156142595780670de0b6b3a764000092613fd4926060890152614efb565b510460808501525b600554606085018051835163eabe7d9160e01b8152306004808301919091526001600160a01b0387811660248401526044830193909352929493602091908290829060649082908c9088165af190811561424f578891614222575b50806142105750600954430361420057614055600d54865190612997565b9061406a838b019160a08c0193845282612bff565b8051858110156141ed576141cf5783929160c09161409d8c6133c68a8e9a998e169a8b8152600e895220548c5190612997565b805186811015613635576141af575060806140b83447612469565b9b019a8b511161419c5751600d5551848952600e8252858920558360008051602061503e83398151915287519287519384523093a38751855185516001600160a01b0389168152602081019290925260408201527fe5b754fb1abb7f01b499791d0b820ae3b6af3424ac1c59768edb53f4ec31a92990606090a16005541687519451813b156135285791608491889493865197889586946351dff98960e01b865230908601526024850152604484015260648301525afa908115613e835750614189575b506118e291925190613bf6565b916141966118e2936114ae565b9161417c565b50505050505050505050506118e2612516565b9850505050509550505050519180831015613ec15750506118e290612a65565b965050505094505050519180831015613ec15750506118e290612a39565b634e487b7160e01b8a526021865260248afd5b50505050505050506118e26124ea565b96505050505050506118e29150612a0d565b90508181813d8311614248575b61423981836114de565b81010312613528575138614037565b503d61422f565b85513d8a823e3d90fd5b50614262614e9a565b508051614298835191614274836114c2565b600e83526d646976696465206279207a65726f60901b602084015215918215614ed3565b6142e3576142cb670de0b6b3a7640000918560608801528584516142bb8161147c565b52516142c5614e9a565b50614fc2565b8083516142d78161147c565b52046080850152613fdc565b634e487b7160e01b84526012600452602484fd5b505050506118e26124be565b60405162461bcd60e51b815260206004820152603460248201527f6f6e65206f662072656465656d546f6b656e73496e206f722072656465656d416044820152736d6f756e74496e206d757374206265207a65726f60601b6064820152608490fd5b506001613f7d565b8181029291811591840414171561247657565b80156143b457670de0b6b3a7640000808202918083048203612476576143a690836137cf565b146129a85750600290600090565b50600090600090565b670de0b6b3a76400009080820291820480820361247657146129a85750600290600090565b9081156143fd576143a66143f6828461436d565b92836137cf565b5050600090600090565b908015614417576129a8916137cf565b5050600190600090565b60055460408051632fe3f38f60e11b8152306004808301919091526001600160a01b039788166024830181905285891660448401528689166064840152608483018890529798959795969495949293602092908390829060a49082908e165afa908115611d6857600091614984575b50806149505750600954430361491a578351636c540baf60e01b815282818381895afa908115611d68576000916148ed575b5043036148b757888616958989169387851461487f57801561484757600019811461480f576144f2908a836137ef565b9990806147cf5750600554865163c488847b60e01b8152308582019081526001600160a01b038a166020820152604081018d90529b9c9a9b999a909988928b9216908290819060600103915afa9788156147c45760009060009961478f575b506147305785516370a0823160e01b815283810186905284816024818b5afa908115614725579089916000916146f4575b50106146b157879060009285308a1460001461462457506145a4935030612c0b565b6145ec575082519586528501528301859052606083015260808201527f298637f684da70674f26509b10f07ec2fbc77a335ab1e7d6215a4b2484d8bb529060a090a160009190565b60649184519162461bcd60e51b835282015260146024820152731d1bdad95b881cd95a5e9d5c994819985a5b195960621b6044820152fd5b885163b2a02ff160e01b81526001600160a01b0392831687820190815293909216602084015260408301939093529190829081906060010381858b5af19182156146a6578092614676575b50506145a4565b9091508382813d831161469f575b61468e81836114de565b81010312610483575051388061466f565b503d614684565b8651903d90823e3d90fd5b855162461bcd60e51b8152808401859052601860248201527f4c49515549444154455f5345495a455f544f4f5f4d55434800000000000000006044820152606490fd5b809250868092503d831161471e575b61470d81836114de565b8101031261155f5788905138614582565b503d614703565b87513d6000823e3d90fd5b855162461bcd60e51b8152808401859052603360248201527f4c49515549444154455f434f4d5054524f4c4c45525f43414c43554c4154455f604482015272105353d5539517d4d152569157d19052531151606a1b6064820152608490fd5b809950878092503d83116147bd575b6147a881836114de565b8101031261155f578388519801519738614551565b503d61479e565b86513d6000823e3d90fd5b9950505093509496505091506012841015611bbf575060008051602061501e8339815191529160008260186060945193878552840152820152a190600090565b505050935050606093955060008051602061501e833981519152945060009150601481519360078552840152820152a1600790600090565b505050935050606093955060008051602061501e833981519152945060009150601581519360078552840152820152a1600790600090565b505050935050606093955060008051602061501e833981519152945060009150601781519360068552840152820152a1600690600090565b50935050606093955060008051602061501e8339815191529450600091506011815193600a8552840152820152a1600a90600090565b90508281813d8311614913575b61490481836114de565b8101031261155f5751386144c2565b503d6148fa565b50935050606093955060008051602061501e8339815191529450600091506016815193600a8552840152820152a1600a90600090565b945050935050606093955060008051602061501e8339815191529450601281519360038552840152820152a1600390600090565b90508281813d83116149aa575b61499b81836114de565b8101031261155f575138614490565b503d614991565b906118e2916149f06040516149c5816114c2565b60158152747375627472616374696f6e20756e646572666c6f7760581b602082015282841115614ed3565b612469565b6005546040805163368f515360e21b8152306004808301919091526001600160a01b03858116602484015260448301879052909593811694929091602091908281806064810103816000809b5af190811561352c578791614cfb575b5080614cca575060099283544303614c9a5785614a6e3447612469565b10614c6c578151936080850185811067ffffffffffffffff821117614c5957835287855283850198888a528386019589875260608101938a855288169a614abf614ab78d61282f565b835283612bff565b815183811015614c4657614c0857614adb8a614ae39251612a9e565b895282612bff565b805182811015614bb857614bcb57614b08614b008a600b54612a9e565b865282612bff565b805182811015614bb857614b7b57505050926080926118e2979892877f13ed6866d4e1ee6da46f845c46d7e54120883d75c5ea9a2dacc1c4ca8984ab80968451868d5260108552838d209081556001600a54910155519384600b55519282519586528501528301526060820152a1613bf6565b9498955096509750509250519280841015613ec15750509160609183600b60008051602061501e833981519152955193878552840152820152a190565b634e487b7160e01b8b526021835260248bfd5b9498955096509750509250519280841015613ec15750509160609183600c60008051602061501e833981519152955193878552840152820152a190565b509498955096509750509250519280841015613ec15750509160609183600760008051602061501e833981519152955193878552840152820152a190565b634e487b7160e01b8c526021845260248cfd5b634e487b7160e01b895260418a52602489fd5b5060008051602061501e8339815191529650809291945060609593505193600f8552840152820152a1600f90565b5060008051602061501e8339815191529650600a91945060609593508092505193818552840152820152a1600a90565b935060008051602061501e833981519152965060609550600e919450809250519360038552840152820152a1600390565b90508281813d8311614d21575b614d1281836114de565b81010312613511575138614a51565b503d614d08565b6009544303614dda57614d3b9033614e0a565b90600c54614d498382612a91565b908110614d9657600c8190556040805133815260208101859052908101919091527fa91e67c5ea634cd43a12c5a482724b03de01e85ca68702a53d0c2f45cb7c1dc590606090a160009190565b606460405162461bcd60e51b815260206004820152602060248201527f61646420726573657276657320756e6578706563746564206f766572666c6f776044820152fd5b5060008051602061501e8339815191526060604051600a81526054602082015260006040820152a1600a90600090565b6001600160a01b03163303614e5957803403614e235790565b60405162461bcd60e51b815260206004820152600e60248201526d0ecc2d8eaca40dad2e6dac2e8c6d60931b6044820152606490fd5b60405162461bcd60e51b815260206004820152600f60248201526e0e6cadcc8cae440dad2e6dac2e8c6d608b1b6044820152606490fd5b9061244091614f31565b60405190614ea7826114c2565b601782527f6d756c7469706c69636174696f6e206f766572666c6f770000000000000000006020830152565b15614edb5750565b60405162461bcd60e51b8152908190614ef79060048301611500565b0390fd5b90614f1f916000604051614f0e8161147c565b525190614f19614e9a565b91614fef565b60405190614f2c8261147c565b815290565b614f4c909291926000604051614f468161147c565b526143bd565b909260048410156117575783614f695761209e9293505190613757565b505060405191612a058361147c565b801591828015614fba575b614fb257670de0b6b3a7640000808302938385048214171561247657614fac6118e293856137cf565b14614ed3565b505050600090565b506000614f83565b15808015614fe7575b614fe1576001811715612476576137d957600090565b50600090565b506001614fcb565b9182158015615015575b614fb25781614fac61500e6118e2948661436d565b94856137cf565b508115614ff956fe45b96fe442630264581b197e84bbada861235052c5a1aadfff9ea4e40a969aa0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212200527590c3932c808387ea1b6a80ca692d87f3c933ef90a9b2e4ac25ca422eaad64736f6c6343000817003345b96fe442630264581b197e84bbada861235052c5a1aadfff9ea4e40a969aa00000000000000000000000008a67ab98a291d1aea2e1eb0a79ae4ab7f2d760410000000000000000000000002d0f27fd1458a535f08d1d66f29c9fadc052146b0000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000012000000000000000000000000e915d5943c71737d49e1c35dadd63022531cca7a000000000000000000000000000000000000000000000000000000000000000752686f204554480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000047245544800000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060408181526004918236101561002a575b505050361561002057600080fd5b61002861162e565b005b600092833560e01c91826306fdde031461139d57508163095ea7b31461132c5781631249c58b14611315578163173b9904146112f657816317bfdfbc146112af57816318160ddd14611290578163182df0f51461127357816323b872dd146112395781632678224714611211578163313ce567146111ef5781633630a6b514610d9e5781633af9e669146111315781633b1d21a2146111165781634576b5db146110f057816347bd3718146110d15781634e4d9fea146110a4578163532cce1814610f655781635fe3b56714610f3c578163601a0bf114610f035781636752e70214610ee45781636c540baf14610ec55781636f307dc314610e9c57816370a0823114610e6457816373acee9814610e145781638303084614610ddb578163852a12e314610da3578163895dabad14610d9e5781638f840ddd14610d7f57816395d89b4114610c9f57816395dd919314610c7957816399d8c1b414610766578163a6afed9514610749578163a9059cbb146106f5578163aa5af0fd146106d6578163aae40a2a14610688578163ae9d70b014610623578163b2a02ff1146105e9578163b71d1a0c146105b8578163bd6d894d1461059b578163c37f68e21461054c578163c5ebeaec14610514578163db006a75146104cf578163dd62ed3e14610486578163e597461914610440578163e9c714f214610423578163f2b3abbd146103f6578163f3fdb15a146103cd578163f851a440146103a0578163f8f9da28146102ea578163fca7820b146102ad575063fcb641471461026b5780610012565b816003193601126102a9579060209181549161028960ff841661165d565b60ff199283168155600161029c346131ea565b9382541617905551908152f35b5080fd5b919050346102e65760203660031901126102e65782600161029c60209554946102d860ff871661165d565b60ff1995861684553561203a565b8280fd5b919050346102e657826003193601126102e657602060018060a01b03600654164790600b5491600c54956103428651978895869485946315f2405360e01b865285016040919493926060820195825260208201520152565b03915afa91821561039657839261035e575b6020838351908152f35b9091506020813d60201161038e575b8161037a602093836114de565b810103126102e65760209250519038610354565b3d915061036d565b81513d85823e3d90fd5b5050346102a957816003193601126102a957600354905160089190911c6001600160a01b03168152602090f35b5050346102a957816003193601126102a95760065490516001600160a01b039091168152602090f35b5050346102a95760203660031901126102a95760209061041c610417611549565b611fef565b9051908152f35b5050346102a957816003193601126102a95760209061041c611ee8565b836020366003190112610483576001610457611549565b61047883549161046960ff841661165d565b60ff19928316855534906130a9565b505082541617815580f35b80fd5b5050346102a957806003193601126102a957806020926104a4611549565b6104ac611564565b6001600160a01b039182168352600f865283832091168252845220549051908152f35b8383346102a95760203660031901126102a95760016020936105078454916104f960ff841661165d565b60ff19928316865535613090565b5083541617825551908152f35b8383346102a95760203660031901126102a957600160209361050784549161053e60ff841661165d565b60ff19928316865535613044565b5050346102a95760203660031901126102a9576105979061057361056e611549565b611e56565b93519283526020830191909152604082015260608101919091529081906080820190565b0390f35b5050346102a957816003193601126102a95760209061041c611e1d565b9050346102e65760203660031901126102e65735916001600160a01b0383168303610483575061041c602092611d7a565b5050346102a95761029c9060209260016106023661157a565b9084969296549661061560ff891661165d565b60ff19978816865533612c0b565b919050346102e657826003193601126102e657600654600b54600c546008548451635c0b440b60e11b8152479681019687526020808801949094526040870192909252606086015293909184916001600160a01b039091169082908190608001610342565b50503660031901126104835761069c611549565b6024356001600160a01b03811691908290036102e6576104786001928454926106c760ff851661165d565b60ff1993841686553490612af8565b5050346102a957816003193601126102a957602090600a549051908152f35b5050346102a957806003193601126102a95790602091610713611549565b91600161073b82549461072860ff871661165d565b60ff199586168455602435903380612178565b159382541617905551908152f35b5050346102a957816003193601126102a95760209061041c6119e8565b919050346102e65760c03660031901126102e657610782611549565b9061078b611564565b90604490813592606480359367ffffffffffffffff94858111610c75576107b59036908a016115e7565b93608435868111610c71576107cd9036908b016115e7565b9360a4359860ff8a16809a03610c6d576003805490999060081c6001600160a01b03163303610c20576009541580610c16575b15610bc9578060075515610b6f57610817906117d1565b610b2d576108349043600955670de0b6b3a7640000600a556128a2565b610ae1575050508151958387116109da57600196806108538954611442565b94601f95868111610a74575b506020908683116001146109f8578b926109ed575b505060001982881b1c191690881b1787555b81519384116109da575090829161089e600254611442565b82811161096a575b5060209183116001146108ec5787926108e1575b505060001982841b1c191690841b176002555b60ff19918282541617905582541617815580f35b0151905038806108ba565b600288528693507f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace9190601f198416895b8181106109525750841161093a575b505050811b016002556108cd565b015160001983861b60f8161c1916905538808061092c565b8284015185558996909401936020938401930161091d565b90919250600288527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace8380860160051c820192602087106109d1575b9186958a929594930160051c01915b8281106109c35750506108a6565b8a81558695508991016109b5565b925081926109a6565b634e487b7160e01b885260419052602487fd5b015190503880610874565b8a8c528a93507fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf69190601f1984168d5b818110610a5c57508411610a44575b505050811b018755610886565b0151600019838a1b60f8161c19169055388080610a37565b8284015185558d969094019360209384019301610a28565b909150898b527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf68680850160051c82019260208610610ad8575b918c91869594930160051c01915b828110610aca57505061085f565b8d81558594508c9101610abc565b92508192610aae565b6084927f73657474696e6720696e7465726573742072617465206d6f64656c206661696c8a93602061195960f21b94519562461bcd60e51b875286015260226024860152840152820152fd5b505162461bcd60e51b81526020818a0152601a60248201527f73657474696e6720636f6d7074726f6c6c6572206661696c656400000000000091810191909152fd5b825162461bcd60e51b81526020818d0152603060248201527f696e697469616c2065786368616e67652072617465206d757374206265206772818601526f32b0ba32b9103a3430b7103d32b9379760811b81870152608490fd5b835162461bcd60e51b81526020818e0152602360248201527f6d61726b6574206d6179206f6e6c7920626520696e697469616c697a6564206f81870152626e636560e81b81880152608490fd5b50600a5415610800565b835162461bcd60e51b81526020818e01526024808201527f6f6e6c792061646d696e206d617920696e697469616c697a6520746865206d6181870152631c9ad95d60e21b81880152608490fd5b8b80fd5b8a80fd5b8980fd5b5050346102a95760203660031901126102a95760209061041c610c9a611549565b611963565b8284346104835780600319360112610483578151908060025490610cc282611442565b80855291602091600191828116908115610d525750600114610cfa575b6105978688610cf0828903836114de565b5191829182611500565b9350600284527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace5b838510610d3f57505050508101602001610cf08261059786610cdf565b8054868601840152938201938101610d22565b905061059797955086935060209250610cf094915060ff191682840152151560051b820101929486610cdf565b5050346102a957816003193601126102a957602090600c549051908152f35b6115af565b8383346102a95760203660031901126102a9576001602093610507845491610dcd60ff841661165d565b60ff19928316865535612803565b919050346102e65760203660031901126102e65782600161029c6020955494610e0660ff871661165d565b60ff19958616845535611918565b5050346102a957816003193601126102a95790602091815491610e3960ff841661165d565b60ff199283168155610e52610e4c6119e8565b15611696565b6001600b549382541617905551908152f35b5050346102a95760203660031901126102a95760209181906001600160a01b03610e8c611549565b168152600e845220549051908152f35b5050346102a957816003193601126102a95760125490516001600160a01b039091168152602090f35b5050346102a957816003193601126102a9576020906009549051908152f35b5050346102a957816003193601126102a9576020906011549051908152f35b919050346102e65760203660031901126102e65782600161029c6020955494610f2e60ff871661165d565b60ff199586168455356118ca565b5050346102a957816003193601126102a95760055490516001600160a01b039091168152602090f35b919050346102e657826003193601126102e65760035460081c6001600160a01b031633819003611049574790811561100e578480809381935af13d15611009573d610faf816115cb565b90610fbc845192836114de565b81528460203d92013e5b15610fcf578280f35b906020606492519162461bcd60e51b835282015260146024820152732330b4b632b2103a379039b2b7321022ba3432b960611b6044820152fd5b610fc6565b825162461bcd60e51b81526020818601526015602482015274139bc8195d1a195c881b19599d081d1bc81cd95b99605a1b6044820152606490fd5b815162461bcd60e51b8152602081850152602f60248201527f5245746865723a3a7377656570546f6b656e3a206f6e6c792061646d696e206360448201526e616e20737765657020746f6b656e7360881b6064820152608490fd5b838060031936011261048357600181546110c060ff821661165d565b60ff19908116835561047834612542565b5050346102a957816003193601126102a957602090600b549051908152f35b5050346102a95760203660031901126102a95760209061041c611111611549565b6117d1565b5050346102a957816003193601126102a95751478152602090f35b839150346102a95760203660031901126102a957611181611150611549565b611158611e1d565b908551916111658361147c565b82526001600160a01b03168452600e6020528484205490612436565b92828210156111dc5750611199575060209151908152f35b606490602084519162461bcd60e51b8352820152601f60248201527f62616c616e636520636f756c64206e6f742062652063616c63756c61746564006044820152fd5b634e487b7160e01b815260218352602490fd5b5050346102a957816003193601126102a95760209060ff600354169051908152f35b9050346102e657826003193601126102e6575490516001600160a01b03909116815260209150f35b5050346102a95761073b9060209260016112523661157a565b9084969296549661126560ff891661165d565b60ff19978816865533612178565b5050346102a957816003193601126102a95760209061041c6116db565b5050346102a957816003193601126102a957602090600d549051908152f35b5050346102a95760203660031901126102a957906020916112ce611549565b91600161029c8254946112e360ff871661165d565b60ff199586168455610c9a610e4c6119e8565b5050346102a957816003193601126102a9576020906008549051908152f35b83806003193601126104835761132961162e565b80f35b5050346102a957806003193601126102a9576020918161134a611549565b91602435918291338152600f87528181209460018060a01b0316948582528752205582519081527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925843392a35160018152f35b839085346104835780600319360112610483578060018054906113bf82611442565b8086529260209260018116908115610d5257506001146113ea576105978688610cf0828903836114de565b9350600184527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf65b83851061142f57505050508101602001610cf08261059786610cdf565b8054868601840152938201938101611412565b90600182811c92168015611472575b602083101461145c57565b634e487b7160e01b600052602260045260246000fd5b91607f1691611451565b6020810190811067ffffffffffffffff82111761149857604052565b634e487b7160e01b600052604160045260246000fd5b67ffffffffffffffff811161149857604052565b6040810190811067ffffffffffffffff82111761149857604052565b90601f8019910116810190811067ffffffffffffffff82111761149857604052565b6020808252825181830181905290939260005b82811061153557505060409293506000838284010152601f8019910116010190565b818101860151848201604001528501611513565b600435906001600160a01b038216820361155f57565b600080fd5b602435906001600160a01b038216820361155f57565b606090600319011261155f576001600160a01b0390600435828116810361155f5791602435908116810361155f579060443590565b3461155f57600036600319011261155f57602060405160018152f35b67ffffffffffffffff811161149857601f01601f191660200190565b81601f8201121561155f578035906115fe826115cb565b9261160c60405194856114de565b8284526020838301011161155f57816000926020809301838601378301015290565b600160005461163f60ff821661165d565b60ff1990811660005561165134612085565b50506000541617600055565b1561166457565b60405162461bcd60e51b815260206004820152600a6024820152691c994b595b9d195c995960b21b6044820152606490fd5b1561169d57565b60405162461bcd60e51b81526020600482015260166024820152751858d8dc9d59481a5b9d195c995cdd0819985a5b195960521b6044820152606490fd5b6116e36120d8565b906004811015611757576116f45790565b60405162461bcd60e51b815260206004820152603560248201527f65786368616e67655261746553746f7265643a2065786368616e67655261746560448201527414dd1bdc9959125b9d195c9b985b0819985a5b1959605a1b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9081602091031261155f5751801515810361155f5790565b1561178c57565b60405162461bcd60e51b815260206004820152601c60248201527f6d61726b6572206d6574686f642072657475726e65642066616c7365000000006044820152606490fd5b6003546001600160a01b039060081c8116330361189c57600554604051623f1ee960e11b8152928216602084600481845afa928315611890576118406040947f7ac369dbd14fa5ea3f473ed67cc9d598964a77501540ba6751eb0b3decf5870d96600091611861575b50611785565b6001600160a01b0319831682176005558351921682526020820152a1600090565b611883915060203d602011611889575b61187b81836114de565b81019061176d565b3861183a565b503d611871565b6040513d6000823e3d90fd5b505060008051602061501e8339815191526060604051600181526041602082015260006040820152a1600190565b6118d26119e8565b90816118e5576118e29150612592565b90565b5060128110156117575760008051602061501e83398151915260606040518381526032602082015260006040820152a190565b6119206119e8565b9081611930576118e2915061274f565b5060128110156117575760008051602061501e83398151915260606040518381526056602082015260006040820152a190565b61196c9061282f565b9060048110156117575761197d5790565b60405162461bcd60e51b815260206004820152603760248201527f626f72726f7742616c616e636553746f7265643a20626f72726f7742616c616e60448201527f636553746f726564496e7465726e616c206661696c65640000000000000000006064820152608490fd5b60098054438114611d73576119fd3447612469565b600b54600c54600a54600654604080516315f2405360e01b8152600480820188905260248201879052604482018690529597949594919392602092908390839060649082906001600160a01b03165afa918215611d6857600092611d39575b5065048c273950008211611cf657611a749043612997565b919086811015611c0257611cb35790611aa89160008651611a948161147c565b52855190611aa18261147c565b81526129b7565b929085811015611c9e5780611c715750611ac28884612436565b989086811015611c025780611c435750611adc9089612a9e565b969086811015611c025780611c175750611b079089600854875190611b008261147c565b8152612ac0565b939086811015611c025780611bd457509080611b2292612ac0565b9480821015611bbf575080611b9357505090611b8b9392917f4dec04e750ca11537cabcd8a9eab06494de08da3735bc8871cd41250e190bc049743905582600a5583600b55600c5551948594859094939260609260808301968352602083015260408201520152565b0390a1600090565b935093505060008051602061501e8339815191529450606093506003815193878552840152820152a190565b602190634e487b7160e01b6000525260246000fd5b9550505093505060008051602061501e8339815191529450606093506005815193878552840152820152a190565b602187634e487b7160e01b6000525260246000fd5b9593505050935060008051602061501e833981519152955060609450815193878552840152820152a190565b9550505093505060008051602061501e8339815191529450606093506001815193878552840152820152a190565b94505093505060008051602061501e8339815191529450606093506006815193878552840152820152a190565b602186634e487b7160e01b6000525260246000fd5b845162461bcd60e51b8152808701849052601f60248201527f636f756c64206e6f742063616c63756c61746520626c6f636b2064656c7461006044820152606490fd5b845162461bcd60e51b8152808701849052601c60248201527f626f72726f772072617465206973206162737572646c792068696768000000006044820152606490fd5b9091508281813d8311611d61575b611d5181836114de565b8101031261155f57519038611a5c565b503d611d47565b85513d6000823e3d90fd5b5050600090565b6003546001600160a01b039060081c81163303611def57600480548383166001600160a01b031982161790915560408051929091166001600160a01b03908116835290921660208201527fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a99181908101611b8b565b505060008051602061501e8339815191526060604051600181526047602082015260006040820152a1600190565b60005490611e2d60ff831661165d565b60ff19918216600055611e41610e4c6119e8565b6001611e4b6116db565b926000541617600055565b6001600160a01b0381166000908152600e60205260408120549291611e7a9061282f565b92906004811015611ed457611ec757611e916120d8565b92906004811015611eb357611ea65793929190565b6009945092508291508190565b634e487b7160e01b82526021600452602482fd5b9150915060099180918190565b634e487b7160e01b83526021600452602483fd5b6004546001600160a01b03808216338114801590611fe7575b611fb85760038054610100600160a81b03600886811b91909116610100600160a81b0319831617928390556001600160a01b03199095166004556040805191861c85166001600160a01b0390811683529290951c9093161660208301527fca4f2f25d0898edd99413412fb94012f9e54ec8142f9b093e7720646a95b16a992917ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc908390a1815190815260006020820152a1600090565b50505060008051602061501e8339815191526060604051600181526000602082015260006040820152a1600190565b503315611f01565b611ff76119e8565b9081612007576118e291506128a2565b5060128110156117575760008051602061501e83398151915260606040518381526042602082015260006040820152a190565b6120426119e8565b9081612052576118e291506130fa565b5060128110156117575760008051602061501e83398151915260606040518381526048602082015260006040820152a190565b61208d6119e8565b90816120a25761209e915033613282565b9091565b5060128110156117575760008051602061501e8339815191526060604051838152601e602082015260006040820152a190600090565b600d54806120e95750600754600091565b906120f43447612469565b91612116604051936121058561147c565b6000809552600b54600c549161372b565b60048293921015612164578261215e576121309250613757565b90600481101561214a578061214457505190565b90509190565b634e487b7160e01b84526021600452602484fd5b50509190565b634e487b7160e01b85526021600452602485fd5b600554604080516317b9b84b60e31b8152306004808301919091526001600160a01b03868116602484015280881660448401526064830189905290979381169660209493928581806084810103816000809d5af190811561242c5789916123fb575b50806123c85750811695811694858714612396571684810361237d57600019905b6122058483612997565b92908a81101561236a5761233757868952600e865261222785858b2054612997565b9a9081811015612324576122f057888a52600e875261224986868c2054612a9e565b91808210156122dd57506122a957899a8860008051602061503e833981519152999a9b52600e8852858c2055898b52848b20556000190361228f575b505051908152a390565b868952600f85528289209089528452818820553880612285565b5050505060008051602061501e833981519152965080929450606095935060529150519360098552840152820152a1600990565b634e487b7160e01b8c526021905260248bfd5b5050505060008051602061501e833981519152965080929450606095935060519150519360098552840152820152a1600990565b634e487b7160e01b8b526021825260248bfd5b50505060008051602061501e833981519152965080929450606095935060509150519360098552840152820152a1600990565b634e487b7160e01b8a5260218b5260248afd5b848752600f8452818720818852845281872054906121fb565b505060008051602061501e833981519152965080929450606095935060509150519360028552840152820152a1600290565b9550505060008051602061501e83398151915296506060955080929450604f9150519360038552840152820152a1600390565b90508581813d8311612425575b61241281836114de565b810103126124215751386121da565b8880fd5b503d612408565b84513d8b823e3d90fd5b90612440916129b7565b6004821015611757578161246257670de0b6b3a7640000915051049060009190565b5090600090565b9190820391821161247657565b634e487b7160e01b600052601160045260246000fd5b60128110156117575760008051602061501e83398151915260606040518381526028602082015260006040820152a190565b60008051602061501e8339815191526060604051600c81526027602082015260006040820152a1600c90565b60008051602061501e8339815191526060604051600a8152602e602082015260006040820152a1600a90565b60008051602061501e8339815191526060604051600f81526031602082015260006040820152a1600f90565b61254a6119e8565b908161255c5761209e915033336137ef565b5060128110156117575760008051602061501e83398151915260606040518381526038602082015260006040820152a190600090565b6003546001600160a01b03919060081c8216338190036127205760095443036126f157816125c03447612469565b106126c257600c5490818311612692576125da8383612469565b918211612641577f3bad0c59cf2f06e7314077049f48a93578cd16f5ef92329f1dab1420a99c177e9361261484611b8b9385600c55613bf6565b60035460081c169160405193849384604091949392606082019560018060a01b0316825260208201520152565b60405162461bcd60e51b8152602060048201526024808201527f72656475636520726573657276657320756e657870656374656420756e646572604482015263666c6f7760e01b6064820152608490fd5b5050505060008051602061501e8339815191526060604051600281526036602082015260006040820152a1600290565b50505060008051602061501e8339815191526060604051600f81526034602082015260006040820152a1600f90565b50505060008051602061501e8339815191526060604051600a81526035602082015260006040820152a1600a90565b50505060008051602061501e8339815191526060604051600181526033602082015260006040820152a1600190565b60035460081c6001600160a01b031633036127d65760095443036127a95760407ff5815f353a60e815cce7553e4f60c533a59d26b1b5504ea4b6db8d60da3e4da291601154908060115582519182526020820152a1600090565b5060008051602061501e8339815191526060604051600a81526058602082015260006040820152a1600a90565b5060008051602061501e8339815191526060604051600181526057602082015260006040820152a1600190565b61280b6119e8565b908161281c576118e2915033613c22565b506012811015611757576118e29061248c565b6001600160a01b031660009081526010602052604081208054919291801561289c57600a5461285d916143e2565b90600481101561216457806128955750600161287b92015490614407565b92906004811015611eb3578061289057509190565b925090565b9150509190565b50508190565b6003546001600160a01b039060081c8116330361296957600954430361293b576006546040516310c8fc9560e11b8152928216602084600481845afa9283156118905761291a6040947fedffc32e068c7c95dfd4bdfd5c4d939a084d6b11c4199eac8436ed234d72f926966000916118615750611785565b6001600160a01b0319831682176006558351921682526020820152a1600090565b505060008051602061501e8339815191526060604051600a81526043602082015260006040820152a1600a90565b505060008051602061501e8339815191526060604051600181526044602082015260006040820152a1600190565b908181116129ad576129a891612469565b600091565b5050600390600090565b906129d19160006040516129ca8161147c565b52516143e2565b9190600481101561175757806129f75750604051916129ef8361147c565b825260009190565b6040519250612a058361147c565b600083529190565b606060008051602061501e833981519152916040519060038252602960208301526040820152a1600390565b606060008051602061501e833981519152916040519060098252603060208301526040820152a1600990565b606060008051602061501e833981519152916040519060098252602f60208301526040820152a1600990565b9190820180921161247657565b9190612aaa9083612a91565b918210612ab75760009190565b60029150600090565b90612aca916129b7565b919060048110156117575780612aef5750670de0b6b3a764000061209e925104612a9e565b91505090600090565b929190612b036119e8565b80612bc5575060405163a6afed9560e01b815260009490602081600481896001600160a01b0389165af1908115612bba578691612b84575b5080612b4e575061209e93945033614421565b925050506012811015611ed45760008051602061501e833981519152606060405183815260106020820152856040820152a19190565b90506020813d602011612bb2575b81612b9f602093836114de565b81010312612bae575138612b3b565b8580fd5b3d9150612b92565b6040513d88823e3d90fd5b929350505060128110156117575760008051602061501e8339815191526060604051838152600f602082015260006040820152a190600090565b60048210156117575752565b60055460405163d02f735160e01b81523060048201526001600160a01b039283166024820152838316604482015284831660648201526084810186905292939290602090829060a490829060009087165af190811561189057600091613012575b5080612fe0575080831681831614612fb05760405192610120840184811067ffffffffffffffff821117611498576040526000845260006020850152600060408501526000606085015260006080850152600060a0850152600060c0850152600060e085015261010084019460008652828416600052600e602052612d04612cf982604060002054612997565b602088015286612bff565b8451600481101561175757612f7457612d53612d469160115480604051612d2a8161147c565b52670de0b6b3a7640000938491612d3f614e9a565b9084614fef565b04908160808901526149b1565b6060860152612d6e612d636120d8565b60c088015286612bff565b8451600481101561175757612f2f57612d9f60c086015160405190612d928261147c565b8152608087015190614efb565b51048060a0860152612deb600c5491612de260405191612dbe836114c2565b60118352706164646974696f6e206f766572666c6f7760781b602084015284612a91565b92831015614ed3565b60e0850152612e01600d546080860151906149b1565b8552818116600052600e602052612e30612e25604060002054606087015190612a9e565b604087015285612bff565b8351600481101561175757612ef4577fa91e67c5ea634cd43a12c5a482724b03de01e85ca68702a53d0c2f45cb7c1dc59460e0850151600c5551600d556020840151828416600052600e602052604060002055604084015182821660005260406000205560608401516040519081528260008051602061503e83398151915292169082602085871692a3602060808501519260405193845230941692a360a081015160e0909101516040805130815260208101939093528201528060608101611b8b565b505050905051600481101561175757606060008051602061501e833981519152916040519060098252601960208301526040820152a1600990565b60405162461bcd60e51b815260206004820152601860248201527f65786368616e67652072617465206d617468206572726f7200000000000000006044820152606490fd5b50505050905051600481101561175757606060008051602061501e833981519152916040519060098252601a60208301526040820152a1600990565b5050505060008051602061501e833981519152606060405160068152601c602082015260006040820152a1600690565b91505060008051602061501e8339815191529250606091506040519060038252601b60208301526040820152a1600390565b90506020813d60201161303c575b8161302d602093836114de565b8101031261155f575138612c6c565b3d9150613020565b61304c6119e8565b908161305d576118e29150336149f5565b5060128110156117575760008051602061501e83398151915260606040518381526008602082015260006040820152a190565b6130986119e8565b908161281c576118e2915033613f6f565b906130b26119e8565b91826130c35761209e9250336137ef565b505060128110156117575760008051602061501e83398151915260606040518381526037602082015260006040820152a190600090565b60035460081c6001600160a01b031633036131bd57600954430361319057670de0b6b3a764000081116131635760407faaa68312e2ea9d50e16af5068410ab56e1a1fd06037b1a35664812c30f82146091600854908060085582519182526020820152a1600090565b5060008051602061501e833981519152606060405160028152604b602082015260006040820152a1600290565b5060008051602061501e8339815191526060604051600a8152604a602082015260006040820152a1600a90565b5060008051602061501e8339815191526060604051600181526049602082015260006040820152a1600190565b6131f26119e8565b9081613206576132029150614d28565b5090565b5060128110156117575760008051602061501e83398151915260606040518381526053602082015260006040820152a190565b6040519060e0820182811067ffffffffffffffff821117611498576040528160c06000918281528260208201528260408201528260608201528260808201528260a08201520152565b60055460408051634ef4c3e160e01b8152306004808301919091526001600160a01b0380861660248401526044830187905293841696959460209491928581806064810103816000809d5af19081156137215789916136f4575b50806136c5575087600954430361369657506132f6613239565b956132ff6120d8565b979091613315888301938884019a8b5284612bff565b82518681101561363557613648579061335361333685949361336296614e0a565b60c083019a818c52519089519161334c8361147c565b8252614e90565b94906060830195865283612bff565b815186811015613635576135f4579061339291613383600d54865190612a9e565b93906080830194855283612bff565b81518781101561358d576135a0579160a0916133d385946133c68f8c90600e8f9c809c9b169c8d8352522054885190612a9e565b9590910194855282612bff565b518781101561358d576135365751600d5551848b52600e8852868b20558751825187516001600160a01b039390931683526020830191909152604082015289959493869390926024928491907f4c209b5fc8ad50758f13e2e1088ba56a560dff690a1c6fef26394f4c03821c4f90606090a151875190815260008051602061503e8339815191528a3092a3600554169185519687938492631ea016b760e21b8452878401525af1801561352c5761348d575b505050505190565b3d8088853e61349c81856114de565b830192848185031261352857805167ffffffffffffffff91828211610c7557019184601f8401121561242157825191821161351557508481819260051b9451906134e8838701836114de565b81520192820101928311613511578301905b8282101561348557815181529083019083016134fa565b8680fd5b634e487b7160e01b895260419052602488fd5b8780fd5b82513d89823e3d90fd5b875162461bcd60e51b81528088018a9052602b60248201527f4d494e545f4e45575f4143434f554e545f42414c414e43455f43414c43554c4160448201526a151253d397d1905253115160aa1b6064820152608490fd5b634e487b7160e01b8d526021885260248dfd5b875162461bcd60e51b81528088018a9052602860248201527f4d494e545f4e45575f544f54414c5f535550504c595f43414c43554c4154494f6044820152671397d1905253115160c21b6064820152608490fd5b60648689808a519262461bcd60e51b845283015260248201527f4d494e545f45584348414e47455f43414c43554c4154494f4e5f4641494c45446044820152fd5b634e487b7160e01b8c526021875260248cfd5b50505194955050508083101561368357509160609183602160008051602061501e83398151915295519360098552840152820152a160099190565b634e487b7160e01b865260219052602485fd5b9250505060008051602061501e8339815191529350816022606094935193600a8552840152820152a1600a9190565b9250505060008051602061501e833981519152935081601f60609493519360038552840152820152a160039190565b90508581813d831161371a575b61370b81836114de565b810103126124215751386132dc565b503d613701565b85513d8b823e3d90fd5b9061373591612a9e565b60048293921015611757578261374f5761209e9250612997565b505090600090565b9190613773604051936137698561147c565b6000809552614380565b6004829392101561216457826137c05761378d9250614407565b92906004811015611eb357806137b15750604051926137ab8461147c565b83529190565b6040519350906137ab8461147c565b5050604051926137ab8461147c565b81156137d9570490565b634e487b7160e01b600052601260045260246000fd5b600554604051631200453160e11b8152306004808301919091526001600160a01b038481166024840152858116604484015260648301879052939493909260209183916084918391600091165af190811561189057600091613bc4575b5080613b8f57506009544303613b5c5760405193610100850185811067ffffffffffffffff821117613b47576040526000855260006020860152600060408601526000606086015260006080860152600060a0860152600060c0860152600060e08601526138ea6138dc60018060a01b03851694856000526010602052600160406000200154606089015261282f565b608088015260208701612bff565b602085015182811015613b3257613aef576000198103613ae55750608084015160408501525b613942613934613924604087015186614e0a565b8060e08801526080870151612997565b60a087015260208601612bff565b602084015181811015613a6657613a7b57613975613967600b5460e087015190612997565b60c087015260208601612bff565b602084015181811015613a6657613a08575060a083927f1a2a22cb034d26d1854bdc6666a5b91fe25efbbb5dcad3b0355478d6f5c362a1928260e096015181600052601060205260406000209081556001600a5491015560c08501519081600b5586860151848701519160405194600180881b031685526020850152604084015260608301526080820152a10151600091565b60849060206040519162461bcd60e51b8352820152603160248201527f52455041595f424f52524f575f4e45575f544f54414c5f42414c414e43455f43604482015270105310d55310551253d397d19052531151607a1b6064820152fd5b602182634e487b7160e01b6000525260246000fd5b60849060206040519162461bcd60e51b8352820152603a60248201527f52455041595f424f52524f575f4e45575f4143434f554e545f424f52524f575f60448201527f42414c414e43455f43414c43554c4154494f4e5f4641494c45440000000000006064820152fd5b6040850152613910565b509290506020915001519080821015611bbf5750606060008051602061501e833981519152916040519060098252603960208301526040820152a1600990600090565b602183634e487b7160e01b6000525260246000fd5b604183634e487b7160e01b6000525260246000fd5b5050505060008051602061501e8339815191526060604051600a8152603b602082015260006040820152a1600a90600090565b91505060008051602061501e8339815191529250606091506040519060038252603a60208301526040820152a1600390600090565b90506020813d602011613bee575b81613bdf602093836114de565b8101031261155f57513861384c565b3d9150613bd2565b6000808093819382908215613c18575b6001600160a01b031690f11561189057565b6108fc9150613c06565b9091906001613c313447612469565b10613f6457613c3e613239565b90613c476116db565b91613c6a604095865194613c5a8661147c565b8552613c64614e9a565b90614f78565b92670de0b6b3a7640000613cc2613cb58351895197613c88896114c2565b600e8952613cb06020996d646976696465206279207a65726f60901b8b820152831515614ed3565b6137cf565b6060850193818552614efb565b5104608083019081526005548251885163eabe7d9160e01b8152306004808301919091526001600160a01b038881166024840152604483019390935292821697939592939192908281806064810103816000809d5af1908115613f5a578991613f2d575b5080613f1957506009544303613f0757613d44600d54865190612997565b91613d598482019260a0830194855283612bff565b815186811015613ef457613ed4579160c091613d8c8695946133c68f8e9a998e169a8b8152600e895220548b5190612997565b80518681101561363557613ea05750613da53447612469565b885111613e8c5751600d5551848952600e82528a8920558360008051602061503e8339815191528651928c519384523093a3845184518a516001600160a01b0389168152602081019290925260408201527fe5b754fb1abb7f01b499791d0b820ae3b6af3424ac1c59768edb53f4ec31a92990606090a16005541684519351813b1561352857916084918894938b5196879586946351dff98960e01b865230908601526024850152604484015260648301525afa958615613e8357506118e2939495613e74575b505190613bf6565b613e7d906114ae565b38613e6c565b513d85823e3d90fd5b5050505050505050505090506118e2612516565b985050505050959650505050519180831015613ec15750506118e290612a65565b634e487b7160e01b825260219052602490fd5b5096505050509495505050519180831015613ec15750506118e290612a39565b634e487b7160e01b8b526021875260248bfd5b505050505050505090506118e26124ea565b9750505050505050506118e2919250612a0d565b90508281813d8311613f53575b613f4481836114de565b81010312612421575138613d26565b503d613f3a565b8b513d8b823e3d90fd5b5090506118e26124be565b600090821580159081614365575b15614303576001613f8e3447612469565b106142f757613f9b613239565b93613fa46116db565b90604092835192613fb48461147c565b8352156142595780670de0b6b3a764000092613fd4926060890152614efb565b510460808501525b600554606085018051835163eabe7d9160e01b8152306004808301919091526001600160a01b0387811660248401526044830193909352929493602091908290829060649082908c9088165af190811561424f578891614222575b50806142105750600954430361420057614055600d54865190612997565b9061406a838b019160a08c0193845282612bff565b8051858110156141ed576141cf5783929160c09161409d8c6133c68a8e9a998e169a8b8152600e895220548c5190612997565b805186811015613635576141af575060806140b83447612469565b9b019a8b511161419c5751600d5551848952600e8252858920558360008051602061503e83398151915287519287519384523093a38751855185516001600160a01b0389168152602081019290925260408201527fe5b754fb1abb7f01b499791d0b820ae3b6af3424ac1c59768edb53f4ec31a92990606090a16005541687519451813b156135285791608491889493865197889586946351dff98960e01b865230908601526024850152604484015260648301525afa908115613e835750614189575b506118e291925190613bf6565b916141966118e2936114ae565b9161417c565b50505050505050505050506118e2612516565b9850505050509550505050519180831015613ec15750506118e290612a65565b965050505094505050519180831015613ec15750506118e290612a39565b634e487b7160e01b8a526021865260248afd5b50505050505050506118e26124ea565b96505050505050506118e29150612a0d565b90508181813d8311614248575b61423981836114de565b81010312613528575138614037565b503d61422f565b85513d8a823e3d90fd5b50614262614e9a565b508051614298835191614274836114c2565b600e83526d646976696465206279207a65726f60901b602084015215918215614ed3565b6142e3576142cb670de0b6b3a7640000918560608801528584516142bb8161147c565b52516142c5614e9a565b50614fc2565b8083516142d78161147c565b52046080850152613fdc565b634e487b7160e01b84526012600452602484fd5b505050506118e26124be565b60405162461bcd60e51b815260206004820152603460248201527f6f6e65206f662072656465656d546f6b656e73496e206f722072656465656d416044820152736d6f756e74496e206d757374206265207a65726f60601b6064820152608490fd5b506001613f7d565b8181029291811591840414171561247657565b80156143b457670de0b6b3a7640000808202918083048203612476576143a690836137cf565b146129a85750600290600090565b50600090600090565b670de0b6b3a76400009080820291820480820361247657146129a85750600290600090565b9081156143fd576143a66143f6828461436d565b92836137cf565b5050600090600090565b908015614417576129a8916137cf565b5050600190600090565b60055460408051632fe3f38f60e11b8152306004808301919091526001600160a01b039788166024830181905285891660448401528689166064840152608483018890529798959795969495949293602092908390829060a49082908e165afa908115611d6857600091614984575b50806149505750600954430361491a578351636c540baf60e01b815282818381895afa908115611d68576000916148ed575b5043036148b757888616958989169387851461487f57801561484757600019811461480f576144f2908a836137ef565b9990806147cf5750600554865163c488847b60e01b8152308582019081526001600160a01b038a166020820152604081018d90529b9c9a9b999a909988928b9216908290819060600103915afa9788156147c45760009060009961478f575b506147305785516370a0823160e01b815283810186905284816024818b5afa908115614725579089916000916146f4575b50106146b157879060009285308a1460001461462457506145a4935030612c0b565b6145ec575082519586528501528301859052606083015260808201527f298637f684da70674f26509b10f07ec2fbc77a335ab1e7d6215a4b2484d8bb529060a090a160009190565b60649184519162461bcd60e51b835282015260146024820152731d1bdad95b881cd95a5e9d5c994819985a5b195960621b6044820152fd5b885163b2a02ff160e01b81526001600160a01b0392831687820190815293909216602084015260408301939093529190829081906060010381858b5af19182156146a6578092614676575b50506145a4565b9091508382813d831161469f575b61468e81836114de565b81010312610483575051388061466f565b503d614684565b8651903d90823e3d90fd5b855162461bcd60e51b8152808401859052601860248201527f4c49515549444154455f5345495a455f544f4f5f4d55434800000000000000006044820152606490fd5b809250868092503d831161471e575b61470d81836114de565b8101031261155f5788905138614582565b503d614703565b87513d6000823e3d90fd5b855162461bcd60e51b8152808401859052603360248201527f4c49515549444154455f434f4d5054524f4c4c45525f43414c43554c4154455f604482015272105353d5539517d4d152569157d19052531151606a1b6064820152608490fd5b809950878092503d83116147bd575b6147a881836114de565b8101031261155f578388519801519738614551565b503d61479e565b86513d6000823e3d90fd5b9950505093509496505091506012841015611bbf575060008051602061501e8339815191529160008260186060945193878552840152820152a190600090565b505050935050606093955060008051602061501e833981519152945060009150601481519360078552840152820152a1600790600090565b505050935050606093955060008051602061501e833981519152945060009150601581519360078552840152820152a1600790600090565b505050935050606093955060008051602061501e833981519152945060009150601781519360068552840152820152a1600690600090565b50935050606093955060008051602061501e8339815191529450600091506011815193600a8552840152820152a1600a90600090565b90508281813d8311614913575b61490481836114de565b8101031261155f5751386144c2565b503d6148fa565b50935050606093955060008051602061501e8339815191529450600091506016815193600a8552840152820152a1600a90600090565b945050935050606093955060008051602061501e8339815191529450601281519360038552840152820152a1600390600090565b90508281813d83116149aa575b61499b81836114de565b8101031261155f575138614490565b503d614991565b906118e2916149f06040516149c5816114c2565b60158152747375627472616374696f6e20756e646572666c6f7760581b602082015282841115614ed3565b612469565b6005546040805163368f515360e21b8152306004808301919091526001600160a01b03858116602484015260448301879052909593811694929091602091908281806064810103816000809b5af190811561352c578791614cfb575b5080614cca575060099283544303614c9a5785614a6e3447612469565b10614c6c578151936080850185811067ffffffffffffffff821117614c5957835287855283850198888a528386019589875260608101938a855288169a614abf614ab78d61282f565b835283612bff565b815183811015614c4657614c0857614adb8a614ae39251612a9e565b895282612bff565b805182811015614bb857614bcb57614b08614b008a600b54612a9e565b865282612bff565b805182811015614bb857614b7b57505050926080926118e2979892877f13ed6866d4e1ee6da46f845c46d7e54120883d75c5ea9a2dacc1c4ca8984ab80968451868d5260108552838d209081556001600a54910155519384600b55519282519586528501528301526060820152a1613bf6565b9498955096509750509250519280841015613ec15750509160609183600b60008051602061501e833981519152955193878552840152820152a190565b634e487b7160e01b8b526021835260248bfd5b9498955096509750509250519280841015613ec15750509160609183600c60008051602061501e833981519152955193878552840152820152a190565b509498955096509750509250519280841015613ec15750509160609183600760008051602061501e833981519152955193878552840152820152a190565b634e487b7160e01b8c526021845260248cfd5b634e487b7160e01b895260418a52602489fd5b5060008051602061501e8339815191529650809291945060609593505193600f8552840152820152a1600f90565b5060008051602061501e8339815191529650600a91945060609593508092505193818552840152820152a1600a90565b935060008051602061501e833981519152965060609550600e919450809250519360038552840152820152a1600390565b90508281813d8311614d21575b614d1281836114de565b81010312613511575138614a51565b503d614d08565b6009544303614dda57614d3b9033614e0a565b90600c54614d498382612a91565b908110614d9657600c8190556040805133815260208101859052908101919091527fa91e67c5ea634cd43a12c5a482724b03de01e85ca68702a53d0c2f45cb7c1dc590606090a160009190565b606460405162461bcd60e51b815260206004820152602060248201527f61646420726573657276657320756e6578706563746564206f766572666c6f776044820152fd5b5060008051602061501e8339815191526060604051600a81526054602082015260006040820152a1600a90600090565b6001600160a01b03163303614e5957803403614e235790565b60405162461bcd60e51b815260206004820152600e60248201526d0ecc2d8eaca40dad2e6dac2e8c6d60931b6044820152606490fd5b60405162461bcd60e51b815260206004820152600f60248201526e0e6cadcc8cae440dad2e6dac2e8c6d608b1b6044820152606490fd5b9061244091614f31565b60405190614ea7826114c2565b601782527f6d756c7469706c69636174696f6e206f766572666c6f770000000000000000006020830152565b15614edb5750565b60405162461bcd60e51b8152908190614ef79060048301611500565b0390fd5b90614f1f916000604051614f0e8161147c565b525190614f19614e9a565b91614fef565b60405190614f2c8261147c565b815290565b614f4c909291926000604051614f468161147c565b526143bd565b909260048410156117575783614f695761209e9293505190613757565b505060405191612a058361147c565b801591828015614fba575b614fb257670de0b6b3a7640000808302938385048214171561247657614fac6118e293856137cf565b14614ed3565b505050600090565b506000614f83565b15808015614fe7575b614fe1576001811715612476576137d957600090565b50600090565b506001614fcb565b9182158015615015575b614fb25781614fac61500e6118e2948661436d565b94856137cf565b508115614ff956fe45b96fe442630264581b197e84bbada861235052c5a1aadfff9ea4e40a969aa0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212200527590c3932c808387ea1b6a80ca692d87f3c933ef90a9b2e4ac25ca422eaad64736f6c63430008170033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000008a67ab98a291d1aea2e1eb0a79ae4ab7f2d760410000000000000000000000002d0f27fd1458a535f08d1d66f29c9fadc052146b0000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000012000000000000000000000000e915d5943c71737d49e1c35dadd63022531cca7a000000000000000000000000000000000000000000000000000000000000000752686f204554480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000047245544800000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : comptroller_ (address): 0x8a67AB98A291d1AEA2E1eB0a79ae4ab7f2D76041
Arg [1] : interestRateModel_ (address): 0x2D0f27Fd1458a535F08D1D66F29C9fAdC052146b
Arg [2] : initialExchangeRateMantissa_ (uint256): 1000000000000000000
Arg [3] : name_ (string): Rho ETH
Arg [4] : symbol_ (string): rETH
Arg [5] : decimals_ (uint8): 18
Arg [6] : admin_ (address): 0xe915d5943C71737d49e1c35dAdd63022531CcA7A
-----Encoded View---------------
11 Constructor Arguments found :
Arg [0] : 0000000000000000000000008a67ab98a291d1aea2e1eb0a79ae4ab7f2d76041
Arg [1] : 0000000000000000000000002d0f27fd1458a535f08d1d66f29c9fadc052146b
Arg [2] : 0000000000000000000000000000000000000000000000000de0b6b3a7640000
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000012
Arg [6] : 000000000000000000000000e915d5943c71737d49e1c35dadd63022531cca7a
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000007
Arg [8] : 52686f2045544800000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000004
Arg [10] : 7245544800000000000000000000000000000000000000000000000000000000
Loading...
Loading
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.