-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Closed
Description
🧐 Motivation
The current MerkleTree.sol
contract contains two for
loops, both of which use uint32
as an iterator when iterating from 0
to uint8 treeDepth
. This is not optimal and uint256
should be used to minimize conversions.
📝 Details
Use uint256
for the iterators in MerkleTree.sol
for (uint32 i = 0; i < treeDepth; ++i) { |
for (uint32 i = 0; i < treeDepth; i++) { |
to save gas.
While on it, you can also change the for loops in the Heap.t.sol
test.
for (uint32 i = 1; i < heap.length(); ++i) { |
Metadata
Metadata
Assignees
Labels
No labels