function INIT_EIP712(string memory name, string memory version) internal {
Title : Using ++i than i++ for saving more gas
Using i++ instead ++i for all the loops, the variable i is incremented using i++. It is known that implementation by using ++i costs less gas per iteration than i++.
Tools Used
Manual Review
Occurances
main/contracts/Basket.sol#L43 for (uint256 i = 0; i < _tokens.length; i++) {
main/contracts/Basket.sol#L70 for (uint256 i = 0; i < _tokens.length; i++) {
main/contracts/Basket.sol#L93 for (uint256 i = 0; i < _tokens.length; i++) {
2.) Title : change uint256 i = 0 into uint i for saving more gas
using this implementation can saving more gas for each loops.
Tool Used
Manual Review
Recommended Mitigation
Change it
Occurances
main/contracts/Basket.sol#L43 for (uint256 i = 0; i < _tokens.length; i++) {
main/contracts/Basket.sol#L70 for (uint256 i = 0; i < _tokens.length; i++) {
main/contracts/Basket.sol#L93 for (uint256 i = 0; i < _tokens.length; i++) {
4.) Title : Caching array length can saving more gas
This implementation can be saving more gas, since if caching the array length is more gas efficient.
just because access to a local variable in solidity is more efficient.
Tool Used
Manual Review
Occurances
main/contracts/Basket.sol#L43 for (uint256 i = 0; i < _tokens.length; i++) {
main/contracts/Basket.sol#L70 for (uint256 i = 0; i < _tokens.length; i++) {
main/contracts/Basket.sol#L93 for (uint256 i = 0; i < _tokens.length; i++) {
calldata
instead ofmemory
File : EIP712Base.sol Line.15
++i
thani++
for saving more gasUsing
i++
instead++i
for all the loops, the variable i is incremented using i++. It is known that implementation by using++i
costs less gas per iteration thani++
.Tools Used
Manual Review
Occurances
2.) Title : change
uint256 i = 0
intouint i
for saving more gasusing this implementation can saving more gas for each loops.
Tool Used
Manual Review
Recommended Mitigation
Change it
Occurances
4.) Title : Caching array length can saving more gas
This implementation can be saving more gas, since if caching the array length is more gas efficient. just because access to a local variable in solidity is more efficient.
Tool Used
Manual Review
Occurances