MerkleProofWrapperUpgradeable.sol 2.51 KB
Newer Older
vicotor's avatar
vicotor committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "../utils/cryptography/MerkleProofUpgradeable.sol";
import "../proxy/utils/Initializable.sol";

contract MerkleProofWrapperUpgradeable is Initializable {
    function __MerkleProofWrapper_init() internal onlyInitializing {
    }

    function __MerkleProofWrapper_init_unchained() internal onlyInitializing {
    }
    function verify(
        bytes32[] memory proof,
        bytes32 root,
        bytes32 leaf
    ) public pure returns (bool) {
        return MerkleProofUpgradeable.verify(proof, root, leaf);
    }

    function verifyCalldata(
        bytes32[] calldata proof,
        bytes32 root,
        bytes32 leaf
    ) public pure returns (bool) {
        return MerkleProofUpgradeable.verifyCalldata(proof, root, leaf);
    }

    function processProof(bytes32[] memory proof, bytes32 leaf) public pure returns (bytes32) {
        return MerkleProofUpgradeable.processProof(proof, leaf);
    }

    function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) public pure returns (bytes32) {
        return MerkleProofUpgradeable.processProofCalldata(proof, leaf);
    }

    function multiProofVerify(
        bytes32[] memory proofs,
        bool[] memory proofFlag,
        bytes32 root,
        bytes32[] memory leaves
    ) public pure returns (bool) {
        return MerkleProofUpgradeable.multiProofVerify(proofs, proofFlag, root, leaves);
    }

    function multiProofVerifyCalldata(
        bytes32[] calldata proofs,
        bool[] calldata proofFlag,
        bytes32 root,
        bytes32[] memory leaves
    ) public pure returns (bool) {
        return MerkleProofUpgradeable.multiProofVerifyCalldata(proofs, proofFlag, root, leaves);
    }

    function processMultiProof(
        bytes32[] memory proofs,
        bool[] memory proofFlag,
        bytes32[] memory leaves
    ) public pure returns (bytes32) {
        return MerkleProofUpgradeable.processMultiProof(proofs, proofFlag, leaves);
    }

    function processMultiProofCalldata(
        bytes32[] calldata proofs,
        bool[] calldata proofFlag,
        bytes32[] memory leaves
    ) public pure returns (bytes32) {
        return MerkleProofUpgradeable.processMultiProofCalldata(proofs, proofFlag, leaves);
    }

    /**
     * @dev This empty reserved space is put in place to allow future versions to add new
     * variables without shifting down storage in the inheritance chain.
     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
     */
    uint256[50] private __gap;
}