This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 383
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note: ignores pending deposits when deposit queue is large. Consider checking if the last user is ZERO_ADDRESS and recursing | ||
const pendingDeposits = await Promise.all( | ||
map(range(250), async i => multicall.wrap(contract).depositQueue(depositHead + Number(i))), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure you can use nextQueuedDepositId
with queuedDepositHead
:
const start = Number(await multicall.wrap(contract).queuedDepositHead());
const end = Number(await multicall.wrap(contract).nextQueuedDepositId());
const pendingDeposits = await Promise.all(range(start, end).map(i => multicall.wrap(contract).depositQueue(i)));
(nextQueuedDepositId
is the next "free slot")
// Note: ignores pending withdrawals when withdrawal queue is large | ||
const pendingWithdrawals = await Promise.all( | ||
map(range(250), async i => multicall.wrap(contract).withdrawalQueue(withdrawalHead + Number(i))), | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure you can use nextQueuedWithdrawalId
with queuedWithdrawalHead
:
const start = Number(await multicall.wrap(contract).queuedWithdrawalHead());
const end = Number(await multicall.wrap(contract).nextQueuedWithdrawalId());
const pendingWithdrawals = await Promise.all(range(start, end).map(i => multicall.wrap(contract).depositQueue(i)));
(nextQueuedWithdrawalId
is the next "free slot")
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
not super sure about the implementation of the pending balances. see https://discord.com/channels/647279669388771329/964569348243075082/1006957984376684596
note: grant of op given for this work
Checklist
How to test?
put
http://localhost:5001/apps/polynomial/balances?network=optimism&addresses%5B%5D=0x17d60e33385700247741d8a0c2db0d4ac28130d7
http://localhost:5001/apps/polynomial/balances?network=optimism&addresses%5B%5D=0x0b289b03210d922f749c1fd3ec5ee93805deb7c1
call
http://localhost:5001/apps/polynomial/balances?network=optimism&addresses%5B%5D=0xea08e9e7fe7f6dfb5b333ddb54dcf9a47ded33af
http://localhost:5001/apps/polynomial/balances?network=optimism&addresses%5B%5D=0x572efefacd35f8acf0ba8d0a89332e8b3a52c6ac
pending deposits can be found from recent transactions of Initiate Deposit in the vault contracts: eg https://optimistic.etherscan.io/address/0xa11451acd2fbdf4ae798f44c4227cab9517739d7