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

Reimbursements #449

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Reimbursements #449

wants to merge 2 commits into from

Conversation

marshabl
Copy link

Here is an approach to moving from reverts -> returns, using the preOpsCall as an example

Changes:

  • Update Context in locktypes and safetylocks to include an array of Reimbursement structs (defined in locktypes)
  • update escrow to capture the gasUsed in preOpsWrapper -> this captures the gas regardless of whether it fails or succeeds because we need to reimburse either way
  • create a new Reimbursement struct with the gasUsed and the reimburser
  • push it into the ctx.reimbursements
  • on revert, we return instead of revert
  • then in atlas.sol -> execute, we have access to ctx.reimbursements (whether failed or succeeded) and we can call settle in there with the ctx so it can do the transfers

ToDo:

  • Update the rest of the hooks to capture reimbursements and return instead of revert

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.

1 participant