Development Setup

Welcome! This section contains everything a developer needs to start working with Kinto.

1. Setup your favorite tool

Kinto supports Foundry, Hardhat, and Truffe. You can pick one and follow the instructions in this section to install it.
The rest of this guide assumes Foundry.

2. Clone the repo

To start, execute git clone our main repository kinto-core (aa branch).
$ git clone [email protected]:KintoXYZ/kinto-core.git
$ git checkout aa

3. Run the tests

Make sure that foundry CLI is installed and run the following:
$ forge test
... when the script finishes, you should see ...
Ran X test suites: Y tests passed, 0 failed, 0 skipped (Z total tests)

4. Setup your env file

Set your .env variables next:
$ cp .env.sample .env
Fill (at least) the following variables:
KINTO_RPC_URL= //RPC URL for the network you are using
TEST_NETWORK_ID= //Network id, mainnet: 7887
TEST_PRIVATE_KEY= //Private key for the address you want to use

5. Setting up a remote chain (optional)

You can develop using forge tests directly.
When you are ready to test things in a natural environment, we recommend using Anvil to fork mainnet and work against it.
More information about the complete process can be found on the repositories README.
anvil -f <KINTO_REMOTE_URL> --fork-block-number <OPTIONAL_BLOCK>
Copy your local fork URL and override KINTO_RPC_URL with your fork.

6. Create a Kinto Wallet

This is only needed if you don't have a wallet and Kinto ID already.
This script is meant to be used on your local fork. If you are using mainnet, you must head to https://engen.kinto.xyz to KYC and create a Kinto Wallet.
Execute our test wallet script:
$ source .env && forge script script/test.sol:KintoDeployTestWalletScript --rpc-url $KINTO_RPC_URL --broadcast -vvvv --slow
... at the end you should see...
== Logs ==
All AA setup is correct
This factory has XYZ created
Wallet already deployed for owner 0x1234 at 0xthisIsYourKintoWalletAddress
You can find more information about the deploy wallet script here.

7. Deploy a simple Counter Contract

Execute our deploy counter script:
$ source .env && forge script script/test.sol:KintoDeployTestCounter --rpc-url $KINTO_RPC_URL --broadcast -vvvv --skip-simulation
== Logs ==
All AA setup is correct
Deployed Counter contract at 0xContractContractAddress
Before UserOp. Counter: 0
Adding paymaster balance to counter 0xContractContractAddress
After UserOp. Counter: 1

Ready to develop

Congratulations! You are ready to deploy contracts and send transactions in the Kinto network.
You can check our Smart Contract API to leverage all the KYC/AML and Account Abstraction functionalities available on Kinto.