AxiomREPL Code
The code for AxiomREPL
Introduction
AxiomREPL allows users to write custom ZK circuits in Javascript. We use it here to generate a circuit that proves our request for the parameters from the Swap
event and the same transaction's to
field.
The goal of writing the AxiomREPL code in this section is to export it for use in our Web App that we'll build after this.
AxiomREPL is located at https://repl.axiom.xyz/
Inputs
We have the following inputs to our AxiomREPL code. These inputs are variables that can later be changed (outside of AxiomREPL) in your app. Once the circuit has been exported outside of AxiomREPL into your web app, a different blockNumber
, txIdx
, and logIdx
for a different user's Swap
transaction can be inserted by your web app and used in the circuit.
Note: every transaction hash maps to a unique blockNumber
and txIdx
combination.
Code
The following code implements logic for getting blockchain data and running compute over that data. The inputs from the input box are used here, but this code cannot be changed once it is exported into your web app. Only the variables in the input field above may be changed by your web app.
If you do need to change your code, it must be done in AxiomREPL and then re-exported (because the verifying key will be different).
Last updated