diff --git a/.aztec-sync-commit b/.aztec-sync-commit
index fdbc14d511e..0bdea76121d 100644
--- a/.aztec-sync-commit
+++ b/.aztec-sync-commit
@@ -1 +1 @@
-1d785fd1087d7387fc29213ca3be50b2fc9c4725
+86a33140f9a65e518003b3f4c60f97d132f85b89
diff --git a/acvm-repo/acvm_js/build.sh b/acvm-repo/acvm_js/build.sh
index ee93413ab85..16fb26e55db 100755
--- a/acvm-repo/acvm_js/build.sh
+++ b/acvm-repo/acvm_js/build.sh
@@ -25,7 +25,7 @@ function run_if_available {
require_command jq
require_command cargo
require_command wasm-bindgen
-# require_command wasm-opt
+require_command wasm-opt
self_path=$(dirname "$(readlink -f "$0")")
pname=$(cargo read-manifest | jq -r '.name')
diff --git a/aztec_macros/src/transforms/functions.rs b/aztec_macros/src/transforms/functions.rs
index 0fb13975fec..4d8b6ef7cdf 100644
--- a/aztec_macros/src/transforms/functions.rs
+++ b/aztec_macros/src/transforms/functions.rs
@@ -216,12 +216,30 @@ pub fn export_fn_abi(
///
/// Inserts the following code at the beginning of an unconstrained function
/// ```noir
-/// let storage = Storage::init(Context::none());
+/// let context = UnconstrainedContext::new();
+/// let storage = Storage::init(context);
/// ```
///
/// This will allow developers to access their contract' storage struct in unconstrained functions
pub fn transform_unconstrained(func: &mut NoirFunction, storage_struct_name: String) {
+ // let context = UnconstrainedContext::new();
+ let let_context = assignment(
+ "context", // Assigned to
+ call(
+ variable_path(chained_dep!(
+ "aztec",
+ "context",
+ "unconstrained_context",
+ "UnconstrainedContext",
+ "new"
+ )),
+ vec![],
+ ),
+ );
+
+ // We inject the statements at the beginning, in reverse order.
func.def.body.statements.insert(0, abstract_storage(storage_struct_name, true));
+ func.def.body.statements.insert(0, let_context);
}
/// Helper function that returns what the private context would look like in the ast
@@ -597,7 +615,7 @@ fn abstract_return_values(func: &NoirFunction) -> Result