ADI Network Testnet Quickstart
Getting starting developing with ADI Network Testnet
You can use all standard EVM tooling for ADI Network Testnet. You can find instructions for bridging testnet ADI and ETH to the ADI Network Testnet in the Network Details page.
To get started with Foundry or Hardhat, follow the steps below:
Deploying to ADI Network Testnet
Below are setup examples for Foundry and Hardhat 3 (with Viem or Ethers). Select your preferred setup tab:
Foundry Setup
1. The Counter contract code
contract Counter {
uint256 public number;
function setNumber(uint256 newNumber) public {
number = newNumber;
}
function increment() public {
number++;
}
}2. Create a new Foundry project
forge init Counter
cd Counter3. Build the project
4. Set your private key for deploying, ensure that it has some balance
5. Create counter.sol file and put the contract code inside.
counter.sol file and put the contract code inside.6. Create counter.s.sol and put the script inside, the script will deploy the counter contract
counter.s.sol and put the script inside, the script will deploy the counter contract7. Deploy the contract
Command returns the address of the deployed contract. This address, in further steps, is expressed as $DEPLOYED_CONTRACT_ADDRESS
8. Set the number value
9. Get the latest number value
Hardhat 3 with Viem
1. Create a new project folder
2. Initialize a new Hardhat 3 project with Node Test Runner and Viem.
3. Add ADI Network Testnet to hardhat.config.ts file and configure the ignition required confirmations.
hardhat.config.ts file and configure the ignition required confirmations.4. Ensure that the module file ignition/modules/counter.ts contains the following code
ignition/modules/counter.ts contains the following code 5. Add your private key to the keystore as TESTNET_PRIVATE_KEY .
TESTNET_PRIVATE_KEY .6. Compile and deploy the example contract
Command returns the address of the deployed contract. This address, in further steps, is expressed as $DEPLOYED_CONTRACT_ADDRESS , if it appears inside the scripts described below, replace it with the actual contract address.
7. Create a new script file in the scripts folder called increment.ts .
scripts folder called increment.ts .8. Copy/paste the script below.
9. Run the script
Hardhat 3 with Ethers
1. Create a new project folder
2. Initialize a new Hardhat 3 project with Mocha and Ethers.js.
3. Add ADI Network Testnet to the hardhat.config.ts file and configure the ignition required confirmations.
hardhat.config.ts file and configure the ignition required confirmations.4. Add your private key to the keystore as TESTNET_PRIVATE_KEY .
TESTNET_PRIVATE_KEY .5. Ensure that the module file ignition/modules/counter.ts contains the following code
ignition/modules/counter.ts contains the following code 6. Compile and deploy the example contract.
Command returns the address of the deployed contract. This address, in further steps, is expressed as $DEPLOYED_CONTRACT_ADDRESS , if it appears inside the scripts described below, replace it with the actual contract address.
7. Create a new script file in the scripts folder called increment.ts.
scripts folder called increment.ts.8. Copy/paste the script below.
9. Run the script
Last updated
