FluidVaultOperate ​
Inherits:HelpersOperate
Fluid vault protocol main operate contract base.
Functions ​
_delegateCallCheck ​
solidity
modifier _delegateCallCheck() ;_operate ​
Single function which handles supply, withdraw, borrow & payback
solidity
function _operate(
uint256 nftId_, // if 0 then new position
int256 newCol_, // if negative then withdraw
int256 newDebt_, // if negative then payback
address to_, // address at which the borrow & withdraw amount should go to. If address(0) then it'll go to msg.sender
uint256 vaultVariables_
)
internal
returns (
uint256, // nftId_
int256, // final supply amount. if - then withdraw
int256, // final borrow amount. if - then payback
uint256 // vaultVariables_
);Parameters
| Name | Type | Description |
|---|---|---|
nftId_ | uint256 | NFT ID for interaction. If 0 then create new NFT/position. |
newCol_ | int256 | new collateral. If positive then deposit, if negative then withdraw, if 0 then do nohing |
newDebt_ | int256 | new debt. If positive then borrow, if negative then payback, if 0 then do nohing |
to_ | address | address where withdraw or borrow should go. If address(0) then msg.sender |
vaultVariables_ | uint256 | the current state of the vaultVariables from storage |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | nftId_ if 0 then this returns the newly created NFT Id else returns the same NFT ID |
<none> | int256 | newCol_ final supply amount. Mainly if max withdraw using type(int).min then this is useful to get perfect amount else remain same as newCol_ |
<none> | int256 | newDebt_ final borrow amount. Mainly if max payback using type(int).min then this is useful to get perfect amount else remain same as newDebt_ |
<none> | uint256 | vaultVariables_ the updated state of the vaultVariables |
constructor ​
solidity
constructor(ConstantViews memory constants_) HelpersOperate(constants_);
