Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please check migration numbers before merging
PR Description
Based on ticket #1796
Implements a lightweight if-clause to distribute IGO.
Previously we would not do an if check in the else branch and would incur a hefty gas cost of modifying the user's IGO value to itself (you still pay extra even if the number doesn't change)
This solution makes very little impact but saves a LOT of gas when it's set to 0 and allows us to have different gas impact per-network.
Operating the feature is same as before, modifying var 28 on the cryptoblades contract.
Testing
Tested locally
Before if clause
win 103217 << extra cost for writing earnings on character for first time
win 87645 << real value to compare
After if clause, 0 amount
win 87883
win 87883
After if clause, non-0 amount
win 110433 << extra cost for taking user's IGO amount from 0 to non-0
win 95297 << consecutive gas cost compared to above for updating IGO number
Seems only 238 gas cost for the if clause. That's very negligible even at BNB ATH.