> For the complete documentation index, see [llms.txt](https://intrinsic-1.gitbook.io/axiomv2-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://intrinsic-1.gitbook.io/axiomv2-sdk/sdk-and-repl-reference/axiomrepl-reference/circuit-functions.md).

# Circuit Functions

Most commonly used AxiomREPL functions

#### `witness`

This function creates a `CircuitValue` that can change between different runs of the circuit (think of it as a JavaScript `let`). For example, if you wanted to create a circuit that checks if a user's balance is above some threshold, you would make the user's address a witness so that the circuit could be used to prove that *any* address's balance is above the threshold.

```typescript
/**
 * Creates a circuit variable from a number, bigint, or string.
 *
 * @param a - The raw circuit input.
 * @returns The witness cell.
 */
witness: (a: number | bigint | string) => CircuitValue;
```

#### `constant`

This function creates a `CircuitValue` that must be the same every time you run your circuit (think of it as JavaScript `const`). For example, from the example above, you could make the threshold a constant to enforce that every time the circuit is run, the same threshold is used.

```typescript
/**
 * Creates a circuit constant from a number, bigint, or string.
 *
 * @param a - The raw circuit input.
 * @returns The constant cell.
 */
constant: (a: number | bigint | string) => CircuitValue;
```

#### `log`

The `log(...)` function is used to debug the value of a `CircuitValue` or a `CircuitValue256` (or some array of them). This is useful for debugging and checking that the values inside the circuit are what you would expect.

<pre class="language-typescript"><code class="lang-typescript"><strong>/**
</strong> * Logs the provided *circuit* values to the console. 
 * Use `console.log` for normal logging.
 *
 * @param args - The values to log (can be `CircuitValue`s or `CircuitValue256`s).
 */
log: (...args: (CircuitValue | CircuitValue256)[]) => void;
</code></pre>

#### `addToCallback`

This function is used to add a values to the data which is passed to your contract when your query is fulfilled. You can call `addToCallback` a maximum of 128 times inside AxiomREPL. See [Handling Axiom Callbacks](/axiomv2-sdk/developers/handling-axiom-callbacks.md) for more info on setting up your contract to receive the the data you pass to `addToCallback`.&#x20;

<pre class="language-typescript"><code class="lang-typescript">/**
 * Adds a circuit value to the callback. 
 * Values passed to this function will be passed to your
<strong> * callback client contract on-chain by Axiom.
</strong> *
 * @param a - The circuit value to add to the callback.
 */
addToCallback: (a: CircuitValue | CircuitValue256) => void;
</code></pre>
