Skip to content

Commit

Permalink
docs: add pedersen class hash
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeR26 committed Jan 18, 2024
1 parent a473c7f commit 1fada3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ You have to deploy a new instance of an existing smart-contract. There is one co

| Tree hash | Class hash |
| :---: | :--- |
| **Pedersen class hash** | Soon |
| **Pedersen class hash** | `0x4ff16c026ed3b1849563c95605ef8ee91ca403f2c680bda53e4f6717400b230` |
| **Poseidon class hash** | `0x03e2efc98f902c0b33eee6c3daa97b941912bcab61b6162884380c682e594eaf`|

So, you will not have to pay fees to declare this part of the airdrop code ; it's already made.
Expand Down
4 changes: 2 additions & 2 deletions cairo/merkleTreeVerify.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ These 2 contracts are used in Starknet as libraries, to verify a proof of a Merk
Classes available in Starknet Mainnet, Goerli Testnet and Sepolia Testnet :
| Tree hash | Class hash |
| :---: | ---: |
| **Pedersen class hash** | Soon |
| **Pedersen class hash** | `0x4ff16c026ed3b1849563c95605ef8ee91ca403f2c680bda53e4f6717400b230` |
| **Poseidon class hash** | `0x03e2efc98f902c0b33eee6c3daa97b941912bcab61b6162884380c682e594eaf`|

## Deployment :

For each Merkle tree, you have to deploy a new instance of one of these 2 classes (choose Pedersen or Poseidon, in accordance with the tree that you have created). The constructor includes only one information : the root of this tree. By this way, this deployment is cost effective : no declaration of class (already made) and a very small storage space (only one felt).
Example with Starknet.js :
```typescript
const MERKLE_CLASS_HASH_PEDERSEN = "Soon";
const MERKLE_CLASS_HASH_PEDERSEN = "0x4ff16c026ed3b1849563c95605ef8ee91ca403f2c680bda53e4f6717400b230";
const MERKLE_CLASS_HASH_POSEIDON = "0x03e2efc98f902c0b33eee6c3daa97b941912bcab61b6162884380c682e594eaf";
const tree = Merkle.StarknetMerkleTree.load(
JSON.parse(fs.readFileSync('./treeTestPoseidon.json', 'ascii'))
Expand Down

0 comments on commit 1fada3d

Please sign in to comment.