Closed code423n4 closed 2 years ago
PREFIX INCREMENTS
IMPACT Prefix increments are cheaper than postfix increments.
Instance: https://github.com/code-423n4/2022-07-swivel/blob/main/Creator/Erc20.sol#L154 nonces[owner]++,
Instance: https://github.com/code-423n4/2022-07-swivel/blob/main/Swivel/Swivel.sol#L100 unchecked {i++;}
Instance: https://github.com/code-423n4/2022-07-swivel/blob/main/Swivel/Swivel.sol#L269 unchecked {i++;}
Instance: https://github.com/code-423n4/2022-07-swivel/blob/main/Swivel/Swivel.sol#L418 i++;
Instance: https://github.com/code-423n4/2022-07-swivel/blob/main/Swivel/Swivel.sol#L511 x++;
Instance: https://github.com/code-423n4/2022-07-swivel/blob/main/Swivel/Swivel.sol#L564 i++;
Instance: https://github.com/code-423n4/2022-07-swivel/blob/main/Marketplace/Erc20.sol#L154 nonces[owner]++,
Instance: https://github.com/code-423n4/2022-07-swivel/blob/main/Tokens/Erc20.sol#L154 nonces[owner]++,
Mitigation: replace foo++ to ++foo
Warden submitted multiple Gas Optimizations. Will not be judged.
PREFIX INCREMENTS
IMPACT Prefix increments are cheaper than postfix increments.
Instance: https://github.com/code-423n4/2022-07-swivel/blob/main/Creator/Erc20.sol#L154 nonces[owner]++,
Instance: https://github.com/code-423n4/2022-07-swivel/blob/main/Swivel/Swivel.sol#L100 unchecked {i++;}
Instance: https://github.com/code-423n4/2022-07-swivel/blob/main/Swivel/Swivel.sol#L269 unchecked {i++;}
Instance: https://github.com/code-423n4/2022-07-swivel/blob/main/Swivel/Swivel.sol#L418 i++;
Instance: https://github.com/code-423n4/2022-07-swivel/blob/main/Swivel/Swivel.sol#L511 x++;
Instance: https://github.com/code-423n4/2022-07-swivel/blob/main/Swivel/Swivel.sol#L564 i++;
Instance: https://github.com/code-423n4/2022-07-swivel/blob/main/Marketplace/Erc20.sol#L154 nonces[owner]++,
Instance: https://github.com/code-423n4/2022-07-swivel/blob/main/Tokens/Erc20.sol#L154 nonces[owner]++,
Mitigation: replace foo++ to ++foo