semaphore icon indicating copy to clipboard operation
semaphore copied to clipboard

returning merkleTreeRoot from internal functions like _addMember

Open 0xDatapunk opened this issue 1 year ago • 0 comments

a gas optimization: in functions like addMember, we currently have uint256 merkleTreeRoot = getMerkleTreeRoot(groupId);, while merkleTreeRoot could have been returned from _addMember call

https://github.com/semaphore-protocol/semaphore/blob/8eb19e83fda62644872b2fcfbd85011d3b2c21e2/packages/contracts/contracts/base/SemaphoreGroups.sol#L70

0xDatapunk avatar Mar 11 '24 17:03 0xDatapunk