Open S1nus opened 4 months ago
This update enhances a smart contract library by integrating the "forge-std" submodule, which enriches the development environment. New bit manipulation functions and improved Merkle Tree verification methods have been introduced, alongside expanded testing capabilities. The project now supports both "forge-std" and "openzeppelin-contracts-upgradeable," providing developers with more robust tools. Additionally, documentation clarifications have been made to facilitate effective usage of the new features.
Files | Change Summary |
---|---|
.gitmodules , lib/forge-std |
Added "forge-std" submodule configuration, enhancing project capabilities. |
remappings.txt |
Updated path for forge-std dependency for improved clarity; other remappings unchanged. |
src/lib/tree/Utils.sol |
Introduced nextSubtreeSize and bitsTrailingZeroes functions for bit manipulation and subtree size calculations. |
src/lib/tree/binary/BinaryMerkleMultiproof.sol , src/lib/tree/binary/BinaryMerkleTree.sol |
Defined BinaryMerkleMultiproof structure and added functions (verifyMulti , verifyMultiNamespaced , verifyMultiHashes ) for Merkle proof verification. |
src/lib/tree/binary/test/BinaryMerkleTree.t.sol |
Added new test function testMultiproof to validate multiproof functionality. |
src/lib/tree/namespace/NamespaceMerkleMultiproof.sol |
Clarified comments for beginKey and endKey fields in NamespaceMerkleMultiproof . |
src/lib/tree/namespace/NamespaceMerkleTree.sol |
Removed _nextSubtreeSize and _bitsTrailingZeroes functions, eliminating related functionality. |
src/lib/tree/namespace/test/NamespaceMerkleMultiproof.t.sol |
Introduced testLoadFromBytes function to validate NamespaceMerkleTree.verifyMulti . |
src/lib/tree/test/proofs.json |
Created a new JSON file to manage proof data for testing and verification processes. |
sequenceDiagram
participant Dev as Developer
participant SW as Software
participant Utils as Utility Functions
participant Merkle as Merkle Tree
participant Test as Testing Framework
Dev->>SW: Integrate forge-std
SW->>Utils: Update remappings
SW->>Merkle: Add Utilities
SW->>Merkle: Verify Multi-Proofs
Merkle->>Test: Retrieve Proof Data
Test-->>Merkle: Send Proof Data
Merkle-->>SW: Verify Proofs
SW-->>Dev: Testing Complete
🐇 In the meadow, where rabbits hop,
New features bloom and never stop!
With clever code and bits to play,
We celebrate in a joyful way!
Forge and verify, oh what fun,
Our smart contracts shine like the sun! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
New to Solidity so idk if there's a better way, but I wrote this to save us from needing to loop through the
NamespaceNodes
just to copy theirdigest
field into another array.Summary by CodeRabbit
New Features
Utils
library, including functions for subtree size calculations and bit manipulation.BinaryMerkleMultiproof
structure for improving Merkle Tree proof verification.BinaryMerkleTree
library with multiple functions for verifying multi-proofs, including the newverifyMultiNamespaced
function.NamespaceMerkleTree
.Bug Fixes
NamespaceMerkleMultiproof
structure.Chores
proofs.json
file for managing proof-related data in testing.