Vault
deposit
depositDeposits token into the Vault, leading to producing corresponding token on the Everscale side.
function deposit(
EverscaleAddress memory recipient,
uint256 amount
) public override onlyEmergencyDisabled
respectDepositLimit(amount) nonReentrantParameters:
recipient
EverscaleAddress memory
Recipient in the Everscale network
amount
uint256
Amount of tokens to deposit
Events emitted:
UserDeposit
deposit
depositSame as regular deposit, but fill multiple pending withdrawals.
function deposit(
EverscaleAddress memory recipient,
uint256 amount,
uint256 expectedMinBounty,
PendingWithdrawalId[] memory pendingWithdrawalIds
) external overrideParameters:
recipient
EverscaleAddress memory
Recipient in the Everscale network
amount
uint256
Amount of tokens to deposit
expectedMinBounty
uint256
Expected minimal bounty amount
pendingWithdrawalIds
PendingWithdrawalId[] memory
List of pending withdrawals to close
Events emitted:
UserDeposit
depositToFactory
depositToFactoryDeposits token to Factory.
Parameters:
amount
uint128
Amount to deposit
wid
int8
Workchain id
user
uint256
User’s address
creditor
uint256
Creditor’s address
recipient
uint256
Recipient’s address
tokenAmount
uint128
Token amount
tonAmount
uint128
Ton amount
swapType
uint8
Type of swap
slippageNumerator
uint128
Numerator used in determining slippage value
slippageDenominator
uint128
Denominator used in determining slippage value
level3
bytes memory
Events emitted:
FactoryDeposit
saveWithdraw
saveWithdrawSave withdrawal receipt. If Vault has enough tokens and withdrawal passes the limits, then it's executed immediately. Otherwise it's saved as a pending withdrawal.
Parameters:
payload
bytes memory
Withdrawal receipt, bytes encoded from EverscaleEvent
signatures
bytes[] memory
List of relay’s signatures
Return value:
instantWithdrawal
bool
True if withdrawal was instantly filled, false if saved as pending withdrawal
pendingWithdrawalId
PendingWithdrawalId memory
Pending withdrawal Id
Events emitted:
InstantWithdrawal
saveWithdraw
saveWithdrawSave withdrawal receipt, same as saveWithdraw(bytes payload, bytes[] signatures),but allows to immediately set up bounty.
Parameters:
payload
bytes memory
Withdrawal receipt, bytes encoded from EverscaleEvent
signatures
bytes[] memory
List of relay’s signatures
bounty
uint
New value for pending withdrawal bounty
cancelPendingWithdrawal
cancelPendingWithdrawalCancel pending withdrawal partially or completely. This may only be called by the pending withdrawal recipient.
Parameters:
id
uint256
Pending withdrawal Id
amount
uint256
Amount to cancel (le then pending withdrawal amount)
recipient
EverscaleAddress memory
Tokens recipient in Everscale network
bounty
uint
New value for bounty
Events emitted:
PendingWithdrawalCancel
withdraw
withdrawWithdraws the calling account's pending withdrawal from this Vault.
Parameters:
id
uint256
Pending withdrawal Id
amountRequested
uint256
Amount of tokens to be withdrawn
recipient
address
The address to send the redeem tokens
maxLoss
uint256
The maximum acceptable loss for withdrawal
bounty
uint256
New value for bounty
Return value:
amountAdjusted
uint256
Quantity of tokens redeemed
Events emitted:
PendingWithdrawalWithdraw
addStrategy
addStrategyAdd a Strategy to the Vault. This may only be called by governance.
Parameters:
strategyId
address
Address of the strategy to add
_debtRatio
uint256
Share of the total vault’s assets that strategy has access to
minDebtPerHarvest
uint256
Lower limit on the increase of debt since last harvest
maxDebtPerHarvest
uint256
Upper limit on the increase of debt since last harvest
_performanceFee
uint256
Fee which strategist will receive based on this Vault’s performance
Events emitted:
StrategyAdded
updateStrategyDebtRatio
updateStrategyDebtRatioChange the quantity of assets strategy may manage. This may be called by governance or management.
Parameters:
strategyId
address
Address of the strategy to update
_debtRatio
uint256
Quantity of assets strategy may manage after update
Events emitted:
StrategyUpdateDebtRatio
updateStrategyMinDebtPerHarvest
updateStrategyMinDebtPerHarvestUpdates strategies minimal debt with new value passed from params.
Parameters:
strategyId
address
Address of the strategy to update
minDebtPerHarvest
uint256
Lower limit on the increase of debt since last harvest
Events emitted:
StrategyUpdateMinDebtPerHarvest
updateStrategyMaxDebtPerHarvest
updateStrategyMaxDebtPerHarvestUpdates strategies maximum debt with new value passed from params.
Parameters:
strategyId
address
Address of the strategy to update
maxDebtPerHarvest
uint256
Upper limit on the increase of debt since last harvest
Events emitted:
StrategyUpdateMaxDebtPerHarvest
updateStrategyPerformanceFee
updateStrategyPerformanceFeeUpdates strategies performance fee with new value passed from params.
Parameters:
strategyId
address
Address of the strategy to update
_performanceFee
uint256
New fee which strategist will receive based on this Vault’s performance
Events emitted:
StrategyUpdatePerformanceFee
revokeStrategy
revokeStrategyCancels strategy.
Parameters:
strategyId
address
Address of the strategy to update
Events emitted:
StrategyRevoked
_assessFees
_assessFeesBased on the strategy id and reported gain, calculates total fee based on the estimated management, strategist and performance fees.
Parameters:
strategyId
address
Address of the strategy to update
gain
uint256
Gains reported used for assessing fees
Return value:
uint256
New assessed fees
report
reportReports the amount of assets the calling Strategy has free (usually in terms of ROI).
Parameters:
gain
uint256
Amount strategy has realized as a gain on it’s investments since the last report
loss
uint256
Amount strategy has realized as a loss on it’s investments since the last report
_debtPayment
uint256
Amount strategy has made available to cover outstanding debt
Return value:
uint256
Amount of debt outstanding
Events emitted:
StrategyReported
skim
skimSkim strategy gain to the rewards_ address. This may only be called by governance or management.
Parameters:
strategyId
address
Address of the strategy to update
skimFees
skimFeesSkim Vault fees to the rewards_ address. This may only be called by governance or management.
Parameters:
skim_to_everscale
bool
True if skim fees to Everscale, false if not
sweep
sweepRemoves tokens from this Vault that are not the type of token managed by this Vault. This may be used in case of accidentally sending the wrong kind of token to this Vault.
Parameters:
_token
address
Token address to transfer out of this vault
forceWithdraw
forceWithdrawForce user's pending withdrawal. Works only if Vault has enough tokens on its balance. This may only be called by wrapper.
Parameters:
pendingWithdrawalId
PendingWithdrawalId memory
Pending withdrawal Id
Events emitted: PendingWithdrawalForce
forceWithdraw
forceWithdrawMulticall for forceWithdraw.
Parameters:
pendingWithdrawalId
PendingWithdrawalId[] memory
Pending withdrawal Id
setPendingWithdrawalApprove
setPendingWithdrawalApproveSet approve status for pending withdrawal. Pending withdrawal must be in Required (1) approve status, so approve status can be set only once. If Vault has enough tokens on its balance - withdrawal will be filled immediately. This may only be called by governance or withdrawGuardian.
Events emitted:
PendingWithdrawalWithdraw
setPendingWithdrawalApprove
setPendingWithdrawalApproveMulticall for setPendingWithdrawalApprove.
Parameters:
pendingWithdrawalId
PendingWithdrawalId[] memory
Pending withdrawal Id
approveStatus
ApproveStatus[] memory
Approve status, must be Approved or Rejected
_transferToEverscale
_transferToEverscaleEmits event to notify successful transfer.
Parameters:
recipient
EverscaleAddress memory
Recipient address in Everscale
_amount
uint256
Amount to transfer
Events emitted:
Deposit
Last updated
Was this helpful?