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

Splitters assume variables have been cached #27

Open
3 tasks
Evert0x opened this issue May 20, 2022 · 0 comments
Open
3 tasks

Splitters assume variables have been cached #27

Evert0x opened this issue May 20, 2022 · 0 comments

Comments

@Evert0x
Copy link
Contributor

Evert0x commented May 20, 2022

Splitters read balances from cachedChildOneBalance and cachedChildTwoBalance in deposit and withdraw actions (#24)

But there is no enforcement that the latest balances are actually cached.

Task

Still WIP

  • Make the default value of the cached... variables isn't 0 but type(uint256).max as the real value of a underlying node can be 0.
  • On the start of deposit and withdraw actions make sure the cached... variables are not their default values
  • Expire the cache in the deposit and withdraw actions to be 100% sure the cache variables are reset to their default values

Challenge

A strategy can be visited multiple times based on the splitter used SEE:

// Double DEPOSIT on one!

Expiring the cache at the end of a deposit or withdraw call will make the second visit (on deposit or withdraw) 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

No branches or pull requests

1 participant