Testnet Deployment
Testnet permissionless contract deployment guide
This guide will walk you through deploying a smart contract on the Injective EVM Testnet network.
Requirements
The guide uses foundry for deployments. Install it by running:
curl -L https://foundry.paradigm.xyz | bash
To verify the installation:
forge --version
Add Injective EVM to your
foundry.toml
[rpc_endpoints]
injectiveEvm = "https://k8s.testnet.json-rpc.injective.network/"
Deploying
Due to the EVM-equivalence of Injective, foundry commands should work as expected. The major difference is the network URL. In most cases, using --rpc-url injectiveEvm
is sufficient.
Navigate to your smart contract project
cd path/to/your/project
Deploying a smart contract
This command creates a transaction and submits it to the network. If the transaction is successful, the smart contract will be deployed, and the address it is deployed at will be output.
# Broadcasting
forge create \
src/{YourContract}.sol:{ContractName} \
--rpc-url injectiveEvm \
--legacy \
--private-key {YourPrivateKey} \
--broadcast
Be sure to copy the address at which the smart contract was deployed, as you will need to use it in subsequent commands.
Verifying on Blockscout
After the deployment is completed, if you visit a network explorer, such as Blockscout, and search for the address of the smart contract, you will see that it has bytecode.
However, to see aditional details, you need to verify the contract.
forge verify-contract \
--rpc-url injectiveEvm \
--verifier blockscout \
--verifier-url 'https://testnet.blockscout-api.injective.network/api/' \
{SmartContractAddress} \
src/{YourContract}.sol:{ContractName}
After that, you can navigate to the contract address in Explorer to see the code, the ABI, parsed logs, and callable methods (example).
Last updated