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

Add RevertOptions as part of the gateway entrypoint functions #299

Closed
Tracked by #258
lumtis opened this issue Aug 8, 2024 · 0 comments · Fixed by #305
Closed
Tracked by #258

Add RevertOptions as part of the gateway entrypoint functions #299

lumtis opened this issue Aug 8, 2024 · 0 comments · Fixed by #305
Assignees
Labels
v2 New smart contract version

Comments

@lumtis
Copy link
Member

lumtis commented Aug 8, 2024

I think there were some confusion with the idea of RevertContext in previous discussion. The idea was to provide a structure to give instruction how to eventually handle revert.

Though RevertContext is not a right name for this, we can call this structure RevertOptions

Add a RevertOptions that can specify the following data:

struct revertOption {
    address revertAddress;
    bool callOnRevert;
    address abortAddress;
}
  • revertAddress is used to determine address to receive revert
  • callOnRevert if onRevert hook should be called
  • abortAddress address to receive funds if aborted

Changes:

  • This structure is added to entrypoint function (deposit, withdraw, depositAndCall, etc...)
  • Added in the emitted events

This is what is only needed in the smart contract, then the protocol orchestrate depending on the options.

Protocol uses revertAddress for abortAddress if not defined, and address of sender for revertAddress if not defined.

@lumtis lumtis added the v2 New smart contract version label Aug 8, 2024
@skosito skosito self-assigned this Aug 8, 2024
@skosito skosito linked a pull request Aug 8, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 New smart contract version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants