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

Upgrade sjoe #120

Merged
merged 19 commits into from
Sep 20, 2023
Merged

Upgrade sjoe #120

merged 19 commits into from
Sep 20, 2023

Conversation

0x0Louis
Copy link
Contributor

The aim of this PR is to add a sweep function to sJoe for non-reward token (and not joe).
This PR also use immutable variables in order to save gas, to keep the storage ordering __gap variables are added.
A non-reentrant check was added for improved security.

contracts/StableJoeStaking.sol Outdated Show resolved Hide resolved
contracts/StableJoeStaking.sol Outdated Show resolved Hide resolved
contracts/StableJoeStaking.sol Outdated Show resolved Hide resolved
Comment on lines 65 to 67
uint88 public depositFeePercent;
/// @notice Reentrancy guard
bool public reentrant;
Copy link
Contributor

Choose a reason for hiding this comment

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

This only work because depositFeePercent is zero atm. That's a bit dangerous imo, imagine we put this upgrade on hold for some reason, then later we update the deposit fee and decide to finally carry on the upgrade while forgetting about this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, but to me it's fine as it would just reset the value to 0. I'll use the right storage for safety, but I don't think it's necessary

@0x0Louis 0x0Louis merged commit 5df7846 into main Sep 20, 2023
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.

3 participants