DynamicMerkleTree icon indicating copy to clipboard operation
DynamicMerkleTree copied to clipboard

On-Chain Dynamic Merkle Tree

This project implements an on-chain dynamic Merkle tree library with some examples. The key features are:

  • efficient updating/appending a node in the tree with O(1) storage write cost;
  • example javascript code to generate Merkle proof for updating/appending (in test/);
  • examples of Merkelized Staking and Merkelized ERC20.

To Play

Try running some of the following tasks:

npx hardhat accounts
npx hardhat compile
npx hardhat clean
npx hardhat test
npx hardhat node
npx hardhat help
REPORT_GAS=true npx hardhat test
npx hardhat coverage
npx hardhat run scripts/deploy.js
node scripts/deploy.js
npx eslint '**/*.js'
npx eslint '**/*.js' --fix
npx prettier '**/*.{json,sol,md}' --check
npx prettier '**/*.{json,sol,md}' --write
npx solhint 'contracts/**/*.sol'
npx solhint 'contracts/**/*.sol' --fix

Cross L2 Bridge Example

This project implements an token transfer between two arbitrum instances using Dynamic Merkle Tree

To Play

Try running some of the following tasks:

npm run arb_bridge_deploy

Deployed Contracts on Arbitrum Testnet

Deployed Contracts on Optimism Testnet

Disclaimer

The code is not audited. USE AT YOUR OWN RISK.