Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

feat: update polynomial vaults to v2 #1137

Merged
merged 6 commits into from
Aug 12, 2022

Conversation

// 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))),
);
Copy link
Contributor

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))),
);
Copy link
Contributor

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.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants