constructor(address forwarderIrrevocable) publicfunction initialize(address admin, contract IERC20 ERC20TokenPayment_, contract ICMTATSnapshot cmtat_token, contract IRuleEngine ruleEngine_, contract IAuthorizationEngine authorizationEngineIrrevocable, uint256 timeLimitToWithdraw_) public@notice initialize the proxy contract The calls to this function will revert if the contract was deployed without a proxy
| Name | Type | Description |
|---|---|---|
| admin | address | Address of the contract (Access Control) |
| ERC20TokenPayment_ | contract IERC20 | ERC20 token to perform the payment |
| cmtat_token | contract ICMTATSnapshot | |
| ruleEngine_ | contract IRuleEngine | |
| authorizationEngineIrrevocable | contract IAuthorizationEngine | |
| timeLimitToWithdraw_ | uint256 |
function __IncomeVault_init(address admin, contract IERC20 ERC20TokenPayment_, contract ICMTATSnapshot cmtat_token, contract IRuleEngine ruleEngine_, contract IAuthorizationEngine authorizationEngineIrrevocable, uint256 timeLimitToWithdraw_) internalcalls the different initialize functions from the different modules
function _msgSender() internal view returns (address sender)This surcharge is not necessary if you do not use the MetaTxModule
function _msgData() internal view returns (bytes)This surcharge is not necessary if you do not use the MetaTxModule
function _contextSuffixLength() internal view returns (uint256)contract ICMTATSnapshot CMTAT_TOKENcontract IERC20 ERC20TokenPaymentmapping(address => mapping(uint256 => bool)) claimedDividendmapping(uint256 => uint256) segregatedDividendmapping(uint256 => bool) segregatedClaimuint256 timeLimitToWithdrawfunction _computeDividendBatch(uint256 time, address[] tokenHolders, uint256[] tokenHoldersBalance, uint256 tokenTotalSupply) internal view returns (uint256[] tokenHolderDividend)| Name | Type | Description |
|---|---|---|
| time | uint256 | dividend time |
| tokenHolders | address[] | addresses to compute dividend |
| tokenHoldersBalance | uint256[] | the sender balance |
| tokenTotalSupply | uint256 | the total supply |
function _computeDividend(uint256 time, uint256 senderBalance, uint256 tokenTotalSupply) internal view returns (uint256 tokenHolderDividend)| Name | Type | Description |
|---|---|---|
| time | uint256 | dividend time |
| senderBalance | uint256 | token holder balance |
| tokenTotalSupply | uint256 | the total supply |
function _transferDividend(uint256 time, address tokenHolder, uint256 tokenHolderDividend) internal| Name | Type | Description |
|---|---|---|
| time | uint256 | dividend time |
| tokenHolder | address | addresses to send the dividends |
| tokenHolderDividend | uint256 | the computed dividends |
bytes32 INCOME_VAULT_OPERATOR_ROLEbytes32 INCOME_VAULT_DEPOSIT_ROLEbytes32 INCOME_VAULT_DISTRIBUTE_ROLEbytes32 INCOME_VAULT_WITHDRAW_ROLEerror IncomeVault_ClaimNotActivated()error IncomeVault_DividendAlreadyClaimed()error IncomeVault_NoDividendToClaim()error IncomeVault_AdminWithAddressZeroNotAllowed()error IncomeVault_TokenPaymentWithAddressZeroNotAllowed()error IncomeVault_CMTATWithAddressZeroNotAllowed()error IncomeVault_FailApproval()error IncomeVault_NoAmountSend()error IncomeVault_NotEnoughAmount()error IncomeVault_TokenBalanceIsZero()error IncomeVault_TooLateToWithdraw(uint256 currentTime)error IncomeVault_TooEarlyToWithdraw(uint256 currentTime)event newDeposit(uint256 time, address sender, uint256 dividend)event DividendClaimed(uint256 time, address sender, uint256 dividend)enum TIME_ERROR_CODE {
OK,
CLAIM_NOT_ACTIVATED,
TOO_LATE_TO_WITHDRAW,
TOO_EARLY_TO_WITHDRAW
}function validateTimeCode(uint256 time) public view returns (enum IncomeVaultOpen.TIME_ERROR_CODE code)validate if a time is valid, return 0 if valid
function validateTime(uint256 time) public viewvalidate if a time is valid, revert if invalid
function validateTimeBatch(uint256[] times) public viewbatch version of {validateTime}
function claimDividend(uint256 time) publicclaim your payment
| Name | Type | Description |
|---|---|---|
| time | uint256 | provide the date where you want to receive your payment |
function claimDividendBatch(uint256[] times) publicbatch version of {claimDividend}
Don't check if the dividends have been already claimed before external call to CMTAT.
| Name | Type | Description |
|---|---|---|
| times | uint256[] | provide the dates where you want to receive your payment |
function __IncomeVaultRestricted_init_unchained(uint256 timeLimitToWithdraw_) internalcalls the different initialize functions from the different modules
function deposit(uint256 time, uint256 amount) publicdeposit an amount to pay the dividends.
| Name | Type | Description |
|---|---|---|
| time | uint256 | provide the date where you want to perform a deposit |
| amount | uint256 | the amount to deposit |
function withdraw(uint256 time, uint256 amount, address withdrawAddress) publicwithdraw a certain amount at a specified time.
| Name | Type | Description |
|---|---|---|
| time | uint256 | provide the date where you want to perform a deposit |
| amount | uint256 | the amount to withdraw |
| withdrawAddress | address | address to receive amountof tokens |
function withdrawAll(uint256 amount, address withdrawAddress) publicwithdraw all tokens from ERC20TokenPayment contracts deposited
| Name | Type | Description |
|---|---|---|
| amount | uint256 | the amount to withdraw |
| withdrawAddress | address | address to receive amountof tokens |
function distributeDividend(address[] addresses, uint256 time) publicdistribute the dividends
The dividends are distributed only if they have not yet been claimed by the token holder
| Name | Type | Description |
|---|---|---|
| addresses | address[] | compute and transfer dividend for these holders |
| time | uint256 | dividend time |
function setStatusClaim(uint256 time, bool status) publicset the status to open or close the claims for a given time
| Name | Type | Description |
|---|---|---|
| time | uint256 | target time |
| status | bool | boolean (true or false) |
function setTimeLimitToWithdraw(uint256 timeLimitToWithdraw_) publicconfigure the time limit to withdraw