From d825e5e0fd3e7707f5b792b71d86a830bf2116b2 Mon Sep 17 00:00:00 2001 From: Oleh Komendant Date: Wed, 11 Dec 2024 14:23:29 +0200 Subject: [PATCH] Add gas usage comments --- contracts/libs/data-structures/CartesianMerkleTree.sol | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/contracts/libs/data-structures/CartesianMerkleTree.sol b/contracts/libs/data-structures/CartesianMerkleTree.sol index f3d411f..0e4180e 100644 --- a/contracts/libs/data-structures/CartesianMerkleTree.sol +++ b/contracts/libs/data-structures/CartesianMerkleTree.sol @@ -4,6 +4,16 @@ pragma solidity ^0.8.4; /** * @notice Cartesian Merkle Tree Module * + * Gas usage for adding and removing 5,000 elements to a treap on the Poseidon and Keccak256 Hash functions is detailed below: + * + * Keccak256: + * - CMT.add - 249k + * - CMT.remove - 181k + * + * Poseidon: + * - CMT.add - 896k + * - CMT.remove - 746k + * * ## Usage Example: * * ```solidity