Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 7 from a total of 7 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Liquidate | 20759996 | 517 days ago | IN | 0 ETH | 0.00083513 | ||||
| Liquidate | 20459436 | 559 days ago | IN | 0 ETH | 0.00539888 | ||||
| Liquidate | 20459435 | 559 days ago | IN | 0 ETH | 0.13321679 | ||||
| Liquidate | 18867959 | 782 days ago | IN | 0 ETH | 0.02719583 | ||||
| Liquidate | 18064173 | 895 days ago | IN | 0 ETH | 0.01654081 | ||||
| Liquidate | 18062978 | 895 days ago | IN | 0 ETH | 0.09438607 | ||||
| Liquidate | 18058950 | 895 days ago | IN | 0 ETH | 0.00118112 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
LiquidationManager
Compiler Version
v0.8.19+commit.7dd6d404
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
import "IERC20.sol";
import "IStabilityPool.sol";
import "ISortedTroves.sol";
import "IBorrowerOperations.sol";
import "ITroveManager.sol";
import "PrismaMath.sol";
import "PrismaBase.sol";
/**
@title Prisma Liquidation Manager
@notice Based on Liquity's `TroveManager`
https://github.com/liquity/dev/blob/main/packages/contracts/contracts/TroveManager.sol
This contract has a 1:n relationship with `TroveManager`, handling liquidations
for every active collateral within the system.
Anyone can call to liquidate an eligible trove at any time. There is no requirement
that liquidations happen in order according to trove ICRs. There are three ways that
a liquidation can occur:
1. ICR <= 100
The trove's entire debt and collateral is redistributed between remaining active troves.
2. 100 < ICR < MCR
The trove is liquidated using stability pool deposits. The collateral is distributed
amongst stability pool depositors. If the stability pool's balance is insufficient to
completely repay the trove, the remaining debt and collateral is redistributed between
the remaining active troves.
3. MCR <= ICR < TCR && TCR < CCR
The trove is liquidated using stability pool deposits. Collateral equal to MCR of
the value of the debt is distributed between stability pool depositors. The remaining
collateral is left claimable by the trove owner.
*/
contract LiquidationManager is PrismaBase {
IStabilityPool public immutable stabilityPool;
IBorrowerOperations public immutable borrowerOperations;
address public immutable factory;
uint256 private constant _100pct = 1000000000000000000; // 1e18 == 100%
mapping(ITroveManager troveManager => bool enabled) internal _enabledTroveManagers;
/*
* --- Variable container structs for liquidations ---
*
* These structs are used to hold, return and assign variables inside the liquidation functions,
* in order to avoid the error: "CompilerError: Stack too deep".
**/
struct TroveManagerValues {
uint256 price;
uint256 MCR;
bool sunsetting;
}
struct LiquidationValues {
uint256 entireTroveDebt;
uint256 entireTroveColl;
uint256 collGasCompensation;
uint256 debtGasCompensation;
uint256 debtToOffset;
uint256 collToSendToSP;
uint256 debtToRedistribute;
uint256 collToRedistribute;
uint256 collSurplus;
}
struct LiquidationTotals {
uint256 totalCollInSequence;
uint256 totalDebtInSequence;
uint256 totalCollGasCompensation;
uint256 totalDebtGasCompensation;
uint256 totalDebtToOffset;
uint256 totalCollToSendToSP;
uint256 totalDebtToRedistribute;
uint256 totalCollToRedistribute;
uint256 totalCollSurplus;
}
event TroveUpdated(
address indexed _borrower,
uint256 _debt,
uint256 _coll,
uint256 _stake,
TroveManagerOperation _operation
);
event TroveLiquidated(address indexed _borrower, uint256 _debt, uint256 _coll, TroveManagerOperation _operation);
event Liquidation(
uint256 _liquidatedDebt,
uint256 _liquidatedColl,
uint256 _collGasCompensation,
uint256 _debtGasCompensation
);
event TroveUpdated(address indexed _borrower, uint256 _debt, uint256 _coll, uint256 stake, uint8 operation);
event TroveLiquidated(address indexed _borrower, uint256 _debt, uint256 _coll, uint8 operation);
enum TroveManagerOperation {
applyPendingRewards,
liquidateInNormalMode,
liquidateInRecoveryMode,
redeemCollateral
}
constructor(
IStabilityPool _stabilityPoolAddress,
IBorrowerOperations _borrowerOperations,
address _factory,
uint256 _gasCompensation
) PrismaBase(_gasCompensation) {
stabilityPool = _stabilityPoolAddress;
borrowerOperations = _borrowerOperations;
factory = _factory;
}
function enableTroveManager(ITroveManager _troveManager) external {
require(msg.sender == factory, "Not factory");
_enabledTroveManagers[_troveManager] = true;
}
// --- Trove Liquidation functions ---
/**
@notice Liquidate a single trove
@dev Reverts if the trove is not active, or cannot be liquidated
@param borrower Borrower address to liquidate
*/
function liquidate(ITroveManager troveManager, address borrower) external {
require(troveManager.getTroveStatus(borrower) == 1, "TroveManager: Trove does not exist or is closed");
address[] memory borrowers = new address[](1);
borrowers[0] = borrower;
batchLiquidateTroves(troveManager, borrowers);
}
/**
@notice Liquidate a sequence of troves
@dev Iterates through troves starting with the lowest ICR
@param maxTrovesToLiquidate The maximum number of troves to liquidate
@param maxICR Maximum ICR to liquidate. Should be set to MCR if the system
is not in recovery mode, to minimize gas costs for this call.
*/
function liquidateTroves(ITroveManager troveManager, uint256 maxTrovesToLiquidate, uint256 maxICR) external {
require(_enabledTroveManagers[troveManager], "TroveManager not approved");
IStabilityPool stabilityPoolCached = stabilityPool;
troveManager.updateBalances();
ISortedTroves sortedTrovesCached = ISortedTroves(troveManager.sortedTroves());
LiquidationValues memory singleLiquidation;
LiquidationTotals memory totals;
TroveManagerValues memory troveManagerValues;
uint256 trovesRemaining = maxTrovesToLiquidate;
uint256 troveCount = troveManager.getTroveOwnersCount();
troveManagerValues.price = troveManager.fetchPrice();
troveManagerValues.sunsetting = troveManager.sunsetting();
troveManagerValues.MCR = troveManager.MCR();
uint debtInStabPool = stabilityPoolCached.getTotalDebtTokenDeposits();
while (trovesRemaining > 0 && troveCount > 1) {
address account = sortedTrovesCached.getLast();
uint ICR = troveManager.getCurrentICR(account, troveManagerValues.price);
if (ICR > maxICR) {
// set to 0 to ensure the next if block evaluates false
trovesRemaining = 0;
break;
}
if (ICR <= _100pct) {
singleLiquidation = _liquidateWithoutSP(troveManager, account);
_applyLiquidationValuesToTotals(totals, singleLiquidation);
} else if (ICR < troveManagerValues.MCR) {
singleLiquidation = _liquidateNormalMode(
troveManager,
account,
debtInStabPool,
troveManagerValues.sunsetting
);
debtInStabPool -= singleLiquidation.debtToOffset;
_applyLiquidationValuesToTotals(totals, singleLiquidation);
} else break; // break if the loop reaches a Trove with ICR >= MCR
unchecked {
--trovesRemaining;
--troveCount;
}
}
if (trovesRemaining > 0 && !troveManagerValues.sunsetting && troveCount > 1) {
(uint entireSystemColl, uint entireSystemDebt) = borrowerOperations.getGlobalSystemBalances();
entireSystemColl -= totals.totalCollToSendToSP * troveManagerValues.price;
entireSystemDebt -= totals.totalDebtToOffset;
address nextAccount = sortedTrovesCached.getLast();
ITroveManager _troveManager = troveManager; //stack too deep workaround
while (trovesRemaining > 0 && troveCount > 1) {
uint ICR = troveManager.getCurrentICR(nextAccount, troveManagerValues.price);
if (ICR > maxICR) break;
unchecked {
--trovesRemaining;
}
address account = nextAccount;
nextAccount = sortedTrovesCached.getPrev(account);
uint256 TCR = PrismaMath._computeCR(entireSystemColl, entireSystemDebt);
if (TCR >= CCR || ICR >= TCR) break;
singleLiquidation = _tryLiquidateWithCap(
_troveManager,
account,
debtInStabPool,
troveManagerValues.MCR,
troveManagerValues.price
);
if (singleLiquidation.debtToOffset == 0) continue;
debtInStabPool -= singleLiquidation.debtToOffset;
entireSystemColl -=
(singleLiquidation.collToSendToSP + singleLiquidation.collSurplus) *
troveManagerValues.price;
entireSystemDebt -= singleLiquidation.debtToOffset;
_applyLiquidationValuesToTotals(totals, singleLiquidation);
unchecked {
--troveCount;
}
}
}
require(totals.totalDebtInSequence > 0, "TroveManager: nothing to liquidate");
if (totals.totalDebtToOffset > 0 || totals.totalCollToSendToSP > 0) {
// Move liquidated collateral and Debt to the appropriate pools
stabilityPoolCached.offset(
troveManager.collateralToken(),
totals.totalDebtToOffset,
totals.totalCollToSendToSP
);
troveManager.decreaseDebtAndSendCollateral(
address(stabilityPoolCached),
totals.totalDebtToOffset,
totals.totalCollToSendToSP
);
}
troveManager.finalizeLiquidation(
msg.sender,
totals.totalDebtToRedistribute,
totals.totalCollToRedistribute,
totals.totalCollSurplus,
totals.totalDebtGasCompensation,
totals.totalCollGasCompensation
);
emit Liquidation(
totals.totalDebtInSequence,
totals.totalCollInSequence - totals.totalCollGasCompensation - totals.totalCollSurplus,
totals.totalCollGasCompensation,
totals.totalDebtGasCompensation
);
}
/**
@notice Liquidate a custom list of troves
@dev Reverts if there is not a single trove that can be liquidated
@param _troveArray List of borrower addresses to liquidate. Troves that were already
liquidated, or cannot be liquidated, are ignored.
*/
/*
* Attempt to liquidate a custom list of troves provided by the caller.
*/
function batchLiquidateTroves(ITroveManager troveManager, address[] memory _troveArray) public {
require(_enabledTroveManagers[troveManager], "TroveManager not approved");
require(_troveArray.length != 0, "TroveManager: Calldata address array must not be empty");
troveManager.updateBalances();
LiquidationValues memory singleLiquidation;
LiquidationTotals memory totals;
TroveManagerValues memory troveManagerValues;
IStabilityPool stabilityPoolCached = stabilityPool;
uint debtInStabPool = stabilityPoolCached.getTotalDebtTokenDeposits();
troveManagerValues.price = troveManager.fetchPrice();
troveManagerValues.sunsetting = troveManager.sunsetting();
troveManagerValues.MCR = troveManager.MCR();
uint troveCount = troveManager.getTroveOwnersCount();
uint length = _troveArray.length;
uint troveIter;
while (troveIter < length && troveCount > 1) {
// first iteration round, when all liquidated troves have ICR < MCR we do not need to track TCR
address account = _troveArray[troveIter];
// closed / non-existent troves return an ICR of type(uint).max and are ignored
uint ICR = troveManager.getCurrentICR(account, troveManagerValues.price);
if (ICR <= _100pct) {
singleLiquidation = _liquidateWithoutSP(troveManager, account);
} else if (ICR < troveManagerValues.MCR) {
singleLiquidation = _liquidateNormalMode(
troveManager,
account,
debtInStabPool,
troveManagerValues.sunsetting
);
debtInStabPool -= singleLiquidation.debtToOffset;
} else {
// As soon as we find a trove with ICR >= MCR we need to start tracking the global TCR with the next loop
break;
}
_applyLiquidationValuesToTotals(totals, singleLiquidation);
unchecked {
++troveIter;
--troveCount;
}
}
if (troveIter < length && troveCount > 1) {
// second iteration round, if we receive a trove with ICR > MCR and need to track TCR
(uint256 entireSystemColl, uint256 entireSystemDebt) = borrowerOperations.getGlobalSystemBalances();
entireSystemColl -= totals.totalCollToSendToSP * troveManagerValues.price;
entireSystemDebt -= totals.totalDebtToOffset;
while (troveIter < length && troveCount > 1) {
address account = _troveArray[troveIter];
uint ICR = troveManager.getCurrentICR(account, troveManagerValues.price);
unchecked {
++troveIter;
}
if (ICR <= _100pct) {
singleLiquidation = _liquidateWithoutSP(troveManager, account);
} else if (ICR < troveManagerValues.MCR) {
singleLiquidation = _liquidateNormalMode(
troveManager,
account,
debtInStabPool,
troveManagerValues.sunsetting
);
} else {
if (troveManagerValues.sunsetting) continue;
uint256 TCR = PrismaMath._computeCR(entireSystemColl, entireSystemDebt);
if (TCR >= CCR || ICR >= TCR) continue;
singleLiquidation = _tryLiquidateWithCap(
troveManager,
account,
debtInStabPool,
troveManagerValues.MCR,
troveManagerValues.price
);
if (singleLiquidation.debtToOffset == 0) continue;
}
debtInStabPool -= singleLiquidation.debtToOffset;
entireSystemColl -=
(singleLiquidation.collToSendToSP + singleLiquidation.collSurplus) *
troveManagerValues.price;
entireSystemDebt -= singleLiquidation.debtToOffset;
_applyLiquidationValuesToTotals(totals, singleLiquidation);
unchecked {
--troveCount;
}
}
}
require(totals.totalDebtInSequence > 0, "TroveManager: nothing to liquidate");
if (totals.totalDebtToOffset > 0 || totals.totalCollToSendToSP > 0) {
// Move liquidated collateral and Debt to the appropriate pools
stabilityPoolCached.offset(
troveManager.collateralToken(),
totals.totalDebtToOffset,
totals.totalCollToSendToSP
);
troveManager.decreaseDebtAndSendCollateral(
address(stabilityPoolCached),
totals.totalDebtToOffset,
totals.totalCollToSendToSP
);
}
troveManager.finalizeLiquidation(
msg.sender,
totals.totalDebtToRedistribute,
totals.totalCollToRedistribute,
totals.totalCollSurplus,
totals.totalDebtGasCompensation,
totals.totalCollGasCompensation
);
emit Liquidation(
totals.totalDebtInSequence,
totals.totalCollInSequence - totals.totalCollGasCompensation - totals.totalCollSurplus,
totals.totalCollGasCompensation,
totals.totalDebtGasCompensation
);
}
/**
@dev Perform a "normal" liquidation, where 100% < ICR < MCR. The trove
is liquidated as much as possible using the stability pool. Any
remaining debt and collateral are redistributed between active troves.
*/
function _liquidateNormalMode(
ITroveManager troveManager,
address _borrower,
uint256 _debtInStabPool,
bool sunsetting
) internal returns (LiquidationValues memory singleLiquidation) {
uint pendingDebtReward;
uint pendingCollReward;
(
singleLiquidation.entireTroveDebt,
singleLiquidation.entireTroveColl,
pendingDebtReward,
pendingCollReward
) = troveManager.getEntireDebtAndColl(_borrower);
troveManager.movePendingTroveRewardsToActiveBalances(pendingDebtReward, pendingCollReward);
singleLiquidation.collGasCompensation = _getCollGasCompensation(singleLiquidation.entireTroveColl);
singleLiquidation.debtGasCompensation = DEBT_GAS_COMPENSATION;
uint256 collToLiquidate = singleLiquidation.entireTroveColl - singleLiquidation.collGasCompensation;
(
singleLiquidation.debtToOffset,
singleLiquidation.collToSendToSP,
singleLiquidation.debtToRedistribute,
singleLiquidation.collToRedistribute
) = _getOffsetAndRedistributionVals(
singleLiquidation.entireTroveDebt,
collToLiquidate,
_debtInStabPool,
sunsetting
);
troveManager.closeTroveByLiquidation(_borrower);
emit TroveLiquidated(
_borrower,
singleLiquidation.entireTroveDebt,
singleLiquidation.entireTroveColl,
TroveManagerOperation.liquidateInNormalMode
);
emit TroveUpdated(_borrower, 0, 0, 0, TroveManagerOperation.liquidateInNormalMode);
return singleLiquidation;
}
/**
@dev Attempt to liquidate a single trove in recovery mode.
If MCR <= ICR < current TCR (accounting for the preceding liquidations in the current sequence)
and there is Debt in the Stability Pool, only offset, with no redistribution,
but at a capped rate of 1.1 and only if the whole debt can be liquidated.
The remainder due to the capped rate will be claimable as collateral surplus.
*/
function _tryLiquidateWithCap(
ITroveManager troveManager,
address _borrower,
uint256 _debtInStabPool,
uint256 _MCR,
uint256 _price
) internal returns (LiquidationValues memory singleLiquidation) {
uint entireTroveDebt;
uint entireTroveColl;
uint pendingDebtReward;
uint pendingCollReward;
(entireTroveDebt, entireTroveColl, pendingDebtReward, pendingCollReward) = troveManager.getEntireDebtAndColl(
_borrower
);
if (entireTroveDebt > _debtInStabPool) {
// do not liquidate if the entire trove cannot be liquidated via SP
return singleLiquidation;
}
troveManager.movePendingTroveRewardsToActiveBalances(pendingDebtReward, pendingCollReward);
singleLiquidation.entireTroveDebt = entireTroveDebt;
singleLiquidation.entireTroveColl = entireTroveColl;
uint256 collToOffset = (entireTroveDebt * _MCR) / _price;
singleLiquidation.collGasCompensation = _getCollGasCompensation(collToOffset);
singleLiquidation.debtGasCompensation = DEBT_GAS_COMPENSATION;
singleLiquidation.debtToOffset = entireTroveDebt;
singleLiquidation.collToSendToSP = collToOffset - singleLiquidation.collGasCompensation;
troveManager.closeTroveByLiquidation(_borrower);
uint256 collSurplus = entireTroveColl - collToOffset;
if (collSurplus > 0) {
singleLiquidation.collSurplus = collSurplus;
troveManager.addCollateralSurplus(_borrower, collSurplus);
}
emit TroveLiquidated(
_borrower,
entireTroveDebt,
singleLiquidation.collToSendToSP,
TroveManagerOperation.liquidateInRecoveryMode
);
emit TroveUpdated(_borrower, 0, 0, 0, TroveManagerOperation.liquidateInRecoveryMode);
return singleLiquidation;
}
/**
@dev Liquidate a trove without using the stability pool. All debt and collateral
are distributed porportionally between the remaining active troves.
*/
function _liquidateWithoutSP(
ITroveManager troveManager,
address _borrower
) internal returns (LiquidationValues memory singleLiquidation) {
uint pendingDebtReward;
uint pendingCollReward;
(
singleLiquidation.entireTroveDebt,
singleLiquidation.entireTroveColl,
pendingDebtReward,
pendingCollReward
) = troveManager.getEntireDebtAndColl(_borrower);
singleLiquidation.collGasCompensation = _getCollGasCompensation(singleLiquidation.entireTroveColl);
singleLiquidation.debtGasCompensation = DEBT_GAS_COMPENSATION;
troveManager.movePendingTroveRewardsToActiveBalances(pendingDebtReward, pendingCollReward);
singleLiquidation.debtToOffset = 0;
singleLiquidation.collToSendToSP = 0;
singleLiquidation.debtToRedistribute = singleLiquidation.entireTroveDebt;
singleLiquidation.collToRedistribute =
singleLiquidation.entireTroveColl -
singleLiquidation.collGasCompensation;
troveManager.closeTroveByLiquidation(_borrower);
emit TroveLiquidated(
_borrower,
singleLiquidation.entireTroveDebt,
singleLiquidation.entireTroveColl,
TroveManagerOperation.liquidateInRecoveryMode
);
emit TroveUpdated(_borrower, 0, 0, 0, TroveManagerOperation.liquidateInRecoveryMode);
return singleLiquidation;
}
/* In a full liquidation, returns the values for a trove's coll and debt to be offset, and coll and debt to be
* redistributed to active troves.
*/
function _getOffsetAndRedistributionVals(
uint256 _debt,
uint256 _coll,
uint256 _debtInStabPool,
bool sunsetting
)
internal
pure
returns (uint256 debtToOffset, uint256 collToSendToSP, uint256 debtToRedistribute, uint256 collToRedistribute)
{
if (_debtInStabPool > 0 && !sunsetting) {
/*
* Offset as much debt & collateral as possible against the Stability Pool, and redistribute the remainder
* between all active troves.
*
* If the trove's debt is larger than the deposited Debt in the Stability Pool:
*
* - Offset an amount of the trove's debt equal to the Debt in the Stability Pool
* - Send a fraction of the trove's collateral to the Stability Pool, equal to the fraction of its offset debt
*
*/
debtToOffset = PrismaMath._min(_debt, _debtInStabPool);
collToSendToSP = (_coll * debtToOffset) / _debt;
debtToRedistribute = _debt - debtToOffset;
collToRedistribute = _coll - collToSendToSP;
} else {
debtToOffset = 0;
collToSendToSP = 0;
debtToRedistribute = _debt;
collToRedistribute = _coll;
}
}
/**
@dev Adds values from `singleLiquidation` to `totals`
Calling this function mutates `totals`, the change is done in-place
to avoid needless expansion of memory
*/
function _applyLiquidationValuesToTotals(
LiquidationTotals memory totals,
LiquidationValues memory singleLiquidation
) internal pure {
// Tally all the values with their respective running totals
totals.totalCollGasCompensation = totals.totalCollGasCompensation + singleLiquidation.collGasCompensation;
totals.totalDebtGasCompensation = totals.totalDebtGasCompensation + singleLiquidation.debtGasCompensation;
totals.totalDebtInSequence = totals.totalDebtInSequence + singleLiquidation.entireTroveDebt;
totals.totalCollInSequence = totals.totalCollInSequence + singleLiquidation.entireTroveColl;
totals.totalDebtToOffset = totals.totalDebtToOffset + singleLiquidation.debtToOffset;
totals.totalCollToSendToSP = totals.totalCollToSendToSP + singleLiquidation.collToSendToSP;
totals.totalDebtToRedistribute = totals.totalDebtToRedistribute + singleLiquidation.debtToRedistribute;
totals.totalCollToRedistribute = totals.totalCollToRedistribute + singleLiquidation.collToRedistribute;
totals.totalCollSurplus = totals.totalCollSurplus + singleLiquidation.collSurplus;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IStabilityPool {
event CollateralGainWithdrawn(address indexed _depositor, uint256[] _collateral);
event CollateralOverwritten(address oldCollateral, address newCollateral);
event DepositSnapshotUpdated(address indexed _depositor, uint256 _P, uint256 _G);
event EpochUpdated(uint128 _currentEpoch);
event G_Updated(uint256 _G, uint128 _epoch, uint128 _scale);
event P_Updated(uint256 _P);
event RewardClaimed(address indexed account, address indexed recipient, uint256 claimed);
event S_Updated(uint256 idx, uint256 _S, uint128 _epoch, uint128 _scale);
event ScaleUpdated(uint128 _currentScale);
event StabilityPoolDebtBalanceUpdated(uint256 _newBalance);
event UserDepositChanged(address indexed _depositor, uint256 _newDeposit);
function claimCollateralGains(address recipient, uint256[] calldata collateralIndexes) external;
function claimReward(address recipient) external returns (uint256 amount);
function enableCollateral(address _collateral) external;
function offset(address collateral, uint256 _debtToOffset, uint256 _collToAdd) external;
function provideToSP(uint256 _amount) external;
function startCollateralSunset(address collateral) external;
function vaultClaimReward(address claimant, address) external returns (uint256 amount);
function withdrawFromSP(uint256 _amount) external;
function DECIMAL_PRECISION() external view returns (uint256);
function P() external view returns (uint256);
function PRISMA_CORE() external view returns (address);
function SCALE_FACTOR() external view returns (uint256);
function SUNSET_DURATION() external view returns (uint128);
function accountDeposits(address) external view returns (uint128 amount, uint128 timestamp);
function claimableReward(address _depositor) external view returns (uint256);
function collateralGainsByDepositor(address depositor, uint256) external view returns (uint80 gains);
function collateralTokens(uint256) external view returns (address);
function currentEpoch() external view returns (uint128);
function currentScale() external view returns (uint128);
function debtToken() external view returns (address);
function depositSnapshots(address) external view returns (uint256 P, uint256 G, uint128 scale, uint128 epoch);
function depositSums(address, uint256) external view returns (uint256);
function emissionId() external view returns (uint256);
function epochToScaleToG(uint128, uint128) external view returns (uint256);
function epochToScaleToSums(uint128, uint128, uint256) external view returns (uint256);
function factory() external view returns (address);
function getCompoundedDebtDeposit(address _depositor) external view returns (uint256);
function getDepositorCollateralGain(address _depositor) external view returns (uint256[] memory collateralGains);
function getTotalDebtTokenDeposits() external view returns (uint256);
function getWeek() external view returns (uint256 week);
function guardian() external view returns (address);
function indexByCollateral(address collateral) external view returns (uint256 index);
function lastCollateralError_Offset() external view returns (uint256);
function lastDebtLossError_Offset() external view returns (uint256);
function lastPrismaError() external view returns (uint256);
function lastUpdate() external view returns (uint32);
function liquidationManager() external view returns (address);
function owner() external view returns (address);
function periodFinish() external view returns (uint32);
function rewardRate() external view returns (uint128);
function vault() external view returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface ISortedTroves {
event NodeAdded(address _id, uint256 _NICR);
event NodeRemoved(address _id);
function insert(address _id, uint256 _NICR, address _prevId, address _nextId) external;
function reInsert(address _id, uint256 _newNICR, address _prevId, address _nextId) external;
function remove(address _id) external;
function setAddresses(address _troveManagerAddress) external;
function contains(address _id) external view returns (bool);
function data() external view returns (address head, address tail, uint256 size);
function findInsertPosition(
uint256 _NICR,
address _prevId,
address _nextId
) external view returns (address, address);
function getFirst() external view returns (address);
function getLast() external view returns (address);
function getNext(address _id) external view returns (address);
function getPrev(address _id) external view returns (address);
function getSize() external view returns (uint256);
function isEmpty() external view returns (bool);
function troveManager() external view returns (address);
function validInsertPosition(uint256 _NICR, address _prevId, address _nextId) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IBorrowerOperations {
struct Balances {
uint256[] collaterals;
uint256[] debts;
uint256[] prices;
}
event BorrowingFeePaid(address indexed borrower, uint256 amount);
event CollateralConfigured(address troveManager, address collateralToken);
event TroveCreated(address indexed _borrower, uint256 arrayIndex);
event TroveManagerRemoved(address troveManager);
event TroveUpdated(address indexed _borrower, uint256 _debt, uint256 _coll, uint256 stake, uint8 operation);
function addColl(
address troveManager,
address account,
uint256 _collateralAmount,
address _upperHint,
address _lowerHint
) external;
function adjustTrove(
address troveManager,
address account,
uint256 _maxFeePercentage,
uint256 _collDeposit,
uint256 _collWithdrawal,
uint256 _debtChange,
bool _isDebtIncrease,
address _upperHint,
address _lowerHint
) external;
function closeTrove(address troveManager, address account) external;
function configureCollateral(address troveManager, address collateralToken) external;
function fetchBalances() external returns (Balances memory balances);
function getGlobalSystemBalances() external returns (uint256 totalPricedCollateral, uint256 totalDebt);
function getTCR() external returns (uint256 globalTotalCollateralRatio);
function openTrove(
address troveManager,
address account,
uint256 _maxFeePercentage,
uint256 _collateralAmount,
uint256 _debtAmount,
address _upperHint,
address _lowerHint
) external;
function removeTroveManager(address troveManager) external;
function repayDebt(
address troveManager,
address account,
uint256 _debtAmount,
address _upperHint,
address _lowerHint
) external;
function setDelegateApproval(address _delegate, bool _isApproved) external;
function setMinNetDebt(uint256 _minNetDebt) external;
function withdrawColl(
address troveManager,
address account,
uint256 _collWithdrawal,
address _upperHint,
address _lowerHint
) external;
function withdrawDebt(
address troveManager,
address account,
uint256 _maxFeePercentage,
uint256 _debtAmount,
address _upperHint,
address _lowerHint
) external;
function checkRecoveryMode(uint256 TCR) external pure returns (bool);
function CCR() external view returns (uint256);
function DEBT_GAS_COMPENSATION() external view returns (uint256);
function DECIMAL_PRECISION() external view returns (uint256);
function PERCENT_DIVISOR() external view returns (uint256);
function PRISMA_CORE() external view returns (address);
function _100pct() external view returns (uint256);
function debtToken() external view returns (address);
function factory() external view returns (address);
function getCompositeDebt(uint256 _debt) external view returns (uint256);
function guardian() external view returns (address);
function isApprovedDelegate(address owner, address caller) external view returns (bool isApproved);
function minNetDebt() external view returns (uint256);
function owner() external view returns (address);
function troveManagersData(address) external view returns (address collateralToken, uint16 index);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface ITroveManager {
event BaseRateUpdated(uint256 _baseRate);
event CollateralSent(address _to, uint256 _amount);
event LTermsUpdated(uint256 _L_collateral, uint256 _L_debt);
event LastFeeOpTimeUpdated(uint256 _lastFeeOpTime);
event Redemption(
uint256 _attemptedDebtAmount,
uint256 _actualDebtAmount,
uint256 _collateralSent,
uint256 _collateralFee
);
event RewardClaimed(address indexed account, address indexed recipient, uint256 claimed);
event SystemSnapshotsUpdated(uint256 _totalStakesSnapshot, uint256 _totalCollateralSnapshot);
event TotalStakesUpdated(uint256 _newTotalStakes);
event TroveIndexUpdated(address _borrower, uint256 _newIndex);
event TroveSnapshotsUpdated(uint256 _L_collateral, uint256 _L_debt);
event TroveUpdated(address indexed _borrower, uint256 _debt, uint256 _coll, uint256 _stake, uint8 _operation);
function addCollateralSurplus(address borrower, uint256 collSurplus) external;
function applyPendingRewards(address _borrower) external returns (uint256 coll, uint256 debt);
function claimCollateral(address _receiver) external;
function claimReward(address receiver) external returns (uint256);
function closeTrove(address _borrower, address _receiver, uint256 collAmount, uint256 debtAmount) external;
function closeTroveByLiquidation(address _borrower) external;
function collectInterests() external;
function decayBaseRateAndGetBorrowingFee(uint256 _debt) external returns (uint256);
function decreaseDebtAndSendCollateral(address account, uint256 debt, uint256 coll) external;
function fetchPrice() external returns (uint256);
function finalizeLiquidation(
address _liquidator,
uint256 _debt,
uint256 _coll,
uint256 _collSurplus,
uint256 _debtGasComp,
uint256 _collGasComp
) external;
function getEntireSystemBalances() external returns (uint256, uint256, uint256);
function movePendingTroveRewardsToActiveBalances(uint256 _debt, uint256 _collateral) external;
function notifyRegisteredId(uint256[] calldata _assignedIds) external returns (bool);
function openTrove(
address _borrower,
uint256 _collateralAmount,
uint256 _compositeDebt,
uint256 NICR,
address _upperHint,
address _lowerHint,
bool _isRecoveryMode
) external returns (uint256 stake, uint256 arrayIndex);
function redeemCollateral(
uint256 _debtAmount,
address _firstRedemptionHint,
address _upperPartialRedemptionHint,
address _lowerPartialRedemptionHint,
uint256 _partialRedemptionHintNICR,
uint256 _maxIterations,
uint256 _maxFeePercentage
) external;
function setAddresses(address _priceFeedAddress, address _sortedTrovesAddress, address _collateralToken) external;
function setParameters(
uint256 _minuteDecayFactor,
uint256 _redemptionFeeFloor,
uint256 _maxRedemptionFee,
uint256 _borrowingFeeFloor,
uint256 _maxBorrowingFee,
uint256 _interestRateInBPS,
uint256 _maxSystemDebt,
uint256 _MCR
) external;
function setPaused(bool _paused) external;
function setPriceFeed(address _priceFeedAddress) external;
function startSunset() external;
function updateBalances() external;
function updateTroveFromAdjustment(
bool _isRecoveryMode,
bool _isDebtIncrease,
uint256 _debtChange,
uint256 _netDebtChange,
bool _isCollIncrease,
uint256 _collChange,
address _upperHint,
address _lowerHint,
address _borrower,
address _receiver
) external returns (uint256, uint256, uint256);
function vaultClaimReward(address claimant, address) external returns (uint256);
function BOOTSTRAP_PERIOD() external view returns (uint256);
function CCR() external view returns (uint256);
function DEBT_GAS_COMPENSATION() external view returns (uint256);
function DECIMAL_PRECISION() external view returns (uint256);
function L_collateral() external view returns (uint256);
function L_debt() external view returns (uint256);
function MAX_INTEREST_RATE_IN_BPS() external view returns (uint256);
function MCR() external view returns (uint256);
function PERCENT_DIVISOR() external view returns (uint256);
function PRISMA_CORE() external view returns (address);
function SUNSETTING_INTEREST_RATE() external view returns (uint256);
function Troves(
address
)
external
view
returns (
uint256 debt,
uint256 coll,
uint256 stake,
uint8 status,
uint128 arrayIndex,
uint256 activeInterestIndex
);
function accountLatestMint(address) external view returns (uint32 amount, uint32 week, uint32 day);
function activeInterestIndex() external view returns (uint256);
function baseRate() external view returns (uint256);
function borrowerOperationsAddress() external view returns (address);
function borrowingFeeFloor() external view returns (uint256);
function claimableReward(address account) external view returns (uint256);
function collateralToken() external view returns (address);
function dailyMintReward(uint256) external view returns (uint256);
function debtToken() external view returns (address);
function defaultedCollateral() external view returns (uint256);
function defaultedDebt() external view returns (uint256);
function emissionId() external view returns (uint16 debt, uint16 minting);
function getBorrowingFee(uint256 _debt) external view returns (uint256);
function getBorrowingFeeWithDecay(uint256 _debt) external view returns (uint256);
function getBorrowingRate() external view returns (uint256);
function getBorrowingRateWithDecay() external view returns (uint256);
function getCurrentICR(address _borrower, uint256 _price) external view returns (uint256);
function getEntireDebtAndColl(
address _borrower
) external view returns (uint256 debt, uint256 coll, uint256 pendingDebtReward, uint256 pendingCollateralReward);
function getEntireSystemColl() external view returns (uint256);
function getEntireSystemDebt() external view returns (uint256);
function getNominalICR(address _borrower) external view returns (uint256);
function getPendingCollAndDebtRewards(address _borrower) external view returns (uint256, uint256);
function getRedemptionFeeWithDecay(uint256 _collateralDrawn) external view returns (uint256);
function getRedemptionRate() external view returns (uint256);
function getRedemptionRateWithDecay() external view returns (uint256);
function getTotalActiveCollateral() external view returns (uint256);
function getTotalActiveDebt() external view returns (uint256);
function getTotalMints(uint256 week) external view returns (uint32[7] memory);
function getTroveCollAndDebt(address _borrower) external view returns (uint256 coll, uint256 debt);
function getTroveFromTroveOwnersArray(uint256 _index) external view returns (address);
function getTroveOwnersCount() external view returns (uint256);
function getTroveStake(address _borrower) external view returns (uint256);
function getTroveStatus(address _borrower) external view returns (uint256);
function getWeek() external view returns (uint256 week);
function getWeekAndDay() external view returns (uint256, uint256);
function guardian() external view returns (address);
function hasPendingRewards(address _borrower) external view returns (bool);
function interestPayable() external view returns (uint256);
function interestRate() external view returns (uint256);
function lastActiveIndexUpdate() external view returns (uint256);
function lastCollateralError_Redistribution() external view returns (uint256);
function lastDebtError_Redistribution() external view returns (uint256);
function lastFeeOperationTime() external view returns (uint256);
function lastUpdate() external view returns (uint32);
function liquidationManager() external view returns (address);
function maxBorrowingFee() external view returns (uint256);
function maxRedemptionFee() external view returns (uint256);
function maxSystemDebt() external view returns (uint256);
function minuteDecayFactor() external view returns (uint256);
function owner() external view returns (address);
function paused() external view returns (bool);
function periodFinish() external view returns (uint32);
function priceFeed() external view returns (address);
function redemptionFeeFloor() external view returns (uint256);
function rewardIntegral() external view returns (uint256);
function rewardIntegralFor(address) external view returns (uint256);
function rewardRate() external view returns (uint128);
function rewardSnapshots(address) external view returns (uint256 collateral, uint256 debt);
function sortedTroves() external view returns (address);
function sunsetting() external view returns (bool);
function surplusBalances(address) external view returns (uint256);
function systemDeploymentTime() external view returns (uint256);
function totalCollateralSnapshot() external view returns (uint256);
function totalStakes() external view returns (uint256);
function totalStakesSnapshot() external view returns (uint256);
function vault() external view returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
library PrismaMath {
uint256 internal constant DECIMAL_PRECISION = 1e18;
/* Precision for Nominal ICR (independent of price). Rationale for the value:
*
* - Making it “too high” could lead to overflows.
* - Making it “too low” could lead to an ICR equal to zero, due to truncation from Solidity floor division.
*
* This value of 1e20 is chosen for safety: the NICR will only overflow for numerator > ~1e39,
* and will only truncate to 0 if the denominator is at least 1e20 times greater than the numerator.
*
*/
uint256 internal constant NICR_PRECISION = 1e20;
function _min(uint256 _a, uint256 _b) internal pure returns (uint256) {
return (_a < _b) ? _a : _b;
}
function _max(uint256 _a, uint256 _b) internal pure returns (uint256) {
return (_a >= _b) ? _a : _b;
}
/*
* Multiply two decimal numbers and use normal rounding rules:
* -round product up if 19'th mantissa digit >= 5
* -round product down if 19'th mantissa digit < 5
*
* Used only inside the exponentiation, _decPow().
*/
function decMul(uint256 x, uint256 y) internal pure returns (uint256 decProd) {
uint256 prod_xy = x * y;
decProd = (prod_xy + (DECIMAL_PRECISION / 2)) / DECIMAL_PRECISION;
}
/*
* _decPow: Exponentiation function for 18-digit decimal base, and integer exponent n.
*
* Uses the efficient "exponentiation by squaring" algorithm. O(log(n)) complexity.
*
* Called by two functions that represent time in units of minutes:
* 1) TroveManager._calcDecayedBaseRate
* 2) CommunityIssuance._getCumulativeIssuanceFraction
*
* The exponent is capped to avoid reverting due to overflow. The cap 525600000 equals
* "minutes in 1000 years": 60 * 24 * 365 * 1000
*
* If a period of > 1000 years is ever used as an exponent in either of the above functions, the result will be
* negligibly different from just passing the cap, since:
*
* In function 1), the decayed base rate will be 0 for 1000 years or > 1000 years
* In function 2), the difference in tokens issued at 1000 years and any time > 1000 years, will be negligible
*/
function _decPow(uint256 _base, uint256 _minutes) internal pure returns (uint256) {
if (_minutes > 525600000) {
_minutes = 525600000;
} // cap to avoid overflow
if (_minutes == 0) {
return DECIMAL_PRECISION;
}
uint256 y = DECIMAL_PRECISION;
uint256 x = _base;
uint256 n = _minutes;
// Exponentiation-by-squaring
while (n > 1) {
if (n % 2 == 0) {
x = decMul(x, x);
n = n / 2;
} else {
// if (n % 2 != 0)
y = decMul(x, y);
x = decMul(x, x);
n = (n - 1) / 2;
}
}
return decMul(x, y);
}
function _getAbsoluteDifference(uint256 _a, uint256 _b) internal pure returns (uint256) {
return (_a >= _b) ? _a - _b : _b - _a;
}
function _computeNominalCR(uint256 _coll, uint256 _debt) internal pure returns (uint256) {
if (_debt > 0) {
return (_coll * NICR_PRECISION) / _debt;
}
// Return the maximal value for uint256 if the Trove has a debt of 0. Represents "infinite" CR.
else {
// if (_debt == 0)
return 2 ** 256 - 1;
}
}
function _computeCR(uint256 _coll, uint256 _debt, uint256 _price) internal pure returns (uint256) {
if (_debt > 0) {
uint256 newCollRatio = (_coll * _price) / _debt;
return newCollRatio;
}
// Return the maximal value for uint256 if the Trove has a debt of 0. Represents "infinite" CR.
else {
// if (_debt == 0)
return 2 ** 256 - 1;
}
}
function _computeCR(uint256 _coll, uint256 _debt) internal pure returns (uint256) {
if (_debt > 0) {
uint256 newCollRatio = (_coll) / _debt;
return newCollRatio;
}
// Return the maximal value for uint256 if the Trove has a debt of 0. Represents "infinite" CR.
else {
// if (_debt == 0)
return 2 ** 256 - 1;
}
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
/*
* Base contract for TroveManager, BorrowerOperations and StabilityPool. Contains global system constants and
* common functions.
*/
contract PrismaBase {
uint256 public constant DECIMAL_PRECISION = 1e18;
// Critical system collateral ratio. If the system's total collateral ratio (TCR) falls below the CCR, Recovery Mode is triggered.
uint256 public constant CCR = 1500000000000000000; // 150%
// Amount of debt to be locked in gas pool on opening troves
uint256 public immutable DEBT_GAS_COMPENSATION;
uint256 public constant PERCENT_DIVISOR = 200; // dividing by 200 yields 0.5%
constructor(uint256 _gasCompensation) {
DEBT_GAS_COMPENSATION = _gasCompensation;
}
// --- Gas compensation functions ---
// Returns the composite debt (drawn debt + gas compensation) of a trove, for the purpose of ICR calculation
function _getCompositeDebt(uint256 _debt) internal view returns (uint256) {
return _debt + DEBT_GAS_COMPENSATION;
}
function _getNetDebt(uint256 _debt) internal view returns (uint256) {
return _debt - DEBT_GAS_COMPENSATION;
}
// Return the amount of collateral to be drawn from a trove's collateral and sent as gas compensation.
function _getCollGasCompensation(uint256 _entireColl) internal pure returns (uint256) {
return _entireColl / PERCENT_DIVISOR;
}
function _requireUserAcceptsFee(uint256 _fee, uint256 _amount, uint256 _maxFeePercentage) internal pure {
uint256 feePercentage = (_fee * DECIMAL_PRECISION) / _amount;
require(feePercentage <= _maxFeePercentage, "Fee exceeded provided maximum");
}
}{
"evmVersion": "paris",
"optimizer": {
"enabled": true,
"runs": 200
},
"libraries": {
"LiquidationManager.sol": {}
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract IStabilityPool","name":"_stabilityPoolAddress","type":"address"},{"internalType":"contract IBorrowerOperations","name":"_borrowerOperations","type":"address"},{"internalType":"address","name":"_factory","type":"address"},{"internalType":"uint256","name":"_gasCompensation","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_liquidatedDebt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_liquidatedColl","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_collGasCompensation","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_debtGasCompensation","type":"uint256"}],"name":"Liquidation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_borrower","type":"address"},{"indexed":false,"internalType":"uint256","name":"_debt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_coll","type":"uint256"},{"indexed":false,"internalType":"enum LiquidationManager.TroveManagerOperation","name":"_operation","type":"uint8"}],"name":"TroveLiquidated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_borrower","type":"address"},{"indexed":false,"internalType":"uint256","name":"_debt","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_coll","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_stake","type":"uint256"},{"indexed":false,"internalType":"enum LiquidationManager.TroveManagerOperation","name":"_operation","type":"uint8"}],"name":"TroveUpdated","type":"event"},{"inputs":[],"name":"CCR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEBT_GAS_COMPENSATION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DECIMAL_PRECISION","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERCENT_DIVISOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITroveManager","name":"troveManager","type":"address"},{"internalType":"address[]","name":"_troveArray","type":"address[]"}],"name":"batchLiquidateTroves","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"borrowerOperations","outputs":[{"internalType":"contract IBorrowerOperations","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITroveManager","name":"_troveManager","type":"address"}],"name":"enableTroveManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract ITroveManager","name":"troveManager","type":"address"},{"internalType":"address","name":"borrower","type":"address"}],"name":"liquidate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract ITroveManager","name":"troveManager","type":"address"},{"internalType":"uint256","name":"maxTrovesToLiquidate","type":"uint256"},{"internalType":"uint256","name":"maxICR","type":"uint256"}],"name":"liquidateTroves","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stabilityPool","outputs":[{"internalType":"contract IStabilityPool","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
6101006040523480156200001257600080fd5b50604051620026f6380380620026f683398101604081905262000035916200006f565b6080526001600160a01b0392831660a05290821660c0521660e052620000c9565b6001600160a01b03811681146200006c57600080fd5b50565b600080600080608085870312156200008657600080fd5b8451620000938162000056565b6020860151909450620000a68162000056565b6040860151909350620000b98162000056565b6060959095015193969295505050565b60805160a05160c05160e0516125bc6200013a600039600081816101c701526101f4015260008181610158015281816107ba015261123001526000818160b3015281816102e00152610eb40152600081816101220152818161190e01528181611c9c0152611f4801526125bc6000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c806377553ad41161007157806377553ad4146101535780637b5031b21461017a5780637c92590f1461018d57806386b9d81f146101a0578063a20baee6146101b3578063c45a0155146101c257600080fd5b8063048c661d146100ae57806317dd676d146100f25780634870dd9a146101075780634ba4a28b1461011d5780635733d58f14610144575b600080fd5b6100d57f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020015b60405180910390f35b6101056101003660046121fc565b6101e9565b005b61010f60c881565b6040519081526020016100e9565b61010f7f000000000000000000000000000000000000000000000000000000000000000081565b61010f6714d1120d7b16000081565b6100d57f000000000000000000000000000000000000000000000000000000000000000081565b610105610188366004612219565b610278565b61010561019b366004612274565b610d53565b6101056101ae36600461234e565b61173e565b61010f670de0b6b3a764000081565b6100d57f000000000000000000000000000000000000000000000000000000000000000081565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146102545760405162461bcd60e51b815260206004820152600b60248201526a4e6f7420666163746f727960a81b60448201526064015b60405180910390fd5b6001600160a01b03166000908152602081905260409020805460ff19166001179055565b6001600160a01b03831660009081526020819052604090205460ff166102dc5760405162461bcd60e51b8152602060048201526019602482015278151c9bdd9953585b9859d95c881b9bdd08185c1c1c9bdd9959603a1b604482015260640161024b565b60007f00000000000000000000000000000000000000000000000000000000000000009050836001600160a01b0316636f3fe4046040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561033c57600080fd5b505af1158015610350573d6000803e3d6000fd5b505050506000846001600160a01b031663ae9187546040518163ffffffff1660e01b8152600401602060405180830381865afa158015610394573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b89190612387565b90506103c2612198565b6103ca612198565b6103f0604051806060016040528060008152602001600081526020016000151581525090565b60008790506000896001600160a01b03166349eefeee6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610435573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045991906123a4565b9050896001600160a01b0316630fdb11cf6040518163ffffffff1660e01b81526004016020604051808303816000875af115801561049b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104bf91906123a4565b836000018181525050896001600160a01b0316639484fb8e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610506573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052a91906123bd565b836040019015159081151581525050896001600160a01b031663794e57246040518163ffffffff1660e01b8152600401602060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059b91906123a4565b8360200181815250506000876001600160a01b0316630d9a6b356040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060891906123a4565b90505b60008311801561061b5750600182115b15610792576000876001600160a01b0316634d6228316040518163ffffffff1660e01b8152600401602060405180830381865afa158015610660573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106849190612387565b8551604051630d293c7160e41b81526001600160a01b0380841660048301526024820192909252919250600091908e169063d293c71090604401602060405180830381865afa1580156106db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ff91906123a4565b90508a81111561071457600094505050610792565b670de0b6b3a7640000811161073e5761072d8d83611874565b97506107398789611abb565b61077f565b85602001518110156107785761075a8d83858960400151611b9e565b975087608001518361076c91906123f5565b92506107398789611abb565b5050610792565b505060001992830192919091019061060b565b6000831180156107a457508360400151155b80156107b05750600182115b15610aca576000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663716c53c26040518163ffffffff1660e01b815260040160408051808303816000875af1158015610817573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083b9190612408565b875160a08a01519294509092506108519161242c565b61085b90836123f5565b915086608001518161086d91906123f5565b90506000896001600160a01b0316634d6228316040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d39190612387565b90508d5b6000871180156108e75750600186115b15610ac55760008f6001600160a01b031663d293c710848b600001516040518363ffffffff1660e01b81526004016109349291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015610951573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097591906123a4565b90508d8111156109855750610ac5565b604051632dc9c0eb60e21b81526001600160a01b03808516600483015260001999909901988491908e169063b72703ac90602401602060405180830381865afa1580156109d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fa9190612387565b93506000610a088787611df6565b90506714d1120d7b16000081101580610a215750808310155b15610a2e57505050610ac5565b610a4384838a8e602001518f60000151611e1c565b9c508c60800151600003610a59575050506108d7565b60808d0151610a6890896123f5565b97508a600001518d61010001518e60a00151610a849190612443565b610a8e919061242c565b610a9890886123f5565b96508c6080015186610aaa91906123f5565b9550610ab68c8e611abb565b505060001990960195506108d7565b505050505b6000856020015111610aee5760405162461bcd60e51b815260040161024b90612456565b600085608001511180610b05575060008560a00151115b15610c3e57876001600160a01b031663e66667338c6001600160a01b031663b2016bd46040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7b9190612387565b87608001518860a001516040518463ffffffff1660e01b8152600401610ba393929190612498565b600060405180830381600087803b158015610bbd57600080fd5b505af1158015610bd1573d6000803e3d6000fd5b505050608086015160a0870151604051633a461b2560e21b81526001600160a01b038f16935063e9186c9492610c0b928d92600401612498565b600060405180830381600087803b158015610c2557600080fd5b505af1158015610c39573d6000803e3d6000fd5b505050505b60c085015160e086015161010087015160608801516040808a01519051637511d13d60e11b8152336004820152602481019590955260448501939093526064840191909152608483015260a48201526001600160a01b038c169063ea23a27a9060c401600060405180830381600087803b158015610cbb57600080fd5b505af1158015610ccf573d6000803e3d6000fd5b5050506020860151610100870151604088015188517f4152c73dd2614c4f9fc35e8c9cf16013cd588c75b49a4c1673ecffdcbcda94039450610d1191906123f5565b610d1b91906123f5565b6040808901516060808b0151835195865260208601949094529184015282015260800160405180910390a15050505050505050505050565b6001600160a01b03821660009081526020819052604090205460ff16610db75760405162461bcd60e51b8152602060048201526019602482015278151c9bdd9953585b9859d95c881b9bdd08185c1c1c9bdd9959603a1b604482015260640161024b565b8051600003610e275760405162461bcd60e51b815260206004820152603660248201527f54726f76654d616e616765723a2043616c6c646174612061646472657373206160448201527572726179206d757374206e6f7420626520656d70747960501b606482015260840161024b565b816001600160a01b0316636f3fe4046040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610e6257600080fd5b505af1158015610e76573d6000803e3d6000fd5b50505050610e82612198565b610e8a612198565b610eb0604051806060016040528060008152602001600081526020016000151581525090565b60007f000000000000000000000000000000000000000000000000000000000000000090506000816001600160a01b0316630d9a6b356040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3991906123a4565b9050866001600160a01b0316630fdb11cf6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610f7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9f91906123a4565b836000018181525050866001600160a01b0316639484fb8e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fe6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100a91906123bd565b836040019015159081151581525050866001600160a01b031663794e57246040518163ffffffff1660e01b8152600401602060405180830381865afa158015611057573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107b91906123a4565b8360200181815250506000876001600160a01b03166349eefeee6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e891906123a4565b875190915060005b81811080156110ff5750600183115b15611217576000898281518110611118576111186124b9565b60209081029190910101518751604051630d293c7160e41b81526001600160a01b0380841660048301526024820192909252919250600091908d169063d293c71090604401602060405180830381865afa15801561117a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119e91906123a4565b9050670de0b6b3a764000081116111c0576111b98c83611874565b99506111fc565b87602001518110156111f5576111dc8c83888b60400151611b9e565b99508960800151866111ee91906123f5565b95506111fc565b5050611217565b611206898b611abb565b5050600019909201916001016110f0565b81811080156112265750600183115b156114b6576000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663716c53c26040518163ffffffff1660e01b815260040160408051808303816000875af115801561128d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b19190612408565b895160a08c01519294509092506112c79161242c565b6112d190836123f5565b91508860800151816112e391906123f5565b90505b83831080156112f55750600185115b156114b35760008b848151811061130e5761130e6124b9565b60209081029190910101518951604051630d293c7160e41b81526001600160a01b0380841660048301526024820192909252919250600091908f169063d293c71090604401602060405180830381865afa158015611370573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139491906123a4565b9050846001019450670de0b6b3a764000081116113bc576113b58e83611874565b9b50611448565b89602001518110156113d8576113b58e838a8d60400151611b9e565b8960400151156113e95750506112e6565b60006113f58585611df6565b90506714d1120d7b1600008110158061140e5750808210155b1561141b575050506112e6565b6114308f848b8e602001518f60000151611e1c565b9c508c60800151600003611446575050506112e6565b505b60808c015161145790896123f5565b975089600001518c61010001518d60a001516114739190612443565b61147d919061242c565b61148790856123f5565b93508b608001518361149991906123f5565b92506114a58b8d611abb565b5050600019909401936112e6565b50505b60008760200151116114da5760405162461bcd60e51b815260040161024b90612456565b6000876080015111806114f1575060008760a00151115b1561162a57846001600160a01b031663e66667338b6001600160a01b031663b2016bd46040518163ffffffff1660e01b8152600401602060405180830381865afa158015611543573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115679190612387565b89608001518a60a001516040518463ffffffff1660e01b815260040161158f93929190612498565b600060405180830381600087803b1580156115a957600080fd5b505af11580156115bd573d6000803e3d6000fd5b505050608088015160a0890151604051633a461b2560e21b81526001600160a01b038e16935063e9186c94926115f7928a92600401612498565b600060405180830381600087803b15801561161157600080fd5b505af1158015611625573d6000803e3d6000fd5b505050505b60c087015160e088015161010089015160608a01516040808c01519051637511d13d60e11b8152336004820152602481019590955260448501939093526064840191909152608483015260a48201526001600160a01b038b169063ea23a27a9060c401600060405180830381600087803b1580156116a757600080fd5b505af11580156116bb573d6000803e3d6000fd5b505050602088015161010089015160408a01518a517f4152c73dd2614c4f9fc35e8c9cf16013cd588c75b49a4c1673ecffdcbcda940394506116fd91906123f5565b61170791906123f5565b6040808b01516060808d0151835195865260208601949094529184015282015260800160405180910390a150505050505050505050565b6040516321e3780160e01b81526001600160a01b0382811660048301528316906321e3780190602401602060405180830381865afa158015611784573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a891906123a4565b60011461180f5760405162461bcd60e51b815260206004820152602f60248201527f54726f76654d616e616765723a2054726f766520646f6573206e6f742065786960448201526e1cdd081bdc881a5cc818db1bdcd959608a1b606482015260840161024b565b604080516001808252818301909252600091602080830190803683370190505090508181600081518110611845576118456124b9565b60200260200101906001600160a01b031690816001600160a01b03168152505061186f8382610d53565b505050565b61187c612198565b604051632e46be5f60e21b81526001600160a01b038381166004830152600091829186169063b91af97c90602401608060405180830381865afa1580156118c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118eb91906124cf565b60208701839052928652935090915061190390612102565b6040848101919091527f000000000000000000000000000000000000000000000000000000000000000060608501525163eb3007fd60e01b815260048101839052602481018290526001600160a01b0386169063eb3007fd90604401600060405180830381600087803b15801561197957600080fd5b505af115801561198d573d6000803e3d6000fd5b505060006080860181905260a08601525050825160c0840152604083015160208401516119ba91906123f5565b60e08401526040516325019ee960e01b81526001600160a01b0385811660048301528616906325019ee990602401600060405180830381600087803b158015611a0257600080fd5b505af1158015611a16573d6000803e3d6000fd5b50505050836001600160a01b03167fea67486ed7ebe3eea8ab3390efd4a3c8aae48be5bea27df104a8af786c408434846000015185602001516002604051611a6093929190612527565b60405180910390a2836001600160a01b03167fc3770d654ed33aeea6bf11ac8ef05d02a6a04ed4686dd2f624d853bbec43cc8b60008060006002604051611aaa9493929190612542565b60405180910390a250505b92915050565b80604001518260400151611acf9190612443565b604083015260608082015190830151611ae89190612443565b606083015280516020830151611afe9190612443565b6020808401919091528101518251611b169190612443565b825260808082015190830151611b2c9190612443565b608083015260a08082015190830151611b459190612443565b60a083015260c08082015190830151611b5e9190612443565b60c083015260e08082015190830151611b779190612443565b60e08301526101008082015190830151611b919190612443565b6101009092019190915250565b611ba6612198565b604051632e46be5f60e21b81526001600160a01b038581166004830152600091829188169063b91af97c90602401608060405180830381865afa158015611bf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c1591906124cf565b602087019290925291855260405163eb3007fd60e01b8152600481018390526024810182905291935091506001600160a01b0388169063eb3007fd90604401600060405180830381600087803b158015611c6e57600080fd5b505af1158015611c82573d6000803e3d6000fd5b50505050611c938360200151612102565b604084018190527f000000000000000000000000000000000000000000000000000000000000000060608501526020840151600091611cd1916123f5565b9050611ce3846000015182888861210f565b60e088015260c087015260a086015260808501526040516325019ee960e01b81526001600160a01b0388811660048301528916906325019ee990602401600060405180830381600087803b158015611d3a57600080fd5b505af1158015611d4e573d6000803e3d6000fd5b50505050866001600160a01b03167fea67486ed7ebe3eea8ab3390efd4a3c8aae48be5bea27df104a8af786c408434856000015186602001516001604051611d9893929190612527565b60405180910390a2866001600160a01b03167fc3770d654ed33aeea6bf11ac8ef05d02a6a04ed4686dd2f624d853bbec43cc8b60008060006001604051611de29493929190612542565b60405180910390a25050505b949350505050565b60008115611e13576000611e0a8385612564565b9150611ab59050565b50600019611ab5565b611e24612198565b604051632e46be5f60e21b81526001600160a01b0386811660048301526000918291829182918b169063b91af97c90602401608060405180830381865afa158015611e73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9791906124cf565b9296509094509250905087841115611eb257505050506120f9565b60405163eb3007fd60e01b815260048101839052602481018290526001600160a01b038b169063eb3007fd90604401600060405180830381600087803b158015611efb57600080fd5b505af1158015611f0f573d6000803e3d6000fd5b5050508486525060208501839052600086611f2a898761242c565b611f349190612564565b9050611f3f81612102565b604087018190527f0000000000000000000000000000000000000000000000000000000000000000606088015260808701869052611f7d90826123f5565b60a08701526040516325019ee960e01b81526001600160a01b038b811660048301528c16906325019ee990602401600060405180830381600087803b158015611fc557600080fd5b505af1158015611fd9573d6000803e3d6000fd5b5050505060008185611feb91906123f5565b9050801561205e57610100870181905260405163789c6b9360e01b81526001600160a01b038c81166004830152602482018390528d169063789c6b9390604401600060405180830381600087803b15801561204557600080fd5b505af1158015612059573d6000803e3d6000fd5b505050505b8a6001600160a01b03167fea67486ed7ebe3eea8ab3390efd4a3c8aae48be5bea27df104a8af786c408434878960a0015160026040516120a093929190612527565b60405180910390a28a6001600160a01b03167fc3770d654ed33aeea6bf11ac8ef05d02a6a04ed4686dd2f624d853bbec43cc8b600080600060026040516120ea9493929190612542565b60405180910390a25050505050505b95945050505050565b6000611ab560c883612564565b600080600080600086118015612123575084155b15612168576121328887612180565b93508761213f858961242c565b6121499190612564565b925061215584896123f5565b915061216183886123f5565b9050612175565b5060009250829150869050855b945094509450949050565b600081831061218f5781612191565b825b9392505050565b6040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b03811681146121f957600080fd5b50565b60006020828403121561220e57600080fd5b8135612191816121e4565b60008060006060848603121561222e57600080fd5b8335612239816121e4565b95602085013595506040909401359392505050565b634e487b7160e01b600052604160045260246000fd5b803561226f816121e4565b919050565b6000806040838503121561228757600080fd5b8235612292816121e4565b915060208381013567ffffffffffffffff808211156122b057600080fd5b818601915086601f8301126122c457600080fd5b8135818111156122d6576122d661224e565b8060051b604051601f19603f830116810181811085821117156122fb576122fb61224e565b60405291825284820192508381018501918983111561231957600080fd5b938501935b8285101561233e5761232f85612264565b8452938501939285019261231e565b8096505050505050509250929050565b6000806040838503121561236157600080fd5b823561236c816121e4565b9150602083013561237c816121e4565b809150509250929050565b60006020828403121561239957600080fd5b8151612191816121e4565b6000602082840312156123b657600080fd5b5051919050565b6000602082840312156123cf57600080fd5b8151801515811461219157600080fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115611ab557611ab56123df565b6000806040838503121561241b57600080fd5b505080516020909101519092909150565b8082028115828204841417611ab557611ab56123df565b80820180821115611ab557611ab56123df565b60208082526022908201527f54726f76654d616e616765723a206e6f7468696e6720746f206c697175696461604082015261746560f01b606082015260800190565b6001600160a01b039390931683526020830191909152604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600080600080608085870312156124e557600080fd5b505082516020840151604085015160609095015191969095509092509050565b6004811061252357634e487b7160e01b600052602160045260246000fd5b9052565b8381526020810183905260608101611dee6040830184612505565b8481526020810184905260408101839052608081016120f96060830184612505565b60008261258157634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220f7c208816304e27eff44394515e81533f8ae969871dfc1515807bf56a34405b064736f6c63430008130033000000000000000000000000ed8b26d99834540c5013701bb3715fafd39993ba00000000000000000000000072c590349535ad52e6953744cb2a36b40954271900000000000000000000000070b66e20766b775b2e9ce5b718bbd285af59b7e100000000000000000000000000000000000000000000000ad78ebc5ac6200000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806377553ad41161007157806377553ad4146101535780637b5031b21461017a5780637c92590f1461018d57806386b9d81f146101a0578063a20baee6146101b3578063c45a0155146101c257600080fd5b8063048c661d146100ae57806317dd676d146100f25780634870dd9a146101075780634ba4a28b1461011d5780635733d58f14610144575b600080fd5b6100d57f000000000000000000000000ed8b26d99834540c5013701bb3715fafd39993ba81565b6040516001600160a01b0390911681526020015b60405180910390f35b6101056101003660046121fc565b6101e9565b005b61010f60c881565b6040519081526020016100e9565b61010f7f00000000000000000000000000000000000000000000000ad78ebc5ac620000081565b61010f6714d1120d7b16000081565b6100d57f00000000000000000000000072c590349535ad52e6953744cb2a36b40954271981565b610105610188366004612219565b610278565b61010561019b366004612274565b610d53565b6101056101ae36600461234e565b61173e565b61010f670de0b6b3a764000081565b6100d57f00000000000000000000000070b66e20766b775b2e9ce5b718bbd285af59b7e181565b336001600160a01b037f00000000000000000000000070b66e20766b775b2e9ce5b718bbd285af59b7e116146102545760405162461bcd60e51b815260206004820152600b60248201526a4e6f7420666163746f727960a81b60448201526064015b60405180910390fd5b6001600160a01b03166000908152602081905260409020805460ff19166001179055565b6001600160a01b03831660009081526020819052604090205460ff166102dc5760405162461bcd60e51b8152602060048201526019602482015278151c9bdd9953585b9859d95c881b9bdd08185c1c1c9bdd9959603a1b604482015260640161024b565b60007f000000000000000000000000ed8b26d99834540c5013701bb3715fafd39993ba9050836001600160a01b0316636f3fe4046040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561033c57600080fd5b505af1158015610350573d6000803e3d6000fd5b505050506000846001600160a01b031663ae9187546040518163ffffffff1660e01b8152600401602060405180830381865afa158015610394573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103b89190612387565b90506103c2612198565b6103ca612198565b6103f0604051806060016040528060008152602001600081526020016000151581525090565b60008790506000896001600160a01b03166349eefeee6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610435573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045991906123a4565b9050896001600160a01b0316630fdb11cf6040518163ffffffff1660e01b81526004016020604051808303816000875af115801561049b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104bf91906123a4565b836000018181525050896001600160a01b0316639484fb8e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610506573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061052a91906123bd565b836040019015159081151581525050896001600160a01b031663794e57246040518163ffffffff1660e01b8152600401602060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059b91906123a4565b8360200181815250506000876001600160a01b0316630d9a6b356040518163ffffffff1660e01b8152600401602060405180830381865afa1580156105e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060891906123a4565b90505b60008311801561061b5750600182115b15610792576000876001600160a01b0316634d6228316040518163ffffffff1660e01b8152600401602060405180830381865afa158015610660573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106849190612387565b8551604051630d293c7160e41b81526001600160a01b0380841660048301526024820192909252919250600091908e169063d293c71090604401602060405180830381865afa1580156106db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ff91906123a4565b90508a81111561071457600094505050610792565b670de0b6b3a7640000811161073e5761072d8d83611874565b97506107398789611abb565b61077f565b85602001518110156107785761075a8d83858960400151611b9e565b975087608001518361076c91906123f5565b92506107398789611abb565b5050610792565b505060001992830192919091019061060b565b6000831180156107a457508360400151155b80156107b05750600182115b15610aca576000807f00000000000000000000000072c590349535ad52e6953744cb2a36b4095427196001600160a01b031663716c53c26040518163ffffffff1660e01b815260040160408051808303816000875af1158015610817573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083b9190612408565b875160a08a01519294509092506108519161242c565b61085b90836123f5565b915086608001518161086d91906123f5565b90506000896001600160a01b0316634d6228316040518163ffffffff1660e01b8152600401602060405180830381865afa1580156108af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d39190612387565b90508d5b6000871180156108e75750600186115b15610ac55760008f6001600160a01b031663d293c710848b600001516040518363ffffffff1660e01b81526004016109349291906001600160a01b03929092168252602082015260400190565b602060405180830381865afa158015610951573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061097591906123a4565b90508d8111156109855750610ac5565b604051632dc9c0eb60e21b81526001600160a01b03808516600483015260001999909901988491908e169063b72703ac90602401602060405180830381865afa1580156109d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fa9190612387565b93506000610a088787611df6565b90506714d1120d7b16000081101580610a215750808310155b15610a2e57505050610ac5565b610a4384838a8e602001518f60000151611e1c565b9c508c60800151600003610a59575050506108d7565b60808d0151610a6890896123f5565b97508a600001518d61010001518e60a00151610a849190612443565b610a8e919061242c565b610a9890886123f5565b96508c6080015186610aaa91906123f5565b9550610ab68c8e611abb565b505060001990960195506108d7565b505050505b6000856020015111610aee5760405162461bcd60e51b815260040161024b90612456565b600085608001511180610b05575060008560a00151115b15610c3e57876001600160a01b031663e66667338c6001600160a01b031663b2016bd46040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7b9190612387565b87608001518860a001516040518463ffffffff1660e01b8152600401610ba393929190612498565b600060405180830381600087803b158015610bbd57600080fd5b505af1158015610bd1573d6000803e3d6000fd5b505050608086015160a0870151604051633a461b2560e21b81526001600160a01b038f16935063e9186c9492610c0b928d92600401612498565b600060405180830381600087803b158015610c2557600080fd5b505af1158015610c39573d6000803e3d6000fd5b505050505b60c085015160e086015161010087015160608801516040808a01519051637511d13d60e11b8152336004820152602481019590955260448501939093526064840191909152608483015260a48201526001600160a01b038c169063ea23a27a9060c401600060405180830381600087803b158015610cbb57600080fd5b505af1158015610ccf573d6000803e3d6000fd5b5050506020860151610100870151604088015188517f4152c73dd2614c4f9fc35e8c9cf16013cd588c75b49a4c1673ecffdcbcda94039450610d1191906123f5565b610d1b91906123f5565b6040808901516060808b0151835195865260208601949094529184015282015260800160405180910390a15050505050505050505050565b6001600160a01b03821660009081526020819052604090205460ff16610db75760405162461bcd60e51b8152602060048201526019602482015278151c9bdd9953585b9859d95c881b9bdd08185c1c1c9bdd9959603a1b604482015260640161024b565b8051600003610e275760405162461bcd60e51b815260206004820152603660248201527f54726f76654d616e616765723a2043616c6c646174612061646472657373206160448201527572726179206d757374206e6f7420626520656d70747960501b606482015260840161024b565b816001600160a01b0316636f3fe4046040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610e6257600080fd5b505af1158015610e76573d6000803e3d6000fd5b50505050610e82612198565b610e8a612198565b610eb0604051806060016040528060008152602001600081526020016000151581525090565b60007f000000000000000000000000ed8b26d99834540c5013701bb3715fafd39993ba90506000816001600160a01b0316630d9a6b356040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3991906123a4565b9050866001600160a01b0316630fdb11cf6040518163ffffffff1660e01b81526004016020604051808303816000875af1158015610f7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9f91906123a4565b836000018181525050866001600160a01b0316639484fb8e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fe6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100a91906123bd565b836040019015159081151581525050866001600160a01b031663794e57246040518163ffffffff1660e01b8152600401602060405180830381865afa158015611057573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107b91906123a4565b8360200181815250506000876001600160a01b03166349eefeee6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e891906123a4565b875190915060005b81811080156110ff5750600183115b15611217576000898281518110611118576111186124b9565b60209081029190910101518751604051630d293c7160e41b81526001600160a01b0380841660048301526024820192909252919250600091908d169063d293c71090604401602060405180830381865afa15801561117a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119e91906123a4565b9050670de0b6b3a764000081116111c0576111b98c83611874565b99506111fc565b87602001518110156111f5576111dc8c83888b60400151611b9e565b99508960800151866111ee91906123f5565b95506111fc565b5050611217565b611206898b611abb565b5050600019909201916001016110f0565b81811080156112265750600183115b156114b6576000807f00000000000000000000000072c590349535ad52e6953744cb2a36b4095427196001600160a01b031663716c53c26040518163ffffffff1660e01b815260040160408051808303816000875af115801561128d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b19190612408565b895160a08c01519294509092506112c79161242c565b6112d190836123f5565b91508860800151816112e391906123f5565b90505b83831080156112f55750600185115b156114b35760008b848151811061130e5761130e6124b9565b60209081029190910101518951604051630d293c7160e41b81526001600160a01b0380841660048301526024820192909252919250600091908f169063d293c71090604401602060405180830381865afa158015611370573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139491906123a4565b9050846001019450670de0b6b3a764000081116113bc576113b58e83611874565b9b50611448565b89602001518110156113d8576113b58e838a8d60400151611b9e565b8960400151156113e95750506112e6565b60006113f58585611df6565b90506714d1120d7b1600008110158061140e5750808210155b1561141b575050506112e6565b6114308f848b8e602001518f60000151611e1c565b9c508c60800151600003611446575050506112e6565b505b60808c015161145790896123f5565b975089600001518c61010001518d60a001516114739190612443565b61147d919061242c565b61148790856123f5565b93508b608001518361149991906123f5565b92506114a58b8d611abb565b5050600019909401936112e6565b50505b60008760200151116114da5760405162461bcd60e51b815260040161024b90612456565b6000876080015111806114f1575060008760a00151115b1561162a57846001600160a01b031663e66667338b6001600160a01b031663b2016bd46040518163ffffffff1660e01b8152600401602060405180830381865afa158015611543573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115679190612387565b89608001518a60a001516040518463ffffffff1660e01b815260040161158f93929190612498565b600060405180830381600087803b1580156115a957600080fd5b505af11580156115bd573d6000803e3d6000fd5b505050608088015160a0890151604051633a461b2560e21b81526001600160a01b038e16935063e9186c94926115f7928a92600401612498565b600060405180830381600087803b15801561161157600080fd5b505af1158015611625573d6000803e3d6000fd5b505050505b60c087015160e088015161010089015160608a01516040808c01519051637511d13d60e11b8152336004820152602481019590955260448501939093526064840191909152608483015260a48201526001600160a01b038b169063ea23a27a9060c401600060405180830381600087803b1580156116a757600080fd5b505af11580156116bb573d6000803e3d6000fd5b505050602088015161010089015160408a01518a517f4152c73dd2614c4f9fc35e8c9cf16013cd588c75b49a4c1673ecffdcbcda940394506116fd91906123f5565b61170791906123f5565b6040808b01516060808d0151835195865260208601949094529184015282015260800160405180910390a150505050505050505050565b6040516321e3780160e01b81526001600160a01b0382811660048301528316906321e3780190602401602060405180830381865afa158015611784573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a891906123a4565b60011461180f5760405162461bcd60e51b815260206004820152602f60248201527f54726f76654d616e616765723a2054726f766520646f6573206e6f742065786960448201526e1cdd081bdc881a5cc818db1bdcd959608a1b606482015260840161024b565b604080516001808252818301909252600091602080830190803683370190505090508181600081518110611845576118456124b9565b60200260200101906001600160a01b031690816001600160a01b03168152505061186f8382610d53565b505050565b61187c612198565b604051632e46be5f60e21b81526001600160a01b038381166004830152600091829186169063b91af97c90602401608060405180830381865afa1580156118c7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118eb91906124cf565b60208701839052928652935090915061190390612102565b6040848101919091527f00000000000000000000000000000000000000000000000ad78ebc5ac620000060608501525163eb3007fd60e01b815260048101839052602481018290526001600160a01b0386169063eb3007fd90604401600060405180830381600087803b15801561197957600080fd5b505af115801561198d573d6000803e3d6000fd5b505060006080860181905260a08601525050825160c0840152604083015160208401516119ba91906123f5565b60e08401526040516325019ee960e01b81526001600160a01b0385811660048301528616906325019ee990602401600060405180830381600087803b158015611a0257600080fd5b505af1158015611a16573d6000803e3d6000fd5b50505050836001600160a01b03167fea67486ed7ebe3eea8ab3390efd4a3c8aae48be5bea27df104a8af786c408434846000015185602001516002604051611a6093929190612527565b60405180910390a2836001600160a01b03167fc3770d654ed33aeea6bf11ac8ef05d02a6a04ed4686dd2f624d853bbec43cc8b60008060006002604051611aaa9493929190612542565b60405180910390a250505b92915050565b80604001518260400151611acf9190612443565b604083015260608082015190830151611ae89190612443565b606083015280516020830151611afe9190612443565b6020808401919091528101518251611b169190612443565b825260808082015190830151611b2c9190612443565b608083015260a08082015190830151611b459190612443565b60a083015260c08082015190830151611b5e9190612443565b60c083015260e08082015190830151611b779190612443565b60e08301526101008082015190830151611b919190612443565b6101009092019190915250565b611ba6612198565b604051632e46be5f60e21b81526001600160a01b038581166004830152600091829188169063b91af97c90602401608060405180830381865afa158015611bf1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c1591906124cf565b602087019290925291855260405163eb3007fd60e01b8152600481018390526024810182905291935091506001600160a01b0388169063eb3007fd90604401600060405180830381600087803b158015611c6e57600080fd5b505af1158015611c82573d6000803e3d6000fd5b50505050611c938360200151612102565b604084018190527f00000000000000000000000000000000000000000000000ad78ebc5ac620000060608501526020840151600091611cd1916123f5565b9050611ce3846000015182888861210f565b60e088015260c087015260a086015260808501526040516325019ee960e01b81526001600160a01b0388811660048301528916906325019ee990602401600060405180830381600087803b158015611d3a57600080fd5b505af1158015611d4e573d6000803e3d6000fd5b50505050866001600160a01b03167fea67486ed7ebe3eea8ab3390efd4a3c8aae48be5bea27df104a8af786c408434856000015186602001516001604051611d9893929190612527565b60405180910390a2866001600160a01b03167fc3770d654ed33aeea6bf11ac8ef05d02a6a04ed4686dd2f624d853bbec43cc8b60008060006001604051611de29493929190612542565b60405180910390a25050505b949350505050565b60008115611e13576000611e0a8385612564565b9150611ab59050565b50600019611ab5565b611e24612198565b604051632e46be5f60e21b81526001600160a01b0386811660048301526000918291829182918b169063b91af97c90602401608060405180830381865afa158015611e73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9791906124cf565b9296509094509250905087841115611eb257505050506120f9565b60405163eb3007fd60e01b815260048101839052602481018290526001600160a01b038b169063eb3007fd90604401600060405180830381600087803b158015611efb57600080fd5b505af1158015611f0f573d6000803e3d6000fd5b5050508486525060208501839052600086611f2a898761242c565b611f349190612564565b9050611f3f81612102565b604087018190527f00000000000000000000000000000000000000000000000ad78ebc5ac6200000606088015260808701869052611f7d90826123f5565b60a08701526040516325019ee960e01b81526001600160a01b038b811660048301528c16906325019ee990602401600060405180830381600087803b158015611fc557600080fd5b505af1158015611fd9573d6000803e3d6000fd5b5050505060008185611feb91906123f5565b9050801561205e57610100870181905260405163789c6b9360e01b81526001600160a01b038c81166004830152602482018390528d169063789c6b9390604401600060405180830381600087803b15801561204557600080fd5b505af1158015612059573d6000803e3d6000fd5b505050505b8a6001600160a01b03167fea67486ed7ebe3eea8ab3390efd4a3c8aae48be5bea27df104a8af786c408434878960a0015160026040516120a093929190612527565b60405180910390a28a6001600160a01b03167fc3770d654ed33aeea6bf11ac8ef05d02a6a04ed4686dd2f624d853bbec43cc8b600080600060026040516120ea9493929190612542565b60405180910390a25050505050505b95945050505050565b6000611ab560c883612564565b600080600080600086118015612123575084155b15612168576121328887612180565b93508761213f858961242c565b6121499190612564565b925061215584896123f5565b915061216183886123f5565b9050612175565b5060009250829150869050855b945094509450949050565b600081831061218f5781612191565b825b9392505050565b6040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6001600160a01b03811681146121f957600080fd5b50565b60006020828403121561220e57600080fd5b8135612191816121e4565b60008060006060848603121561222e57600080fd5b8335612239816121e4565b95602085013595506040909401359392505050565b634e487b7160e01b600052604160045260246000fd5b803561226f816121e4565b919050565b6000806040838503121561228757600080fd5b8235612292816121e4565b915060208381013567ffffffffffffffff808211156122b057600080fd5b818601915086601f8301126122c457600080fd5b8135818111156122d6576122d661224e565b8060051b604051601f19603f830116810181811085821117156122fb576122fb61224e565b60405291825284820192508381018501918983111561231957600080fd5b938501935b8285101561233e5761232f85612264565b8452938501939285019261231e565b8096505050505050509250929050565b6000806040838503121561236157600080fd5b823561236c816121e4565b9150602083013561237c816121e4565b809150509250929050565b60006020828403121561239957600080fd5b8151612191816121e4565b6000602082840312156123b657600080fd5b5051919050565b6000602082840312156123cf57600080fd5b8151801515811461219157600080fd5b634e487b7160e01b600052601160045260246000fd5b81810381811115611ab557611ab56123df565b6000806040838503121561241b57600080fd5b505080516020909101519092909150565b8082028115828204841417611ab557611ab56123df565b80820180821115611ab557611ab56123df565b60208082526022908201527f54726f76654d616e616765723a206e6f7468696e6720746f206c697175696461604082015261746560f01b606082015260800190565b6001600160a01b039390931683526020830191909152604082015260600190565b634e487b7160e01b600052603260045260246000fd5b600080600080608085870312156124e557600080fd5b505082516020840151604085015160609095015191969095509092509050565b6004811061252357634e487b7160e01b600052602160045260246000fd5b9052565b8381526020810183905260608101611dee6040830184612505565b8481526020810184905260408101839052608081016120f96060830184612505565b60008261258157634e487b7160e01b600052601260045260246000fd5b50049056fea2646970667358221220f7c208816304e27eff44394515e81533f8ae969871dfc1515807bf56a34405b064736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000ed8b26d99834540c5013701bb3715fafd39993ba00000000000000000000000072c590349535ad52e6953744cb2a36b40954271900000000000000000000000070b66e20766b775b2e9ce5b718bbd285af59b7e100000000000000000000000000000000000000000000000ad78ebc5ac6200000
-----Decoded View---------------
Arg [0] : _stabilityPoolAddress (address): 0xed8B26D99834540C5013701bB3715faFD39993Ba
Arg [1] : _borrowerOperations (address): 0x72c590349535AD52e6953744cb2A36B409542719
Arg [2] : _factory (address): 0x70b66E20766b775B2E9cE5B718bbD285Af59b7E1
Arg [3] : _gasCompensation (uint256): 200000000000000000000
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000ed8b26d99834540c5013701bb3715fafd39993ba
Arg [1] : 00000000000000000000000072c590349535ad52e6953744cb2a36b409542719
Arg [2] : 00000000000000000000000070b66e20766b775b2e9ce5b718bbd285af59b7e1
Arg [3] : 00000000000000000000000000000000000000000000000ad78ebc5ac6200000
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ 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.