Logic contract
Logic acts as the connection between DEFII and external protocols. It's a library where the logic for interacting with external protocols is implemented. When DEFII needs to interact with an external protocol, it uses delegatecall to invoke Logic functions.
Read functions
accountLiquidity
Shows the amount of liquidity locked in an external protocol.
function accountLiquidity(
address account
) external view virtual returns (uint256);
account
address
Address for which to return the amount of liquidity.
Write function
enter
Implements the deposit logic into an external protocol. This can include leverage in a lending protocol, providing liquidity to liquidity pools, and so on. Expects that the smart contract already has a certain amount of input tokens
function enter() external payable;
exit
Implements the logic of exiting from the external protocol.
function exit(uint256 liquidity) external payable;
liquidity
uint256
The amount of liquidity to withdraw from the external protocol.
withdrawLiquidity
Function for withdrawing liquidity from the external protocol directly to the recipient.
function withdrawLiquidity(
address recipient,
uint256 amount
) external payable;
recipient
address
Recipient address
amount
uint256
Amount of tokens to withdraw.
emergencyExit
Function for exiting the protocol in emergency situations.
function emergencyExit() external payable;
claimRewards
Claims rewards to recipient.
function claimRewards(address recipient) external payable;
recipient
address
Recipient address
Last updated