Skip to content

Gas Optimization Bounty submission #2 #453

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

Merged
merged 4 commits into from
Aug 3, 2023

Conversation

nkrishang
Copy link
Contributor

Summary

Submission Contributor Contracts Target gas report gasreport.txt Current gas report gasreport.txt
#420 https://github.com/WhiteOakKong TokenStake.sol 464d016 733a21c

Overall gas reduced in target contracts: 6.09%
Total gas before: 313_031 after: 293_966 (ref: src/test/benchmark/TokenStake.t.sol)

WhiteOakKong and others added 4 commits August 3, 2023 15:06
* Update `Staker` and `StakingCondition` structs

* Update `Staker` struct
* Update `StakingCondition` struct
* Other minor changes to allow for updates

* Reorder/resize varaibles in Staking20Upgradeable.

- uint256 stakingTokenDecimals => uint16 stakingTokenDecimals
- uint256 rewardTokenDecimals => uint16 rewardTokenDecimals
- Move `stakersArray` below the fixed size variables.

* Make changes in Staking20 and Remove stakerArray

* Remove stakersArray from Staking20.sol

* Reorder variables in Staking20.sol for consistency

* run solint/prettier

* run yarn gas

* Updating gas report to ensure accuracy.

---------

Co-authored-by: nkrishang <[email protected]>
@nkrishang nkrishang merged commit d7ab7d0 into main Aug 3, 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.

2 participants