From 3c599429c77bf25d6d2b975f1b417c0847815a01 Mon Sep 17 00:00:00 2001 From: rachid Date: Sat, 12 Aug 2023 17:44:55 +0200 Subject: [PATCH 1/8] feat!: use a struct for namespace and rename namespaceID --- src/lib/tree/Constants.sol | 12 +- src/lib/tree/Types.sol | 37 +++-- .../tree/namespace/NamespaceMerkleTree.sol | 14 +- src/lib/tree/namespace/NamespaceNode.sol | 10 +- src/lib/tree/namespace/TreeHasher.sol | 38 +++-- .../test/NamespaceMerkleMultiproof.t.sol | 24 +-- .../namespace/test/NamespaceMerkleTree.t.sol | 138 +++++++++--------- src/lib/tree/namespace/test/TreeHasher.t.sol | 20 +-- src/lib/verifier/DAVerifier.sol | 13 +- src/lib/verifier/test/DAVerifier.t.sol | 32 ++-- 10 files changed, 188 insertions(+), 150 deletions(-) diff --git a/src/lib/tree/Constants.sol b/src/lib/tree/Constants.sol index ab36d809..7410c0f4 100644 --- a/src/lib/tree/Constants.sol +++ b/src/lib/tree/Constants.sol @@ -15,7 +15,13 @@ library Constants { bytes1 internal constant LEAF_PREFIX = 0x00; bytes1 internal constant NODE_PREFIX = 0x01; - /// @dev Parity share namespace ID - NamespaceID internal constant PARITY_SHARE_NAMESPACE_ID = - NamespaceID.wrap(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); + /// @dev Parity share namespace in bytes. + bytes29 internal constant PARITY_SHARE_NAMESPACE_BYTES = + 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; +} + +/// @dev Parity share namespace. +/// utility function to provide the parity share namespace as a Namespace struct. +function PARITY_SHARE_NAMESPACE() pure returns (Namespace memory) { + return Namespace(0xFF, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); } diff --git a/src/lib/tree/Types.sol b/src/lib/tree/Types.sol index 2185f71e..af376aac 100644 --- a/src/lib/tree/Types.sol +++ b/src/lib/tree/Types.sol @@ -1,20 +1,37 @@ // SPDX-License-Identifier: Apache-2.0 pragma solidity ^0.8.19; -type NamespaceID is bytes29; +/// @notice A representation of the Celestia-app namespace ID and its version. +/// More in here: https://github.com/celestiaorg/celestia-app/blob/main/docs/architecture/adr-014-versioned-namespaces.md +struct Namespace { + // The namespace version. + bytes1 version; + // The namespace ID. + bytes28 id; +} + +using {equalTo, lessThan, greaterThan, toBytes} for Namespace global; -using {equality as ==} for NamespaceID global; -using {lessthan as <} for NamespaceID global; -using {greaterthan as >} for NamespaceID global; +function equalTo(Namespace memory l, Namespace memory r) pure returns (bool) { + return l.toBytes() == r.toBytes(); +} + +function lessThan(Namespace memory l, Namespace memory r) pure returns (bool) { + return l.toBytes() < r.toBytes(); +} -function equality(NamespaceID l, NamespaceID r) pure returns (bool) { - return NamespaceID.unwrap(l) == NamespaceID.unwrap(r); +function greaterThan(Namespace memory l, Namespace memory r) pure returns (bool) { + return l.toBytes() > r.toBytes(); } -function lessthan(NamespaceID l, NamespaceID r) pure returns (bool) { - return NamespaceID.unwrap(l) < NamespaceID.unwrap(r); +function toBytes(Namespace memory n) pure returns (bytes29) { + return bytes29(abi.encodePacked(n.version, n.id)); } -function greaterthan(NamespaceID l, NamespaceID r) pure returns (bool) { - return NamespaceID.unwrap(l) > NamespaceID.unwrap(r); +function toNamespace(bytes29 n) pure returns (Namespace memory) { + bytes memory id = new bytes(28); + for (uint256 i = 1; i < 29; i++) { + id[i - 1] = n[i]; + } + return Namespace(n[0], bytes28(id)); } diff --git a/src/lib/tree/namespace/NamespaceMerkleTree.sol b/src/lib/tree/namespace/NamespaceMerkleTree.sol index c3a946cc..a3bfdcbe 100644 --- a/src/lib/tree/namespace/NamespaceMerkleTree.sol +++ b/src/lib/tree/namespace/NamespaceMerkleTree.sol @@ -14,18 +14,18 @@ library NamespaceMerkleTree { /// @notice Verify if element exists in Merkle tree, given data, proof, and root. /// @param root The root of the tree in which the given leaf is verified. /// @param proof Namespace Merkle proof for the leaf. - /// @param minmaxNID Namespace ID of the leaf. + /// @param namespace Namespace of the leaf. /// @param data The data of the leaf to verify. /// @return `true` if the proof is valid, `false` otherwise. /// @dev proof.numLeaves is necessary to determine height of subtree containing the data to prove. function verify( NamespaceNode memory root, NamespaceMerkleProof memory proof, - NamespaceID minmaxNID, + Namespace memory namespace, bytes memory data ) internal pure returns (bool) { // A sibling at height 1 is created by getting the leafDigest of the original data. - NamespaceNode memory node = leafDigest(minmaxNID, data); + NamespaceNode memory node = leafDigest(namespace, data); // Since we're verifying a leaf, height parameter is 1. return verifyInner(root, proof, node, 1); @@ -137,19 +137,19 @@ library NamespaceMerkleTree { /// @notice Verify if contiguous elements exists in Merkle tree, given leaves, mutliproof, and root. /// @param root The root of the tree in which the given leaves are verified. /// @param proof Namespace Merkle multiproof for the leaves. - /// @param minmaxNID Namespace ID of the leaves. All leaves must have the same namespace ID. - /// @param data The leaves to verify. Note: leaf data must be the _entire_ share (including namespace ID prefixing). + /// @param namespace Namespace of the leaves. All leaves must have the same namespace. + /// @param data The leaves to verify. Note: leaf data must be the _entire_ share (including namespace prefixing). /// @return `true` if the proof is valid, `false` otherwise. function verifyMulti( NamespaceNode memory root, NamespaceMerkleMultiproof memory proof, - NamespaceID minmaxNID, + Namespace memory namespace, bytes[] memory data ) internal pure returns (bool) { // Hash all the leaves to get leaf nodes. NamespaceNode[] memory nodes = new NamespaceNode[](data.length); for (uint256 i = 0; i < data.length; ++i) { - nodes[i] = leafDigest(minmaxNID, data[i]); + nodes[i] = leafDigest(namespace, data[i]); } // Verify inclusion of leaf nodes. diff --git a/src/lib/tree/namespace/NamespaceNode.sol b/src/lib/tree/namespace/NamespaceNode.sol index 8a61052d..84f13887 100644 --- a/src/lib/tree/namespace/NamespaceNode.sol +++ b/src/lib/tree/namespace/NamespaceNode.sol @@ -5,10 +5,10 @@ import "../Types.sol"; /// @notice Namespace Merkle Tree node. struct NamespaceNode { - // Minimum namespace ID. - NamespaceID min; - // Maximum namespace ID. - NamespaceID max; + // Minimum namespace. + Namespace min; + // Maximum namespace. + Namespace max; // Node value. bytes32 digest; } @@ -19,5 +19,5 @@ struct NamespaceNode { /// @return `true` is equal, `false otherwise. // solhint-disable-next-line func-visibility function namespaceNodeEquals(NamespaceNode memory first, NamespaceNode memory second) pure returns (bool) { - return (first.min == second.min) && (first.max == second.max) && (first.digest == second.digest); + return first.min.equalTo(second.min) && first.max.equalTo(second.max) && (first.digest == second.digest); } diff --git a/src/lib/tree/namespace/TreeHasher.sol b/src/lib/tree/namespace/TreeHasher.sol index de9f754e..f3e0f4d3 100644 --- a/src/lib/tree/namespace/TreeHasher.sol +++ b/src/lib/tree/namespace/TreeHasher.sol @@ -7,8 +7,8 @@ import "./NamespaceNode.sol"; /// @notice Get the minimum namespace. // solhint-disable-next-line func-visibility -function namespaceMin(NamespaceID l, NamespaceID r) pure returns (NamespaceID) { - if (l < r) { +function namespaceMin(Namespace memory l, Namespace memory r) pure returns (Namespace memory) { + if (l.lessThan(r)) { return l; } else { return r; @@ -17,8 +17,8 @@ function namespaceMin(NamespaceID l, NamespaceID r) pure returns (NamespaceID) { /// @notice Get the maximum namespace. // solhint-disable-next-line func-visibility -function namespaceMax(NamespaceID l, NamespaceID r) pure returns (NamespaceID) { - if (l > r) { +function namespaceMax(Namespace memory l, Namespace memory r) pure returns (Namespace memory) { + if (l.greaterThan(r)) { return l; } else { return r; @@ -26,13 +26,13 @@ function namespaceMax(NamespaceID l, NamespaceID r) pure returns (NamespaceID) { } /// @notice Hash a leaf node. -/// @param minmaxNID Namespace ID. +/// @param namespace Namespace of the leaf. /// @param data Raw data of the leaf. /// @dev More details in https://github.com/celestiaorg/celestia-specs/blob/master/src/specs/data_structures.md#namespace-merkle-tree // solhint-disable-next-line func-visibility -function leafDigest(NamespaceID minmaxNID, bytes memory data) pure returns (NamespaceNode memory) { - bytes32 digest = sha256(abi.encodePacked(Constants.LEAF_PREFIX, minmaxNID, data)); - NamespaceNode memory node = NamespaceNode(minmaxNID, minmaxNID, digest); +function leafDigest(Namespace memory namespace, bytes memory data) pure returns (NamespaceNode memory) { + bytes32 digest = sha256(abi.encodePacked(Constants.LEAF_PREFIX, namespace.toBytes(), data)); + NamespaceNode memory node = NamespaceNode(namespace, namespace, digest); return node; } @@ -42,17 +42,27 @@ function leafDigest(NamespaceID minmaxNID, bytes memory data) pure returns (Name /// @dev More details in https://github.com/celestiaorg/celestia-specs/blob/master/src/specs/data_structures.md#namespace-merkle-tree // solhint-disable-next-line func-visibility function nodeDigest(NamespaceNode memory l, NamespaceNode memory r) pure returns (NamespaceNode memory) { - NamespaceID min = namespaceMin(l.min, r.min); - NamespaceID max; - if (l.min == Constants.PARITY_SHARE_NAMESPACE_ID) { - max = Constants.PARITY_SHARE_NAMESPACE_ID; - } else if (r.min == Constants.PARITY_SHARE_NAMESPACE_ID) { + Namespace memory min = namespaceMin(l.min, r.min); + Namespace memory max; + if (l.min.equalTo(PARITY_SHARE_NAMESPACE())) { + max = PARITY_SHARE_NAMESPACE(); + } else if (r.min.equalTo(PARITY_SHARE_NAMESPACE())) { max = l.max; } else { max = namespaceMax(l.max, r.max); } - bytes32 digest = sha256(abi.encodePacked(Constants.NODE_PREFIX, l.min, l.max, l.digest, r.min, r.max, r.digest)); + bytes32 digest = sha256( + abi.encodePacked( + Constants.NODE_PREFIX, + l.min.toBytes(), + l.max.toBytes(), + l.digest, + r.min.toBytes(), + r.max.toBytes(), + r.digest + ) + ); NamespaceNode memory node = NamespaceNode(min, max, digest); return node; diff --git a/src/lib/tree/namespace/test/NamespaceMerkleMultiproof.t.sol b/src/lib/tree/namespace/test/NamespaceMerkleMultiproof.t.sol index 540a8c97..6a1faa4f 100644 --- a/src/lib/tree/namespace/test/NamespaceMerkleMultiproof.t.sol +++ b/src/lib/tree/namespace/test/NamespaceMerkleMultiproof.t.sol @@ -11,7 +11,7 @@ import "../NamespaceMerkleTree.sol"; /** * TEST VECTORS * - * Data blocks: namespace id, data + * Data blocks: namespace, data * 0x0000000000000000000000000000000000000000000000000000000010 0x01 * 0x0000000000000000000000000000000000000000000000000000000010 0x02 * 0x0000000000000000000000000000000000000000000000000000000010 0x03 @@ -50,33 +50,33 @@ contract NamespaceMerkleMultiproofTest is DSTest { function setUp() external {} function assertEqNamespaceNode(NamespaceNode memory first, NamespaceNode memory second) internal { - assertEq(NamespaceID.unwrap(first.min), NamespaceID.unwrap(second.min)); - assertEq(NamespaceID.unwrap(first.max), NamespaceID.unwrap(second.max)); + assertTrue(first.min.equalTo(second.min)); + assertTrue(first.max.equalTo(second.max)); assertEq(first.digest, second.digest); } /// @notice Verify inclusion of leaves 0 and 1. function testVerifyMulti01() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010); + Namespace memory nid = Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010); NamespaceNode memory root = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), 0x5b3328b03a538d627db78668034089cb395f63d05b24fdf99558d36fe991d268 ); NamespaceNode[] memory sideNodes = new NamespaceNode[](3); sideNodes[0] = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), 0xfdb4e3c872666aa9869a1d46c8a5a0e735becdf17c62b9c3ccf4258449475bda ); sideNodes[1] = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), 0xc350aeddd5ada629057034f15d4545065213a7a28f9f9b77bdc71c4225145920 ); sideNodes[2] = NamespaceNode( - Constants.PARITY_SHARE_NAMESPACE_ID, - Constants.PARITY_SHARE_NAMESPACE_ID, + PARITY_SHARE_NAMESPACE(), + PARITY_SHARE_NAMESPACE(), 0x5aa3e7ea31995fdd38f41015275229b290a8ee4810521db766ad457b9a8373d6 ); diff --git a/src/lib/tree/namespace/test/NamespaceMerkleTree.t.sol b/src/lib/tree/namespace/test/NamespaceMerkleTree.t.sol index efc46341..5be6f5e6 100644 --- a/src/lib/tree/namespace/test/NamespaceMerkleTree.t.sol +++ b/src/lib/tree/namespace/test/NamespaceMerkleTree.t.sol @@ -6,11 +6,13 @@ import "ds-test/test.sol"; import "../NamespaceNode.sol"; import "../NamespaceMerkleProof.sol"; import "../NamespaceMerkleTree.sol"; +import "../../Constants.sol"; /** * TEST VECTORS * - * Data blocks: namespace id, data + * Data blocks: Namespace, data + * Data blocks: Namespace, data * 0x0000000000000000000000000000000000000000000000000000000010 0x01 * 0x0000000000000000000000000000000000000000000000000000000020 0x02 * 0x0000000000000000000000000000000000000000000000000000000030 0x03 @@ -49,13 +51,13 @@ contract NamespaceMerkleTreeTest is DSTest { function setUp() external {} function assertEqNamespaceNode(NamespaceNode memory first, NamespaceNode memory second) internal { - assertEq(NamespaceID.unwrap(first.min), NamespaceID.unwrap(second.min)); - assertEq(NamespaceID.unwrap(first.max), NamespaceID.unwrap(second.max)); + assertTrue(first.min.equalTo(second.min)); + assertTrue(first.max.equalTo(second.max)); assertEq(first.digest, second.digest); } function testVerifyNone() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000000); + Namespace memory nid = Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000000); NamespaceNode memory root = NamespaceNode(nid, nid, sha256("")); NamespaceNode[] memory sideNodes; uint256 key = 0; @@ -67,7 +69,7 @@ contract NamespaceMerkleTreeTest is DSTest { } function testVerifyOneLeafEmpty() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000000); + Namespace memory nid = Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000000); NamespaceNode memory root = NamespaceNode(nid, nid, 0x0679246d6c4216de0daa08e5523fb2674db2b6599c3b72ff946b488a15290b62); NamespaceNode[] memory sideNodes; @@ -80,7 +82,7 @@ contract NamespaceMerkleTreeTest is DSTest { } function testVerifyOneLeafSome() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000000); + Namespace memory nid = Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000000); NamespaceNode memory root = NamespaceNode(nid, nid, 0x56d8381cfe28e8eb21da620145b7b977a74837720da5147b00bfab6f1b4af24d); NamespaceNode[] memory sideNodes; @@ -93,7 +95,7 @@ contract NamespaceMerkleTreeTest is DSTest { } function testVerifyOneLeaf01() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000000); + Namespace memory nid = Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000000); NamespaceNode memory root = NamespaceNode(nid, nid, 0x353857cdb4c745eb9fdebbd8ec44093fabb9f08d437e2298d9e6afa1a409b30c); NamespaceNode[] memory sideNodes; @@ -107,14 +109,14 @@ contract NamespaceMerkleTreeTest is DSTest { function testVerifyLeafOneOfTwo() external { NamespaceNode memory root = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000020), 0x1dae5c3d39a8bf31ea33ba368238a52f816cd50485c580565609554cf360c91f ); NamespaceNode[] memory sideNodes = new NamespaceNode[](1); sideNodes[0] = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000020), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000020), 0xc5fd5617b70207108c8d9bcf624b1eedf39b763af86f660255947674e043cd2c ); @@ -123,26 +125,26 @@ contract NamespaceMerkleTreeTest is DSTest { NamespaceMerkleProof memory proof = NamespaceMerkleProof(sideNodes, key, numLeaves); bytes memory data = hex"01"; bool isValid = NamespaceMerkleTree.verify( - root, proof, NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), data + root, proof, Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), data ); assertTrue(isValid); } function testVerifyLeafOneOfFour() external { NamespaceNode memory root = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000040), 0xa8dcd9f365fb64aa6d72b5027fe74db0fc7d009c2d75c7b9b9656927281cb35e ); NamespaceNode[] memory sideNodes = new NamespaceNode[](2); sideNodes[0] = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000020), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000020), 0xc5fd5617b70207108c8d9bcf624b1eedf39b763af86f660255947674e043cd2c ); sideNodes[1] = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000030), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000030), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000040), 0x2aa20c7587b009772a9a88402b7cc8fcb82edc9e31754e95544a670a696f55a7 ); @@ -151,31 +153,31 @@ contract NamespaceMerkleTreeTest is DSTest { NamespaceMerkleProof memory proof = NamespaceMerkleProof(sideNodes, key, numLeaves); bytes memory data = hex"01"; bool isValid = NamespaceMerkleTree.verify( - root, proof, NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), data + root, proof, Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), data ); assertTrue(isValid); } function testVerifyLeafOneOfEight() external { NamespaceNode memory root = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000040), 0x34e6541306dc4e57a5a2a9ef57a46d5705ed09efb8c6a02580d3a972922b6862 ); NamespaceNode[] memory sideNodes = new NamespaceNode[](3); sideNodes[0] = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000020), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000020), 0xc5fd5617b70207108c8d9bcf624b1eedf39b763af86f660255947674e043cd2c ); sideNodes[1] = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000030), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000030), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000040), 0x2aa20c7587b009772a9a88402b7cc8fcb82edc9e31754e95544a670a696f55a7 ); sideNodes[2] = NamespaceNode( - Constants.PARITY_SHARE_NAMESPACE_ID, - Constants.PARITY_SHARE_NAMESPACE_ID, + PARITY_SHARE_NAMESPACE(), + PARITY_SHARE_NAMESPACE(), 0x5aa3e7ea31995fdd38f41015275229b290a8ee4810521db766ad457b9a8373d6 ); @@ -184,31 +186,31 @@ contract NamespaceMerkleTreeTest is DSTest { NamespaceMerkleProof memory proof = NamespaceMerkleProof(sideNodes, key, numLeaves); bytes memory data = hex"01"; bool isValid = NamespaceMerkleTree.verify( - root, proof, NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), data + root, proof, Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), data ); assertTrue(isValid); } function testVerifyLeafSevenOfEight() external { NamespaceNode memory root = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000040), 0x34e6541306dc4e57a5a2a9ef57a46d5705ed09efb8c6a02580d3a972922b6862 ); NamespaceNode[] memory sideNodes = new NamespaceNode[](3); sideNodes[0] = NamespaceNode( - Constants.PARITY_SHARE_NAMESPACE_ID, - Constants.PARITY_SHARE_NAMESPACE_ID, + PARITY_SHARE_NAMESPACE(), + PARITY_SHARE_NAMESPACE(), 0x655790e24d376e9556a3cba9908a5d97f27faa050806ecfcb481861a83240bd5 ); sideNodes[1] = NamespaceNode( - Constants.PARITY_SHARE_NAMESPACE_ID, - Constants.PARITY_SHARE_NAMESPACE_ID, + PARITY_SHARE_NAMESPACE(), + PARITY_SHARE_NAMESPACE(), 0x055a3ea75c438d752aeabbba94ed8fac93e0b32321256a65fde176dba14f5186 ); sideNodes[2] = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000040), 0xa8dcd9f365fb64aa6d72b5027fe74db0fc7d009c2d75c7b9b9656927281cb35e ); @@ -216,30 +218,30 @@ contract NamespaceMerkleTreeTest is DSTest { uint256 numLeaves = 8; NamespaceMerkleProof memory proof = NamespaceMerkleProof(sideNodes, key, numLeaves); bytes memory data = hex"07"; - bool isValid = NamespaceMerkleTree.verify(root, proof, Constants.PARITY_SHARE_NAMESPACE_ID, data); + bool isValid = NamespaceMerkleTree.verify(root, proof, PARITY_SHARE_NAMESPACE(), data); assertTrue(isValid); } function testVerifyLeafEightOfEight() external { NamespaceNode memory root = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000040), 0x34e6541306dc4e57a5a2a9ef57a46d5705ed09efb8c6a02580d3a972922b6862 ); NamespaceNode[] memory sideNodes = new NamespaceNode[](3); sideNodes[0] = NamespaceNode( - Constants.PARITY_SHARE_NAMESPACE_ID, - Constants.PARITY_SHARE_NAMESPACE_ID, + PARITY_SHARE_NAMESPACE(), + PARITY_SHARE_NAMESPACE(), 0x2669e36b48e95bd9903300e50c27c53984fc439f6235fade08e3f14e78a42aac ); sideNodes[1] = NamespaceNode( - Constants.PARITY_SHARE_NAMESPACE_ID, - Constants.PARITY_SHARE_NAMESPACE_ID, + PARITY_SHARE_NAMESPACE(), + PARITY_SHARE_NAMESPACE(), 0x055a3ea75c438d752aeabbba94ed8fac93e0b32321256a65fde176dba14f5186 ); sideNodes[2] = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000040), 0xa8dcd9f365fb64aa6d72b5027fe74db0fc7d009c2d75c7b9b9656927281cb35e ); @@ -247,12 +249,12 @@ contract NamespaceMerkleTreeTest is DSTest { uint256 numLeaves = 8; NamespaceMerkleProof memory proof = NamespaceMerkleProof(sideNodes, key, numLeaves); bytes memory data = hex"08"; - bool isValid = NamespaceMerkleTree.verify(root, proof, Constants.PARITY_SHARE_NAMESPACE_ID, data); + bool isValid = NamespaceMerkleTree.verify(root, proof, PARITY_SHARE_NAMESPACE(), data); assertTrue(isValid); } function testVerifyInnerLeafIsRoot() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000000); + Namespace memory nid = Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000000); NamespaceNode memory root = NamespaceNode(nid, nid, 0xc59fa9c4ec515726c2b342544433f844c7b930cf7a5e7abab593332453ceaf70); NamespaceNode[] memory sideNodes; @@ -267,7 +269,7 @@ contract NamespaceMerkleTreeTest is DSTest { } function testVerifyInnerFalseForStartingHeightZero() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020); + Namespace memory nid = Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000020); NamespaceNode memory root = NamespaceNode(nid, nid, 0xc59fa9c4ec515726c2b342544433f844c7b930cf7a5e7abab593332453ceaf70); NamespaceNode[] memory sideNodes; @@ -282,7 +284,7 @@ contract NamespaceMerkleTreeTest is DSTest { } function testVerifyInnerFalseForTooLargeKey() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020); + Namespace memory nid = Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000020); NamespaceNode memory root = NamespaceNode(nid, nid, 0xc59fa9c4ec515726c2b342544433f844c7b930cf7a5e7abab593332453ceaf70); NamespaceNode[] memory sideNodes; @@ -297,13 +299,13 @@ contract NamespaceMerkleTreeTest is DSTest { } function testVerifyInnerFalseForIncorrectProofLength() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020); + Namespace memory nid = Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000020); NamespaceNode memory root = NamespaceNode(nid, nid, 0xc59fa9c4ec515726c2b342544433f844c7b930cf7a5e7abab593332453ceaf70); NamespaceNode[] memory sideNodes = new NamespaceNode[](1); sideNodes[0] = NamespaceNode( - Constants.PARITY_SHARE_NAMESPACE_ID, - Constants.PARITY_SHARE_NAMESPACE_ID, + PARITY_SHARE_NAMESPACE(), + PARITY_SHARE_NAMESPACE(), 0x24ddc56b10cebbf760b3a744ad3a0e91093db34b4d22995f6de6dac918e38ae5 ); uint256 key = 0; @@ -318,24 +320,24 @@ contract NamespaceMerkleTreeTest is DSTest { function testVerifyInnerOneOfEight() external { NamespaceNode memory root = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000040), 0x34e6541306dc4e57a5a2a9ef57a46d5705ed09efb8c6a02580d3a972922b6862 ); NamespaceNode[] memory sideNodes = new NamespaceNode[](2); sideNodes[0] = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000030), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000030), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000040), 0x2aa20c7587b009772a9a88402b7cc8fcb82edc9e31754e95544a670a696f55a7 ); sideNodes[1] = NamespaceNode( - Constants.PARITY_SHARE_NAMESPACE_ID, - Constants.PARITY_SHARE_NAMESPACE_ID, + PARITY_SHARE_NAMESPACE(), + PARITY_SHARE_NAMESPACE(), 0x5aa3e7ea31995fdd38f41015275229b290a8ee4810521db766ad457b9a8373d6 ); NamespaceNode memory node = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000020), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000020), 0x1dae5c3d39a8bf31ea33ba368238a52f816cd50485c580565609554cf360c91f ); @@ -348,24 +350,24 @@ contract NamespaceMerkleTreeTest is DSTest { function testVerifyInnerSevenOfEight() external { NamespaceNode memory root = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000040), 0x34e6541306dc4e57a5a2a9ef57a46d5705ed09efb8c6a02580d3a972922b6862 ); NamespaceNode[] memory sideNodes = new NamespaceNode[](2); sideNodes[0] = NamespaceNode( - Constants.PARITY_SHARE_NAMESPACE_ID, - Constants.PARITY_SHARE_NAMESPACE_ID, + PARITY_SHARE_NAMESPACE(), + PARITY_SHARE_NAMESPACE(), 0x055a3ea75c438d752aeabbba94ed8fac93e0b32321256a65fde176dba14f5186 ); sideNodes[1] = NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000010), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000040), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000010), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000040), 0xa8dcd9f365fb64aa6d72b5027fe74db0fc7d009c2d75c7b9b9656927281cb35e ); NamespaceNode memory node = NamespaceNode( - Constants.PARITY_SHARE_NAMESPACE_ID, - Constants.PARITY_SHARE_NAMESPACE_ID, + PARITY_SHARE_NAMESPACE(), + PARITY_SHARE_NAMESPACE(), 0x1b79ffd74644e8c287fe5f1dd70bc8ea02738697cebf2810ffb2dc5157485c40 ); diff --git a/src/lib/tree/namespace/test/TreeHasher.t.sol b/src/lib/tree/namespace/test/TreeHasher.t.sol index 142710e4..70876a19 100644 --- a/src/lib/tree/namespace/test/TreeHasher.t.sol +++ b/src/lib/tree/namespace/test/TreeHasher.t.sol @@ -12,13 +12,13 @@ contract TreeHasherTest is DSTest { function setUp() external {} function assertEqNamespaceNode(NamespaceNode memory first, NamespaceNode memory second) internal { - assertEq(NamespaceID.unwrap(first.min), NamespaceID.unwrap(second.min)); - assertEq(NamespaceID.unwrap(first.max), NamespaceID.unwrap(second.max)); + assertTrue(first.min.equalTo(second.min)); + assertTrue(first.max.equalTo(second.max)); assertEq(first.digest, second.digest); } function testLeafDigestEmpty() external { - NamespaceID nid = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000000); + Namespace memory nid = Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000000); NamespaceNode memory expected = NamespaceNode(nid, nid, 0x0679246d6c4216de0daa08e5523fb2674db2b6599c3b72ff946b488a15290b62); bytes memory data; @@ -27,7 +27,7 @@ contract TreeHasherTest is DSTest { } function testLeafDigestSome() external { - NamespaceID nid = NamespaceID.wrap(0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde); + Namespace memory nid = Namespace(0xde, 0xadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde); NamespaceNode memory expected = NamespaceNode(nid, nid, 0x3624c7f7169cb5bbd0d010b851ebd0edca10b2a1b126f5fb1a6d5e0d98356e63); bytes memory data = hex"69"; @@ -36,8 +36,8 @@ contract TreeHasherTest is DSTest { } function testNodeDigest() external { - NamespaceID nidLeft = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000000); - NamespaceID nidRight = NamespaceID.wrap(0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde); + Namespace memory nidLeft = Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000000); + Namespace memory nidRight = Namespace(0xde, 0xadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde); NamespaceNode memory expected = NamespaceNode(nidLeft, nidRight, 0x95cad48bc181484c851004cf772abe767391e19549d3b8192b55b1d654a71bcd); NamespaceNode memory left = @@ -49,15 +49,15 @@ contract TreeHasherTest is DSTest { } function testNodeParity() external { - NamespaceID nidMin = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000000); - NamespaceID nidMax = NamespaceID.wrap(0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde); + Namespace memory nidMin = Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000000); + Namespace memory nidMax = Namespace(0xde, 0xadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefde); NamespaceNode memory expected = NamespaceNode(nidMin, nidMax, 0xc6960f535d4ab0aed075aed34a116725e8035012ceffe5405ae72abe3bcaa28f); NamespaceNode memory left = NamespaceNode(nidMin, nidMax, 0xdb55da3fc3098e9c42311c6013304ff36b19ef73d12ea932054b5ad51df4f49d); NamespaceNode memory right = NamespaceNode( - Constants.PARITY_SHARE_NAMESPACE_ID, - Constants.PARITY_SHARE_NAMESPACE_ID, + PARITY_SHARE_NAMESPACE(), + PARITY_SHARE_NAMESPACE(), 0xc75cb66ae28d8ebc6eded002c28a8ba0d06d3a78c6b5cbf9b2ade051f0775ac4 ); NamespaceNode memory node = nodeDigest(left, right); diff --git a/src/lib/verifier/DAVerifier.sol b/src/lib/verifier/DAVerifier.sol index b413ed4e..aadc5645 100644 --- a/src/lib/verifier/DAVerifier.sol +++ b/src/lib/verifier/DAVerifier.sol @@ -18,8 +18,8 @@ struct SharesProof { bytes[] data; // The shares proof to the row roots. If the shares span multiple rows, we will have multiple nmt proofs. NamespaceMerkleMultiproof[] shareProofs; - // The namespace ID of the shares. - NamespaceID namespaceID; + // The namespace of the shares. + Namespace namespace; // The rows where the shares belong. If the shares span multiple rows, we will have multiple rows. NamespaceNode[] rowRoots; // The proofs of the rowRoots to the data root. @@ -112,12 +112,12 @@ library DAVerifier { for (uint256 i = 0; i < _sharesProof.shareProofs.length; i++) { uint256 sharesUsed = _sharesProof.shareProofs[i].endKey - _sharesProof.shareProofs[i].beginKey; NamespaceNode memory rowRoot = - NamespaceNode(_sharesProof.namespaceID, _sharesProof.namespaceID, _sharesProof.rowRoots[i].digest); + NamespaceNode(_sharesProof.namespace, _sharesProof.namespace, _sharesProof.rowRoots[i].digest); if ( !NamespaceMerkleTree.verifyMulti( rowRoot, _sharesProof.shareProofs[i], - _sharesProof.namespaceID, + _sharesProof.namespace, slice(_sharesProof.data, cursor, cursor + sharesUsed) ) ) { @@ -151,7 +151,7 @@ library DAVerifier { revert InvalidDataRootTupleToDataRootTupleRootProof(); } - bytes memory rowRoot = abi.encodePacked(_rowRoot.min, _rowRoot.max, _rowRoot.digest); + bytes memory rowRoot = abi.encodePacked(_rowRoot.min.toBytes(), _rowRoot.max.toBytes(), _rowRoot.digest); if (!BinaryMerkleTree.verify(_root, _rowProof, rowRoot)) { revert InvalidRowToDataRootProof(); } @@ -187,7 +187,8 @@ library DAVerifier { } for (uint256 i = 0; i < _rowProofs.length; i++) { - bytes memory rowRoot = abi.encodePacked(_rowRoots[i].min, _rowRoots[i].max, _rowRoots[i].digest); + bytes memory rowRoot = + abi.encodePacked(_rowRoots[i].min.toBytes(), _rowRoots[i].max.toBytes(), _rowRoots[i].digest); if (!BinaryMerkleTree.verify(_root, _rowProofs[i], rowRoot)) { revert InvalidRowsToDataRootProof(i); } diff --git a/src/lib/verifier/test/DAVerifier.t.sol b/src/lib/verifier/test/DAVerifier.t.sol index 1cc46357..0635c3fb 100644 --- a/src/lib/verifier/test/DAVerifier.t.sol +++ b/src/lib/verifier/test/DAVerifier.t.sol @@ -122,7 +122,7 @@ contract DAVerifierTest is DSTest { fixture.dataRootTupleRootNonce(), fixture.getDataRootTuple(), fixture.getDataRootTupleProof() ); SharesProof memory sharesProof = - SharesProof(_data, _shareProofs, fixture.minimaxNID(), _rowRoots, _rowProofs, attestationProof); + SharesProof(_data, _shareProofs, fixture.getNamespace(), _rowRoots, _rowProofs, attestationProof); bool valid = DAVerifier.verifySharesToDataRootTupleRoot(bridge, sharesProof, fixture.dataRoot()); assertTrue(valid); @@ -177,7 +177,7 @@ contract DAVerifierTest is DSTest { // check that the merkle proof is valid bool validMerkleProof = NamespaceMerkleTree.verifyMulti( - fixture.getFirstRowRootNode(), fixture.getShareToRowRootProof(), fixture.minimaxNID(), _data + fixture.getFirstRowRootNode(), fixture.getShareToRowRootProof(), fixture.getNamespace(), _data ); assertTrue(validMerkleProof); @@ -226,9 +226,6 @@ contract TestFixture { hex"0000000000000000000000000000000000000000000000000000000000000000" ); - /// @notice the share's namespace ID. - NamespaceID public minimaxNID = NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000001); - /// @notice the first EDS row root. bytes public firstRowRoot = abi.encodePacked( hex"00000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000001787bf77b567506b6e1d0048bfd89edd352a4fbc102e62f07cc9fe6b4cbe5ee69" @@ -270,8 +267,8 @@ contract TestFixture { /// @notice shares to data root proof side nodes. NamespaceNode[] public shareToDataRootProofSideNodes = [ NamespaceNode( - NamespaceID.wrap(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff), - NamespaceID.wrap(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff), + Namespace(0xff, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff), + Namespace(0xff, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff), 0x0ec8148c743a4a4db384f40f487cae2fd1ca0d18442d1f162916bdf1cc61b679 ) ]; @@ -282,6 +279,11 @@ contract TestFixture { bytes32(0xff576381b02abadc50e414f6b4efcae31091cd40a5aba75f56be52d1bb2efcae) ]; + /// @notice the share's namespace. + function getNamespace() public pure returns (Namespace memory) { + return Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000001); + } + /// @notice the data root tuple of the block containing the submitted blob. function getDataRootTuple() public view returns (DataRootTuple memory) { return DataRootTuple(height, dataRoot); @@ -295,8 +297,8 @@ contract TestFixture { /// @notice the first EDS row root. function getFirstRowRootNode() public pure returns (NamespaceNode memory) { return NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000001), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000001), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000001), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000001), 0x787bf77b567506b6e1d0048bfd89edd352a4fbc102e62f07cc9fe6b4cbe5ee69 ); } @@ -304,8 +306,8 @@ contract TestFixture { /// @notice the second EDS row root. function getSecondRowRootNode() public pure returns (NamespaceNode memory) { return NamespaceNode( - NamespaceID.wrap(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff), - NamespaceID.wrap(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff), + Namespace(0xff, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff), + Namespace(0xff, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff), 0x7329c7d336d0140840837fc0d8eafa2403f4f6b019b602581cd9f04e28026eae ); } @@ -313,8 +315,8 @@ contract TestFixture { /// @notice the first EDS column root. function getFirstColumnRootNode() public pure returns (NamespaceNode memory) { return NamespaceNode( - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000001), - NamespaceID.wrap(0x0000000000000000000000000000000000000000000000000000000001), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000001), + Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000001), 0x787bf77b567506b6e1d0048bfd89edd352a4fbc102e62f07cc9fe6b4cbe5ee69 ); } @@ -322,8 +324,8 @@ contract TestFixture { /// @notice the second EDS column root. function getSecondColumnRootNode() public pure returns (NamespaceNode memory) { return NamespaceNode( - NamespaceID.wrap(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff), - NamespaceID.wrap(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffff), + Namespace(0xff, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff), + Namespace(0xff, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff), 0x7329c7d336d0140840837fc0d8eafa2403f4f6b019b602581cd9f04e28026eae ); } From d3667750ee8bc767b286781ac358ce4b4a9ea0be Mon Sep 17 00:00:00 2001 From: root Date: Sat, 12 Aug 2023 15:49:45 +0000 Subject: [PATCH 2/8] chore: regenerate wrappers --- wrappers/QuantumGravityBridge.sol/wrapper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrappers/QuantumGravityBridge.sol/wrapper.go b/wrappers/QuantumGravityBridge.sol/wrapper.go index fa70aef0..64d2d43b 100644 --- a/wrappers/QuantumGravityBridge.sol/wrapper.go +++ b/wrappers/QuantumGravityBridge.sol/wrapper.go @@ -58,7 +58,7 @@ type Validator struct { // WrappersMetaData contains all meta data concerning the Wrappers contract. var WrappersMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_powerThreshold\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_validatorSetHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InsufficientVotingPower\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDataRootTupleRootNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidValidatorSetNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MalformedCurrentValidatorSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SuppliedValidatorSetInvalid\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"dataRootTupleRoot\",\"type\":\"bytes32\"}],\"name\":\"DataRootTupleRootEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"powerThreshold\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"validatorSetHash\",\"type\":\"bytes32\"}],\"name\":\"ValidatorSetUpdatedEvent\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"state_dataRootTupleRoots\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_eventNonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_lastValidatorSetCheckpoint\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_powerThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_validatorSetNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_dataRootTupleRoot\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"power\",\"type\":\"uint256\"}],\"internalType\":\"structValidator[]\",\"name\":\"_currentValidatorSet\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structSignature[]\",\"name\":\"_sigs\",\"type\":\"tuple[]\"}],\"name\":\"submitDataRootTupleRoot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_oldNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_newPowerThreshold\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_newValidatorSetHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"power\",\"type\":\"uint256\"}],\"internalType\":\"structValidator[]\",\"name\":\"_currentValidatorSet\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structSignature[]\",\"name\":\"_sigs\",\"type\":\"tuple[]\"}],\"name\":\"updateValidatorSet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_tupleRootNonce\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"height\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"dataRoot\",\"type\":\"bytes32\"}],\"internalType\":\"structDataRootTuple\",\"name\":\"_tuple\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"sideNodes\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"key\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numLeaves\",\"type\":\"uint256\"}],\"internalType\":\"structBinaryMerkleProof\",\"name\":\"_proof\",\"type\":\"tuple\"}],\"name\":\"verifyAttestation\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x6080346100ed57601f61103b38819003918201601f1916830192916001600160401b0391828511848610176100d75781606092859260409788528339810103126100ed5781519183602082015191015191845192602084016918da1958dadc1bda5b9d60b21b815285878601528360608601528160808601526080855260a0850192858410908411176100d7577fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c94879460c09285875282519020886002556000558060015584520152a251610f4890816100f38239f35b634e487b7160e01b600052604160045260246000fd5b600080fdfe608060408181526004918236101561001657600080fd5b600092833560e01c91826305d85c131461039f575081631f3302a9146102545781635433218c14610237578163817f985b1461020f578163cdade866146101f0578163e23eb32614610093575063e5a2b5d21461007257600080fd5b3461008f578160031936011261008f576020906001549051908152f35b5080fd5b9050346101ec5760a03660031901126101ec578035916044359167ffffffffffffffff6064358181116101e8576100cd90369084016104cc565b90916084359081116101e4576100e69036908501610502565b916002549460015495600181018091116101d15789036101c3578382036101b55761011d61011483876105d4565b87602435610654565b8a54036101a757509261018f927f6614d037bde4905e31ca5ff05de61964c267f28b0320ed49e59f7d99752e1c4f979592879560209851898101906f0e8e4c2dce6c2c6e8d2dedc84c2e8c6d60831b82528c898201528960608201526060815261018681610533565b519020936106d7565b8460025584865260038352818187205551908152a280f35b8651630bbdaec960e11b8152fd5b865163c6617b7b60e01b8152fd5b865163e869766d60e01b8152fd5b634e487b7160e01b8b526011825260248bfd5b8780fd5b8680fd5b8280fd5b50503461008f578160031936011261008f576020906002549051908152f35b9050346101ec5760203660031901126101ec5760209282913581526003845220549051908152f35b50503461008f578160031936011261008f57602091549051908152f35b83833461008f576003199160803684011261035d578160231936011261035d57815167ffffffffffffffff948184018681118382101761038c57845260248035835260209660443588850152606435968188116103885760609088360301126103845785519460608601918683108184111761037257828852888501358181116101ec578901366023820112156101ec5785810135918211610360578160051b916103018c840186610581565b84528460808901928201019236841161035d575090848b9201905b83821061034e575050505095604491610345969786528101358886015201358584015235610a81565b90519015158152f35b8135815290820190820161031c565b80fd5b634e487b7160e01b8352604186528483fd5b634e487b7160e01b8252604185528382fd5b8480fd5b8580fd5b634e487b7160e01b845260418252602484fd5b848285346101ec5760c03660031901126101ec57813591604435906064359067ffffffffffffffff6084358181116101e4576103de90369084016104cc565b92909160a4359081116104c8576103f89036908301610502565b916002549a6001549b600181018091116104b5578a036104a9575082850361049b5761043061042786866105d4565b8c602435610654565b8a540361048d575091879899916104759361046d87897fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c9c610654565b9586936106d7565b8655816001558460025582519182526020820152a280f35b8751630bbdaec960e11b8152fd5b875163c6617b7b60e01b8152fd5b6368a35ffd60e11b8152fd5b634e487b7160e01b8c526011835260248cfd5b8880fd5b9181601f840112156104fd5782359167ffffffffffffffff83116104fd576020808501948460061b0101116104fd57565b600080fd5b9181601f840112156104fd5782359167ffffffffffffffff83116104fd57602080850194606085020101116104fd57565b6080810190811067ffffffffffffffff82111761054f57604052565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761054f57604052565b90601f8019910116810190811067ffffffffffffffff82111761054f57604052565b60010190816001116105b157565b634e487b7160e01b600052601160045260246000fd5b919082018092116105b157565b60409182518092602092838301958181850186895252606084019294600090815b84831061061a575050505050610614925003601f198101835282610581565b51902090565b919395509193863560018060a01b0381168091036101ec578582819260019452858a013586820152019701930190918795939694926105f5565b916040519160208301936918da1958dadc1bda5b9d60b21b85526040840152606083015260808201526080815260a0810181811067ffffffffffffffff82111761054f5760405251902090565b91908110156106b1576060020190565b634e487b7160e01b600052603260045260246000fd5b91908110156106b15760061b0190565b93919060009485935b828510610707575b505050505050106106f557565b60405163cabeb65560e01b8152600490fd5b909192939497969561071a868a876106a1565b6020908181013515908161083f575b8161082a575b506108235761073f8786866106c7565b6001600160a01b039035818116908190036104fd5761075f898d8a6106a1565b916107c66107be6040948551878101907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008252603c8b8183015281526107a481610565565b5190206107b08261084c565b8888840135930135916109cc565b91909161085a565b16036108135750906107e5916107dd8887876106c7565b0135906105c7565b9486861015610809575b60001981146105b1576001019392919097949596976106e0565b85969798506106e8565b51638baa579f60e01b8152600490fd5b50946107ef565b60ff91506108379061084c565b16153861072f565b6040810135159150610729565b3560ff811681036104fd5790565b60058110156109b6578061086b5750565b600181036108b85760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b600281036109055760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6003810361095d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b60041461096657565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311610a755760ff16601b81141580610a6a575b610a5e579160809493916020936040519384528484015260408301526060820152600093849182805260015afa15610a515781516001600160a01b03811615610a4b579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600490565b50601c811415610a04565b50505050600090600390565b916002548311610ac557610ac29260005260036020526040600020546020604051938051828601520151604084015260408352610abd83610565565b610b0d565b90565b505050600090565b906101009182039182116105b157565b6000198101919082116105b157565b919082039182116105b157565b80518210156106b15760209160051b010190565b6040820180519193909291600190818111610dd45750825151610dca575b6020830192835185511115610dbf576020610b5e93610b78604051610b6c81600098899586888401526021830190610e9d565b03601f198101835282610581565b60405191828092610e9d565b039060025afa15610db45782519481515115610d9c57829081958051925b610c97575b505160001991828201918211610c835703610c36575b8293925b610bc3575b50505050501490565b9091929394818601868111610c225783518051821015610c1a57610bf19291610beb91610af9565b51610ec8565b94848101809111610c06579392919083610bb5565b634e487b7160e01b84526011600452602484fd5b505094610bba565b634e487b7160e01b85526011600452602485fd5b9091939482515182870190878211610c8357811015610c785790610c5e610c65928551610af9565b5190610ec8565b94848101809111610c0657939190610bb1565b505050509250505090565b634e487b7160e01b86526011600452602486fd5b9091819793949697519387891b948515610d8857891c94858a1b95808704821490151715610d7457610cc990866105c7565b60001992818401918211610d52578551821015610d66575094865151928a01928a8411610d5257831015610d4457610d02908451610aec565b88831b1115610d3057610c5e610d19928751610af9565b965b868101809111610c8357959392919084610b96565b610beb610d3e928751610af9565b96610d1b565b505050505050509250505090565b634e487b7160e01b89526011600452602489fd5b949350509796949350610b9b565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b88526012600452602488fd5b519495949293505003610dae57501490565b91505090565b6040513d84823e3d90fd5b505050505050600090565b5050505050600090565b610de5845151916020860151610df4565b14610b2b575050505050600090565b909160005b60018481831b1015610e2557810180911115610df957634e487b7160e01b600052601160045260246000fd5b50929190926101009081039081116105b157610e4090610acd565b916001610e4c84610add565b1b91610e5783610add565b8111610e635750505090565b9192509060018303610e7757505050600190565b82610e88610e9494610e8e93610aec565b92610aec565b90610df4565b610ac2906105a3565b9081519160005b838110610eb5575050016000815290565b8060208092840101518185015201610ea4565b610ef560009160209360405191600160f81b868401526021830152604182015260418152610b6c81610533565b039060025afa15610f065760005190565b6040513d6000823e3d90fdfea26469706673582212200c3187622365c82480a03883264cc046b3d34bea50f1b808111f7cea6896febf64736f6c63430008140033", + Bin: "0x6080346100ed57601f61103b38819003918201601f1916830192916001600160401b0391828511848610176100d75781606092859260409788528339810103126100ed5781519183602082015191015191845192602084016918da1958dadc1bda5b9d60b21b815285878601528360608601528160808601526080855260a0850192858410908411176100d7577fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c94879460c09285875282519020886002556000558060015584520152a251610f4890816100f38239f35b634e487b7160e01b600052604160045260246000fd5b600080fdfe608060408181526004918236101561001657600080fd5b600092833560e01c91826305d85c131461039f575081631f3302a9146102545781635433218c14610237578163817f985b1461020f578163cdade866146101f0578163e23eb32614610093575063e5a2b5d21461007257600080fd5b3461008f578160031936011261008f576020906001549051908152f35b5080fd5b9050346101ec5760a03660031901126101ec578035916044359167ffffffffffffffff6064358181116101e8576100cd90369084016104cc565b90916084359081116101e4576100e69036908501610502565b916002549460015495600181018091116101d15789036101c3578382036101b55761011d61011483876105d4565b87602435610654565b8a54036101a757509261018f927f6614d037bde4905e31ca5ff05de61964c267f28b0320ed49e59f7d99752e1c4f979592879560209851898101906f0e8e4c2dce6c2c6e8d2dedc84c2e8c6d60831b82528c898201528960608201526060815261018681610533565b519020936106d7565b8460025584865260038352818187205551908152a280f35b8651630bbdaec960e11b8152fd5b865163c6617b7b60e01b8152fd5b865163e869766d60e01b8152fd5b634e487b7160e01b8b526011825260248bfd5b8780fd5b8680fd5b8280fd5b50503461008f578160031936011261008f576020906002549051908152f35b9050346101ec5760203660031901126101ec5760209282913581526003845220549051908152f35b50503461008f578160031936011261008f57602091549051908152f35b83833461008f576003199160803684011261035d578160231936011261035d57815167ffffffffffffffff948184018681118382101761038c57845260248035835260209660443588850152606435968188116103885760609088360301126103845785519460608601918683108184111761037257828852888501358181116101ec578901366023820112156101ec5785810135918211610360578160051b916103018c840186610581565b84528460808901928201019236841161035d575090848b9201905b83821061034e575050505095604491610345969786528101358886015201358584015235610a81565b90519015158152f35b8135815290820190820161031c565b80fd5b634e487b7160e01b8352604186528483fd5b634e487b7160e01b8252604185528382fd5b8480fd5b8580fd5b634e487b7160e01b845260418252602484fd5b848285346101ec5760c03660031901126101ec57813591604435906064359067ffffffffffffffff6084358181116101e4576103de90369084016104cc565b92909160a4359081116104c8576103f89036908301610502565b916002549a6001549b600181018091116104b5578a036104a9575082850361049b5761043061042786866105d4565b8c602435610654565b8a540361048d575091879899916104759361046d87897fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c9c610654565b9586936106d7565b8655816001558460025582519182526020820152a280f35b8751630bbdaec960e11b8152fd5b875163c6617b7b60e01b8152fd5b6368a35ffd60e11b8152fd5b634e487b7160e01b8c526011835260248cfd5b8880fd5b9181601f840112156104fd5782359167ffffffffffffffff83116104fd576020808501948460061b0101116104fd57565b600080fd5b9181601f840112156104fd5782359167ffffffffffffffff83116104fd57602080850194606085020101116104fd57565b6080810190811067ffffffffffffffff82111761054f57604052565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761054f57604052565b90601f8019910116810190811067ffffffffffffffff82111761054f57604052565b60010190816001116105b157565b634e487b7160e01b600052601160045260246000fd5b919082018092116105b157565b60409182518092602092838301958181850186895252606084019294600090815b84831061061a575050505050610614925003601f198101835282610581565b51902090565b919395509193863560018060a01b0381168091036101ec578582819260019452858a013586820152019701930190918795939694926105f5565b916040519160208301936918da1958dadc1bda5b9d60b21b85526040840152606083015260808201526080815260a0810181811067ffffffffffffffff82111761054f5760405251902090565b91908110156106b1576060020190565b634e487b7160e01b600052603260045260246000fd5b91908110156106b15760061b0190565b93919060009485935b828510610707575b505050505050106106f557565b60405163cabeb65560e01b8152600490fd5b909192939497969561071a868a876106a1565b6020908181013515908161083f575b8161082a575b506108235761073f8786866106c7565b6001600160a01b039035818116908190036104fd5761075f898d8a6106a1565b916107c66107be6040948551878101907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008252603c8b8183015281526107a481610565565b5190206107b08261084c565b8888840135930135916109cc565b91909161085a565b16036108135750906107e5916107dd8887876106c7565b0135906105c7565b9486861015610809575b60001981146105b1576001019392919097949596976106e0565b85969798506106e8565b51638baa579f60e01b8152600490fd5b50946107ef565b60ff91506108379061084c565b16153861072f565b6040810135159150610729565b3560ff811681036104fd5790565b60058110156109b6578061086b5750565b600181036108b85760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b600281036109055760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6003810361095d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b60041461096657565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311610a755760ff16601b81141580610a6a575b610a5e579160809493916020936040519384528484015260408301526060820152600093849182805260015afa15610a515781516001600160a01b03811615610a4b579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600490565b50601c811415610a04565b50505050600090600390565b916002548311610ac557610ac29260005260036020526040600020546020604051938051828601520151604084015260408352610abd83610565565b610b0d565b90565b505050600090565b906101009182039182116105b157565b6000198101919082116105b157565b919082039182116105b157565b80518210156106b15760209160051b010190565b6040820180519193909291600190818111610dd45750825151610dca575b6020830192835185511115610dbf576020610b5e93610b78604051610b6c81600098899586888401526021830190610e9d565b03601f198101835282610581565b60405191828092610e9d565b039060025afa15610db45782519481515115610d9c57829081958051925b610c97575b505160001991828201918211610c835703610c36575b8293925b610bc3575b50505050501490565b9091929394818601868111610c225783518051821015610c1a57610bf19291610beb91610af9565b51610ec8565b94848101809111610c06579392919083610bb5565b634e487b7160e01b84526011600452602484fd5b505094610bba565b634e487b7160e01b85526011600452602485fd5b9091939482515182870190878211610c8357811015610c785790610c5e610c65928551610af9565b5190610ec8565b94848101809111610c0657939190610bb1565b505050509250505090565b634e487b7160e01b86526011600452602486fd5b9091819793949697519387891b948515610d8857891c94858a1b95808704821490151715610d7457610cc990866105c7565b60001992818401918211610d52578551821015610d66575094865151928a01928a8411610d5257831015610d4457610d02908451610aec565b88831b1115610d3057610c5e610d19928751610af9565b965b868101809111610c8357959392919084610b96565b610beb610d3e928751610af9565b96610d1b565b505050505050509250505090565b634e487b7160e01b89526011600452602489fd5b949350509796949350610b9b565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b88526012600452602488fd5b519495949293505003610dae57501490565b91505090565b6040513d84823e3d90fd5b505050505050600090565b5050505050600090565b610de5845151916020860151610df4565b14610b2b575050505050600090565b909160005b60018481831b1015610e2557810180911115610df957634e487b7160e01b600052601160045260246000fd5b50929190926101009081039081116105b157610e4090610acd565b916001610e4c84610add565b1b91610e5783610add565b8111610e635750505090565b9192509060018303610e7757505050600190565b82610e88610e9494610e8e93610aec565b92610aec565b90610df4565b610ac2906105a3565b9081519160005b838110610eb5575050016000815290565b8060208092840101518185015201610ea4565b610ef560009160209360405191600160f81b868401526021830152604182015260418152610b6c81610533565b039060025afa15610f065760005190565b6040513d6000823e3d90fdfea2646970667358221220c5eafd1b52e7e8925aff6625b624db48c5f5d956a2951632f3cbe3b0a747051b64736f6c63430008140033", } // WrappersABI is the input ABI used to generate the binding from. From 990d1fddc3021d513a7f74741363dbd889ed2088 Mon Sep 17 00:00:00 2001 From: CHAMI Rachid Date: Sat, 12 Aug 2023 23:19:06 +0200 Subject: [PATCH 3/8] Update src/lib/tree/Types.sol Co-authored-by: Rootul P --- src/lib/tree/Types.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/tree/Types.sol b/src/lib/tree/Types.sol index af376aac..ab37c990 100644 --- a/src/lib/tree/Types.sol +++ b/src/lib/tree/Types.sol @@ -2,7 +2,7 @@ pragma solidity ^0.8.19; /// @notice A representation of the Celestia-app namespace ID and its version. -/// More in here: https://github.com/celestiaorg/celestia-app/blob/main/docs/architecture/adr-014-versioned-namespaces.md +/// See: https://celestiaorg.github.io/celestia-app/specs/namespace.html struct Namespace { // The namespace version. bytes1 version; From 282dac521a257b6601a651727a58600c0261467d Mon Sep 17 00:00:00 2001 From: root Date: Sat, 12 Aug 2023 21:26:45 +0000 Subject: [PATCH 4/8] chore: regenerate wrappers --- wrappers/QuantumGravityBridge.sol/wrapper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrappers/QuantumGravityBridge.sol/wrapper.go b/wrappers/QuantumGravityBridge.sol/wrapper.go index 64d2d43b..98e71511 100644 --- a/wrappers/QuantumGravityBridge.sol/wrapper.go +++ b/wrappers/QuantumGravityBridge.sol/wrapper.go @@ -58,7 +58,7 @@ type Validator struct { // WrappersMetaData contains all meta data concerning the Wrappers contract. var WrappersMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_powerThreshold\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_validatorSetHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InsufficientVotingPower\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDataRootTupleRootNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidValidatorSetNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MalformedCurrentValidatorSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SuppliedValidatorSetInvalid\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"dataRootTupleRoot\",\"type\":\"bytes32\"}],\"name\":\"DataRootTupleRootEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"powerThreshold\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"validatorSetHash\",\"type\":\"bytes32\"}],\"name\":\"ValidatorSetUpdatedEvent\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"state_dataRootTupleRoots\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_eventNonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_lastValidatorSetCheckpoint\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_powerThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_validatorSetNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_dataRootTupleRoot\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"power\",\"type\":\"uint256\"}],\"internalType\":\"structValidator[]\",\"name\":\"_currentValidatorSet\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structSignature[]\",\"name\":\"_sigs\",\"type\":\"tuple[]\"}],\"name\":\"submitDataRootTupleRoot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_oldNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_newPowerThreshold\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_newValidatorSetHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"power\",\"type\":\"uint256\"}],\"internalType\":\"structValidator[]\",\"name\":\"_currentValidatorSet\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structSignature[]\",\"name\":\"_sigs\",\"type\":\"tuple[]\"}],\"name\":\"updateValidatorSet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_tupleRootNonce\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"height\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"dataRoot\",\"type\":\"bytes32\"}],\"internalType\":\"structDataRootTuple\",\"name\":\"_tuple\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"sideNodes\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"key\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numLeaves\",\"type\":\"uint256\"}],\"internalType\":\"structBinaryMerkleProof\",\"name\":\"_proof\",\"type\":\"tuple\"}],\"name\":\"verifyAttestation\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x6080346100ed57601f61103b38819003918201601f1916830192916001600160401b0391828511848610176100d75781606092859260409788528339810103126100ed5781519183602082015191015191845192602084016918da1958dadc1bda5b9d60b21b815285878601528360608601528160808601526080855260a0850192858410908411176100d7577fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c94879460c09285875282519020886002556000558060015584520152a251610f4890816100f38239f35b634e487b7160e01b600052604160045260246000fd5b600080fdfe608060408181526004918236101561001657600080fd5b600092833560e01c91826305d85c131461039f575081631f3302a9146102545781635433218c14610237578163817f985b1461020f578163cdade866146101f0578163e23eb32614610093575063e5a2b5d21461007257600080fd5b3461008f578160031936011261008f576020906001549051908152f35b5080fd5b9050346101ec5760a03660031901126101ec578035916044359167ffffffffffffffff6064358181116101e8576100cd90369084016104cc565b90916084359081116101e4576100e69036908501610502565b916002549460015495600181018091116101d15789036101c3578382036101b55761011d61011483876105d4565b87602435610654565b8a54036101a757509261018f927f6614d037bde4905e31ca5ff05de61964c267f28b0320ed49e59f7d99752e1c4f979592879560209851898101906f0e8e4c2dce6c2c6e8d2dedc84c2e8c6d60831b82528c898201528960608201526060815261018681610533565b519020936106d7565b8460025584865260038352818187205551908152a280f35b8651630bbdaec960e11b8152fd5b865163c6617b7b60e01b8152fd5b865163e869766d60e01b8152fd5b634e487b7160e01b8b526011825260248bfd5b8780fd5b8680fd5b8280fd5b50503461008f578160031936011261008f576020906002549051908152f35b9050346101ec5760203660031901126101ec5760209282913581526003845220549051908152f35b50503461008f578160031936011261008f57602091549051908152f35b83833461008f576003199160803684011261035d578160231936011261035d57815167ffffffffffffffff948184018681118382101761038c57845260248035835260209660443588850152606435968188116103885760609088360301126103845785519460608601918683108184111761037257828852888501358181116101ec578901366023820112156101ec5785810135918211610360578160051b916103018c840186610581565b84528460808901928201019236841161035d575090848b9201905b83821061034e575050505095604491610345969786528101358886015201358584015235610a81565b90519015158152f35b8135815290820190820161031c565b80fd5b634e487b7160e01b8352604186528483fd5b634e487b7160e01b8252604185528382fd5b8480fd5b8580fd5b634e487b7160e01b845260418252602484fd5b848285346101ec5760c03660031901126101ec57813591604435906064359067ffffffffffffffff6084358181116101e4576103de90369084016104cc565b92909160a4359081116104c8576103f89036908301610502565b916002549a6001549b600181018091116104b5578a036104a9575082850361049b5761043061042786866105d4565b8c602435610654565b8a540361048d575091879899916104759361046d87897fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c9c610654565b9586936106d7565b8655816001558460025582519182526020820152a280f35b8751630bbdaec960e11b8152fd5b875163c6617b7b60e01b8152fd5b6368a35ffd60e11b8152fd5b634e487b7160e01b8c526011835260248cfd5b8880fd5b9181601f840112156104fd5782359167ffffffffffffffff83116104fd576020808501948460061b0101116104fd57565b600080fd5b9181601f840112156104fd5782359167ffffffffffffffff83116104fd57602080850194606085020101116104fd57565b6080810190811067ffffffffffffffff82111761054f57604052565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761054f57604052565b90601f8019910116810190811067ffffffffffffffff82111761054f57604052565b60010190816001116105b157565b634e487b7160e01b600052601160045260246000fd5b919082018092116105b157565b60409182518092602092838301958181850186895252606084019294600090815b84831061061a575050505050610614925003601f198101835282610581565b51902090565b919395509193863560018060a01b0381168091036101ec578582819260019452858a013586820152019701930190918795939694926105f5565b916040519160208301936918da1958dadc1bda5b9d60b21b85526040840152606083015260808201526080815260a0810181811067ffffffffffffffff82111761054f5760405251902090565b91908110156106b1576060020190565b634e487b7160e01b600052603260045260246000fd5b91908110156106b15760061b0190565b93919060009485935b828510610707575b505050505050106106f557565b60405163cabeb65560e01b8152600490fd5b909192939497969561071a868a876106a1565b6020908181013515908161083f575b8161082a575b506108235761073f8786866106c7565b6001600160a01b039035818116908190036104fd5761075f898d8a6106a1565b916107c66107be6040948551878101907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008252603c8b8183015281526107a481610565565b5190206107b08261084c565b8888840135930135916109cc565b91909161085a565b16036108135750906107e5916107dd8887876106c7565b0135906105c7565b9486861015610809575b60001981146105b1576001019392919097949596976106e0565b85969798506106e8565b51638baa579f60e01b8152600490fd5b50946107ef565b60ff91506108379061084c565b16153861072f565b6040810135159150610729565b3560ff811681036104fd5790565b60058110156109b6578061086b5750565b600181036108b85760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b600281036109055760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6003810361095d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b60041461096657565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311610a755760ff16601b81141580610a6a575b610a5e579160809493916020936040519384528484015260408301526060820152600093849182805260015afa15610a515781516001600160a01b03811615610a4b579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600490565b50601c811415610a04565b50505050600090600390565b916002548311610ac557610ac29260005260036020526040600020546020604051938051828601520151604084015260408352610abd83610565565b610b0d565b90565b505050600090565b906101009182039182116105b157565b6000198101919082116105b157565b919082039182116105b157565b80518210156106b15760209160051b010190565b6040820180519193909291600190818111610dd45750825151610dca575b6020830192835185511115610dbf576020610b5e93610b78604051610b6c81600098899586888401526021830190610e9d565b03601f198101835282610581565b60405191828092610e9d565b039060025afa15610db45782519481515115610d9c57829081958051925b610c97575b505160001991828201918211610c835703610c36575b8293925b610bc3575b50505050501490565b9091929394818601868111610c225783518051821015610c1a57610bf19291610beb91610af9565b51610ec8565b94848101809111610c06579392919083610bb5565b634e487b7160e01b84526011600452602484fd5b505094610bba565b634e487b7160e01b85526011600452602485fd5b9091939482515182870190878211610c8357811015610c785790610c5e610c65928551610af9565b5190610ec8565b94848101809111610c0657939190610bb1565b505050509250505090565b634e487b7160e01b86526011600452602486fd5b9091819793949697519387891b948515610d8857891c94858a1b95808704821490151715610d7457610cc990866105c7565b60001992818401918211610d52578551821015610d66575094865151928a01928a8411610d5257831015610d4457610d02908451610aec565b88831b1115610d3057610c5e610d19928751610af9565b965b868101809111610c8357959392919084610b96565b610beb610d3e928751610af9565b96610d1b565b505050505050509250505090565b634e487b7160e01b89526011600452602489fd5b949350509796949350610b9b565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b88526012600452602488fd5b519495949293505003610dae57501490565b91505090565b6040513d84823e3d90fd5b505050505050600090565b5050505050600090565b610de5845151916020860151610df4565b14610b2b575050505050600090565b909160005b60018481831b1015610e2557810180911115610df957634e487b7160e01b600052601160045260246000fd5b50929190926101009081039081116105b157610e4090610acd565b916001610e4c84610add565b1b91610e5783610add565b8111610e635750505090565b9192509060018303610e7757505050600190565b82610e88610e9494610e8e93610aec565b92610aec565b90610df4565b610ac2906105a3565b9081519160005b838110610eb5575050016000815290565b8060208092840101518185015201610ea4565b610ef560009160209360405191600160f81b868401526021830152604182015260418152610b6c81610533565b039060025afa15610f065760005190565b6040513d6000823e3d90fdfea2646970667358221220c5eafd1b52e7e8925aff6625b624db48c5f5d956a2951632f3cbe3b0a747051b64736f6c63430008140033", + Bin: "0x6080346100ed57601f61103b38819003918201601f1916830192916001600160401b0391828511848610176100d75781606092859260409788528339810103126100ed5781519183602082015191015191845192602084016918da1958dadc1bda5b9d60b21b815285878601528360608601528160808601526080855260a0850192858410908411176100d7577fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c94879460c09285875282519020886002556000558060015584520152a251610f4890816100f38239f35b634e487b7160e01b600052604160045260246000fd5b600080fdfe608060408181526004918236101561001657600080fd5b600092833560e01c91826305d85c131461039f575081631f3302a9146102545781635433218c14610237578163817f985b1461020f578163cdade866146101f0578163e23eb32614610093575063e5a2b5d21461007257600080fd5b3461008f578160031936011261008f576020906001549051908152f35b5080fd5b9050346101ec5760a03660031901126101ec578035916044359167ffffffffffffffff6064358181116101e8576100cd90369084016104cc565b90916084359081116101e4576100e69036908501610502565b916002549460015495600181018091116101d15789036101c3578382036101b55761011d61011483876105d4565b87602435610654565b8a54036101a757509261018f927f6614d037bde4905e31ca5ff05de61964c267f28b0320ed49e59f7d99752e1c4f979592879560209851898101906f0e8e4c2dce6c2c6e8d2dedc84c2e8c6d60831b82528c898201528960608201526060815261018681610533565b519020936106d7565b8460025584865260038352818187205551908152a280f35b8651630bbdaec960e11b8152fd5b865163c6617b7b60e01b8152fd5b865163e869766d60e01b8152fd5b634e487b7160e01b8b526011825260248bfd5b8780fd5b8680fd5b8280fd5b50503461008f578160031936011261008f576020906002549051908152f35b9050346101ec5760203660031901126101ec5760209282913581526003845220549051908152f35b50503461008f578160031936011261008f57602091549051908152f35b83833461008f576003199160803684011261035d578160231936011261035d57815167ffffffffffffffff948184018681118382101761038c57845260248035835260209660443588850152606435968188116103885760609088360301126103845785519460608601918683108184111761037257828852888501358181116101ec578901366023820112156101ec5785810135918211610360578160051b916103018c840186610581565b84528460808901928201019236841161035d575090848b9201905b83821061034e575050505095604491610345969786528101358886015201358584015235610a81565b90519015158152f35b8135815290820190820161031c565b80fd5b634e487b7160e01b8352604186528483fd5b634e487b7160e01b8252604185528382fd5b8480fd5b8580fd5b634e487b7160e01b845260418252602484fd5b848285346101ec5760c03660031901126101ec57813591604435906064359067ffffffffffffffff6084358181116101e4576103de90369084016104cc565b92909160a4359081116104c8576103f89036908301610502565b916002549a6001549b600181018091116104b5578a036104a9575082850361049b5761043061042786866105d4565b8c602435610654565b8a540361048d575091879899916104759361046d87897fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c9c610654565b9586936106d7565b8655816001558460025582519182526020820152a280f35b8751630bbdaec960e11b8152fd5b875163c6617b7b60e01b8152fd5b6368a35ffd60e11b8152fd5b634e487b7160e01b8c526011835260248cfd5b8880fd5b9181601f840112156104fd5782359167ffffffffffffffff83116104fd576020808501948460061b0101116104fd57565b600080fd5b9181601f840112156104fd5782359167ffffffffffffffff83116104fd57602080850194606085020101116104fd57565b6080810190811067ffffffffffffffff82111761054f57604052565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761054f57604052565b90601f8019910116810190811067ffffffffffffffff82111761054f57604052565b60010190816001116105b157565b634e487b7160e01b600052601160045260246000fd5b919082018092116105b157565b60409182518092602092838301958181850186895252606084019294600090815b84831061061a575050505050610614925003601f198101835282610581565b51902090565b919395509193863560018060a01b0381168091036101ec578582819260019452858a013586820152019701930190918795939694926105f5565b916040519160208301936918da1958dadc1bda5b9d60b21b85526040840152606083015260808201526080815260a0810181811067ffffffffffffffff82111761054f5760405251902090565b91908110156106b1576060020190565b634e487b7160e01b600052603260045260246000fd5b91908110156106b15760061b0190565b93919060009485935b828510610707575b505050505050106106f557565b60405163cabeb65560e01b8152600490fd5b909192939497969561071a868a876106a1565b6020908181013515908161083f575b8161082a575b506108235761073f8786866106c7565b6001600160a01b039035818116908190036104fd5761075f898d8a6106a1565b916107c66107be6040948551878101907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008252603c8b8183015281526107a481610565565b5190206107b08261084c565b8888840135930135916109cc565b91909161085a565b16036108135750906107e5916107dd8887876106c7565b0135906105c7565b9486861015610809575b60001981146105b1576001019392919097949596976106e0565b85969798506106e8565b51638baa579f60e01b8152600490fd5b50946107ef565b60ff91506108379061084c565b16153861072f565b6040810135159150610729565b3560ff811681036104fd5790565b60058110156109b6578061086b5750565b600181036108b85760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b600281036109055760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6003810361095d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b60041461096657565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311610a755760ff16601b81141580610a6a575b610a5e579160809493916020936040519384528484015260408301526060820152600093849182805260015afa15610a515781516001600160a01b03811615610a4b579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600490565b50601c811415610a04565b50505050600090600390565b916002548311610ac557610ac29260005260036020526040600020546020604051938051828601520151604084015260408352610abd83610565565b610b0d565b90565b505050600090565b906101009182039182116105b157565b6000198101919082116105b157565b919082039182116105b157565b80518210156106b15760209160051b010190565b6040820180519193909291600190818111610dd45750825151610dca575b6020830192835185511115610dbf576020610b5e93610b78604051610b6c81600098899586888401526021830190610e9d565b03601f198101835282610581565b60405191828092610e9d565b039060025afa15610db45782519481515115610d9c57829081958051925b610c97575b505160001991828201918211610c835703610c36575b8293925b610bc3575b50505050501490565b9091929394818601868111610c225783518051821015610c1a57610bf19291610beb91610af9565b51610ec8565b94848101809111610c06579392919083610bb5565b634e487b7160e01b84526011600452602484fd5b505094610bba565b634e487b7160e01b85526011600452602485fd5b9091939482515182870190878211610c8357811015610c785790610c5e610c65928551610af9565b5190610ec8565b94848101809111610c0657939190610bb1565b505050509250505090565b634e487b7160e01b86526011600452602486fd5b9091819793949697519387891b948515610d8857891c94858a1b95808704821490151715610d7457610cc990866105c7565b60001992818401918211610d52578551821015610d66575094865151928a01928a8411610d5257831015610d4457610d02908451610aec565b88831b1115610d3057610c5e610d19928751610af9565b965b868101809111610c8357959392919084610b96565b610beb610d3e928751610af9565b96610d1b565b505050505050509250505090565b634e487b7160e01b89526011600452602489fd5b949350509796949350610b9b565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b88526012600452602488fd5b519495949293505003610dae57501490565b91505090565b6040513d84823e3d90fd5b505050505050600090565b5050505050600090565b610de5845151916020860151610df4565b14610b2b575050505050600090565b909160005b60018481831b1015610e2557810180911115610df957634e487b7160e01b600052601160045260246000fd5b50929190926101009081039081116105b157610e4090610acd565b916001610e4c84610add565b1b91610e5783610add565b8111610e635750505090565b9192509060018303610e7757505050600190565b82610e88610e9494610e8e93610aec565b92610aec565b90610df4565b610ac2906105a3565b9081519160005b838110610eb5575050016000815290565b8060208092840101518185015201610ea4565b610ef560009160209360405191600160f81b868401526021830152604182015260418152610b6c81610533565b039060025afa15610f065760005190565b6040513d6000823e3d90fdfea2646970667358221220ae66a137e3d735c0e92c2bc293b85e068d9fbfb0c94cd746406d6b047afe377964736f6c63430008140033", } // WrappersABI is the input ABI used to generate the binding from. From 30947ffb82efb6eaad18683fcf28217a3b39a5ba Mon Sep 17 00:00:00 2001 From: rachid Date: Wed, 23 Aug 2023 15:55:11 +0200 Subject: [PATCH 5/8] chore: fmt --- src/lib/verifier/test/DAVerifier.t.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/verifier/test/DAVerifier.t.sol b/src/lib/verifier/test/DAVerifier.t.sol index 756b2b5a..71436a38 100644 --- a/src/lib/verifier/test/DAVerifier.t.sol +++ b/src/lib/verifier/test/DAVerifier.t.sol @@ -284,7 +284,6 @@ contract TestFixture { return Namespace(0x00, 0x00000000000000000000000000000000000000000000000000000001); } - /// @notice the data root tuple of the block containing the token transfer transaction. function getDataRootTuple() public view returns (DataRootTuple memory) { return DataRootTuple(height, dataRoot); From 354aadf24a74f855f6a3d4b9062e4c8cfa81884c Mon Sep 17 00:00:00 2001 From: rachid Date: Thu, 7 Sep 2023 13:18:30 +0200 Subject: [PATCH 6/8] chore: remove unnecessary constant --- src/lib/tree/Constants.sol | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/lib/tree/Constants.sol b/src/lib/tree/Constants.sol index 7410c0f4..9534dd3f 100644 --- a/src/lib/tree/Constants.sol +++ b/src/lib/tree/Constants.sol @@ -14,10 +14,6 @@ library Constants { /// @dev The prefixes of leaves and nodes bytes1 internal constant LEAF_PREFIX = 0x00; bytes1 internal constant NODE_PREFIX = 0x01; - - /// @dev Parity share namespace in bytes. - bytes29 internal constant PARITY_SHARE_NAMESPACE_BYTES = - 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; } /// @dev Parity share namespace. From 55167a1e9561000e775cbaf314c18a5c93e026b0 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 7 Sep 2023 13:29:30 +0000 Subject: [PATCH 7/8] chore: regenerate wrappers --- wrappers/QuantumGravityBridge.sol/wrapper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrappers/QuantumGravityBridge.sol/wrapper.go b/wrappers/QuantumGravityBridge.sol/wrapper.go index 98e71511..7e1331e9 100644 --- a/wrappers/QuantumGravityBridge.sol/wrapper.go +++ b/wrappers/QuantumGravityBridge.sol/wrapper.go @@ -58,7 +58,7 @@ type Validator struct { // WrappersMetaData contains all meta data concerning the Wrappers contract. var WrappersMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_powerThreshold\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_validatorSetHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"InsufficientVotingPower\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDataRootTupleRootNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidValidatorSetNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MalformedCurrentValidatorSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SuppliedValidatorSetInvalid\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"dataRootTupleRoot\",\"type\":\"bytes32\"}],\"name\":\"DataRootTupleRootEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"powerThreshold\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"validatorSetHash\",\"type\":\"bytes32\"}],\"name\":\"ValidatorSetUpdatedEvent\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"state_dataRootTupleRoots\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_eventNonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_lastValidatorSetCheckpoint\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_powerThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_validatorSetNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_dataRootTupleRoot\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"power\",\"type\":\"uint256\"}],\"internalType\":\"structValidator[]\",\"name\":\"_currentValidatorSet\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structSignature[]\",\"name\":\"_sigs\",\"type\":\"tuple[]\"}],\"name\":\"submitDataRootTupleRoot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_oldNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_newPowerThreshold\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_newValidatorSetHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"power\",\"type\":\"uint256\"}],\"internalType\":\"structValidator[]\",\"name\":\"_currentValidatorSet\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structSignature[]\",\"name\":\"_sigs\",\"type\":\"tuple[]\"}],\"name\":\"updateValidatorSet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_tupleRootNonce\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"height\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"dataRoot\",\"type\":\"bytes32\"}],\"internalType\":\"structDataRootTuple\",\"name\":\"_tuple\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"sideNodes\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"key\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numLeaves\",\"type\":\"uint256\"}],\"internalType\":\"structBinaryMerkleProof\",\"name\":\"_proof\",\"type\":\"tuple\"}],\"name\":\"verifyAttestation\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x6080346100ed57601f61103b38819003918201601f1916830192916001600160401b0391828511848610176100d75781606092859260409788528339810103126100ed5781519183602082015191015191845192602084016918da1958dadc1bda5b9d60b21b815285878601528360608601528160808601526080855260a0850192858410908411176100d7577fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c94879460c09285875282519020886002556000558060015584520152a251610f4890816100f38239f35b634e487b7160e01b600052604160045260246000fd5b600080fdfe608060408181526004918236101561001657600080fd5b600092833560e01c91826305d85c131461039f575081631f3302a9146102545781635433218c14610237578163817f985b1461020f578163cdade866146101f0578163e23eb32614610093575063e5a2b5d21461007257600080fd5b3461008f578160031936011261008f576020906001549051908152f35b5080fd5b9050346101ec5760a03660031901126101ec578035916044359167ffffffffffffffff6064358181116101e8576100cd90369084016104cc565b90916084359081116101e4576100e69036908501610502565b916002549460015495600181018091116101d15789036101c3578382036101b55761011d61011483876105d4565b87602435610654565b8a54036101a757509261018f927f6614d037bde4905e31ca5ff05de61964c267f28b0320ed49e59f7d99752e1c4f979592879560209851898101906f0e8e4c2dce6c2c6e8d2dedc84c2e8c6d60831b82528c898201528960608201526060815261018681610533565b519020936106d7565b8460025584865260038352818187205551908152a280f35b8651630bbdaec960e11b8152fd5b865163c6617b7b60e01b8152fd5b865163e869766d60e01b8152fd5b634e487b7160e01b8b526011825260248bfd5b8780fd5b8680fd5b8280fd5b50503461008f578160031936011261008f576020906002549051908152f35b9050346101ec5760203660031901126101ec5760209282913581526003845220549051908152f35b50503461008f578160031936011261008f57602091549051908152f35b83833461008f576003199160803684011261035d578160231936011261035d57815167ffffffffffffffff948184018681118382101761038c57845260248035835260209660443588850152606435968188116103885760609088360301126103845785519460608601918683108184111761037257828852888501358181116101ec578901366023820112156101ec5785810135918211610360578160051b916103018c840186610581565b84528460808901928201019236841161035d575090848b9201905b83821061034e575050505095604491610345969786528101358886015201358584015235610a81565b90519015158152f35b8135815290820190820161031c565b80fd5b634e487b7160e01b8352604186528483fd5b634e487b7160e01b8252604185528382fd5b8480fd5b8580fd5b634e487b7160e01b845260418252602484fd5b848285346101ec5760c03660031901126101ec57813591604435906064359067ffffffffffffffff6084358181116101e4576103de90369084016104cc565b92909160a4359081116104c8576103f89036908301610502565b916002549a6001549b600181018091116104b5578a036104a9575082850361049b5761043061042786866105d4565b8c602435610654565b8a540361048d575091879899916104759361046d87897fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c9c610654565b9586936106d7565b8655816001558460025582519182526020820152a280f35b8751630bbdaec960e11b8152fd5b875163c6617b7b60e01b8152fd5b6368a35ffd60e11b8152fd5b634e487b7160e01b8c526011835260248cfd5b8880fd5b9181601f840112156104fd5782359167ffffffffffffffff83116104fd576020808501948460061b0101116104fd57565b600080fd5b9181601f840112156104fd5782359167ffffffffffffffff83116104fd57602080850194606085020101116104fd57565b6080810190811067ffffffffffffffff82111761054f57604052565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761054f57604052565b90601f8019910116810190811067ffffffffffffffff82111761054f57604052565b60010190816001116105b157565b634e487b7160e01b600052601160045260246000fd5b919082018092116105b157565b60409182518092602092838301958181850186895252606084019294600090815b84831061061a575050505050610614925003601f198101835282610581565b51902090565b919395509193863560018060a01b0381168091036101ec578582819260019452858a013586820152019701930190918795939694926105f5565b916040519160208301936918da1958dadc1bda5b9d60b21b85526040840152606083015260808201526080815260a0810181811067ffffffffffffffff82111761054f5760405251902090565b91908110156106b1576060020190565b634e487b7160e01b600052603260045260246000fd5b91908110156106b15760061b0190565b93919060009485935b828510610707575b505050505050106106f557565b60405163cabeb65560e01b8152600490fd5b909192939497969561071a868a876106a1565b6020908181013515908161083f575b8161082a575b506108235761073f8786866106c7565b6001600160a01b039035818116908190036104fd5761075f898d8a6106a1565b916107c66107be6040948551878101907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008252603c8b8183015281526107a481610565565b5190206107b08261084c565b8888840135930135916109cc565b91909161085a565b16036108135750906107e5916107dd8887876106c7565b0135906105c7565b9486861015610809575b60001981146105b1576001019392919097949596976106e0565b85969798506106e8565b51638baa579f60e01b8152600490fd5b50946107ef565b60ff91506108379061084c565b16153861072f565b6040810135159150610729565b3560ff811681036104fd5790565b60058110156109b6578061086b5750565b600181036108b85760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b600281036109055760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6003810361095d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b60041461096657565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311610a755760ff16601b81141580610a6a575b610a5e579160809493916020936040519384528484015260408301526060820152600093849182805260015afa15610a515781516001600160a01b03811615610a4b579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600490565b50601c811415610a04565b50505050600090600390565b916002548311610ac557610ac29260005260036020526040600020546020604051938051828601520151604084015260408352610abd83610565565b610b0d565b90565b505050600090565b906101009182039182116105b157565b6000198101919082116105b157565b919082039182116105b157565b80518210156106b15760209160051b010190565b6040820180519193909291600190818111610dd45750825151610dca575b6020830192835185511115610dbf576020610b5e93610b78604051610b6c81600098899586888401526021830190610e9d565b03601f198101835282610581565b60405191828092610e9d565b039060025afa15610db45782519481515115610d9c57829081958051925b610c97575b505160001991828201918211610c835703610c36575b8293925b610bc3575b50505050501490565b9091929394818601868111610c225783518051821015610c1a57610bf19291610beb91610af9565b51610ec8565b94848101809111610c06579392919083610bb5565b634e487b7160e01b84526011600452602484fd5b505094610bba565b634e487b7160e01b85526011600452602485fd5b9091939482515182870190878211610c8357811015610c785790610c5e610c65928551610af9565b5190610ec8565b94848101809111610c0657939190610bb1565b505050509250505090565b634e487b7160e01b86526011600452602486fd5b9091819793949697519387891b948515610d8857891c94858a1b95808704821490151715610d7457610cc990866105c7565b60001992818401918211610d52578551821015610d66575094865151928a01928a8411610d5257831015610d4457610d02908451610aec565b88831b1115610d3057610c5e610d19928751610af9565b965b868101809111610c8357959392919084610b96565b610beb610d3e928751610af9565b96610d1b565b505050505050509250505090565b634e487b7160e01b89526011600452602489fd5b949350509796949350610b9b565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b88526012600452602488fd5b519495949293505003610dae57501490565b91505090565b6040513d84823e3d90fd5b505050505050600090565b5050505050600090565b610de5845151916020860151610df4565b14610b2b575050505050600090565b909160005b60018481831b1015610e2557810180911115610df957634e487b7160e01b600052601160045260246000fd5b50929190926101009081039081116105b157610e4090610acd565b916001610e4c84610add565b1b91610e5783610add565b8111610e635750505090565b9192509060018303610e7757505050600190565b82610e88610e9494610e8e93610aec565b92610aec565b90610df4565b610ac2906105a3565b9081519160005b838110610eb5575050016000815290565b8060208092840101518185015201610ea4565b610ef560009160209360405191600160f81b868401526021830152604182015260418152610b6c81610533565b039060025afa15610f065760005190565b6040513d6000823e3d90fdfea2646970667358221220ae66a137e3d735c0e92c2bc293b85e068d9fbfb0c94cd746406d6b047afe377964736f6c63430008140033", + Bin: "0x6080346100ed57601f61103b38819003918201601f1916830192916001600160401b0391828511848610176100d75781606092859260409788528339810103126100ed5781519183602082015191015191845192602084016918da1958dadc1bda5b9d60b21b815285878601528360608601528160808601526080855260a0850192858410908411176100d7577fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c94879460c09285875282519020886002556000558060015584520152a251610f4890816100f38239f35b634e487b7160e01b600052604160045260246000fd5b600080fdfe608060408181526004918236101561001657600080fd5b600092833560e01c91826305d85c131461039f575081631f3302a9146102545781635433218c14610237578163817f985b1461020f578163cdade866146101f0578163e23eb32614610093575063e5a2b5d21461007257600080fd5b3461008f578160031936011261008f576020906001549051908152f35b5080fd5b9050346101ec5760a03660031901126101ec578035916044359167ffffffffffffffff6064358181116101e8576100cd90369084016104cc565b90916084359081116101e4576100e69036908501610502565b916002549460015495600181018091116101d15789036101c3578382036101b55761011d61011483876105d4565b87602435610654565b8a54036101a757509261018f927f6614d037bde4905e31ca5ff05de61964c267f28b0320ed49e59f7d99752e1c4f979592879560209851898101906f0e8e4c2dce6c2c6e8d2dedc84c2e8c6d60831b82528c898201528960608201526060815261018681610533565b519020936106d7565b8460025584865260038352818187205551908152a280f35b8651630bbdaec960e11b8152fd5b865163c6617b7b60e01b8152fd5b865163e869766d60e01b8152fd5b634e487b7160e01b8b526011825260248bfd5b8780fd5b8680fd5b8280fd5b50503461008f578160031936011261008f576020906002549051908152f35b9050346101ec5760203660031901126101ec5760209282913581526003845220549051908152f35b50503461008f578160031936011261008f57602091549051908152f35b83833461008f576003199160803684011261035d578160231936011261035d57815167ffffffffffffffff948184018681118382101761038c57845260248035835260209660443588850152606435968188116103885760609088360301126103845785519460608601918683108184111761037257828852888501358181116101ec578901366023820112156101ec5785810135918211610360578160051b916103018c840186610581565b84528460808901928201019236841161035d575090848b9201905b83821061034e575050505095604491610345969786528101358886015201358584015235610a81565b90519015158152f35b8135815290820190820161031c565b80fd5b634e487b7160e01b8352604186528483fd5b634e487b7160e01b8252604185528382fd5b8480fd5b8580fd5b634e487b7160e01b845260418252602484fd5b848285346101ec5760c03660031901126101ec57813591604435906064359067ffffffffffffffff6084358181116101e4576103de90369084016104cc565b92909160a4359081116104c8576103f89036908301610502565b916002549a6001549b600181018091116104b5578a036104a9575082850361049b5761043061042786866105d4565b8c602435610654565b8a540361048d575091879899916104759361046d87897fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c9c610654565b9586936106d7565b8655816001558460025582519182526020820152a280f35b8751630bbdaec960e11b8152fd5b875163c6617b7b60e01b8152fd5b6368a35ffd60e11b8152fd5b634e487b7160e01b8c526011835260248cfd5b8880fd5b9181601f840112156104fd5782359167ffffffffffffffff83116104fd576020808501948460061b0101116104fd57565b600080fd5b9181601f840112156104fd5782359167ffffffffffffffff83116104fd57602080850194606085020101116104fd57565b6080810190811067ffffffffffffffff82111761054f57604052565b634e487b7160e01b600052604160045260246000fd5b6060810190811067ffffffffffffffff82111761054f57604052565b90601f8019910116810190811067ffffffffffffffff82111761054f57604052565b60010190816001116105b157565b634e487b7160e01b600052601160045260246000fd5b919082018092116105b157565b60409182518092602092838301958181850186895252606084019294600090815b84831061061a575050505050610614925003601f198101835282610581565b51902090565b919395509193863560018060a01b0381168091036101ec578582819260019452858a013586820152019701930190918795939694926105f5565b916040519160208301936918da1958dadc1bda5b9d60b21b85526040840152606083015260808201526080815260a0810181811067ffffffffffffffff82111761054f5760405251902090565b91908110156106b1576060020190565b634e487b7160e01b600052603260045260246000fd5b91908110156106b15760061b0190565b93919060009485935b828510610707575b505050505050106106f557565b60405163cabeb65560e01b8152600490fd5b909192939497969561071a868a876106a1565b6020908181013515908161083f575b8161082a575b506108235761073f8786866106c7565b6001600160a01b039035818116908190036104fd5761075f898d8a6106a1565b916107c66107be6040948551878101907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008252603c8b8183015281526107a481610565565b5190206107b08261084c565b8888840135930135916109cc565b91909161085a565b16036108135750906107e5916107dd8887876106c7565b0135906105c7565b9486861015610809575b60001981146105b1576001019392919097949596976106e0565b85969798506106e8565b51638baa579f60e01b8152600490fd5b50946107ef565b60ff91506108379061084c565b16153861072f565b6040810135159150610729565b3560ff811681036104fd5790565b60058110156109b6578061086b5750565b600181036108b85760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b600281036109055760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b6003810361095d5760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b60041461096657565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311610a755760ff16601b81141580610a6a575b610a5e579160809493916020936040519384528484015260408301526060820152600093849182805260015afa15610a515781516001600160a01b03811615610a4b579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600490565b50601c811415610a04565b50505050600090600390565b916002548311610ac557610ac29260005260036020526040600020546020604051938051828601520151604084015260408352610abd83610565565b610b0d565b90565b505050600090565b906101009182039182116105b157565b6000198101919082116105b157565b919082039182116105b157565b80518210156106b15760209160051b010190565b6040820180519193909291600190818111610dd45750825151610dca575b6020830192835185511115610dbf576020610b5e93610b78604051610b6c81600098899586888401526021830190610e9d565b03601f198101835282610581565b60405191828092610e9d565b039060025afa15610db45782519481515115610d9c57829081958051925b610c97575b505160001991828201918211610c835703610c36575b8293925b610bc3575b50505050501490565b9091929394818601868111610c225783518051821015610c1a57610bf19291610beb91610af9565b51610ec8565b94848101809111610c06579392919083610bb5565b634e487b7160e01b84526011600452602484fd5b505094610bba565b634e487b7160e01b85526011600452602485fd5b9091939482515182870190878211610c8357811015610c785790610c5e610c65928551610af9565b5190610ec8565b94848101809111610c0657939190610bb1565b505050509250505090565b634e487b7160e01b86526011600452602486fd5b9091819793949697519387891b948515610d8857891c94858a1b95808704821490151715610d7457610cc990866105c7565b60001992818401918211610d52578551821015610d66575094865151928a01928a8411610d5257831015610d4457610d02908451610aec565b88831b1115610d3057610c5e610d19928751610af9565b965b868101809111610c8357959392919084610b96565b610beb610d3e928751610af9565b96610d1b565b505050505050509250505090565b634e487b7160e01b89526011600452602489fd5b949350509796949350610b9b565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b88526012600452602488fd5b519495949293505003610dae57501490565b91505090565b6040513d84823e3d90fd5b505050505050600090565b5050505050600090565b610de5845151916020860151610df4565b14610b2b575050505050600090565b909160005b60018481831b1015610e2557810180911115610df957634e487b7160e01b600052601160045260246000fd5b50929190926101009081039081116105b157610e4090610acd565b916001610e4c84610add565b1b91610e5783610add565b8111610e635750505090565b9192509060018303610e7757505050600190565b82610e88610e9494610e8e93610aec565b92610aec565b90610df4565b610ac2906105a3565b9081519160005b838110610eb5575050016000815290565b8060208092840101518185015201610ea4565b610ef560009160209360405191600160f81b868401526021830152604182015260418152610b6c81610533565b039060025afa15610f065760005190565b6040513d6000823e3d90fdfea26469706673582212202c5d35c7bb3bb578fede52ac7eb4c386666b5078f485642ac26db669c7c9fd7264736f6c63430008140033", } // WrappersABI is the input ABI used to generate the binding from. From f9b264b0d22dfff0ad98e6b85baad838a2fe6fce Mon Sep 17 00:00:00 2001 From: root Date: Fri, 8 Sep 2023 10:26:10 +0000 Subject: [PATCH 8/8] chore: regenerate wrapper --- wrappers/QuantumGravityBridge.sol/wrapper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrappers/QuantumGravityBridge.sol/wrapper.go b/wrappers/QuantumGravityBridge.sol/wrapper.go index e213af29..c07a0f32 100644 --- a/wrappers/QuantumGravityBridge.sol/wrapper.go +++ b/wrappers/QuantumGravityBridge.sol/wrapper.go @@ -58,7 +58,7 @@ type Validator struct { // WrappersMetaData contains all meta data concerning the Wrappers contract. var WrappersMetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"target\",\"type\":\"address\"}],\"name\":\"AddressEmptyCode\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"ERC1967InvalidImplementation\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"ERC1967NonPayable\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"FailedInnerCall\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InsufficientVotingPower\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidDataRootTupleRootNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidSignature\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"InvalidValidatorSetNonce\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"MalformedCurrentValidatorSet\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"SuppliedValidatorSetInvalid\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"UUPSUnauthorizedCallContext\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"slot\",\"type\":\"bytes32\"}],\"name\":\"UUPSUnsupportedProxiableUUID\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"dataRootTupleRoot\",\"type\":\"bytes32\"}],\"name\":\"DataRootTupleRootEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"powerThreshold\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"validatorSetHash\",\"type\":\"bytes32\"}],\"name\":\"ValidatorSetUpdatedEvent\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"UPGRADE_INTERFACE_VERSION\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_powerThreshold\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_validatorSetHash\",\"type\":\"bytes32\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"state_dataRootTupleRoots\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_eventNonce\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_lastValidatorSetCheckpoint\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state_powerThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_validatorSetNonce\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_dataRootTupleRoot\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"power\",\"type\":\"uint256\"}],\"internalType\":\"structValidator[]\",\"name\":\"_currentValidatorSet\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structSignature[]\",\"name\":\"_sigs\",\"type\":\"tuple[]\"}],\"name\":\"submitDataRootTupleRoot\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_newNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_oldNonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_newPowerThreshold\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"_newValidatorSetHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"power\",\"type\":\"uint256\"}],\"internalType\":\"structValidator[]\",\"name\":\"_currentValidatorSet\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"internalType\":\"structSignature[]\",\"name\":\"_sigs\",\"type\":\"tuple[]\"}],\"name\":\"updateValidatorSet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_tupleRootNonce\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"height\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"dataRoot\",\"type\":\"bytes32\"}],\"internalType\":\"structDataRootTuple\",\"name\":\"_tuple\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32[]\",\"name\":\"sideNodes\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint256\",\"name\":\"key\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"numLeaves\",\"type\":\"uint256\"}],\"internalType\":\"structBinaryMerkleProof\",\"name\":\"_proof\",\"type\":\"tuple\"}],\"name\":\"verifyAttestation\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", - Bin: "0x60a0806040523461002a573060805261169a9081610030823960805181818161041501526104f30152f35b600080fdfe6080604081815260048036101561001557600080fd5b600092833560e01c90816305d85c13146109a0575080631f3302a91461085c578063226fe7be146106de5780634f1ef2861461047957806352d1902d146104005780635433218c146103e1578063715018a614610384578063817f985b1461035d5780638da5cb5b14610334578063ad3cb1cc146102af578063cdade86614610290578063e23eb32614610138578063e5a2b5d2146101155763f2fde38b146100bd57600080fd5b34610111576020366003190112610111576100d6610ba0565b916100df610bf4565b6001600160a01b038316156100fb57836100f884610c20565b80f35b51631e4fbdf760e01b8152908101839052602490fd5b8280fd5b5050346101345781600319360112610134576020906097549051908152f35b5080fd5b50346101115760a036600319011261011157803591604435916001600160401b0360643581811161028c576101709036908401610ace565b9091608435908111610288576101899036908501610b03565b9160985494609754956001810180911161027557890361026757838203610259576101c06101b78387610d8a565b87602435610d0d565b6096540361024b575092610233927f6614d037bde4905e31ca5ff05de61964c267f28b0320ed49e59f7d99752e1c4f979592879560209851898101906f0e8e4c2dce6c2c6e8d2dedc84c2e8c6d60831b82528c898201528960608201526060815261022a81610b33565b51902093610e40565b8460985584865260998352818187205551908152a280f35b8651630bbdaec960e11b8152fd5b865163c6617b7b60e01b8152fd5b865163e869766d60e01b8152fd5b634e487b7160e01b8b526011825260248bfd5b8780fd5b8680fd5b5050346101345781600319360112610134576020906098549051908152f35b509134610331578060031936011261033157815190828201908282106001600160401b0383111761031e5750610310935082526005815260208101640352e302e360dc1b815282519384926020845251809281602086015285850190610bd1565b601f01601f19168101030190f35b634e487b7160e01b815260418552602490fd5b80fd5b50503461013457816003193601126101345760645490516001600160a01b039091168152602090f35b50346101115760203660031901126101115760209282913581526099845220549051908152f35b833461033157806003193601126103315761039d610bf4565b606480546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5050346101345781600319360112610134576020906096549051908152f35b509134610331578060031936011261033157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316300361046c57602090517f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8152f35b5163703e46dd60e11b8152fd5b5090806003193601126101115761048e610ba0565b9060249384356001600160401b038111610134573660238201121561013457808501356104ba81610bb6565b946104c785519687610b7f565b81865260209182870193368a83830101116106da578186928b8693018737880101526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081163081149081156106ac575b5061069c5761052c610bf4565b81169585516352d1902d60e01b815283818a818b5afa86918161066d575b50610566575050505050505191634c9c8ce360e01b8352820152fd5b9088888894938c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc918281036106585750853b15610644575080546001600160a01b031916821790558451889392917fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8580a28251156106265750506106189582915190845af4913d1561061c573d61060a61060182610bb6565b92519283610b7f565b81528581943d92013e610c69565b5080f35b5060609250610c69565b95509550505050503461063857505080f35b63b398979f60e01b8152fd5b8651634c9c8ce360e01b8152808501849052fd5b8751632a87526960e21b815280860191909152fd5b9091508481813d8311610695575b6106858183610b7f565b8101031261028c5751903861054a565b503d61067b565b855163703e46dd60e11b81528890fd5b9050817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541614153861051f565b8580fd5b50346101115760603660031901126101115780359060243591604435927ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e93845460ff81881c161594858096610849575b1580610826575b61081957509186917fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c938660016001600160401b031983161789556107fa575b50610782818387610d0d565b8560985560965581609755610795610ccc565b61079d610ccc565b6107a633610c20565b82519182526020820152a26107b9578280f35b805468ff00000000000000001916905551600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a138808280f35b68ffffffffffffffffff19166801000000000000000117875538610776565b875162dc149f60e41b8152fd5b50303b1580610836575b15610736565b5060016001600160401b03831614610830565b5060016001600160401b0383161061072f565b50919034610134576003199160803684011261033157816023193601126103315781516001600160401b03948184018681118382101761098d57845260248035835260209660443588850152606435968188116106da576060908836030112610989578551946060860191868310818411176109775782885288850135818111610111578901366023820112156101115785810135918211610965578160051b916109098c840186610b7f565b845284608089019282010192368411610331575090848b9201905b83821061095657505050509560449161094d9697865281013588860152013585840152356111ea565b90519015158152f35b81358152908201908201610924565b634e487b7160e01b8352604186528483fd5b634e487b7160e01b8252604185528382fd5b8480fd5b634e487b7160e01b845260418252602484fd5b848385346101115760c03660031901126101115781359160443590606435906001600160401b03608435818111610288576109de9036908401610ace565b92909160a435908111610aca576109f89036908301610b03565b916098549a6097549b60018101809111610ab7578a03610aab5750828503610a9d57610a30610a278686610d8a565b8c602435610d0d565b60965403610a8f57509187989991610a7693610a6e87897fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c9c610d0d565b958693610e40565b609655816097558460985582519182526020820152a280f35b8751630bbdaec960e11b8152fd5b875163c6617b7b60e01b8152fd5b6368a35ffd60e11b8152fd5b634e487b7160e01b8c526011835260248cfd5b8880fd5b9181601f84011215610afe578235916001600160401b038311610afe576020808501948460061b010111610afe57565b600080fd5b9181601f84011215610afe578235916001600160401b038311610afe5760208085019460608502010111610afe57565b608081019081106001600160401b03821117610b4e57604052565b634e487b7160e01b600052604160045260246000fd5b606081019081106001600160401b03821117610b4e57604052565b90601f801991011681019081106001600160401b03821117610b4e57604052565b600435906001600160a01b0382168203610afe57565b6001600160401b038111610b4e57601f01601f191660200190565b60005b838110610be45750506000910152565b8181015183820152602001610bd4565b6064546001600160a01b03163303610c0857565b60405163118cdaa760e01b8152336004820152602490fd5b606480546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b90610c905750805115610c7e57805190602001fd5b604051630a12f52160e11b8152600490fd5b81511580610cc3575b610ca1575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b15610c99565b60ff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e5460401c1615610cfb57565b604051631afcd79f60e31b8152600490fd5b916040519160208301936918da1958dadc1bda5b9d60b21b85526040840152606083015260808201526080815260a081018181106001600160401b03821117610b4e5760405251902090565b6001019081600111610d6757565b634e487b7160e01b600052601160045260246000fd5b91908201809211610d6757565b60409182518092602092838301958181850186895252606084019294600090815b848310610dd0575050505050610dca925003601f198101835282610b7f565b51902090565b919395509193863560018060a01b038116809103610111578582819260019452858a01358682015201970193019091879593969492610dab565b9190811015610e1a576060020190565b634e487b7160e01b600052603260045260246000fd5b9190811015610e1a5760061b0190565b93919060009485935b828510610e70575b50505050505010610e5e57565b60405163cabeb65560e01b8152600490fd5b9091929394979695610e83868a87610e0a565b60209081810135159081610fa8575b81610f93575b50610f8c57610ea8878686610e30565b6001600160a01b03903581811690819003610afe57610ec8898d8a610e0a565b91610f2f610f276040948551878101907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008252603c8b818301528152610f0d81610b64565b519020610f1982610fb5565b888884013593013591611135565b919091610fc3565b1603610f7c575090610f4e91610f46888787610e30565b013590610d7d565b9486861015610f72575b6000198114610d6757600101939291909794959697610e49565b8596979850610e51565b51638baa579f60e01b8152600490fd5b5094610f58565b60ff9150610fa090610fb5565b161538610e98565b6040810135159150610e92565b3560ff81168103610afe5790565b600581101561111f5780610fd45750565b600181036110215760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b6002810361106e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b600381036110c65760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b6004146110cf57565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116111de5760ff16601b811415806111d3575b6111c7579160809493916020936040519384528484015260408301526060820152600093849182805260015afa156111ba5781516001600160a01b038116156111b4579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600490565b50601c81141561116d565b50505050600090600390565b91609854831161122e5761122b926000526099602052604060002054602060405193805182860152015160408401526040835261122683610b64565b611276565b90565b505050600090565b90610100918203918211610d6757565b600019810191908211610d6757565b91908203918211610d6757565b8051821015610e1a5760209160051b010190565b604082018051919390929160019081811161154d5750825151611543575b6020830192835185511115611538576020604051936112ef828601866112de60216000998a968786526112cf815180928b8686019101610bd1565b81010389810184520182610b7f565b604051928392839251928391610bd1565b8101039060025afa1561152d578251948151511561151557829081958051925b611410575b5051600019918282019182116113fc57036113af575b8293925b61133c575b50505050501490565b909192939481860186811161139b57835180518210156113935761136a929161136491611262565b51611616565b9484810180911161137f57939291908361132e565b634e487b7160e01b84526011600452602484fd5b505094611333565b634e487b7160e01b85526011600452602485fd5b90919394825151828701908782116113fc578110156113f157906113d76113de928551611262565b5190611616565b9484810180911161137f5793919061132a565b505050509250505090565b634e487b7160e01b86526011600452602486fd5b9091819793949697519387891b94851561150157891c94858a1b958087048214901517156114ed576114429086610d7d565b600019928184019182116114cb5785518210156114df575094865151928a01928a84116114cb578310156114bd5761147b908451611255565b88831b11156114a9576113d7611492928751611262565b965b8681018091116113fc5795939291908461130f565b6113646114b7928751611262565b96611494565b505050505050509250505090565b634e487b7160e01b89526011600452602489fd5b949350509796949350611314565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b88526012600452602488fd5b51949594929350500361152757501490565b91505090565b6040513d84823e3d90fd5b505050505050600090565b5050505050600090565b61155e84515191602086015161156d565b14611294575050505050600090565b909160005b60018481831b101561159e5781018091111561157257634e487b7160e01b600052601160045260246000fd5b5092919092610100908103908111610d67576115b990611236565b9160016115c584611246565b1b916115d083611246565b81116115dc5750505090565b91925090600183036115f057505050600190565b8261160161160d9461160793611255565b92611255565b9061156d565b61122b90610d59565b6116456000916020936040519085820192600160f81b845260218301526041820152604181526112de81610b33565b8101039060025afa156116585760005190565b6040513d6000823e3d90fdfea2646970667358221220bcad526c72e175b935d10652c18373469e6ed10ee07bc65d6bb7aa21546d8dcc64736f6c63430008140033", + Bin: "0x60a0806040523461002a573060805261169a9081610030823960805181818161041501526104f30152f35b600080fdfe6080604081815260048036101561001557600080fd5b600092833560e01c90816305d85c13146109a0575080631f3302a91461085c578063226fe7be146106de5780634f1ef2861461047957806352d1902d146104005780635433218c146103e1578063715018a614610384578063817f985b1461035d5780638da5cb5b14610334578063ad3cb1cc146102af578063cdade86614610290578063e23eb32614610138578063e5a2b5d2146101155763f2fde38b146100bd57600080fd5b34610111576020366003190112610111576100d6610ba0565b916100df610bf4565b6001600160a01b038316156100fb57836100f884610c20565b80f35b51631e4fbdf760e01b8152908101839052602490fd5b8280fd5b5050346101345781600319360112610134576020906097549051908152f35b5080fd5b50346101115760a036600319011261011157803591604435916001600160401b0360643581811161028c576101709036908401610ace565b9091608435908111610288576101899036908501610b03565b9160985494609754956001810180911161027557890361026757838203610259576101c06101b78387610d8a565b87602435610d0d565b6096540361024b575092610233927f6614d037bde4905e31ca5ff05de61964c267f28b0320ed49e59f7d99752e1c4f979592879560209851898101906f0e8e4c2dce6c2c6e8d2dedc84c2e8c6d60831b82528c898201528960608201526060815261022a81610b33565b51902093610e40565b8460985584865260998352818187205551908152a280f35b8651630bbdaec960e11b8152fd5b865163c6617b7b60e01b8152fd5b865163e869766d60e01b8152fd5b634e487b7160e01b8b526011825260248bfd5b8780fd5b8680fd5b5050346101345781600319360112610134576020906098549051908152f35b509134610331578060031936011261033157815190828201908282106001600160401b0383111761031e5750610310935082526005815260208101640352e302e360dc1b815282519384926020845251809281602086015285850190610bd1565b601f01601f19168101030190f35b634e487b7160e01b815260418552602490fd5b80fd5b50503461013457816003193601126101345760645490516001600160a01b039091168152602090f35b50346101115760203660031901126101115760209282913581526099845220549051908152f35b833461033157806003193601126103315761039d610bf4565b606480546001600160a01b0319811690915581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5050346101345781600319360112610134576020906096549051908152f35b509134610331578060031936011261033157507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316300361046c57602090517f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8152f35b5163703e46dd60e11b8152fd5b5090806003193601126101115761048e610ba0565b9060249384356001600160401b038111610134573660238201121561013457808501356104ba81610bb6565b946104c785519687610b7f565b81865260209182870193368a83830101116106da578186928b8693018737880101526001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081163081149081156106ac575b5061069c5761052c610bf4565b81169585516352d1902d60e01b815283818a818b5afa86918161066d575b50610566575050505050505191634c9c8ce360e01b8352820152fd5b9088888894938c7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc918281036106585750853b15610644575080546001600160a01b031916821790558451889392917fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b8580a28251156106265750506106189582915190845af4913d1561061c573d61060a61060182610bb6565b92519283610b7f565b81528581943d92013e610c69565b5080f35b5060609250610c69565b95509550505050503461063857505080f35b63b398979f60e01b8152fd5b8651634c9c8ce360e01b8152808501849052fd5b8751632a87526960e21b815280860191909152fd5b9091508481813d8311610695575b6106858183610b7f565b8101031261028c5751903861054a565b503d61067b565b855163703e46dd60e11b81528890fd5b9050817f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc541614153861051f565b8580fd5b50346101115760603660031901126101115780359060243591604435927ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e93845460ff81881c161594858096610849575b1580610826575b61081957509186917fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c938660016001600160401b031983161789556107fa575b50610782818387610d0d565b8560985560965581609755610795610ccc565b61079d610ccc565b6107a633610c20565b82519182526020820152a26107b9578280f35b805468ff00000000000000001916905551600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d290602090a138808280f35b68ffffffffffffffffff19166801000000000000000117875538610776565b875162dc149f60e41b8152fd5b50303b1580610836575b15610736565b5060016001600160401b03831614610830565b5060016001600160401b0383161061072f565b50919034610134576003199160803684011261033157816023193601126103315781516001600160401b03948184018681118382101761098d57845260248035835260209660443588850152606435968188116106da576060908836030112610989578551946060860191868310818411176109775782885288850135818111610111578901366023820112156101115785810135918211610965578160051b916109098c840186610b7f565b845284608089019282010192368411610331575090848b9201905b83821061095657505050509560449161094d9697865281013588860152013585840152356111ea565b90519015158152f35b81358152908201908201610924565b634e487b7160e01b8352604186528483fd5b634e487b7160e01b8252604185528382fd5b8480fd5b634e487b7160e01b845260418252602484fd5b848385346101115760c03660031901126101115781359160443590606435906001600160401b03608435818111610288576109de9036908401610ace565b92909160a435908111610aca576109f89036908301610b03565b916098549a6097549b60018101809111610ab7578a03610aab5750828503610a9d57610a30610a278686610d8a565b8c602435610d0d565b60965403610a8f57509187989991610a7693610a6e87897fe55fb3cbbfe29b13c7f8a35ef23127e7df9ab88df16bac166ad254a20f02414c9c610d0d565b958693610e40565b609655816097558460985582519182526020820152a280f35b8751630bbdaec960e11b8152fd5b875163c6617b7b60e01b8152fd5b6368a35ffd60e11b8152fd5b634e487b7160e01b8c526011835260248cfd5b8880fd5b9181601f84011215610afe578235916001600160401b038311610afe576020808501948460061b010111610afe57565b600080fd5b9181601f84011215610afe578235916001600160401b038311610afe5760208085019460608502010111610afe57565b608081019081106001600160401b03821117610b4e57604052565b634e487b7160e01b600052604160045260246000fd5b606081019081106001600160401b03821117610b4e57604052565b90601f801991011681019081106001600160401b03821117610b4e57604052565b600435906001600160a01b0382168203610afe57565b6001600160401b038111610b4e57601f01601f191660200190565b60005b838110610be45750506000910152565b8181015183820152602001610bd4565b6064546001600160a01b03163303610c0857565b60405163118cdaa760e01b8152336004820152602490fd5b606480546001600160a01b039283166001600160a01b0319821681179092559091167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a3565b90610c905750805115610c7e57805190602001fd5b604051630a12f52160e11b8152600490fd5b81511580610cc3575b610ca1575090565b604051639996b31560e01b81526001600160a01b039091166004820152602490fd5b50803b15610c99565b60ff7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0e5460401c1615610cfb57565b604051631afcd79f60e31b8152600490fd5b916040519160208301936918da1958dadc1bda5b9d60b21b85526040840152606083015260808201526080815260a081018181106001600160401b03821117610b4e5760405251902090565b6001019081600111610d6757565b634e487b7160e01b600052601160045260246000fd5b91908201809211610d6757565b60409182518092602092838301958181850186895252606084019294600090815b848310610dd0575050505050610dca925003601f198101835282610b7f565b51902090565b919395509193863560018060a01b038116809103610111578582819260019452858a01358682015201970193019091879593969492610dab565b9190811015610e1a576060020190565b634e487b7160e01b600052603260045260246000fd5b9190811015610e1a5760061b0190565b93919060009485935b828510610e70575b50505050505010610e5e57565b60405163cabeb65560e01b8152600490fd5b9091929394979695610e83868a87610e0a565b60209081810135159081610fa8575b81610f93575b50610f8c57610ea8878686610e30565b6001600160a01b03903581811690819003610afe57610ec8898d8a610e0a565b91610f2f610f276040948551878101907f19457468657265756d205369676e6564204d6573736167653a0a3332000000008252603c8b818301528152610f0d81610b64565b519020610f1982610fb5565b888884013593013591611135565b919091610fc3565b1603610f7c575090610f4e91610f46888787610e30565b013590610d7d565b9486861015610f72575b6000198114610d6757600101939291909794959697610e49565b8596979850610e51565b51638baa579f60e01b8152600490fd5b5094610f58565b60ff9150610fa090610fb5565b161538610e98565b6040810135159150610e92565b3560ff81168103610afe5790565b600581101561111f5780610fd45750565b600181036110215760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606490fd5b6002810361106e5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606490fd5b600381036110c65760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608490fd5b6004146110cf57565b60405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b6064820152608490fd5b634e487b7160e01b600052602160045260246000fd5b9291907f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083116111de5760ff16601b811415806111d3575b6111c7579160809493916020936040519384528484015260408301526060820152600093849182805260015afa156111ba5781516001600160a01b038116156111b4579190565b50600190565b50604051903d90823e3d90fd5b50505050600090600490565b50601c81141561116d565b50505050600090600390565b91609854831161122e5761122b926000526099602052604060002054602060405193805182860152015160408401526040835261122683610b64565b611276565b90565b505050600090565b90610100918203918211610d6757565b600019810191908211610d6757565b91908203918211610d6757565b8051821015610e1a5760209160051b010190565b604082018051919390929160019081811161154d5750825151611543575b6020830192835185511115611538576020604051936112ef828601866112de60216000998a968786526112cf815180928b8686019101610bd1565b81010389810184520182610b7f565b604051928392839251928391610bd1565b8101039060025afa1561152d578251948151511561151557829081958051925b611410575b5051600019918282019182116113fc57036113af575b8293925b61133c575b50505050501490565b909192939481860186811161139b57835180518210156113935761136a929161136491611262565b51611616565b9484810180911161137f57939291908361132e565b634e487b7160e01b84526011600452602484fd5b505094611333565b634e487b7160e01b85526011600452602485fd5b90919394825151828701908782116113fc578110156113f157906113d76113de928551611262565b5190611616565b9484810180911161137f5793919061132a565b505050509250505090565b634e487b7160e01b86526011600452602486fd5b9091819793949697519387891b94851561150157891c94858a1b958087048214901517156114ed576114429086610d7d565b600019928184019182116114cb5785518210156114df575094865151928a01928a84116114cb578310156114bd5761147b908451611255565b88831b11156114a9576113d7611492928751611262565b965b8681018091116113fc5795939291908461130f565b6113646114b7928751611262565b96611494565b505050505050509250505090565b634e487b7160e01b89526011600452602489fd5b949350509796949350611314565b634e487b7160e01b88526011600452602488fd5b634e487b7160e01b88526012600452602488fd5b51949594929350500361152757501490565b91505090565b6040513d84823e3d90fd5b505050505050600090565b5050505050600090565b61155e84515191602086015161156d565b14611294575050505050600090565b909160005b60018481831b101561159e5781018091111561157257634e487b7160e01b600052601160045260246000fd5b5092919092610100908103908111610d67576115b990611236565b9160016115c584611246565b1b916115d083611246565b81116115dc5750505090565b91925090600183036115f057505050600190565b8261160161160d9461160793611255565b92611255565b9061156d565b61122b90610d59565b6116456000916020936040519085820192600160f81b845260218301526041820152604181526112de81610b33565b8101039060025afa156116585760005190565b6040513d6000823e3d90fdfea2646970667358221220f86c14b33c2bee9acdb4d15b826306074ec0890d82c5c5ce87e842bbdc8dff6f64736f6c63430008140033", } // WrappersABI is the input ABI used to generate the binding from.