FundLockUser.sol
View Source: contracts/fund-lock/FundLockUser.sol
↗ Extends: FundLockBase, IFundLockUser
FundLockUser
FundLock contract responsible for all user related token operations like deposits, withdrawals and funds release to a wallet.
Contract Members
Constants & Variables
Functions
deposit(address tokenAddress, uint256 value)
withdraw(address tokenAddress, uint256 value)
release(address tokenAddress, uint256 withdrawTimestamp)
deposit
User facing function for depositing funds to be used in Elektro. value
deposited will go to the client's {balanceSheetS}.
Arguments
Name | Type | Description |
---|---|---|
tokenAddress | address | - address of the token to be deposited |
value | uint256 | - amount of the token to be deposited |
withdraw
Marking funds that need to be withdrawn by the depositor. This function does NOT do any transfers. It only marks funds by creating Funds
structs and mapping them to user and token addresses. Also changes {balanceSheetS} and emits event. Created for security purposes.
Arguments
Name | Type | Description |
---|---|---|
tokenAddress | address | address of the token to be marked for withdrawal |
value | uint256 | amount of the token to be marked for withdrawal |
release
Actual withdrawal through releasing funds and making transfer to the client who called the function. In order to be released, funds first have to be marked as {fundsToWithdrawS} by the {withdraw()} function and time interval set as {releaseLock} has to pass since withdraw() was called. Uses different transfer logic depending on which token is used (ETH/WETH/ERC20).
Arguments
Name | Type | Description |
---|---|---|
tokenAddress | address | - address of the token to be released |
withdrawTimestamp | uint256 | - timestamp associated with a certain withdraw request (can be found in {Funds} struct included in the {fundsToWithdrawS} mapping). |
Last updated