AlienFinance
0x50454acC07bf8fC78100619a1b68e9E8d28cE022
Methods
absorbToReserves
function absorbToReserves(address market) external nonpayable
Increase reserves by absorbing the surplus cash.
This function is callable by the reserve manager only.
Parameters
market
address
The address of the market
acceptOwnership
function acceptOwnership() external nonpayable
The new owner accepts the ownership transfer.
accrueInterest
function accrueInterest(address market) external nonpayable
Accrue the interest of a market.
Parameters
market
address
The address of the market
allAllowedExtensions
function allAllowedExtensions(address, uint256) external view returns (address)
The list of all allowed extensions for a user
Parameters
_0
address
undefined
_1
uint256
undefined
Returns
_0
address
undefined
allCreditMarkets
function allCreditMarkets(address, uint256) external view returns (address)
The list of a user's credit markets
Parameters
_0
address
undefined
_1
uint256
undefined
Returns
_0
address
undefined
allEnteredMarkets
function allEnteredMarkets(address, uint256) external view returns (address)
The list of all markets a user has entered
Parameters
_0
address
undefined
_1
uint256
undefined
Returns
_0
address
undefined
allMarkets
function allMarkets(uint256) external view returns (address)
The list of all supported markets
Parameters
_0
uint256
undefined
Returns
_0
address
undefined
allowedExtensions
function allowedExtensions(address, address) external view returns (bool)
The mapping of a user's allowed extensions
Parameters
_0
address
undefined
_1
address
undefined
Returns
_0
bool
undefined
borrow
function borrow(address from, address to, address market, uint256 amount) external nonpayable
Borrow an amount of asset from Alien.
Parameters
from
address
The address which will borrow the asset
to
address
The address which will receive the token
market
address
The address of the market
amount
uint256
The amount of asset to borrow
calculateLiquidationOpportunity
function calculateLiquidationOpportunity(address marketBorrow, address marketCollateral, uint256 repayAmount) external view returns (uint256)
Calculate the amount of aToken that can be seized in a liquidation.
Parameters
marketBorrow
address
The address of the market being borrowed from
marketCollateral
address
The address of the market being used as collateral
repayAmount
uint256
The amount of the borrowed asset being repaid
Returns
_0
uint256
The amount of aToken that can be seized
checkAccountLiquidity
function checkAccountLiquidity(address user) external nonpayable
Check the account liquidity of a user.
Parameters
user
address
The address of the user
configureYield
function configureYield() external nonpayable
creditLimitManager
function creditLimitManager() external view returns (address)
The credit limit manager address
Returns
_0
address
undefined
creditLimits
function creditLimits(address, address) external view returns (uint256)
The mapping of the credit limits
Parameters
_0
address
undefined
_1
address
undefined
Returns
_0
uint256
undefined
deferLiquidityCheck
function deferLiquidityCheck(address user, bytes data) external nonpayable
Defer the liquidity check to a user.
The message sender must implement the IDeferLiquidityCheck.
Parameters
user
address
The address of the user
data
bytes
The data to pass to the callback
delistMarket
function delistMarket(address market) external nonpayable
Delist a market.
This function is callable by the market configurator only.
Parameters
market
address
The address of the market
enteredMarkets
function enteredMarkets(address, address) external view returns (bool)
The mapping of a user's entered markets
Parameters
_0
address
undefined
_1
address
undefined
Returns
_0
bool
undefined
getATokenBalance
function getATokenBalance(address user, address market) external view returns (uint256)
Get the AToken balance of a user in a market.
Parameters
user
address
The address of the user
market
address
The address of the market
Returns
_0
uint256
The AToken balance
getAccountLiquidity
function getAccountLiquidity(address user) external view returns (uint256, uint256, uint256)
Get the account liquidity of a user.
Parameters
user
address
The address of the user
Returns
_0
uint256
The total collateral value, liquidation collateral value, and total debt value of the user
_1
uint256
undefined
_2
uint256
undefined
getAllMarkets
function getAllMarkets() external view returns (address[])
Get all markets.
Returns
_0
address[]
The list of all markets
getBorrowBalance
function getBorrowBalance(address user, address market) external view returns (uint256)
Get the borrow balance of a user in a market.
Parameters
user
address
The address of the user
market
address
The address of the market
Returns
_0
uint256
The borrow balance
getCreditLimit
function getCreditLimit(address user, address market) external view returns (uint256)
Get the credit limit of a user in a market.
Parameters
user
address
The address of the user
market
address
The address of the market
Returns
_0
uint256
The credit limit
getExchangeRate
function getExchangeRate(address market) external view returns (uint256)
Get the exchange rate of a market.
Parameters
market
address
The address of the market
Returns
_0
uint256
The exchange rate
getMarketConfiguration
function getMarketConfiguration(address market) external view returns (struct DataTypes.MarketConfig)
Get the configuration of a market.
Parameters
market
address
The address of the market
Returns
_0
DataTypes.MarketConfig
The market configuration
getSupplyBalance
function getSupplyBalance(address user, address market) external view returns (uint256)
Get the supply balance of a user in a market.
Parameters
user
address
The address of the user
market
address
The address of the market
Returns
_0
uint256
The supply balance
getTotalBorrow
function getTotalBorrow(address market) external view returns (uint256)
Get the total borrow of a market.
Parameters
market
address
The address of the market
Returns
_0
uint256
The total borrow
getTotalCash
function getTotalCash(address market) external view returns (uint256)
Get the total cash of a market.
Parameters
market
address
The address of the market
Returns
_0
uint256
The total cash
getTotalReserves
function getTotalReserves(address market) external view returns (uint256)
Get the total reserves of a market.
Parameters
market
address
The address of the market
Returns
_0
uint256
The total reserves
getTotalSupply
function getTotalSupply(address market) external view returns (uint256)
Get the total supply of a market.
Parameters
market
address
The address of the market
Returns
_0
uint256
The total supply
getUserAllowedExtensions
function getUserAllowedExtensions(address user) external view returns (address[])
Get the user's allowed extensions.
Parameters
user
address
The address of the user
Returns
_0
address[]
The list of allowed extensions
getUserCreditMarkets
function getUserCreditMarkets(address user) external view returns (address[])
Get the list of all credit markets for a user.
Parameters
user
address
The address of the user
Returns
_0
address[]
The list of all credit markets
initialize
function initialize(address _admin, address _gasStation, address _pointsOperator) external nonpayable
Initialize the contract.
Parameters
_admin
address
The address of the admin
_gasStation
address
The address of the gas station
_pointsOperator
address
The address of the points operator
isAllowedExtension
function isAllowedExtension(address user, address extension) external view returns (bool)
Whether or not a user has allowed an extension.
Parameters
user
address
The address of the user
extension
address
The address of the extension
Returns
_0
bool
true if the user has allowed the extension, false otherwise
isCreditAccount
function isCreditAccount(address user) external view returns (bool)
Whether or not an account is a credit account.
Parameters
user
address
The address of the user
Returns
_0
bool
true if the account is a credit account, false otherwise
isMarketListed
function isMarketListed(address market) external view returns (bool)
Whether or not a market is listed.
Parameters
market
address
The address of the market to check
Returns
_0
bool
true if the market is listed, false otherwise
isUserLiquidatable
function isUserLiquidatable(address user) external view returns (bool)
Check if an account is liquidatable.
Parameters
user
address
The address of the account to check
Returns
_0
bool
true if the account is liquidatable, false otherwise
liquidate
function liquidate(address liquidator, address borrower, address marketBorrow, address marketCollateral, uint256 repayAmount) external nonpayable
Liquidate an undercollateralized borrower.
Parameters
liquidator
address
The address which will liquidate the borrower
borrower
address
The address of the borrower
marketBorrow
address
The address of the borrow market
marketCollateral
address
The address of the collateral market
repayAmount
uint256
The amount of asset to repay, or type(uint256).max for max
liquidityCheckStatus
function liquidityCheckStatus(address) external view returns (uint8)
The mapping of the liquidity check status
Parameters
_0
address
undefined
Returns
_0
uint8
undefined
listMarket
function listMarket(address market, DataTypes.MarketConfig config) external nonpayable
Parameters
market
address
undefined
config
DataTypes.MarketConfig
undefined
marketConfigurator
function marketConfigurator() external view returns (address)
The market configurator address
Returns
_0
address
undefined
markets
function markets(address) external view returns (struct DataTypes.MarketConfig config, uint40 lastUpdateTimestamp, uint256 totalCash, uint256 totalBorrow, uint256 totalSupply, uint256 totalReserves, uint256 borrowIndex)
The mapping of the supported markets
Parameters
_0
address
undefined
Returns
config
DataTypes.MarketConfig
undefined
lastUpdateTimestamp
uint40
undefined
totalCash
uint256
undefined
totalBorrow
uint256
undefined
totalSupply
uint256
undefined
totalReserves
uint256
undefined
borrowIndex
uint256
undefined
owner
function owner() external view returns (address)
Returns the address of the current owner.
Returns
_0
address
undefined
pendingOwner
function pendingOwner() external view returns (address)
Returns the address of the pending owner.
Returns
_0
address
undefined
priceOracle
function priceOracle() external view returns (address)
The price oracle address
Returns
_0
address
undefined
proxiableUUID
function proxiableUUID() external view returns (bytes32)
Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the implementation. It is used to validate the implementation's compatibility when performing an upgrade. IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this function revert if invoked through a proxy. This is guaranteed by the notDelegated
modifier.
Returns
_0
bytes32
undefined
redeem
function redeem(address from, address to, address market, uint256 amount) external nonpayable
Redeem an amount of asset from Alien.
Parameters
from
address
The address which will redeem the asset
to
address
The address which will receive the token
market
address
The address of the market
amount
uint256
The amount of asset to redeem, or type(uint256).max for max
reduceReserves
function reduceReserves(address market, uint256 aTokenAmount, address recipient) external nonpayable
Reduce reserves by withdrawing the requested amount.
This function is callable by the reserve manager only.
Parameters
market
address
The address of the market
aTokenAmount
uint256
The amount of aToken to withdraw
recipient
address
The address which will receive the underlying asset
renounceOwnership
function renounceOwnership() external nonpayable
Leaves the contract without owner. It will not be possible to call onlyOwner
functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
repay
function repay(address from, address to, address market, uint256 amount) external nonpayable
Repay an amount of asset to Alien.
Parameters
from
address
The address which will repay the asset
to
address
The address which will hold the balance
market
address
The address of the market
amount
uint256
The amount of asset to repay, or type(uint256).max for max
reserveManager
function reserveManager() external view returns (address)
The reserve manager address
Returns
_0
address
undefined
seize
function seize(address token, address recipient) external nonpayable
Seize the unlisted token.
Parameters
token
address
The address of the token
recipient
address
The address which will receive the token
setCreditLimit
function setCreditLimit(address user, address market, uint256 credit) external nonpayable
Set the credit limit for a user in a market.
This function is callable by the credit limit manager only.
Parameters
user
address
The address of the user
market
address
The address of the market
credit
uint256
The credit limit
setCreditLimitManager
function setCreditLimitManager(address manager) external nonpayable
Set the credit limit manager.
Parameters
manager
address
The address of the credit limit manager
setMarketConfiguration
function setMarketConfiguration(address market, DataTypes.MarketConfig config) external nonpayable
Parameters
market
address
undefined
config
DataTypes.MarketConfig
undefined
setMarketConfigurator
function setMarketConfigurator(address configurator) external nonpayable
Set the market configurator.
Parameters
configurator
address
The address of the market configurator
setPriceOracle
function setPriceOracle(address oracle) external nonpayable
Set the price oracle.
Parameters
oracle
address
The address of the price oracle
setReserveManager
function setReserveManager(address manager) external nonpayable
Set the reserve manager.
Parameters
manager
address
The address of the reserve manager
setUserExtension
function setUserExtension(address extension, bool allowed) external nonpayable
User enables or disables an extension.
Parameters
extension
address
The address of the extension
allowed
bool
Whether to allow or disallow the extension
supply
function supply(address from, address to, address market, uint256 amount) external nonpayable
Supply an amount of asset to Alien.
Parameters
from
address
The address which will supply the asset
to
address
The address which will hold the balance
market
address
The address of the market
amount
uint256
The amount of asset to supply
transferAToken
function transferAToken(address market, address from, address to, uint256 amount) external nonpayable
Transfer AToken from one account to another.
This function is callable by the AToken contract only.
Parameters
market
address
The address of the market
from
address
The address to transfer from
to
address
The address to transfer to
amount
uint256
The amount to transfer
transferOwnership
function transferOwnership(address newOwner) external nonpayable
Starts the ownership transfer of the contract to a new account. Replaces the pending transfer if there is one. Can only be called by the current owner.
Parameters
newOwner
address
undefined
upgradeTo
function upgradeTo(address newImplementation) external nonpayable
Upgrade the implementation of the proxy to newImplementation
. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.
Parameters
newImplementation
address
undefined
upgradeToAndCall
function upgradeToAndCall(address newImplementation, bytes data) external payable
Upgrade the implementation of the proxy to newImplementation
, and subsequently execute the function call encoded in data
. Calls {_authorizeUpgrade}. Emits an {Upgraded} event.
Parameters
newImplementation
address
undefined
data
bytes
undefined
Events
AdminChanged
event AdminChanged(address previousAdmin, address newAdmin)
Parameters
previousAdmin
address
undefined
newAdmin
address
undefined
BeaconUpgraded
event BeaconUpgraded(address indexed beacon)
Parameters
beacon indexed
address
undefined
Borrow
event Borrow(address indexed market, address indexed from, address indexed to, uint256 amount, uint256 accountBorrow, uint256 totalBorrow)
Parameters
market indexed
address
undefined
from indexed
address
undefined
to indexed
address
undefined
amount
uint256
undefined
accountBorrow
uint256
undefined
totalBorrow
uint256
undefined
CreditLimitChanged
event CreditLimitChanged(address indexed user, address indexed market, uint256 credit)
Parameters
user indexed
address
undefined
market indexed
address
undefined
credit
uint256
undefined
CreditLimitManagerSet
event CreditLimitManagerSet(address manager)
Parameters
manager
address
undefined
ExtensionAdded
event ExtensionAdded(address indexed user, address indexed extension)
Parameters
user indexed
address
undefined
extension indexed
address
undefined
ExtensionRemoved
event ExtensionRemoved(address indexed user, address indexed extension)
Parameters
user indexed
address
undefined
extension indexed
address
undefined
Initialized
event Initialized(uint8 version)
Parameters
version
uint8
undefined
InterestAccrued
event InterestAccrued(address indexed market, uint40 timestamp, uint256 borrowRatePerSecond, uint256 borrowIndex, uint256 totalBorrow, uint256 totalReserves)
Parameters
market indexed
address
undefined
timestamp
uint40
undefined
borrowRatePerSecond
uint256
undefined
borrowIndex
uint256
undefined
totalBorrow
uint256
undefined
totalReserves
uint256
undefined
Liquidate
event Liquidate(address indexed liquidator, address indexed borrower, address indexed marketBorrow, address marketCollateral, uint256 repayAmount, uint256 seizedAmount)
Parameters
liquidator indexed
address
undefined
borrower indexed
address
undefined
marketBorrow indexed
address
undefined
marketCollateral
address
undefined
repayAmount
uint256
undefined
seizedAmount
uint256
undefined
MarketConfigurationChanged
event MarketConfigurationChanged(address indexed market, DataTypes.MarketConfig config)
Parameters
market indexed
address
undefined
config
DataTypes.MarketConfig
undefined
MarketConfiguratorSet
event MarketConfiguratorSet(address configurator)
Parameters
configurator
address
undefined
MarketDelisted
event MarketDelisted(address indexed market)
Parameters
market indexed
address
undefined
MarketEntered
event MarketEntered(address indexed market, address indexed user)
Parameters
market indexed
address
undefined
user indexed
address
undefined
MarketExited
event MarketExited(address indexed market, address indexed user)
Parameters
market indexed
address
undefined
user indexed
address
undefined
MarketListed
event MarketListed(address indexed market, uint40 timestamp, DataTypes.MarketConfig config)
Parameters
market indexed
address
undefined
timestamp
uint40
undefined
config
DataTypes.MarketConfig
undefined
OwnershipTransferStarted
event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner)
Parameters
previousOwner indexed
address
undefined
newOwner indexed
address
undefined
OwnershipTransferred
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
Parameters
previousOwner indexed
address
undefined
newOwner indexed
address
undefined
PriceOracleSet
event PriceOracleSet(address priceOracle)
Parameters
priceOracle
address
undefined
Redeem
event Redeem(address indexed market, address indexed from, address indexed to, uint256 amount, uint256 aTokenAmount)
Parameters
market indexed
address
undefined
from indexed
address
undefined
to indexed
address
undefined
amount
uint256
undefined
aTokenAmount
uint256
undefined
Repay
event Repay(address indexed market, address indexed from, address indexed to, uint256 amount, uint256 accountBorrow, uint256 totalBorrow)
Parameters
market indexed
address
undefined
from indexed
address
undefined
to indexed
address
undefined
amount
uint256
undefined
accountBorrow
uint256
undefined
totalBorrow
uint256
undefined
ReserveManagerSet
event ReserveManagerSet(address manager)
Parameters
manager
address
undefined
ReservesDecreased
event ReservesDecreased(address indexed market, address indexed recipient, uint256 aTokenAmount, uint256 amount)
Parameters
market indexed
address
undefined
recipient indexed
address
undefined
aTokenAmount
uint256
undefined
amount
uint256
undefined
ReservesIncreased
event ReservesIncreased(address indexed market, uint256 aTokenAmount, uint256 amount)
Parameters
market indexed
address
undefined
aTokenAmount
uint256
undefined
amount
uint256
undefined
Supply
event Supply(address indexed market, address indexed from, address indexed to, uint256 amount, uint256 aTokenAmount)
Parameters
market indexed
address
undefined
from indexed
address
undefined
to indexed
address
undefined
amount
uint256
undefined
aTokenAmount
uint256
undefined
TokenSeized
event TokenSeized(address indexed token, address indexed recipient, uint256 amount)
Parameters
token indexed
address
undefined
recipient indexed
address
undefined
amount
uint256
undefined
Upgraded
event Upgraded(address indexed implementation)
Parameters
implementation indexed
address
undefined
Last updated