编译器
0.8.17+commit.8df45f5f
文件 1 的 8:Address.sol
pragma solidity ^0.8.1;
library Address {
function isContract(address account) internal view returns (bool) {
return account.code.length > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
文件 2 的 8:IERC20.sol
pragma solidity ^0.8.0;
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
文件 3 的 8:IERC20Permit.sol
pragma solidity ^0.8.0;
interface IERC20Permit {
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
function nonces(address owner) external view returns (uint256);
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
文件 4 的 8:IEUSD.sol
pragma solidity ^0.8.17;
interface IEUSD {
function totalSupply() external view returns (uint256);
function getTotalShares() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function sharesOf(address _account) external view returns (uint256);
function allowance(
address owner,
address spender
) external view returns (uint256);
function approve(address _spender, uint256 _amount) external returns (bool);
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
function transferShares(
address _recipient,
uint256 _sharesAmount
) external returns (uint256);
function getSharesByMintedEUSD(
uint256 _EUSDAmount
) external view returns (uint256);
function getMintedEUSDByShares(
uint256 _sharesAmount
) external view returns (uint256);
function mint(
address _recipient,
uint256 _mintAmount
) external returns (uint256 newTotalShares);
function burnShares(
address _account,
uint256 burnAmount
) external returns (uint256 newTotalShares);
function burn(
address _account,
uint256 burnAmount
) external returns (uint256 newTotalShares);
function transfer(address to, uint256 amount) external returns (bool);
}
文件 5 的 8:Iconfigurator.sol
pragma solidity ^0.8.17;
interface Iconfigurator {
function mintVault(address pool) external view returns(bool);
function mintVaultMaxSupply(address pool) external view returns(uint256);
function vaultMintPaused(address pool) external view returns(bool);
function vaultBurnPaused(address pool) external view returns(bool);
function tokenMiner(address pool) external view returns(bool);
function getSafeCollateralRatio(address pool) external view returns(uint256);
function getBadCollateralRatio(address pool) external view returns(uint256);
function getVaultWeight(address pool) external view returns (uint256);
function vaultMintFeeApy(address pool) external view returns(uint256);
function vaultKeeperRatio(address pool) external view returns(uint256);
function redemptionFee() external view returns(uint256);
function getEUSDAddress() external view returns(address);
function peUSD() external view returns(address);
function eUSDMiningIncentives() external view returns(address);
function getProtocolRewardsPool() external view returns(address);
function flashloanFee() external view returns(uint256);
function getEUSDMaxLocked() external view returns (uint256);
function stableToken() external view returns (address);
function isRedemptionProvider(address user) external view returns (bool);
function becomeRedemptionProvider(bool _bool) external;
function refreshMintReward(address user) external;
function distributeRewards() external;
function hasRole(bytes32 role, address account) external view returns (bool);
}
文件 6 的 8:LybraEUSDVaultBase.sol
pragma solidity ^0.8.17;
import "../../interfaces/IEUSD.sol";
import "../../interfaces/Iconfigurator.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
interface IPriceFeed {
function fetchPrice() external returns (uint256);
}
abstract contract LybraEUSDVaultBase {
using SafeERC20 for IERC20;
IEUSD public immutable EUSD;
IERC20 public immutable collateralAsset;
Iconfigurator public immutable configurator;
uint256 public constant badCollateralRatio = 150 * 1e18;
IPriceFeed immutable etherOracle;
uint256 public totalDepositedAsset;
uint256 public lastReportTime;
uint256 poolTotalCirculation;
mapping(address => uint256) public depositedAsset;
mapping(address => uint256) borrowed;
uint256 public feeStored;
mapping(address => uint256) depositedTime;
event DepositEther(address indexed onBehalfOf, address asset, uint256 etherAmount, uint256 assetAmount, uint256 timestamp);
event DepositAsset(address indexed onBehalfOf, address asset, uint256 amount, uint256 timestamp);
event WithdrawAsset(address indexed sponsor, address asset, address indexed onBehalfOf, uint256 amount, uint256 timestamp);
event Mint(address indexed sponsor, address indexed onBehalfOf, uint256 amount, uint256 timestamp);
event Burn(address indexed sponsor, address indexed onBehalfOf, uint256 amount, uint256 timestamp);
event LiquidationRecord(address indexed provider, address indexed keeper, address indexed onBehalfOf, uint256 eusdamount, uint256 liquidateEtherAmount, uint256 keeperReward, bool superLiquidation, uint256 timestamp);
event LSDValueCaptured(uint256 stETHAdded, uint256 payoutEUSD, uint256 discountRate, uint256 timestamp);
event RigidRedemption(address indexed caller, address indexed provider, uint256 eusdAmount, uint256 collateralAmount, uint256 timestamp);
event FeeDistribution(address indexed feeAddress, uint256 feeAmount, uint256 timestamp);
constructor(address _collateralAsset, address _etherOracle, address _configurator) {
collateralAsset = IERC20(_collateralAsset);
configurator = Iconfigurator(_configurator);
EUSD = IEUSD(configurator.getEUSDAddress());
etherOracle = IPriceFeed(_etherOracle);
}
function depositEtherToMint(uint256 mintAmount) external payable virtual;
function depositAssetToMint(uint256 assetAmount, uint256 mintAmount) external virtual {
require(assetAmount >= 1 ether, "Deposit should not be less than 1 stETH.");
collateralAsset.safeTransferFrom(msg.sender, address(this), assetAmount);
totalDepositedAsset += assetAmount;
depositedAsset[msg.sender] += assetAmount;
depositedTime[msg.sender] = block.timestamp;
if (mintAmount > 0) {
_mintEUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());
}
emit DepositAsset(msg.sender, address(collateralAsset), assetAmount, block.timestamp);
}
function withdraw(address onBehalfOf, uint256 amount) external virtual {
require(onBehalfOf != address(0), "TZA");
require(amount != 0, "ZERO_WITHDRAW");
require(depositedAsset[msg.sender] >= amount, "Withdraw amount exceeds deposited amount.");
totalDepositedAsset -= amount;
depositedAsset[msg.sender] -= amount;
uint256 withdrawal = checkWithdrawal(msg.sender, amount);
collateralAsset.safeTransfer(onBehalfOf, withdrawal);
if (borrowed[msg.sender] > 0) {
_checkHealth(msg.sender, getAssetPrice());
}
emit WithdrawAsset(msg.sender, address(collateralAsset), onBehalfOf, withdrawal, block.timestamp);
}
function checkWithdrawal(address user, uint256 amount) public view returns (uint256 withdrawal) {
withdrawal = block.timestamp - 3 days >= depositedTime[user] ? amount : (amount * 999) / 1000;
}
function mint(address onBehalfOf, uint256 amount) external {
require(onBehalfOf != address(0), "MINT_TO_THE_ZERO_ADDRESS");
require(amount != 0, "ZERO_MINT");
_mintEUSD(msg.sender, onBehalfOf, amount, getAssetPrice());
}
function burn(address onBehalfOf, uint256 amount) external {
require(onBehalfOf != address(0), "BURN_TO_THE_ZERO_ADDRESS");
_repay(msg.sender, onBehalfOf, amount);
}
function liquidation(address provider, address onBehalfOf, uint256 assetAmount) external virtual {
uint256 assetPrice = getAssetPrice();
uint256 onBehalfOfCollateralRatio = (depositedAsset[onBehalfOf] * assetPrice * 100) / borrowed[onBehalfOf];
require(onBehalfOfCollateralRatio < badCollateralRatio, "Borrowers collateral ratio should below badCollateralRatio");
require(assetAmount * 2 <= depositedAsset[onBehalfOf], "a max of 50% collateral can be liquidated");
require(EUSD.allowance(provider, address(this)) != 0 || msg.sender == provider, "provider should authorize to provide liquidation eUSD");
uint256 eusdAmount = (assetAmount * assetPrice) / 1e18;
_repay(provider, onBehalfOf, eusdAmount);
uint256 reducedAsset = assetAmount;
if(onBehalfOfCollateralRatio > 1e20 && onBehalfOfCollateralRatio < 11e19) {
reducedAsset = assetAmount * onBehalfOfCollateralRatio / 1e20;
}
if(onBehalfOfCollateralRatio >= 11e19) {
reducedAsset = assetAmount * 11 / 10;
}
totalDepositedAsset -= reducedAsset;
depositedAsset[onBehalfOf] -= reducedAsset;
uint256 reward2keeper;
uint256 keeperRatio = configurator.vaultKeeperRatio(address(this));
if (msg.sender != provider && onBehalfOfCollateralRatio >= 1e20 + keeperRatio * 1e18) {
reward2keeper = assetAmount * keeperRatio / 100;
collateralAsset.safeTransfer(msg.sender, reward2keeper);
}
collateralAsset.safeTransfer(provider, reducedAsset - reward2keeper);
emit LiquidationRecord(provider, msg.sender, onBehalfOf, eusdAmount, reducedAsset, reward2keeper, false, block.timestamp);
}
function superLiquidation(address provider, address onBehalfOf, uint256 assetAmount) external virtual {
uint256 assetPrice = getAssetPrice();
require((totalDepositedAsset * assetPrice * 100) / poolTotalCirculation < badCollateralRatio, "overallCollateralRatio should below 150%");
uint256 onBehalfOfCollateralRatio = (depositedAsset[onBehalfOf] * assetPrice * 100) / borrowed[onBehalfOf];
require(onBehalfOfCollateralRatio < 125 * 1e18, "borrowers collateralRatio should below 125%");
require(assetAmount <= depositedAsset[onBehalfOf], "total of collateral can be liquidated at most");
uint256 eusdAmount = (assetAmount * assetPrice) / 1e18;
if (onBehalfOfCollateralRatio >= 1e20) {
eusdAmount = (eusdAmount * 1e20) / onBehalfOfCollateralRatio;
}
require(EUSD.allowance(provider, address(this)) != 0 || msg.sender == provider, "provider should authorize to provide liquidation eUSD");
_repay(provider, onBehalfOf, eusdAmount);
totalDepositedAsset -= assetAmount;
depositedAsset[onBehalfOf] -= assetAmount;
uint256 reward2keeper;
if (msg.sender != provider && onBehalfOfCollateralRatio >= 1e20 + configurator.vaultKeeperRatio(address(this)) * 1e18) {
reward2keeper = ((assetAmount * configurator.vaultKeeperRatio(address(this))) * 1e18) / onBehalfOfCollateralRatio;
collateralAsset.safeTransfer(msg.sender, reward2keeper);
}
collateralAsset.safeTransfer(provider, assetAmount - reward2keeper);
emit LiquidationRecord(provider, msg.sender, onBehalfOf, eusdAmount, assetAmount, reward2keeper, true, block.timestamp);
}
function excessIncomeDistribution(uint256 payAmount) external virtual;
function rigidRedemption(address provider, uint256 eusdAmount, uint256 minReceiveAmount) external virtual {
require(provider != msg.sender, "CBS");
require(configurator.isRedemptionProvider(provider), "provider is not a RedemptionProvider");
require(borrowed[provider] >= eusdAmount, "eusdAmount cannot surpass providers debt");
uint256 assetPrice = getAssetPrice();
uint256 providerCollateralRatio = (depositedAsset[provider] * assetPrice * 100) / borrowed[provider];
require(providerCollateralRatio >= 100 * 1e18, "The provider's collateral ratio should be not less than 100%.");
_repay(msg.sender, provider, eusdAmount);
uint256 collateralAmount = eusdAmount * 1e18 * (10_000 - configurator.redemptionFee()) / assetPrice / 10_000;
uint256 sendAmount = checkWithdrawal(provider, collateralAmount);
require(sendAmount >= minReceiveAmount, "EL");
depositedAsset[provider] -= collateralAmount;
totalDepositedAsset -= collateralAmount;
collateralAsset.safeTransfer(msg.sender, sendAmount);
emit RigidRedemption(msg.sender, provider, eusdAmount, sendAmount, block.timestamp);
}
function _mintEUSD(address _provider, address _onBehalfOf, uint256 _mintAmount, uint256 _assetPrice) internal virtual {
require(poolTotalCirculation + _mintAmount <= configurator.mintVaultMaxSupply(address(this)), "ESL");
configurator.refreshMintReward(_provider);
borrowed[_provider] += _mintAmount;
EUSD.mint(_onBehalfOf, _mintAmount);
_saveReport();
poolTotalCirculation += _mintAmount;
_checkHealth(_provider, _assetPrice);
emit Mint(msg.sender, _onBehalfOf, _mintAmount, block.timestamp);
}
function _repay(address _provider, address _onBehalfOf, uint256 _amount) internal virtual {
uint256 amount = borrowed[_onBehalfOf] >= _amount ? _amount : borrowed[_onBehalfOf];
EUSD.burn(_provider, amount);
configurator.refreshMintReward(_onBehalfOf);
borrowed[_onBehalfOf] -= amount;
_saveReport();
poolTotalCirculation -= amount;
emit Burn(_provider, _onBehalfOf, amount, block.timestamp);
}
function _checkHealth(address _user, uint256 _assetPrice) internal view {
if (((depositedAsset[_user] * _assetPrice * 100) / borrowed[_user]) < configurator.getSafeCollateralRatio(address(this))) revert("collateralRatio is Below safeCollateralRatio");
}
function _saveReport() internal {
feeStored += _newFee();
lastReportTime = block.timestamp;
}
function _newFee() internal view returns (uint256) {
return (poolTotalCirculation * configurator.vaultMintFeeApy(address(this)) * (block.timestamp - lastReportTime)) / (86_400 * 365) / 10_000;
}
function _etherPrice() internal returns (uint256) {
return etherOracle.fetchPrice();
}
function getBorrowedOf(address user) external view returns (uint256) {
return borrowed[user];
}
function getPoolTotalCirculation() external view returns (uint256) {
return poolTotalCirculation;
}
function getAsset() external view virtual returns (address) {
return address(collateralAsset);
}
function getVaultType() external pure returns (uint8) {
return 0;
}
function getAssetPrice() public virtual returns (uint256);
function getAsset2EtherExchangeRate() external view virtual returns (uint256);
}
文件 7 的 8:LybraStETHVault.sol
pragma solidity ^0.8.17;
import "../interfaces/IEUSD.sol";
import "./base/LybraEUSDVaultBase.sol";
interface Ilido {
function submit(address _referral) external payable returns (uint256 StETH);
}
contract LybraStETHVault is LybraEUSDVaultBase {
uint256 public lidoRebaseTime = 12 hours;
constructor(address _stETH, address _oracle, address _config) LybraEUSDVaultBase(_stETH, _oracle, _config) {
}
function setLidoRebaseTime(uint256 _time) external {
require(configurator.hasRole(keccak256("ADMIN"), msg.sender), "NA");
lidoRebaseTime = _time;
}
function depositEtherToMint(uint256 mintAmount) external payable override {
require(msg.value >= 1 ether, "DNL");
uint256 sharesAmount = Ilido(address(collateralAsset)).submit{value: msg.value}(address(configurator));
require(sharesAmount != 0, "ZERO_DEPOSIT");
totalDepositedAsset += msg.value;
depositedAsset[msg.sender] += msg.value;
depositedTime[msg.sender] = block.timestamp;
if (mintAmount > 0) {
_mintEUSD(msg.sender, msg.sender, mintAmount, getAssetPrice());
}
emit DepositEther(msg.sender, address(collateralAsset), msg.value, msg.value, block.timestamp);
}
function excessIncomeDistribution(uint256 stETHAmount) external override {
uint256 excessAmount = collateralAsset.balanceOf(address(this)) - totalDepositedAsset;
require(excessAmount != 0 && stETHAmount != 0, "Only LSD excess income can be exchanged");
uint256 realAmount = stETHAmount > excessAmount ? excessAmount : stETHAmount;
uint256 dutchAuctionDiscountPrice = getDutchAuctionDiscountPrice();
uint256 payAmount = realAmount * getAssetPrice() * dutchAuctionDiscountPrice / 10_000 / 1e18;
uint256 income = feeStored + _newFee();
if (payAmount > income) {
bool success = EUSD.transferFrom(msg.sender, address(configurator), income);
require(success, "TF");
try configurator.distributeRewards() {} catch {}
uint256 sharesAmount = EUSD.getSharesByMintedEUSD(payAmount - income);
if (sharesAmount == 0) {
sharesAmount = (payAmount - income);
}
EUSD.burnShares(msg.sender, sharesAmount);
feeStored = 0;
emit FeeDistribution(address(configurator), income, block.timestamp);
} else {
bool success = EUSD.transferFrom(msg.sender, address(configurator), payAmount);
require(success, "TF");
try configurator.distributeRewards() {} catch {}
feeStored = income - payAmount;
emit FeeDistribution(address(configurator), payAmount, block.timestamp);
}
lastReportTime = block.timestamp;
collateralAsset.transfer(msg.sender, realAmount);
emit LSDValueCaptured(realAmount, payAmount, dutchAuctionDiscountPrice, block.timestamp);
}
function getDutchAuctionDiscountPrice() public view returns (uint256) {
uint256 time = (block.timestamp - lidoRebaseTime) % 1 days;
if (time < 30 minutes) return 10_000;
return 10_000 - (time / 30 minutes - 1) * 100;
}
function getAssetPrice() public override returns (uint256) {
return _etherPrice();
}
function getAsset2EtherExchangeRate() external view override returns (uint256) {
return 1e18;
}
}
文件 8 的 8:SafeERC20.sol
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/IERC20Permit.sol";
import "../../../utils/Address.sol";
library SafeERC20 {
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value));
}
}
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value);
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0));
_callOptionalReturn(token, approvalCall);
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
(bool success, bytes memory returndata) = address(token).call(data);
return
success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token));
}
}
{
"compilationTarget": {
"contracts/lybra/pools/LybraStETHVault.sol": "LybraStETHVault"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 200
},
"remappings": []
}
[{"inputs":[{"internalType":"address","name":"_stETH","type":"address"},{"internalType":"address","name":"_oracle","type":"address"},{"internalType":"address","name":"_config","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sponsor","type":"address"},{"indexed":true,"internalType":"address","name":"onBehalfOf","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"onBehalfOf","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"DepositAsset","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"onBehalfOf","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":false,"internalType":"uint256","name":"etherAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"DepositEther","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"feeAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"feeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"FeeDistribution","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"stETHAdded","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"payoutEUSD","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"discountRate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"LSDValueCaptured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"provider","type":"address"},{"indexed":true,"internalType":"address","name":"keeper","type":"address"},{"indexed":true,"internalType":"address","name":"onBehalfOf","type":"address"},{"indexed":false,"internalType":"uint256","name":"eusdamount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"liquidateEtherAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"keeperReward","type":"uint256"},{"indexed":false,"internalType":"bool","name":"superLiquidation","type":"bool"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"LiquidationRecord","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sponsor","type":"address"},{"indexed":true,"internalType":"address","name":"onBehalfOf","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"provider","type":"address"},{"indexed":false,"internalType":"uint256","name":"eusdAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"collateralAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"RigidRedemption","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sponsor","type":"address"},{"indexed":false,"internalType":"address","name":"asset","type":"address"},{"indexed":true,"internalType":"address","name":"onBehalfOf","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"WithdrawAsset","type":"event"},{"inputs":[],"name":"EUSD","outputs":[{"internalType":"contract IEUSD","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"badCollateralRatio","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"onBehalfOf","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"checkWithdrawal","outputs":[{"internalType":"uint256","name":"withdrawal","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collateralAsset","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"configurator","outputs":[{"internalType":"contract Iconfigurator","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assetAmount","type":"uint256"},{"internalType":"uint256","name":"mintAmount","type":"uint256"}],"name":"depositAssetToMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"mintAmount","type":"uint256"}],"name":"depositEtherToMint","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"depositedAsset","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"stETHAmount","type":"uint256"}],"name":"excessIncomeDistribution","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"feeStored","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAsset","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAsset2EtherExchangeRate","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAssetPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getBorrowedOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDutchAuctionDiscountPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolTotalCirculation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVaultType","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"lastReportTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lidoRebaseTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"provider","type":"address"},{"internalType":"address","name":"onBehalfOf","type":"address"},{"internalType":"uint256","name":"assetAmount","type":"uint256"}],"name":"liquidation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"onBehalfOf","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"provider","type":"address"},{"internalType":"uint256","name":"eusdAmount","type":"uint256"},{"internalType":"uint256","name":"minReceiveAmount","type":"uint256"}],"name":"rigidRedemption","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_time","type":"uint256"}],"name":"setLidoRebaseTime","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"provider","type":"address"},{"internalType":"address","name":"onBehalfOf","type":"address"},{"internalType":"uint256","name":"assetAmount","type":"uint256"}],"name":"superLiquidation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalDepositedAsset","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"onBehalfOf","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]