Conversation
…nagement CII-56: Pending transactions management
CII-53: Deposit Endpoint
CII-54: Execute endpoint
CII-55: Finish execute gracefully
CII-58: Refund workflow
Merge 3.5 3
…ed-transactions-v1
…ayed-transactions-v1
| } | ||
|
|
||
| if (singleTxThreshold == 0) { | ||
| singleTransactionThreshold[token] = defaultSingleTransactionThreshold; |
There was a problem hiding this comment.
Question: do you think it will be better that, instead of using default values here, we should error as to prevent as much as we can bad values?
Valid also for aggregateThreshold
|
|
||
| _processDelayedTransactions(tokenAddress); | ||
|
|
||
| uint256 currentBlock = block.number; |
There was a problem hiding this comment.
Do you think it will be better to work with block.timestamp instead of block.number, or, at least keep also the timestamp when the deposit was made just to simplify the logic of time computing when we decide we can execute a transaction?
| _addDelayedTransaction(tokenAddress, amount, recipientAddress, true, callData); | ||
| emit TransactionDelayed(msg.sender, tokenAddress, amount, recipientAddress, true); | ||
| return (0, 0); | ||
| } else { |
| aggregatedValue[bucketId][tokenAddress] += amount; | ||
| (batchNonce, depositNonce) = _processDeposit(tokenAddress, amount, recipientAddress, callData); | ||
| return (batchNonce, depositNonce); | ||
| } else { |
|
|
||
| function _processDelayedTransactions(address tokenAddress) internal { | ||
| uint256 i = 0; | ||
| while (i < delayedTransactions.length) { |
There was a problem hiding this comment.
I guess this will consume a lot of gas. And the user y will actually pay for executing the deposit operations for user x, and so on. Thinking of a way to improve this and do the computation only when trying to assemble the current batch (I do not have a good idea now)
This method also has the disadvantage that, if a transaction is placed in a bucket, it won't be executed until a new deposit will be made. Which, if it will happen in 3 days, that will be the moment when it will actually be placed in a batch.
| await safe.deposit(genericERC20.address, 400, recipientAddress); | ||
| await safe.deposit(genericERC20.address, 200, recipientAddress); // Delayed | ||
|
|
||
| // Simulate 24 hours (14,400 blocks at 6s per block) |
No description provided.