Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Retirement batches #79

Open
wants to merge 26 commits into
base: main
Choose a base branch
from

Conversation

biwano
Copy link

@biwano biwano commented Feb 27, 2025

  • Adds the BatchRetireFacet that enables doing multiple retirements in one transaction. With tests.
  • Adds an upgrade script to cut the BatchRetireFacet on the Diamond. With tests.
  • Updates the ReentrancyGuard to support batching
  • Updates the upgradeCurrentDiamond method to support the BatchRetireFacet
  • Adds the getSourceTokensWithSlippage helper method
  • Fixes the adjustedAmountOut in LibSwap
  • Adds the IQuoterView.sol interface and updates references
  • Specifies the foundry version in the README
  • Adds extension recommendations for vscode

Copy link

vercel bot commented Feb 27, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
solidity ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 12, 2025 3:18pm

@biwano biwano requested a review from psparacino March 5, 2025 13:58

AppStorage internal s;

/** Handles non reentrance for single retirement transactions */
modifier nonReentrant() {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brendan Reentrency guard only on the batchRetire function?

(bool success, bytes memory data) = diamondAddress.delegatecall(calls[i].callData);

// Extract the call result
if (success && data.length == 32) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we want to fully abstract this batchCall we should remove the data length success condition for any void functions or return types like other bytes/strings etc. In that case we could just return raw bytes and decode offchain based on the function called.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in f531024
I did a bit of refactoring. Since we return whole bytes. I also send the success boolean in the event and in the function return value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants