@aztec/ivc-integration 3.0.0-nightly.20251111 → 3.0.0-nightly.20251112
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/app_creator.json +3 -3
- package/artifacts/app_reader.json +3 -3
- package/artifacts/keys/mock_hiding.ivc.vk +0 -0
- package/artifacts/keys/mock_rollup_root_verifier.sol +45 -45
- package/artifacts/mock_hiding.json +95 -95
- package/artifacts/mock_private_kernel_init.json +56 -56
- package/artifacts/mock_private_kernel_inner.json +56 -56
- package/artifacts/mock_private_kernel_reset.json +95 -95
- package/artifacts/mock_private_kernel_tail.json +95 -95
- package/artifacts/mock_rollup_root.json +53 -53
- package/artifacts/mock_rollup_tx_base_private.json +97 -97
- package/artifacts/mock_rollup_tx_base_public.json +97 -97
- package/artifacts/mock_rollup_tx_merge.json +97 -97
- package/package.json +16 -16
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"noir_version": "1.0.0-beta.15+
|
|
3
|
-
"hash": "
|
|
2
|
+
"noir_version": "1.0.0-beta.15+c117dfab68bfe7e01465259314eda6abaf7a5a8c-aztec",
|
|
3
|
+
"hash": "3657237550747019383",
|
|
4
4
|
"abi": {
|
|
5
5
|
"parameters": [
|
|
6
6
|
{
|
|
@@ -126,22 +126,22 @@
|
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
},
|
|
129
|
-
"bytecode": "H4sIAAAAAAAA/
|
|
130
|
-
"debug_symbols": "
|
|
129
|
+
"bytecode": "H4sIAAAAAAAA/82aWXMUVRiGv55JICRBIyYuoNK4RFDUYMQFlyCI4oZxjwuGJSNGJYQ4RHEjQXFnyQRFXAMJiqi5scrSKn+EP4Ab7iyvvPHSinm731OcNJ2Z8/VMJumqqWem55zzfef0mV7OPJ6EWwW5dWNn1+g4W/jZG3+lSWw+39eMv3ZZZSrJWeRssoqcQ1Zb9cFaci55Fnk2WUeeQ84jzyXryQbyPPJ88gLyQnI+uYC8iLyYvIRcSPrkIvJS8jLycvIKspG8klxMLiGvIq8ml5LXkNeS15FN5DLyerKZvIFcTt5I3kTeTN5CriBvJW8jbyfvIFvIleSd5CpyNXkXuYa8m7yHXEveS95H3k8+QD5IriMfIlvJh8lHyEfJx8jHySfIJ8k28inyafIZ8llyPfkc2U5uIDeSm8jNZAeZIZ8nt5AvkJ3ki+RL5MvkVrKL3EZ2k9vJHvIVMkvuIHvJV8nXyJ3k6+Qb5JvkW+Tb5C6yj+wnd5PvyJkb9r87/krxsy9Om1dh1Y9rU9OW5152Qrx9xQTcl6DefqtsU8e6nlPLhpb81rrm1/7+tvWLm/9au/P37oHVp/4d/KeIvPZbO3y3elLKg5GSZAfjQDEBDySoNyBTezCQ14C1w3erFxwMxErFNRppq1De9oTLt42Njf0Xt9+XgluQkp1rjhw035pbiRxp7xuMCZKOBNd0Mk/Z3HhZL6doNy63uM0MXpIJmBP9Qc25xwgDKds3ZxHtKd1TxDgouj4k7cun4h4nzZc5Gx5kffOaLIdCKWMsB2TK5nVQVnMy+0x0J7F0zBe+6DbtmClyTBzjkOjmBh5zCs2N6G+m0LEwFwlf3HJG2UOi/22mFDl97t5ukMesmP2+uOUVfeM7VSvP/CjjOJwOqqvnac5vSWMcFn2MuDiF5t0XopvP0zHeihwTx/hSyjPeX4lznNR0jbcix8QxvpbyjPc34hwnPV3jrcgxcYxv3cuW9Mk07V52QryhYgIOJah3RNwnVdK8jlg7fLd6JT0YFZLsYBwtJuDRBPWGZWoPBvIatnb4bvVKukxgT7h8WymXCUbIY+ZbsyQwImcuExyT4pcJHH9VwTLBiKLduNzitqTLBMPWmGj6O+IeIwykbN+cRbSPImlFjO/c2w3ywT9Q5iyFuqV4fEcfh2XK5ltQVnOS+V50t8mzY77wRbdpx0yRY+IYx0U3N/CvZKG5oX18NydvX9xyRtnjkuzfEt8xpx/c2w3yqIrZ74tbXtE3vlO18syPMo7D6aC6emV5fD8hM38cyvFY/aPM/HEox+PuTzLzx6Ecj6E/iz4GNu252y5b6Nw9qihr3x+PxuSjzXNPwjxdNu11Fcvcir+IgmXxw6Lv83uKnLTLoNr5iD5g6U/bh/fFvQ/apcUkfcBymrYPH4h7H7TLdUn6gCUqbR8+FPc+aJbARPS/H9xnKp6dgvvSE6Lv80eKnDT3IUHjylzQB1zjtX34WNz7oLmHCBpX5oI+4Pqs7cMn4t4HzfU/aFyZC/qAa6u2D3vFvQ+aa7f5S38OP+M6h/M+zps47+B3i3mMeYBx3MvcUa9SJq56pqz2zBrVHrsTkTKoj2V8PINXMQfYsDBhYcHCgIX9CvO1TkLjFbYrTFdYrjBcYbfCbIXVCqMVNitMVlisMFhhry7keCyS0FaFqQpLFYYq7FSYqbBSYaTCRoWJCgsVBirsU5inTRIap7BNYZrCMoVhCrsUZimsUhilsElhksIihUEKexTm6EoJjdFVEpqisERhiMIOhRkKKxRGKGxQmKCwQGGAwv6E+dkqofEJ2xOmJyxPGJ6wO2F2wuqE0QmbEyYnLE4YnLA3YW5ukNDY3CShqQlLE4Ym7EyYmbAyYWTCxoSJCQsTBibsS5iX3RIal7AtYVrCsoRhCbsSZiWsShiVsClhUsKihEEJexLmZJ+ExuRuCU1JWJHRzVYpasm+xra5K5Yu/8Uu15jnu2by5N8nW/7M/LHA7De/tzqyo7Mnsznb2Ztp7+zqzfRkzfw39/MNpLmP9MVp80z9+mT1Y//WarDem3ZNHHvR2BfdZsa7MuY7025FpGxVhJ6o43uT5eHFFJ5H1lv7zHjMJ+1jmc1syfS0b9+xLduZ6cpGs622IimOSsrUr0lWP/aoVlvva6IByYqYet4kn1MR5ivr5Wm3NuY706Y5Gna+ph//A5J4Ui84MQAA",
|
|
130
|
+
"debug_symbols": "pZXhjoIwDIDfZb/5wbp1bL7K5WJQ54WEoOHgkovx3a+sZeolEKN/+gmzX0rL2EUd4m782jbd8fStNh8Xteubtm2+tu1pXw/NqaO7l2uh5svt0MdIt9TdOmWd6z52g9p0Y9sW6qdux/Sn73PdJQ51T6tloWJ3IJLw2LRx+nUtbtnlcqpxIMnWhJyO+iFfr+SDNyIwxrlsAHi2AoQgAnR+qQKzUoH2dq4AtL0Z4GkDIGaDL18ymNwFwMUa3LLBBTs/hQtYZYN7WuAxC3ylXxCEEnMFsFTBWhPM7VWwGl9po0WfDf41g8kvg71r4z+DhncnsWp4ahTrNbw7CwQ99wGtW+rD2rb0bq7gflPRtvykq3rf9A+fMqVpzxcK6DtSKJOiTRFTdClWKXq1oSmHFHXJ0AxgUD59E7RlIMMxKoZnhAQoGWSpCMAwDMtAhmNUDLJo6gEEpimFWghCIySXnp4PhU5YCb1w8tEAbSnUQhAaoRWicPLRVG0l9MLAxMlHY8HJNw31p+6betdGOUyOY7e/O1uG3/O8Mp8+5/60j4exj9Pw0hqN8w8=",
|
|
131
131
|
"file_map": {
|
|
132
132
|
"6": {
|
|
133
133
|
"source": "use crate::{cmp::Eq, convert::From, runtime::is_unconstrained, static_assert};\n\n/// A `BoundedVec<T, MaxLen>` is a growable storage similar to a `Vec<T>` except that it\n/// is bounded with a maximum possible length. Unlike `Vec`, `BoundedVec` is not implemented\n/// via slices and thus is not subject to the same restrictions slices are (notably, nested\n/// slices - and thus nested vectors as well - are disallowed).\n///\n/// Since a BoundedVec is backed by a normal array under the hood, growing the BoundedVec by\n/// pushing an additional element is also more efficient - the length only needs to be increased\n/// by one.\n///\n/// For these reasons `BoundedVec<T, N>` should generally be preferred over `Vec<T>` when there\n/// is a reasonable maximum bound that can be placed on the vector.\n///\n/// Example:\n///\n/// ```noir\n/// let mut vector: BoundedVec<Field, 10> = BoundedVec::new();\n/// for i in 0..5 {\n/// vector.push(i);\n/// }\n/// assert(vector.len() == 5);\n/// assert(vector.max_len() == 10);\n/// ```\npub struct BoundedVec<T, let MaxLen: u32> {\n storage: [T; MaxLen],\n len: u32,\n}\n\nimpl<T, let MaxLen: u32> BoundedVec<T, MaxLen> {\n /// Creates a new, empty vector of length zero.\n ///\n /// Since this container is backed by an array internally, it still needs an initial value\n /// to give each element. To resolve this, each element is zeroed internally. This value\n /// is guaranteed to be inaccessible unless `get_unchecked` is used.\n ///\n /// Example:\n ///\n /// ```noir\n /// let empty_vector: BoundedVec<Field, 10> = BoundedVec::new();\n /// assert(empty_vector.len() == 0);\n /// ```\n ///\n /// Note that whenever calling `new` the maximum length of the vector should always be specified\n /// via a type signature:\n ///\n /// ```noir\n /// fn good() -> BoundedVec<Field, 10> {\n /// // Ok! MaxLen is specified with a type annotation\n /// let v1: BoundedVec<Field, 3> = BoundedVec::new();\n /// let v2 = BoundedVec::new();\n ///\n /// // Ok! MaxLen is known from the type of `good`'s return value\n /// v2\n /// }\n ///\n /// fn bad() {\n /// // Error: Type annotation needed\n /// // The compiler can't infer `MaxLen` from the following code:\n /// let mut v3 = BoundedVec::new();\n /// v3.push(5);\n /// }\n /// ```\n ///\n /// This defaulting of `MaxLen` (and numeric generics in general) to zero may change in future noir versions\n /// but for now make sure to use type annotations when using bounded vectors. Otherwise, you will receive a\n /// constraint failure at runtime when the vec is pushed to.\n pub fn new() -> Self {\n let zeroed = crate::mem::zeroed();\n BoundedVec { storage: [zeroed; MaxLen], len: 0 }\n }\n\n /// Retrieves an element from the vector at the given index, starting from zero.\n ///\n /// If the given index is equal to or greater than the length of the vector, this\n /// will issue a constraint failure.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn foo<let N: u32>(v: BoundedVec<u32, N>) {\n /// let first = v.get(0);\n /// let last = v.get(v.len() - 1);\n /// assert(first != last);\n /// }\n /// ```\n pub fn get(self, index: u32) -> T {\n assert(index < self.len, \"Attempted to read past end of BoundedVec\");\n self.get_unchecked(index)\n }\n\n /// Retrieves an element from the vector at the given index, starting from zero, without\n /// performing a bounds check.\n ///\n /// Since this function does not perform a bounds check on length before accessing the element,\n /// it is unsafe! Use at your own risk!\n ///\n /// Example:\n ///\n /// ```noir\n /// fn sum_of_first_three<let N: u32>(v: BoundedVec<u32, N>) -> u32 {\n /// // Always ensure the length is larger than the largest\n /// // index passed to get_unchecked\n /// assert(v.len() > 2);\n /// let first = v.get_unchecked(0);\n /// let second = v.get_unchecked(1);\n /// let third = v.get_unchecked(2);\n /// first + second + third\n /// }\n /// ```\n pub fn get_unchecked(self, index: u32) -> T {\n self.storage[index]\n }\n\n /// Writes an element to the vector at the given index, starting from zero.\n ///\n /// If the given index is equal to or greater than the length of the vector, this will issue a constraint failure.\n ///\n /// Example:\n ///\n /// ```noir\n /// fn foo<let N: u32>(v: BoundedVec<u32, N>) {\n /// let first = v.get(0);\n /// assert(first != 42);\n /// v.set(0, 42);\n /// let new_first = v.get(0);\n /// assert(new_first == 42);\n /// }\n /// ```\n pub fn set(&mut self, index: u32, value: T) {\n assert(index < self.len, \"Attempted to write past end of BoundedVec\");\n self.set_unchecked(index, value)\n }\n\n /// Writes an element to the vector at the given index, starting from zero, without performing a bounds check.\n ///\n /// Since this function does not perform a bounds check on length before accessing the element, it is unsafe! Use at your own risk!\n ///\n /// Example:\n ///\n /// ```noir\n /// fn set_unchecked_example() {\n /// let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n /// vec.extend_from_array([1, 2]);\n ///\n /// // Here we're safely writing within the valid range of `vec`\n /// // `vec` now has the value [42, 2]\n /// vec.set_unchecked(0, 42);\n ///\n /// // We can then safely read this value back out of `vec`.\n /// // Notice that we use the checked version of `get` which would prevent reading unsafe values.\n /// assert_eq(vec.get(0), 42);\n ///\n /// // We've now written past the end of `vec`.\n /// // As this index is still within the maximum potential length of `v`,\n /// // it won't cause a constraint failure.\n /// vec.set_unchecked(2, 42);\n /// println(vec);\n ///\n /// // This will write past the end of the maximum potential length of `vec`,\n /// // it will then trigger a constraint failure.\n /// vec.set_unchecked(5, 42);\n /// println(vec);\n /// }\n /// ```\n pub fn set_unchecked(&mut self, index: u32, value: T) {\n self.storage[index] = value;\n }\n\n /// Pushes an element to the end of the vector. This increases the length\n /// of the vector by one.\n ///\n /// Panics if the new length of the vector will be greater than the max length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 2> = BoundedVec::new();\n ///\n /// v.push(1);\n /// v.push(2);\n ///\n /// // Panics with failed assertion \"push out of bounds\"\n /// v.push(3);\n /// ```\n pub fn push(&mut self, elem: T) {\n assert(self.len < MaxLen, \"push out of bounds\");\n\n self.storage[self.len] = elem;\n self.len += 1;\n }\n\n /// Returns the current length of this vector\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 4> = BoundedVec::new();\n /// assert(v.len() == 0);\n ///\n /// v.push(100);\n /// assert(v.len() == 1);\n ///\n /// v.push(200);\n /// v.push(300);\n /// v.push(400);\n /// assert(v.len() == 4);\n ///\n /// let _ = v.pop();\n /// let _ = v.pop();\n /// assert(v.len() == 2);\n /// ```\n pub fn len(self) -> u32 {\n self.len\n }\n\n /// Returns the maximum length of this vector. This is always\n /// equal to the `MaxLen` parameter this vector was initialized with.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 5> = BoundedVec::new();\n ///\n /// assert(v.max_len() == 5);\n /// v.push(10);\n /// assert(v.max_len() == 5);\n /// ```\n pub fn max_len(_self: BoundedVec<T, MaxLen>) -> u32 {\n MaxLen\n }\n\n /// Returns the internal array within this vector.\n ///\n /// Since arrays in Noir are immutable, mutating the returned storage array will not mutate\n /// the storage held internally by this vector.\n ///\n /// Note that uninitialized elements may be zeroed out!\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 5> = BoundedVec::new();\n ///\n /// assert(v.storage() == [0, 0, 0, 0, 0]);\n ///\n /// v.push(57);\n /// assert(v.storage() == [57, 0, 0, 0, 0]);\n /// ```\n pub fn storage(self) -> [T; MaxLen] {\n self.storage\n }\n\n /// Pushes each element from the given array to this vector.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut vec: BoundedVec<Field, 3> = BoundedVec::new();\n /// vec.extend_from_array([2, 4]);\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_array<let Len: u32>(&mut self, array: [T; Len]) {\n let new_len = self.len + array.len();\n assert(new_len <= MaxLen, \"extend_from_array out of bounds\");\n for i in 0..array.len() {\n self.storage[self.len + i] = array[i];\n }\n self.len = new_len;\n }\n\n /// Pushes each element from the given slice to this vector.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut vec: BoundedVec<Field, 3> = BoundedVec::new();\n /// vec.extend_from_slice(&[2, 4]);\n ///\n /// assert(vec.len == 2);\n /// assert(vec.get(0) == 2);\n /// assert(vec.get(1) == 4);\n /// ```\n pub fn extend_from_slice(&mut self, slice: [T]) {\n let new_len = self.len + slice.len();\n assert(new_len <= MaxLen, \"extend_from_slice out of bounds\");\n for i in 0..slice.len() {\n self.storage[self.len + i] = slice[i];\n }\n self.len = new_len;\n }\n\n /// Pushes each element from the other vector to this vector. The length of\n /// the other vector is left unchanged.\n ///\n /// Panics if pushing each element would cause the length of this vector\n /// to exceed the maximum length.\n ///\n /// ```noir\n /// let mut v1: BoundedVec<Field, 5> = BoundedVec::new();\n /// let mut v2: BoundedVec<Field, 7> = BoundedVec::new();\n ///\n /// v2.extend_from_array([1, 2, 3]);\n /// v1.extend_from_bounded_vec(v2);\n ///\n /// assert(v1.storage() == [1, 2, 3, 0, 0]);\n /// assert(v2.storage() == [1, 2, 3, 0, 0, 0, 0]);\n /// ```\n pub fn extend_from_bounded_vec<let Len: u32>(&mut self, vec: BoundedVec<T, Len>) {\n let append_len = vec.len();\n let new_len = self.len + append_len;\n assert(new_len <= MaxLen, \"extend_from_bounded_vec out of bounds\");\n\n if is_unconstrained() {\n for i in 0..append_len {\n self.storage[self.len + i] = vec.get_unchecked(i);\n }\n } else {\n let mut exceeded_len = false;\n for i in 0..Len {\n exceeded_len |= i == append_len;\n if !exceeded_len {\n self.storage[self.len + i] = vec.get_unchecked(i);\n }\n }\n }\n self.len = new_len;\n }\n\n /// Creates a new vector, populating it with values derived from an array input.\n /// The maximum length of the vector is determined based on the type signature.\n ///\n /// Example:\n ///\n /// ```noir\n /// let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array([1, 2, 3])\n /// ```\n pub fn from_array<let Len: u32>(array: [T; Len]) -> Self {\n static_assert(Len <= MaxLen, \"from array out of bounds\");\n let mut vec: BoundedVec<T, MaxLen> = BoundedVec::new();\n vec.extend_from_array(array);\n vec\n }\n\n /// Pops the element at the end of the vector. This will decrease the length\n /// of the vector by one.\n ///\n /// Panics if the vector is empty.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<Field, 2> = BoundedVec::new();\n /// v.push(1);\n /// v.push(2);\n ///\n /// let two = v.pop();\n /// let one = v.pop();\n ///\n /// assert(two == 2);\n /// assert(one == 1);\n ///\n /// // error: cannot pop from an empty vector\n /// let _ = v.pop();\n /// ```\n pub fn pop(&mut self) -> T {\n assert(self.len > 0, \"cannot pop from an empty vector\");\n self.len -= 1;\n\n let elem = self.storage[self.len];\n self.storage[self.len] = crate::mem::zeroed();\n elem\n }\n\n /// Returns true if the given predicate returns true for any element\n /// in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let mut v: BoundedVec<u32, 3> = BoundedVec::new();\n /// v.extend_from_array([2, 4, 6]);\n ///\n /// let all_even = !v.any(|elem: u32| elem % 2 != 0);\n /// assert(all_even);\n /// ```\n pub fn any<Env>(self, predicate: fn[Env](T) -> bool) -> bool {\n let mut ret = false;\n if is_unconstrained() {\n for i in 0..self.len {\n ret |= predicate(self.storage[i]);\n }\n } else {\n let mut exceeded_len = false;\n for i in 0..MaxLen {\n exceeded_len |= i == self.len;\n if !exceeded_len {\n ret |= predicate(self.storage[i]);\n }\n }\n }\n ret\n }\n\n /// Creates a new vector of equal size by calling a closure on each element in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let result = vec.map(|value| value * 2);\n ///\n /// let expected = BoundedVec::from_array([2, 4, 6, 8]);\n /// assert_eq(result, expected);\n /// ```\n pub fn map<U, Env>(self, f: fn[Env](T) -> U) -> BoundedVec<U, MaxLen> {\n let mut ret = BoundedVec::new();\n ret.len = self.len();\n\n if is_unconstrained() {\n for i in 0..self.len() {\n ret.storage[i] = f(self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n ret.storage[i] = f(self.get_unchecked(i));\n }\n }\n }\n\n ret\n }\n\n /// Creates a new vector of equal size by calling a closure on each element\n /// in this vector, along with its index.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let result = vec.mapi(|i, value| i + value * 2);\n ///\n /// let expected = BoundedVec::from_array([2, 5, 8, 11]);\n /// assert_eq(result, expected);\n /// ```\n pub fn mapi<U, Env>(self, f: fn[Env](u32, T) -> U) -> BoundedVec<U, MaxLen> {\n let mut ret = BoundedVec::new();\n ret.len = self.len();\n\n if is_unconstrained() {\n for i in 0..self.len() {\n ret.storage[i] = f(i, self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n ret.storage[i] = f(i, self.get_unchecked(i));\n }\n }\n }\n\n ret\n }\n\n /// Calls a closure on each element in this vector.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let mut result = BoundedVec::<u32, 4>::new();\n /// vec.for_each(|value| result.push(value * 2));\n ///\n /// let expected = BoundedVec::from_array([2, 4, 6, 8]);\n /// assert_eq(result, expected);\n /// ```\n pub fn for_each<Env>(self, f: fn[Env](T) -> ()) {\n if is_unconstrained() {\n for i in 0..self.len() {\n f(self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n f(self.get_unchecked(i));\n }\n }\n }\n }\n\n /// Calls a closure on each element in this vector, along with its index.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n /// let mut result = BoundedVec::<u32, 4>::new();\n /// vec.for_eachi(|i, value| result.push(i + value * 2));\n ///\n /// let expected = BoundedVec::from_array([2, 5, 8, 11]);\n /// assert_eq(result, expected);\n /// ```\n pub fn for_eachi<Env>(self, f: fn[Env](u32, T) -> ()) {\n if is_unconstrained() {\n for i in 0..self.len() {\n f(i, self.get_unchecked(i));\n }\n } else {\n for i in 0..MaxLen {\n if i < self.len() {\n f(i, self.get_unchecked(i));\n }\n }\n }\n }\n\n /// Creates a new BoundedVec from the given array and length.\n /// The given length must be less than or equal to the length of the array.\n ///\n /// This function will zero out any elements at or past index `len` of `array`.\n /// This incurs an extra runtime cost of O(MaxLen). If you are sure your array is\n /// zeroed after that index, you can use `from_parts_unchecked` to remove the extra loop.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);\n /// assert_eq(vec.len(), 3);\n /// ```\n pub fn from_parts(mut array: [T; MaxLen], len: u32) -> Self {\n assert(len <= MaxLen);\n let zeroed = crate::mem::zeroed();\n\n if is_unconstrained() {\n for i in len..MaxLen {\n array[i] = zeroed;\n }\n } else {\n for i in 0..MaxLen {\n if i >= len {\n array[i] = zeroed;\n }\n }\n }\n\n BoundedVec { storage: array, len }\n }\n\n /// Creates a new BoundedVec from the given array and length.\n /// The given length must be less than or equal to the length of the array.\n ///\n /// This function is unsafe because it expects all elements past the `len` index\n /// of `array` to be zeroed, but does not check for this internally. Use `from_parts`\n /// for a safe version of this function which does zero out any indices past the\n /// given length. Invalidating this assumption can notably cause `BoundedVec::eq`\n /// to give incorrect results since it will check even elements past `len`.\n ///\n /// Example:\n ///\n /// ```noir\n /// let vec: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 0], 3);\n /// assert_eq(vec.len(), 3);\n ///\n /// // invalid use!\n /// let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 1], 3);\n /// let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 2], 3);\n ///\n /// // both vecs have length 3 so we'd expect them to be equal, but this\n /// // fails because elements past the length are still checked in eq\n /// assert_eq(vec1, vec2); // fails\n /// ```\n pub fn from_parts_unchecked(array: [T; MaxLen], len: u32) -> Self {\n assert(len <= MaxLen);\n BoundedVec { storage: array, len }\n }\n}\n\nimpl<T, let MaxLen: u32> Eq for BoundedVec<T, MaxLen>\nwhere\n T: Eq,\n{\n fn eq(self, other: BoundedVec<T, MaxLen>) -> bool {\n // TODO: https://github.com/noir-lang/noir/issues/4837\n //\n // We make the assumption that the user has used the proper interface for working with `BoundedVec`s\n // rather than directly manipulating the internal fields as this can result in an inconsistent internal state.\n if self.len == other.len {\n self.storage == other.storage\n } else {\n false\n }\n }\n}\n\nimpl<T, let MaxLen: u32, let Len: u32> From<[T; Len]> for BoundedVec<T, MaxLen> {\n fn from(array: [T; Len]) -> BoundedVec<T, MaxLen> {\n BoundedVec::from_array(array)\n }\n}\n\nmod bounded_vec_tests {\n\n mod get {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_elements_past_end_of_vec() {\n let vec: BoundedVec<Field, 5> = BoundedVec::new();\n\n let _ = vec.get(0);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn panics_when_reading_beyond_length() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n let _ = vec.get(3);\n }\n\n #[test]\n fn get_works_within_bounds() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(2), 3);\n assert_eq(vec.get(4), 5);\n }\n\n #[test]\n fn get_unchecked_works() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(0), 1);\n assert_eq(vec.get_unchecked(2), 3);\n }\n\n #[test]\n fn get_unchecked_works_past_len() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n assert_eq(vec.get_unchecked(4), 0);\n }\n }\n\n mod set {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn set_updates_values_properly() {\n let mut vec = BoundedVec::from_array([0, 0, 0, 0, 0]);\n\n vec.set(0, 42);\n assert_eq(vec.storage, [42, 0, 0, 0, 0]);\n\n vec.set(1, 43);\n assert_eq(vec.storage, [42, 43, 0, 0, 0]);\n\n vec.set(2, 44);\n assert_eq(vec.storage, [42, 43, 44, 0, 0]);\n\n vec.set(1, 10);\n assert_eq(vec.storage, [42, 10, 44, 0, 0]);\n\n vec.set(0, 0);\n assert_eq(vec.storage, [0, 10, 44, 0, 0]);\n }\n\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_writing_elements_past_end_of_vec() {\n let mut vec: BoundedVec<Field, 5> = BoundedVec::new();\n vec.set(0, 42);\n }\n\n #[test(should_fail_with = \"Attempted to write past end of BoundedVec\")]\n fn panics_when_setting_beyond_length() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3]);\n vec.set(3, 4);\n }\n\n #[test]\n fn set_unchecked_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(0, 10);\n assert_eq(vec.get(0), 10);\n }\n\n #[test(should_fail_with = \"Attempted to read past end of BoundedVec\")]\n fn set_unchecked_operations_past_len() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n vec.set_unchecked(3, 40);\n assert_eq(vec.get(3), 40);\n }\n\n #[test]\n fn set_preserves_other_elements() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n vec.set(2, 30);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 30);\n assert_eq(vec.get(3), 4);\n assert_eq(vec.get(4), 5);\n }\n }\n\n mod any {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn returns_false_if_predicate_not_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, false, false]);\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n fn returns_true_if_predicate_satisfied() {\n let vec: BoundedVec<bool, 4> = BoundedVec::from_array([false, false, true, true]);\n let result = vec.any(|value| value);\n\n assert(result);\n }\n\n #[test]\n fn returns_false_on_empty_boundedvec() {\n let vec: BoundedVec<bool, 0> = BoundedVec::new();\n let result = vec.any(|value| value);\n\n assert(!result);\n }\n\n #[test]\n fn any_with_complex_predicates() {\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n\n assert(vec.any(|x| x > 3));\n assert(!vec.any(|x| x > 10));\n assert(vec.any(|x| x % 2 == 0)); // has a even number\n assert(vec.any(|x| x == 3)); // has a specific value\n }\n\n #[test]\n fn any_with_partial_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n\n assert(vec.any(|x| x == 1));\n assert(vec.any(|x| x == 2));\n assert(!vec.any(|x| x == 3));\n }\n }\n\n mod map {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn applies_function_correctly() {\n // docs:start:bounded-vec-map-example\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|value| value * 2);\n // docs:end:bounded-vec-map-example\n let expected = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|value| (value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = vec.map(|value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn map_with_conditional_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.map(|x| if x % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([1, 4, 3, 8]);\n assert_eq(result, expected);\n }\n\n #[test]\n fn map_preserves_length() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.map(|x| x * 2);\n\n assert_eq(result.len(), vec.len());\n assert_eq(result.max_len(), vec.max_len());\n }\n\n #[test]\n fn map_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let result = vec.map(|x| x * 2);\n assert_eq(result, vec);\n assert_eq(result.len(), 0);\n assert_eq(result.max_len(), 5);\n }\n }\n\n mod mapi {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn applies_function_correctly() {\n // docs:start:bounded-vec-mapi-example\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.mapi(|i, value| i + value * 2);\n // docs:end:bounded-vec-mapi-example\n let expected = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = vec.mapi(|i, value| (i + value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = vec.mapi(|_, value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn mapi_with_index_branching_logic() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n\n let result = vec.mapi(|i, x| if i % 2 == 0 { x * 2 } else { x });\n let expected = BoundedVec::from_array([2, 2, 6, 4]);\n assert_eq(result, expected);\n }\n }\n\n mod for_each {\n use crate::collections::bounded_vec::BoundedVec;\n\n // map in terms of for_each\n fn for_each_map<T, U, Env, let MaxLen: u32>(\n input: BoundedVec<T, MaxLen>,\n f: fn[Env](T) -> U,\n ) -> BoundedVec<U, MaxLen> {\n let mut output = BoundedVec::<U, MaxLen>::new();\n let output_ref = &mut output;\n input.for_each(|x| output_ref.push(f(x)));\n output\n }\n\n #[test]\n fn smoke_test() {\n let mut acc = 0;\n let acc_ref = &mut acc;\n // docs:start:bounded-vec-for-each-example\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n vec.for_each(|value| { *acc_ref += value; });\n // docs:end:bounded-vec-for-each-example\n assert_eq(acc, 6);\n }\n\n #[test]\n fn applies_function_correctly() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_each_map(vec, |value| value * 2);\n let expected = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_each_map(vec, |value| (value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 4, 6, 8]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = for_each_map(vec, |value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn for_each_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_each(|_| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_each_with_side_effects() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let mut seen = BoundedVec::<u32, 3>::new();\n let seen_ref = &mut seen;\n vec.for_each(|x| seen_ref.push(x));\n assert_eq(seen, vec);\n }\n }\n\n mod for_eachi {\n use crate::collections::bounded_vec::BoundedVec;\n\n // mapi in terms of for_eachi\n fn for_eachi_mapi<T, U, Env, let MaxLen: u32>(\n input: BoundedVec<T, MaxLen>,\n f: fn[Env](u32, T) -> U,\n ) -> BoundedVec<U, MaxLen> {\n let mut output = BoundedVec::<U, MaxLen>::new();\n let output_ref = &mut output;\n input.for_eachi(|i, x| output_ref.push(f(i, x)));\n output\n }\n\n #[test]\n fn smoke_test() {\n let mut acc = 0;\n let acc_ref = &mut acc;\n // docs:start:bounded-vec-for-eachi-example\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n vec.for_eachi(|i, value| { *acc_ref += i * value; });\n // docs:end:bounded-vec-for-eachi-example\n\n // 0 * 1 + 1 * 2 + 2 * 3\n assert_eq(acc, 8);\n }\n\n #[test]\n fn applies_function_correctly() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_eachi_mapi(vec, |i, value| i + value * 2);\n let expected = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn applies_function_that_changes_return_type() {\n let vec: BoundedVec<u32, 4> = BoundedVec::from_array([1, 2, 3, 4]);\n let result = for_eachi_mapi(vec, |i, value| (i + value * 2) as Field);\n let expected: BoundedVec<Field, 4> = BoundedVec::from_array([2, 5, 8, 11]);\n\n assert_eq(result, expected);\n }\n\n #[test]\n fn does_not_apply_function_past_len() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([0, 1]);\n let result = for_eachi_mapi(vec, |_, value| if value == 0 { 5 } else { value });\n let expected = BoundedVec::from_array([5, 1]);\n\n assert_eq(result, expected);\n assert_eq(result.get_unchecked(2), 0);\n }\n\n #[test]\n fn for_eachi_on_empty_vector() {\n let vec: BoundedVec<u32, 5> = BoundedVec::new();\n let mut count = 0;\n let count_ref = &mut count;\n vec.for_eachi(|_, _| { *count_ref += 1; });\n assert_eq(count, 0);\n }\n\n #[test]\n fn for_eachi_with_index_tracking() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([10, 20, 30]);\n let mut indices = BoundedVec::<u32, 3>::new();\n let indices_ref = &mut indices;\n vec.for_eachi(|i, _| indices_ref.push(i));\n\n let expected = BoundedVec::from_array([0, 1, 2]);\n assert_eq(indices, expected);\n }\n\n }\n\n mod from_array {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn empty() {\n let empty_array: [Field; 0] = [];\n let bounded_vec = BoundedVec::from_array([]);\n\n assert_eq(bounded_vec.max_len(), 0);\n assert_eq(bounded_vec.len(), 0);\n assert_eq(bounded_vec.storage(), empty_array);\n }\n\n #[test]\n fn equal_len() {\n let array = [1, 2, 3];\n let bounded_vec = BoundedVec::from_array(array);\n\n assert_eq(bounded_vec.max_len(), 3);\n assert_eq(bounded_vec.len(), 3);\n assert_eq(bounded_vec.storage(), array);\n }\n\n #[test]\n fn max_len_greater_then_array_len() {\n let array = [1, 2, 3];\n let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from_array(array);\n\n assert_eq(bounded_vec.max_len(), 10);\n assert_eq(bounded_vec.len(), 3);\n assert_eq(bounded_vec.get(0), 1);\n assert_eq(bounded_vec.get(1), 2);\n assert_eq(bounded_vec.get(2), 3);\n }\n\n #[test(should_fail_with = \"from array out of bounds\")]\n fn max_len_lower_then_array_len() {\n let _: BoundedVec<Field, 2> = BoundedVec::from_array([0; 3]);\n }\n\n #[test]\n fn from_array_preserves_order() {\n let array = [5, 3, 1, 4, 2];\n let vec: BoundedVec<u32, 5> = BoundedVec::from_array(array);\n for i in 0..array.len() {\n assert_eq(vec.get(i), array[i]);\n }\n }\n\n #[test]\n fn from_array_with_different_types() {\n let bool_array = [true, false, true];\n let bool_vec: BoundedVec<bool, 3> = BoundedVec::from_array(bool_array);\n assert_eq(bool_vec.len(), 3);\n assert_eq(bool_vec.get(0), true);\n assert_eq(bool_vec.get(1), false);\n }\n }\n\n mod trait_from {\n use crate::collections::bounded_vec::BoundedVec;\n use crate::convert::From;\n\n #[test]\n fn simple() {\n let array = [1, 2];\n let bounded_vec: BoundedVec<Field, 10> = BoundedVec::from(array);\n\n assert_eq(bounded_vec.max_len(), 10);\n assert_eq(bounded_vec.len(), 2);\n assert_eq(bounded_vec.get(0), 1);\n assert_eq(bounded_vec.get(1), 2);\n }\n }\n\n mod trait_eq {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn empty_equality() {\n let mut bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let mut bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n\n assert_eq(bounded_vec1, bounded_vec2);\n }\n\n #[test]\n fn inequality() {\n let mut bounded_vec1: BoundedVec<Field, 3> = BoundedVec::new();\n let mut bounded_vec2: BoundedVec<Field, 3> = BoundedVec::new();\n bounded_vec1.push(1);\n bounded_vec2.push(2);\n\n assert(bounded_vec1 != bounded_vec2);\n }\n }\n\n mod from_parts {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn from_parts() {\n // docs:start:from-parts\n let vec: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 0], 3);\n assert_eq(vec.len(), 3);\n\n // Any elements past the given length are zeroed out, so these\n // two BoundedVecs will be completely equal\n let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 1], 3);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts([1, 2, 3, 2], 3);\n assert_eq(vec1, vec2);\n // docs:end:from-parts\n }\n\n #[test]\n fn from_parts_unchecked() {\n // docs:start:from-parts-unchecked\n let vec: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 0], 3);\n assert_eq(vec.len(), 3);\n\n // invalid use!\n let vec1: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 1], 3);\n let vec2: BoundedVec<u32, 4> = BoundedVec::from_parts_unchecked([1, 2, 3, 2], 3);\n\n // both vecs have length 3 so we'd expect them to be equal, but this\n // fails because elements past the length are still checked in eq\n assert(vec1 != vec2);\n // docs:end:from-parts-unchecked\n }\n }\n\n mod push_pop {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn push_and_pop_operations() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n assert_eq(vec.len(), 0);\n\n vec.push(1);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 1);\n\n vec.push(2);\n assert_eq(vec.len(), 2);\n assert_eq(vec.get(1), 2);\n\n let popped = vec.pop();\n assert_eq(popped, 2);\n assert_eq(vec.len(), 1);\n\n let popped2 = vec.pop();\n assert_eq(popped2, 1);\n assert_eq(vec.len(), 0);\n }\n\n #[test(should_fail_with = \"push out of bounds\")]\n fn push_to_full_vector() {\n let mut vec: BoundedVec<u32, 2> = BoundedVec::new();\n vec.push(1);\n vec.push(2);\n vec.push(3); // should panic\n }\n\n #[test(should_fail_with = \"cannot pop from an empty vector\")]\n fn pop_from_empty_vector() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let _ = vec.pop(); // should panic\n }\n\n #[test]\n fn push_pop_cycle() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n\n // push to full\n vec.push(1);\n vec.push(2);\n vec.push(3);\n assert_eq(vec.len(), 3);\n\n // pop all\n assert_eq(vec.pop(), 3);\n assert_eq(vec.pop(), 2);\n assert_eq(vec.pop(), 1);\n assert_eq(vec.len(), 0);\n\n // push again\n vec.push(4);\n assert_eq(vec.len(), 1);\n assert_eq(vec.get(0), 4);\n }\n }\n\n mod extend {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn extend_from_array() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3]);\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n fn extend_from_slice() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_slice(&[2, 3]);\n\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n\n #[test]\n fn extend_from_bounded_vec() {\n let mut vec1: BoundedVec<u32, 5> = BoundedVec::new();\n let mut vec2: BoundedVec<u32, 3> = BoundedVec::new();\n\n vec1.push(1);\n vec2.push(2);\n vec2.push(3);\n\n vec1.extend_from_bounded_vec(vec2);\n\n assert_eq(vec1.len(), 3);\n assert_eq(vec1.get(0), 1);\n assert_eq(vec1.get(1), 2);\n assert_eq(vec1.get(2), 3);\n }\n\n #[test(should_fail_with = \"extend_from_array out of bounds\")]\n fn extend_array_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_array([2, 3, 4]); // should panic\n }\n\n #[test(should_fail_with = \"extend_from_slice out of bounds\")]\n fn extend_slice_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n vec.push(1);\n vec.extend_from_slice(&[2, 3, 4]); // S]should panic\n }\n\n #[test(should_fail_with = \"extend_from_bounded_vec out of bounds\")]\n fn extend_bounded_vec_beyond_max_len() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::new();\n let other: BoundedVec<u32, 5> = BoundedVec::from_array([1, 2, 3, 4, 5]);\n vec.extend_from_bounded_vec(other); // should panic\n }\n\n #[test]\n fn extend_with_empty_collections() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n let original_len = vec.len();\n\n vec.extend_from_array([]);\n assert_eq(vec.len(), original_len);\n\n vec.extend_from_slice(&[]);\n assert_eq(vec.len(), original_len);\n\n let empty: BoundedVec<u32, 3> = BoundedVec::new();\n vec.extend_from_bounded_vec(empty);\n assert_eq(vec.len(), original_len);\n }\n }\n\n mod storage {\n use crate::collections::bounded_vec::BoundedVec;\n\n #[test]\n fn storage_consistency() {\n let mut vec: BoundedVec<u32, 5> = BoundedVec::new();\n\n // test initial storage state\n assert_eq(vec.storage(), [0, 0, 0, 0, 0]);\n\n vec.push(1);\n vec.push(2);\n\n // test storage after modifications\n assert_eq(vec.storage(), [1, 2, 0, 0, 0]);\n\n // storage doesn't change length\n assert_eq(vec.len(), 2);\n assert_eq(vec.max_len(), 5);\n }\n\n #[test]\n fn storage_after_pop() {\n let mut vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n\n let _ = vec.pop();\n // after pop, the last element should be zeroed\n assert_eq(vec.storage(), [1, 2, 0]);\n assert_eq(vec.len(), 2);\n }\n\n #[test]\n fn vector_immutable() {\n let vec: BoundedVec<u32, 3> = BoundedVec::from_array([1, 2, 3]);\n let storage = vec.storage();\n\n assert_eq(storage, [1, 2, 3]);\n\n // Verify that the original vector is unchanged\n assert_eq(vec.len(), 3);\n assert_eq(vec.get(0), 1);\n assert_eq(vec.get(1), 2);\n assert_eq(vec.get(2), 3);\n }\n }\n}\n",
|
|
134
134
|
"path": "std/collections/bounded_vec.nr"
|
|
135
135
|
},
|
|
136
136
|
"22": {
|
|
137
|
-
"source": "pub mod hash;\npub mod aes128;\npub mod array;\npub mod slice;\npub mod ecdsa_secp256k1;\npub mod ecdsa_secp256r1;\npub mod embedded_curve_ops;\npub mod field;\npub mod collections;\npub mod compat;\npub mod convert;\npub mod option;\npub mod string;\npub mod test;\npub mod cmp;\npub mod ops;\npub mod default;\npub mod prelude;\npub mod runtime;\npub mod meta;\npub mod append;\npub mod mem;\npub mod panic;\npub mod hint;\n\nuse convert::AsPrimitive;\n\n// Oracle calls are required to be wrapped in an unconstrained function\n// Thus, the only argument to the `println` oracle is expected to always be an ident\n#[oracle(print)]\nunconstrained fn print_oracle<T>(with_newline: bool, input: T) {}\n\nunconstrained fn print_unconstrained<T>(with_newline: bool, input: T) {\n print_oracle(with_newline, input);\n}\n\npub fn println<T>(input: T) {\n // Safety: a print statement cannot be constrained\n unsafe {\n print_unconstrained(true, input);\n }\n}\n\npub fn print<T>(input: T) {\n // Safety: a print statement cannot be constrained\n unsafe {\n print_unconstrained(false, input);\n }\n}\n\n/// Asserts the validity of the provided proof and public inputs against the provided verification key and hash.\n///\n/// The ACVM cannot determine whether the provided proof is valid during execution as this requires knowledge of\n/// the backend against which the program is being proven. However if an invalid proof if submitted, the program may\n/// fail to prove or the backend may generate a proof which will subsequently fail to verify.\n///\n/// # Important Note\n///\n/// If you are not developing your own backend such as [Barretenberg](https://github.com/AztecProtocol/barretenberg)\n/// you probably shouldn't need to interact with this function directly. It's easier and safer to use a verification\n/// library which is published by the developers of the backend which will document or enforce any safety requirements.\n///\n/// If you use this directly, you're liable to introduce underconstrainedness bugs and *your circuit will be insecure*.\n///\n/// # Arguments\n/// - verification_key: The verification key of the circuit to be verified.\n/// - proof: The proof to be verified.\n/// - public_inputs: The public inputs associated with `proof`\n/// - key_hash: The hash of `verification_key` of the form expected by the backend.\n/// - proof_type: An identifier for the proving scheme used to generate the proof to be verified. This allows\n/// for a single backend to support verifying multiple proving schemes.\n///\n/// # Constraining `key_hash`\n///\n/// The Noir compiler does not by itself constrain that `key_hash` is a valid hash of `verification_key`.\n/// This is because different backends may differ in how they hash their verification keys.\n/// It is then the responsibility of either the noir developer (by explicitly hashing the verification key\n/// in the correct manner) or by the proving system itself internally asserting the correctness of `key_hash`.\npub fn verify_proof_with_type<let N: u32, let M: u32, let K: u32>(\n verification_key: [Field; N],\n proof: [Field; M],\n public_inputs: [Field; K],\n key_hash: Field,\n proof_type: u32,\n) {\n if !crate::runtime::is_unconstrained() {\n crate::assert_constant(proof_type);\n }\n verify_proof_internal(verification_key, proof, public_inputs, key_hash, proof_type);\n}\n\n#[foreign(recursive_aggregation)]\nfn verify_proof_internal<let N: u32, let M: u32, let K: u32>(\n verification_key: [Field; N],\n proof: [Field; M],\n public_inputs: [Field; K],\n key_hash: Field,\n proof_type: u32,\n) {}\n\n// Asserts that the given value is known at compile-time.\n// Useful for debugging for-loop bounds.\n#[builtin(assert_constant)]\npub fn assert_constant<T>(x: T) {}\n\n// Asserts that the given value is both true and known at compile-time.\n// The message can be a string, a format string, or any value, as long as it is known at compile-time\n#[builtin(static_assert)]\npub fn static_assert<T>(predicate: bool, message: T) {}\n\n#[deprecated(\"wrapping operations should be done with the Wrapping traits. E.g: x.wrapping_add(y)\")]\npub fn wrapping_add<T>(x: T, y: T) -> T\nwhere\n T: AsPrimitive<Field>,\n Field: AsPrimitive<T>,\n{\n AsPrimitive::as_(x.as_() + y.as_())\n}\n#[deprecated(\"wrapping operations should be done with the Wrapping traits. E.g: x.wrapping_sub(y)\")]\npub fn wrapping_sub<T>(x: T, y: T) -> T\nwhere\n T: AsPrimitive<Field>,\n Field: AsPrimitive<T>,\n{\n //340282366920938463463374607431768211456 is 2^128, it is used to avoid underflow\n AsPrimitive::as_(x.as_() + 340282366920938463463374607431768211456 - y.as_())\n}\n#[deprecated(\"wrapping operations should be done with the Wrapping traits. E.g: x.wrapping_mul(y)\")]\npub fn wrapping_mul<T>(x: T, y: T) -> T\nwhere\n T: AsPrimitive<Field>,\n Field: AsPrimitive<T>,\n{\n AsPrimitive::as_(x.as_() * y.as_())\n}\n\n#[builtin(as_witness)]\npub fn as_witness(x: Field) {}\n",
|
|
137
|
+
"source": "pub mod hash;\npub mod aes128;\npub mod array;\npub mod slice;\npub mod ecdsa_secp256k1;\npub mod ecdsa_secp256r1;\npub mod embedded_curve_ops;\npub mod field;\npub mod collections;\npub mod compat;\npub mod convert;\npub mod option;\npub mod string;\npub mod test;\npub mod cmp;\npub mod ops;\npub mod default;\npub mod prelude;\npub mod runtime;\npub mod meta;\npub mod append;\npub mod mem;\npub mod panic;\npub mod hint;\n\nmod primitive_docs;\n\nuse convert::AsPrimitive;\n\n// Oracle calls are required to be wrapped in an unconstrained function\n// Thus, the only argument to the `println` oracle is expected to always be an ident\n#[oracle(print)]\nunconstrained fn print_oracle<T>(with_newline: bool, input: T) {}\n\nunconstrained fn print_unconstrained<T>(with_newline: bool, input: T) {\n print_oracle(with_newline, input);\n}\n\npub fn println<T>(input: T) {\n // Safety: a print statement cannot be constrained\n unsafe {\n print_unconstrained(true, input);\n }\n}\n\npub fn print<T>(input: T) {\n // Safety: a print statement cannot be constrained\n unsafe {\n print_unconstrained(false, input);\n }\n}\n\n/// Asserts the validity of the provided proof and public inputs against the provided verification key and hash.\n///\n/// The ACVM cannot determine whether the provided proof is valid during execution as this requires knowledge of\n/// the backend against which the program is being proven. However if an invalid proof if submitted, the program may\n/// fail to prove or the backend may generate a proof which will subsequently fail to verify.\n///\n/// # Important Note\n///\n/// If you are not developing your own backend such as [Barretenberg](https://github.com/AztecProtocol/barretenberg)\n/// you probably shouldn't need to interact with this function directly. It's easier and safer to use a verification\n/// library which is published by the developers of the backend which will document or enforce any safety requirements.\n///\n/// If you use this directly, you're liable to introduce underconstrainedness bugs and *your circuit will be insecure*.\n///\n/// # Arguments\n/// - verification_key: The verification key of the circuit to be verified.\n/// - proof: The proof to be verified.\n/// - public_inputs: The public inputs associated with `proof`\n/// - key_hash: The hash of `verification_key` of the form expected by the backend.\n/// - proof_type: An identifier for the proving scheme used to generate the proof to be verified. This allows\n/// for a single backend to support verifying multiple proving schemes.\n///\n/// # Constraining `key_hash`\n///\n/// The Noir compiler does not by itself constrain that `key_hash` is a valid hash of `verification_key`.\n/// This is because different backends may differ in how they hash their verification keys.\n/// It is then the responsibility of either the noir developer (by explicitly hashing the verification key\n/// in the correct manner) or by the proving system itself internally asserting the correctness of `key_hash`.\npub fn verify_proof_with_type<let N: u32, let M: u32, let K: u32>(\n verification_key: [Field; N],\n proof: [Field; M],\n public_inputs: [Field; K],\n key_hash: Field,\n proof_type: u32,\n) {\n if !crate::runtime::is_unconstrained() {\n crate::assert_constant(proof_type);\n }\n verify_proof_internal(verification_key, proof, public_inputs, key_hash, proof_type);\n}\n\n#[foreign(recursive_aggregation)]\nfn verify_proof_internal<let N: u32, let M: u32, let K: u32>(\n verification_key: [Field; N],\n proof: [Field; M],\n public_inputs: [Field; K],\n key_hash: Field,\n proof_type: u32,\n) {}\n\n// Asserts that the given value is known at compile-time.\n// Useful for debugging for-loop bounds.\n#[builtin(assert_constant)]\npub fn assert_constant<T>(x: T) {}\n\n// Asserts that the given value is both true and known at compile-time.\n// The message can be a string, a format string, or any value, as long as it is known at compile-time\n#[builtin(static_assert)]\npub fn static_assert<T>(predicate: bool, message: T) {}\n\n#[deprecated(\"wrapping operations should be done with the Wrapping traits. E.g: x.wrapping_add(y)\")]\npub fn wrapping_add<T>(x: T, y: T) -> T\nwhere\n T: AsPrimitive<Field>,\n Field: AsPrimitive<T>,\n{\n AsPrimitive::as_(x.as_() + y.as_())\n}\n#[deprecated(\"wrapping operations should be done with the Wrapping traits. E.g: x.wrapping_sub(y)\")]\npub fn wrapping_sub<T>(x: T, y: T) -> T\nwhere\n T: AsPrimitive<Field>,\n Field: AsPrimitive<T>,\n{\n //340282366920938463463374607431768211456 is 2^128, it is used to avoid underflow\n AsPrimitive::as_(x.as_() + 340282366920938463463374607431768211456 - y.as_())\n}\n#[deprecated(\"wrapping operations should be done with the Wrapping traits. E.g: x.wrapping_mul(y)\")]\npub fn wrapping_mul<T>(x: T, y: T) -> T\nwhere\n T: AsPrimitive<Field>,\n Field: AsPrimitive<T>,\n{\n AsPrimitive::as_(x.as_() * y.as_())\n}\n\n#[builtin(as_witness)]\npub fn as_witness(x: Field) {}\n",
|
|
138
138
|
"path": "std/lib.nr"
|
|
139
139
|
},
|
|
140
|
-
"
|
|
140
|
+
"51": {
|
|
141
141
|
"source": "use dep::mock_types::{\n AppPublicInputs, MEGA_VK_LENGTH_IN_FIELDS, PrivateKernelPublicInputs,\n PrivateKernelPublicInputsBuilder, PROOF_TYPE_OINK, TxRequest, VerificationKey,\n};\n\nfn main(\n tx: TxRequest,\n app_inputs: call_data(1) AppPublicInputs,\n app_vk: VerificationKey<MEGA_VK_LENGTH_IN_FIELDS>,\n) -> return_data PrivateKernelPublicInputs {\n std::verify_proof_with_type(app_vk.key, [], [], app_vk.hash, PROOF_TYPE_OINK);\n\n let mut private_kernel_inputs = PrivateKernelPublicInputsBuilder::from_tx(tx);\n private_kernel_inputs.ingest_app_inputs(app_inputs);\n private_kernel_inputs.finish()\n}\n",
|
|
142
142
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/mock-protocol-circuits/crates/mock-private-kernel-init/src/main.nr"
|
|
143
143
|
},
|
|
144
|
-
"
|
|
144
|
+
"52": {
|
|
145
145
|
"source": "pub global MAX_COMMITMENTS_PER_CALL: u32 = 2;\npub global MAX_COMMITMENTS_PER_TX: u32 = 4;\npub global MAX_COMMITMENT_READ_REQUESTS_PER_CALL: u32 = 2;\npub global MAX_COMMITMENT_READ_REQUESTS_PER_TX: u32 = 4;\n\npub use protocol_types::{\n abis::avm_circuit_public_inputs::AvmCircuitPublicInputs,\n constants::{\n AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, AVM_V2_VERIFICATION_KEY_LENGTH_IN_FIELDS_PADDED,\n CHONK_PROOF_LENGTH, CHONK_VK_LENGTH_IN_FIELDS, MEGA_VK_LENGTH_IN_FIELDS,\n NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, PROOF_TYPE_AVM, PROOF_TYPE_CHONK, PROOF_TYPE_HN,\n PROOF_TYPE_HN_FINAL, PROOF_TYPE_HN_TAIL, PROOF_TYPE_OINK, PROOF_TYPE_ROLLUP_HONK,\n PROOF_TYPE_ROOT_ROLLUP_HONK,\n },\n proof::{\n traits::SerializeToColumns,\n verification_key::{RollupHonkVerificationKey, VerificationKey},\n },\n traits::Serialize,\n};\n\npub struct TxRequest {\n pub number_of_calls: u32,\n}\n\npub struct AppPublicInputs {\n pub commitments: [Field; MAX_COMMITMENTS_PER_CALL],\n pub read_requests: [Field; MAX_COMMITMENT_READ_REQUESTS_PER_CALL],\n}\n\nimpl Default for AppPublicInputs {\n fn default() -> Self {\n Self {\n commitments: [0; MAX_COMMITMENTS_PER_CALL],\n read_requests: [0; MAX_COMMITMENT_READ_REQUESTS_PER_CALL],\n }\n }\n}\n\npub struct PrivateKernelPublicInputs {\n pub remaining_calls: u32,\n pub commitments: [Field; MAX_COMMITMENTS_PER_TX],\n pub read_requests: [Field; MAX_COMMITMENT_READ_REQUESTS_PER_TX],\n}\n\nimpl Default for PrivateKernelPublicInputs {\n fn default() -> Self {\n Self {\n remaining_calls: 0,\n commitments: [0; MAX_COMMITMENTS_PER_TX],\n read_requests: [0; MAX_COMMITMENT_READ_REQUESTS_PER_TX],\n }\n }\n}\n\npub struct PrivateKernelPublicInputsBuilder {\n pub remaining_calls: u32,\n pub commitments: BoundedVec<Field, MAX_COMMITMENTS_PER_TX>,\n pub read_requests: BoundedVec<Field, MAX_COMMITMENT_READ_REQUESTS_PER_TX>,\n}\n\nimpl PrivateKernelPublicInputsBuilder {\n pub fn from_tx(tx: TxRequest) -> Self {\n Self {\n remaining_calls: tx.number_of_calls,\n commitments: BoundedVec::new(),\n read_requests: BoundedVec::new(),\n }\n }\n\n pub fn from_previous_kernel(prev_kernel_public_inputs: PrivateKernelPublicInputs) -> Self {\n let mut builder = PrivateKernelPublicInputsBuilder {\n remaining_calls: prev_kernel_public_inputs.remaining_calls,\n commitments: BoundedVec::new(),\n read_requests: BoundedVec::new(),\n };\n for i in 0..MAX_COMMITMENTS_PER_TX {\n if prev_kernel_public_inputs.commitments[i] != 0 {\n builder.commitments.push(prev_kernel_public_inputs.commitments[i]);\n }\n }\n for i in 0..MAX_COMMITMENT_READ_REQUESTS_PER_TX {\n if prev_kernel_public_inputs.read_requests[i] != 0 {\n builder.read_requests.push(prev_kernel_public_inputs.read_requests[i]);\n }\n }\n builder\n }\n\n pub fn ingest_app_inputs(&mut self, app_inputs: AppPublicInputs) {\n for i in 0..MAX_COMMITMENTS_PER_CALL {\n if app_inputs.commitments[i] != 0 {\n self.commitments.push(app_inputs.commitments[i]);\n }\n }\n\n for i in 0..MAX_COMMITMENT_READ_REQUESTS_PER_CALL {\n if app_inputs.read_requests[i] != 0 {\n self.read_requests.push(app_inputs.read_requests[i]);\n }\n }\n\n self.remaining_calls -= 1;\n }\n\n pub fn finish(self) -> PrivateKernelPublicInputs {\n PrivateKernelPublicInputs {\n remaining_calls: self.remaining_calls,\n commitments: self.commitments.storage(),\n read_requests: self.read_requests.storage(),\n }\n }\n}\n\n#[derive(Serialize)]\npub struct KernelPublicInputs {\n pub commitments: [Field; MAX_COMMITMENTS_PER_TX],\n}\n\nimpl Default for KernelPublicInputs {\n fn default() -> Self {\n Self { commitments: [0; MAX_COMMITMENTS_PER_TX] }\n }\n}\n\n#[derive(Serialize)]\npub struct RollupPublicInputs {\n accumulated: u32,\n}\n\nimpl RollupPublicInputs {\n pub fn new(accumulated: u32) -> Self {\n Self { accumulated }\n }\n\n pub fn merge(self, other: Self) -> Self {\n Self { accumulated: self.accumulated + other.accumulated }\n }\n}\n\npub struct PreviousRollupData {\n base_or_merge_public_inputs: RollupPublicInputs,\n proof: [Field; NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH],\n vk: RollupHonkVerificationKey,\n}\n\nimpl PreviousRollupData {\n pub fn verify(self, is_root: bool) {\n let inputs = self.base_or_merge_public_inputs.serialize();\n\n std::verify_proof_with_type(\n self.vk.key,\n self.proof,\n inputs,\n self.vk.hash,\n if is_root {\n PROOF_TYPE_ROOT_ROLLUP_HONK\n } else {\n PROOF_TYPE_ROLLUP_HONK\n },\n );\n }\n\n pub fn public_inputs(self) -> RollupPublicInputs {\n self.base_or_merge_public_inputs\n }\n}\n\n// CHONK: \"Client Honk\" - An UltraHonk variant with incremental folding and delayed non-native arithmetic.\npub struct ChonkProofData {\n pub public_inputs: KernelPublicInputs,\n pub proof: [Field; CHONK_PROOF_LENGTH],\n pub vk_data: VerificationKey<CHONK_VK_LENGTH_IN_FIELDS>,\n}\n\nimpl ChonkProofData {\n pub fn verify(self) {\n let inputs = KernelPublicInputs::serialize(self.public_inputs);\n std::verify_proof_with_type(\n self.vk_data.key,\n self.proof,\n inputs,\n self.vk_data.hash,\n PROOF_TYPE_CHONK,\n );\n }\n}\n",
|
|
146
146
|
"path": "/home/aztec-dev/aztec-packages/noir-projects/mock-protocol-circuits/crates/mock-types/src/lib.nr"
|
|
147
147
|
}
|
|
@@ -152,31 +152,31 @@
|
|
|
152
152
|
}
|
|
153
153
|
},
|
|
154
154
|
"verificationKey": {
|
|
155
|
-
"bytes": "
|
|
155
|
+
"bytes": "000000000000000000000000000000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000004100000000000000000000000000000000000000000000000000000000000000c10000000000000000000000000000004b19f042665d4fd0ec17e7532879a2a861000000000000000000000000000000000026943874b40aaa607597d7b010ed74000000000000000000000000000000c430bfa49e7401bfe51be640109c7fd75900000000000000000000000000000000002f948793e5e2263d23c575ebed5f250000000000000000000000000000009506185b769e3872f498b7eec13fcc2cfb0000000000000000000000000000000000090c5c4f4111a9f690e369f8d7cbc700000000000000000000000000000009b6db2ff6fab75773ced9e2b602cc5fa900000000000000000000000000000000000bbd7817270e251a4fea7ec3872743000000000000000000000000000000269147d893a3fa55505b2b70ca70ab1b22000000000000000000000000000000000013cd5635a4d32ad9656362b8cd97f40000000000000000000000000000008af9dc9cd8ff7fdb245ecb13d3c1932d6500000000000000000000000000000000001961ba597f1e79a9e6275b77aed659000000000000000000000000000000cbc3d42b17353703c0c5a088f58170c8130000000000000000000000000000000000037ef373a62ddf45d129f01e4985cf000000000000000000000000000000b7e2061387ecfe7d80e7c7769a2505388a000000000000000000000000000000000024d61a0c10cdc743383aea0262679a0000000000000000000000000000002e561260cf0d939a5f220a011cc5bcc27f000000000000000000000000000000000002b552e1dea9f28f200be8470e6912000000000000000000000000000000e38511ad7daa9bd41a76805eec997a424f00000000000000000000000000000000000a1c04b98643e18ca97a3cfb8c5da70000000000000000000000000000000b38add73759ad6e4e1b03e7495f0d9a8e000000000000000000000000000000000026a040a9b3913f8237773df567553d0000000000000000000000000000004e819e5c9fea83d5b236bdd1f0007fb6a300000000000000000000000000000000002f80ee3ee051280031939773ae18d100000000000000000000000000000060529825e4fc65aa3d341aab04672865bf00000000000000000000000000000000002317deb891b27e16386f5d7e5b30b800000000000000000000000000000006e3b26eaa4526bd12a773e766aedc726800000000000000000000000000000000001e009a846518a8a963350cf62767720000000000000000000000000000009f51786c672512d86bf10eeadb9de3f33f00000000000000000000000000000000002462d46ad58bcf7ce72a212251180d00000000000000000000000000000097bc968761716947d1f209e0adf2146c8600000000000000000000000000000000000db88f4634d3d76aa318b3177c47ac0000000000000000000000000000001a36887cac9db5ca645f062023bc96e0c900000000000000000000000000000000002c42513c9e3f1fe0cdc4795d59253d00000000000000000000000000000036a57a2c0aad1fe684ab02ca74bdf30fae0000000000000000000000000000000000096ea5e69ddd18f544a1af4cda2b8f000000000000000000000000000000463804dd9ba595b0509e86b4ee51a385ba000000000000000000000000000000000017792b9e1271686da058d7d0e61ac8000000000000000000000000000000b9ca851b4b4bcfe9047004ede6cc70476400000000000000000000000000000000002be5cb507e94d29439e1951a9157a6000000000000000000000000000000cfcf377c3643b8845845fa59622363ed2c0000000000000000000000000000000000010be8336a35e83f332113493aab25000000000000000000000000000000eceb28b9848eaaded40f62aa4592751b5a00000000000000000000000000000000002d811a933f81a0f627d74567fb1af7000000000000000000000000000000f07a3ed217b7d2f2cd7bca48f3e93395e40000000000000000000000000000000000086c81c3c8354ef568b51ef1e5300600000000000000000000000000000051e48f6d035c914b9be93c4d481b3197ef00000000000000000000000000000000000f9d0080a0b8831902bb140632281a0000000000000000000000000000007e7742b11386f157e51064340dc72701a4000000000000000000000000000000000009b3b98fe68b65d93bb3fa429332d20000000000000000000000000000004c899f1ce9dd657104b46b8dfbf6eb70eb000000000000000000000000000000000024490cfd7298f3b8bdf0d7ac7f1b22000000000000000000000000000000b1b5f6a71864fe49374359d3e9a245e8ca000000000000000000000000000000000026b14b193a8a689dc1f1ece11a6592000000000000000000000000000000ff59d8d3d194c1f25ca653a38000e9ac2d0000000000000000000000000000000000280371c85e5d92743d5f0143a2c7b6000000000000000000000000000000d6d2e8bb47cbe787b4cefe94bc799dda61000000000000000000000000000000000008676fd9e6a6a01e77127dc318392800000000000000000000000000000034a152c3eb3f120130a7de761e3fc92e6b00000000000000000000000000000000002f87f6ee945e09c5e7258332eaa640000000000000000000000000000000a6fb9b3e7a8a535abe5cce2d02c78af85c00000000000000000000000000000000002397661372114869511ebbfef7cafc0000000000000000000000000000005987a7835cf91182b760fe58a2262ba09c0000000000000000000000000000000000130703ae35119ab32296ec33e9e2d700000000000000000000000000000030a0d620602e3c0e367f79fe5c7c347fa10000000000000000000000000000000000058a2336ee887abbf0b7407668c2bd000000000000000000000000000000522ff11365919708a5e91a8a9cd9cec82c00000000000000000000000000000000002d0f741fa1348ffe3922aa45c22d37000000000000000000000000000000e476c1c0dd5f4e9f89360efd76a98907a600000000000000000000000000000000002a31a29459ef8a3ba8f6a78c1da536000000000000000000000000000000f765dd3c65d5111f3fa920a3a1352b768300000000000000000000000000000000001e6d98197922a20f5a8708977572e0000000000000000000000000000000beed59b3bebfd95488cb7ce39199a2a6be00000000000000000000000000000000001032b55508af539de70b39fdaf7df4000000000000000000000000000000006b982179965ee19110ba69836607b377000000000000000000000000000000000012ea00f98e7364b163e0bc06be76ae00000000000000000000000000000038ff559e9dfc9d2682980cd3146722b119000000000000000000000000000000000004fe240fbac8d47f9ce1b52f1720a80000000000000000000000000000007b59c1fb8dd995040ef7cfc3a15337036e0000000000000000000000000000000000264feb1c9a2626982090d0046852390000000000000000000000000000001bf7bf908352c6544344b42e626da9d05a0000000000000000000000000000000000092fdcfd125a6ec77133955a41843d000000000000000000000000000000a9708b49bda6af5e030e895ea1eb3b0e37000000000000000000000000000000000009ca0a4139ca4a46f8549b899947cd0000000000000000000000000000005210c2a35e6ddb62df43394994578a582300000000000000000000000000000000000aac650bcec6b8643bc09f4ac90a910000000000000000000000000000002a0271e64fdca5140ea94f5a48460b33b000000000000000000000000000000000001f6df58453c98a8bdba5425eb33f63000000000000000000000000000000ba7d49af35ab3f3b1eae194179baa6bb9100000000000000000000000000000000001fa757a1b94586fc58b7b83ac65a7c000000000000000000000000000000de976f9da67b401d6d30b63d4014826b6d0000000000000000000000000000000000100823bc59d8562e857655ea26c74300000000000000000000000000000095b5d8b7b4a63b05df652b0d10ef146d260000000000000000000000000000000000099e3bd5a0a00ab7fe18040105b9b30000000000000000000000000000002129af3a637f5a622a32440f860d1e2a7f00000000000000000000000000000000000015b8d2515d76e2ccec99dcd19459000000000000000000000000000000222b888108dc25d1aa450e0b4bc212c37e00000000000000000000000000000000001b917517920bad3d8bc01c9595092a000000000000000000000000000000482141c7ebe42000a1d58ccb74381f6d190000000000000000000000000000000000305e8992b148eedb22e6e992077a8400000000000000000000000000000038ed8da2375186b518c7345c60b1134b2d0000000000000000000000000000000000061f64497996e8915722501e9e36790000000000000000000000000000002ad3d7cb59792e11c0d2691f317fd50e6e00000000000000000000000000000000001b84d38339321f405ebaf6a2f8308400000000000000000000000000000028edd1a7e46c840d9c943fdf45521c64ce0000000000000000000000000000000000043d063b130adfb37342af45d0155a0000000000000000000000000000009330952ae74c573d1686d9cb4a007338540000000000000000000000000000000000261522c4089330646aff9673619494000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000039e1194eee119336f8fce78f5cee6f361d00000000000000000000000000000000000a926c35375420def3abd24209656d000000000000000000000000000000c8ba242c87e99c38cb90408d13c919799f000000000000000000000000000000000021865083dce030e9fe3c0ec128e16d000000000000000000000000000000001dbb619e6e929e76a6efd1e4385c88f3000000000000000000000000000000000005f8a1641d13b243a02a3f02b2ee280000000000000000000000000000002d82538a2445a88d2075c85f73a52fa00d00000000000000000000000000000000000765b47bcde9aab139f5be476581ad0000000000000000000000000000008199eb3f9a2a1f196a4ceb852524c5940d00000000000000000000000000000000000e42760c6f2beb83472d413a5e15570000000000000000000000000000004dde264addef42e41eb907356c891d62650000000000000000000000000000000000203ea550470228dac21d893338e621",
|
|
156
156
|
"fields": [
|
|
157
157
|
"0x000000000000000000000000000000000000000000000000000000000000000f",
|
|
158
158
|
"0x0000000000000000000000000000000000000000000000000000000000000041",
|
|
159
159
|
"0x00000000000000000000000000000000000000000000000000000000000000c1",
|
|
160
|
-
"
|
|
161
|
-
"
|
|
162
|
-
"
|
|
163
|
-
"
|
|
164
|
-
"
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
"
|
|
174
|
-
"
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
"
|
|
179
|
-
"
|
|
160
|
+
"0x0000000000000000000000000000004b19f042665d4fd0ec17e7532879a2a861",
|
|
161
|
+
"0x000000000000000000000000000000000026943874b40aaa607597d7b010ed74",
|
|
162
|
+
"0x000000000000000000000000000000c430bfa49e7401bfe51be640109c7fd759",
|
|
163
|
+
"0x00000000000000000000000000000000002f948793e5e2263d23c575ebed5f25",
|
|
164
|
+
"0x0000000000000000000000000000009506185b769e3872f498b7eec13fcc2cfb",
|
|
165
|
+
"0x0000000000000000000000000000000000090c5c4f4111a9f690e369f8d7cbc7",
|
|
166
|
+
"0x00000000000000000000000000000009b6db2ff6fab75773ced9e2b602cc5fa9",
|
|
167
|
+
"0x00000000000000000000000000000000000bbd7817270e251a4fea7ec3872743",
|
|
168
|
+
"0x000000000000000000000000000000269147d893a3fa55505b2b70ca70ab1b22",
|
|
169
|
+
"0x000000000000000000000000000000000013cd5635a4d32ad9656362b8cd97f4",
|
|
170
|
+
"0x0000000000000000000000000000008af9dc9cd8ff7fdb245ecb13d3c1932d65",
|
|
171
|
+
"0x00000000000000000000000000000000001961ba597f1e79a9e6275b77aed659",
|
|
172
|
+
"0x000000000000000000000000000000cbc3d42b17353703c0c5a088f58170c813",
|
|
173
|
+
"0x0000000000000000000000000000000000037ef373a62ddf45d129f01e4985cf",
|
|
174
|
+
"0x000000000000000000000000000000b7e2061387ecfe7d80e7c7769a2505388a",
|
|
175
|
+
"0x000000000000000000000000000000000024d61a0c10cdc743383aea0262679a",
|
|
176
|
+
"0x0000000000000000000000000000002e561260cf0d939a5f220a011cc5bcc27f",
|
|
177
|
+
"0x000000000000000000000000000000000002b552e1dea9f28f200be8470e6912",
|
|
178
|
+
"0x000000000000000000000000000000e38511ad7daa9bd41a76805eec997a424f",
|
|
179
|
+
"0x00000000000000000000000000000000000a1c04b98643e18ca97a3cfb8c5da7",
|
|
180
180
|
"0x0000000000000000000000000000000b38add73759ad6e4e1b03e7495f0d9a8e",
|
|
181
181
|
"0x000000000000000000000000000000000026a040a9b3913f8237773df567553d",
|
|
182
182
|
"0x0000000000000000000000000000004e819e5c9fea83d5b236bdd1f0007fb6a3",
|
|
@@ -217,34 +217,34 @@
|
|
|
217
217
|
"0x000000000000000000000000000000000008676fd9e6a6a01e77127dc3183928",
|
|
218
218
|
"0x00000000000000000000000000000034a152c3eb3f120130a7de761e3fc92e6b",
|
|
219
219
|
"0x00000000000000000000000000000000002f87f6ee945e09c5e7258332eaa640",
|
|
220
|
-
"
|
|
221
|
-
"
|
|
222
|
-
"
|
|
223
|
-
"
|
|
224
|
-
"
|
|
225
|
-
"
|
|
226
|
-
"
|
|
227
|
-
"
|
|
228
|
-
"
|
|
229
|
-
"
|
|
230
|
-
"
|
|
231
|
-
"
|
|
232
|
-
"
|
|
233
|
-
"
|
|
234
|
-
"
|
|
235
|
-
"
|
|
236
|
-
"
|
|
237
|
-
"
|
|
238
|
-
"
|
|
239
|
-
"
|
|
240
|
-
"
|
|
241
|
-
"
|
|
242
|
-
"
|
|
243
|
-
"
|
|
244
|
-
"
|
|
245
|
-
"
|
|
246
|
-
"
|
|
247
|
-
"
|
|
220
|
+
"0x000000000000000000000000000000a6fb9b3e7a8a535abe5cce2d02c78af85c",
|
|
221
|
+
"0x00000000000000000000000000000000002397661372114869511ebbfef7cafc",
|
|
222
|
+
"0x0000000000000000000000000000005987a7835cf91182b760fe58a2262ba09c",
|
|
223
|
+
"0x0000000000000000000000000000000000130703ae35119ab32296ec33e9e2d7",
|
|
224
|
+
"0x00000000000000000000000000000030a0d620602e3c0e367f79fe5c7c347fa1",
|
|
225
|
+
"0x0000000000000000000000000000000000058a2336ee887abbf0b7407668c2bd",
|
|
226
|
+
"0x000000000000000000000000000000522ff11365919708a5e91a8a9cd9cec82c",
|
|
227
|
+
"0x00000000000000000000000000000000002d0f741fa1348ffe3922aa45c22d37",
|
|
228
|
+
"0x000000000000000000000000000000e476c1c0dd5f4e9f89360efd76a98907a6",
|
|
229
|
+
"0x00000000000000000000000000000000002a31a29459ef8a3ba8f6a78c1da536",
|
|
230
|
+
"0x000000000000000000000000000000f765dd3c65d5111f3fa920a3a1352b7683",
|
|
231
|
+
"0x00000000000000000000000000000000001e6d98197922a20f5a8708977572e0",
|
|
232
|
+
"0x000000000000000000000000000000beed59b3bebfd95488cb7ce39199a2a6be",
|
|
233
|
+
"0x00000000000000000000000000000000001032b55508af539de70b39fdaf7df4",
|
|
234
|
+
"0x000000000000000000000000000000006b982179965ee19110ba69836607b377",
|
|
235
|
+
"0x000000000000000000000000000000000012ea00f98e7364b163e0bc06be76ae",
|
|
236
|
+
"0x00000000000000000000000000000038ff559e9dfc9d2682980cd3146722b119",
|
|
237
|
+
"0x000000000000000000000000000000000004fe240fbac8d47f9ce1b52f1720a8",
|
|
238
|
+
"0x0000000000000000000000000000007b59c1fb8dd995040ef7cfc3a15337036e",
|
|
239
|
+
"0x0000000000000000000000000000000000264feb1c9a2626982090d004685239",
|
|
240
|
+
"0x0000000000000000000000000000001bf7bf908352c6544344b42e626da9d05a",
|
|
241
|
+
"0x0000000000000000000000000000000000092fdcfd125a6ec77133955a41843d",
|
|
242
|
+
"0x000000000000000000000000000000a9708b49bda6af5e030e895ea1eb3b0e37",
|
|
243
|
+
"0x000000000000000000000000000000000009ca0a4139ca4a46f8549b899947cd",
|
|
244
|
+
"0x0000000000000000000000000000005210c2a35e6ddb62df43394994578a5823",
|
|
245
|
+
"0x00000000000000000000000000000000000aac650bcec6b8643bc09f4ac90a91",
|
|
246
|
+
"0x0000000000000000000000000000002a0271e64fdca5140ea94f5a48460b33b0",
|
|
247
|
+
"0x00000000000000000000000000000000001f6df58453c98a8bdba5425eb33f63",
|
|
248
248
|
"0x000000000000000000000000000000ba7d49af35ab3f3b1eae194179baa6bb91",
|
|
249
249
|
"0x00000000000000000000000000000000001fa757a1b94586fc58b7b83ac65a7c",
|
|
250
250
|
"0x000000000000000000000000000000de976f9da67b401d6d30b63d4014826b6d",
|