You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
contracts/ForgottenRunesWarriorsMinter.sol:162: for (uint256 i = 0; i < numWarriors; i++) {
contracts/ForgottenRunesWarriorsMinter.sol:220: for (uint256 i = 0; i < numWarriors; i++) {
contracts/ForgottenRunesWarriorsMinter.sol:259: for (uint256 i = 0; i < count; i++) {
contracts/ForgottenRunesWarriorsMinter.sol:355: for (uint256 i = startIdx; i < endIdx + 1; i++) {
> 0 is less efficient than != 0 for uint in require condition
For loop optimization
> 0
is less efficient than!= 0
for uint in require conditionRef: https://twitter.com/GalloDaSballo/status/1485430908165443590
https://github.com/code-423n4/2022-05-runes/blob/060b4f82b79c8308fe65674a39a07c44fa586cd3/contracts/ForgottenRunesWarriorsMinter.sol#L140-L143
https://github.com/code-423n4/2022-05-runes/blob/060b4f82b79c8308fe65674a39a07c44fa586cd3/contracts/ForgottenRunesWarriorsMinter.sol#L210-L213
Use custom errors
Solidity ^0.8.4 allow the use of custom errors to optimize gas usage.
https://blog.soliditylang.org/2021/04/21/custom-errors/
The text was updated successfully, but these errors were encountered: