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

[WIP] Use relayer balance for exits in vault actions (BPT in). #1743

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jubeira
Copy link
Contributor

@jubeira jubeira commented Sep 13, 2022

See #945.

This initial draft replaces BPT amount in for the relayer balance when a sentinel value (0xa11) is found in the amount.

Some notes:

  • Only for exits, when BPT in is given.
  • Does it make sense to implement this for tokens given out? On paper we only care about the amount of tokens given out in those cases, not how much BPT we use. In other words we'd be ignoring the operation kind, which sounds counter-intuitive.
  • It doesn't make much sense to use all relayer balance when sender is not relayer, so we should probably revert if that's not the case when the sentinel value is found.
  • Do we want to extend the sentinel value functionality to other operations as well? It'll probably mean an extra else if when we look for chained references as in this draft.

Input is welcome!

@jubeira jubeira added this to the Batch Relayer v4 milestone Sep 14, 2022
@jubeira jubeira linked an issue Sep 14, 2022 that may be closed by this pull request
@nventuro nventuro marked this pull request as ready for review September 16, 2022 17:26
} else {
// Save gas by only re-encoding the data if we actually performed a replacement
return userData;
}
}

function _useRelayerBalance(uint256 bptAmountIn) internal pure returns (bool) {
// Look for 0xa11 sentinel value to use all of relayer's balance.
Copy link
Contributor

Choose a reason for hiding this comment

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

Lol does this stand for 'all'? 😂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if 0xba1 stands for BAL, why not? 🙃

@jubeira jubeira self-assigned this Sep 20, 2022
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.

[relayer] Add 'relayer balance' sentinel value
3 participants