Verify Whitelist Solidity

[Solved] Verify Whitelist Solidity | Solidity - Code Explorer | yomemimo.com
Question : Verify whitelist solidity

Answered by : dejan-ilic

function verifyWhitelist(bytes32 leaf, bytes32[] memory proof) private view returns (bool) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash < proofElement) { computedHash = keccak256( abi.encodePacked(computedHash, proofElement) ); } else { computedHash = keccak256( abi.encodePacked(proofElement, computedHash) ); } } return computedHash == _merkleRoot; }

Source : | Last Update : Tue, 28 Jun 22

Answers related to Verify whitelist solidity

Code Explorer Popular Question For Solidity