# Interacting with contracts

{% hint style="info" %}
As a developer, you can also interact with your contracts using the EOAs you list when creating the Kinto Application.
{% endhint %}

## 1. Preparing your Kinto Wallet for local testing

In order to use this guide you will need to configure your Kinto Wallet with a signing policy of 1/2 and add an EOA or hardware wallet as your second signer that you can use to sign locally.

In the Kinto website, click on the top right and select My Account -> Setup and follow the steps to add/change a signer and update your policy accordingly:

<figure><img src="/files/BHlPGEp5cqqrD6DZAJdI" alt=""><figcaption></figcaption></figure>

## 2. Creating and sending UserOps

To follow these steps you will need a [<mark style="color:purple;">properly setup environment</mark>](/kinto-the-modular-exchange/building-on-kinto/development-setup/environment-setup.md).

Full example code is provided with ample comments.

```solidity

contract KintoIncrementTest is MigrationHelper { 
//Migration helper contains useful functions to interact with the Kinto chain

    //Grab your signer private key, kinto wallet and counter deployed in previous guides
    uint256 walletSignerKey = vm.envUint("KINTO_WALLET_SIGNER_KEY");
    address kintoWalletAddress = vm.envAddress("KINTO_WALLET");
    Counter counter = Counter(0xyourAddressHere);
    console.log("Before UserOp. Counter:", counter.count());
    
    //Setup kinto wallet
    IKintoWallet _kintoWallet;
    _kintoWallet = IKintoWallet(kintoWalletAddress);
    uint256 nonce = _kintoWallet.getNonce();
    
    //Setup signers for the kinto wallet
    uint256[] memory privateKeys = new uint256[](1);
    privateKeys[0] = walletSignerKey;
    
    //Create a userOp array
    UserOperation[] memory userOps = new UserOperation[](2);
    
    // whitelist counter contract in the wallet
    address[] memory targets = new address[](1);
    targets[0] = address(counter);
    
    bool[] memory flags = new bool[](1);
    flags[0] = true;
    
    //First userOp will whitelist the application
    userOps[0] = _createUserOperation(
        block.chainid,
        address(_kintoWallet),
        address(_kintoWallet),
        0,
        nonce,
        privateKeys,
        abi.encodeWithSignature("whitelistApp(address[],bool[])", targets, flags),
        address(paymaster)
    );
    
    // increment counter
    userOps[1] = _createUserOperation(
        block.chainid,
        address(_kintoWallet),
        address(counter),
        0,
        nonce + 1,
        privateKeys,
        abi.encodeWithSignature("increment()"),
        address(paymaster)
    );
    
    vm.broadcast(walletSignerKey);
    entryPoint.handleOps(userOps, payable(walletSignerKey));
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.kinto.xyz/kinto-the-modular-exchange/building-on-kinto/interacting-with-your-kinto-app/interacting-with-contracts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
