
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
solidity-patricia-tree
Advanced tools
This is a rewritten version of Christian Reitwießner's patricia-trie to use his patricia tree implementation as a solidity library through npm.
npm i solidity-patricia-tree
pragma solidity ^0.4.25;
import {PatriciaTree} from "solidity-patricia-tree/contracts/tree.sol";
contract TestPatriciaTree {
using PatriciaTree for PatriciaTree.Tree;
PatriciaTree.Tree tree;
function test() public {
// testInsert();
testProofs();
}
function testInsert() internal {
tree.insert("one", "ONE");
tree.insert("two", "ONE");
tree.insert("three", "ONE");
tree.insert("four", "ONE");
tree.insert("five", "ONE");
tree.insert("six", "ONE");
tree.insert("seven", "ONE");
// update
tree.insert("one", "TWO");
}
function testProofs() internal {
tree.insert("one", "ONE");
uint branchMask;
bytes32[] memory siblings;
(branchMask, siblings) = tree.getProof("one");
PatriciaTree.verifyProof(tree.root, "one", "ONE", branchMask, siblings);
tree.insert("two", "TWO");
(branchMask, siblings) = tree.getProof("one");
PatriciaTree.verifyProof(tree.root, "one", "ONE", branchMask, siblings);
(branchMask, siblings) = tree.getProof("two");
PatriciaTree.verifyProof(tree.root, "two", "TWO", branchMask, siblings);
}
}
npm install -g truffle
npm install -g ganache
npm install
Test cases include the information about how the functions work, but also includes a demo scenario. Running and reading the test cases will help you understand how it works.
npm run test
FAQs
Patricia Tree solidity implemenation
The npm package solidity-patricia-tree receives a total of 0 weekly downloads. As such, solidity-patricia-tree popularity was classified as not popular.
We found that solidity-patricia-tree demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.