ADI Network Testnet Quickstart
Getting starting developing with ADI Network Testnet
Deploying to ADI Network Testnet
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
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
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.
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
