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

Fix no casting lqty to votes #63

Closed

Conversation

GalloDaSballo
Copy link
Collaborator

@GalloDaSballo GalloDaSballo commented Oct 29, 2024

Invariant Testing Run, with revert checks on all view functions

https://getrecon.xyz/dashboard/jobs/66d7b004-e279-406c-baf5-35b7398f6557

Change lqtyToVotes to use a uint120, proven to be safe since the max is bigger than the product of the max uint32 and max of uint88

Also improves packing of storage slots, saving gas, with (I believe) no additional security risk

WARNING!

I have altered the logical flow of how boldAccrued is computed, PLEASE REVIEW THIS!

Update

Removed references to uint120 in src (except UniV4)

Updated Invariant Testing to check for revert cases

Packed the boldAccrued into the snapshot

https://getrecon.xyz/shares/a8a1e527-8dee-454f-8556-384c9d5387e7

Missing Tests

  • feat: update boldAccrued in snapshot - UNTESTED

Missing Polish

I made all the snapshot logic "view" and conditionally accruing
Should we change the code to always have only one return value even on view?

@GalloDaSballo
Copy link
Collaborator Author

Closing as we need to raise the precision of TS, the optimization was technically sound and no specific additional property was broken
But we need a bigger uint to combat precision loss

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