Minimal Foundry starter for compiling, testing, deploying, verifying, and interacting with a Counter contract on Injective EVM.
Stack:Solidity · Foundry · Injective EVM · Blockscout
- On GitHub, press the "Use this template" button.
- In the dropdown, select "Create new repository"
- Fill in the form, then press the "Create repository"
- You should now have a copy of the template repo in your own Github account or organisation
- Click on the "<> Code" button
- In the dropdown, select the "Local" tab, then copy the git URL
git clone https://github.com/${YOUR_GITHUB}/foundry-injective-template.git foundry-injective-template cd foundry-injective-template cp .env.example .env make compile # compile contract make test # run local (simulated EVM) tests make deploy # deploy contract to Injective Testnet make verify # verify deployed contract on Injective Testnet Blockscout make interact-read # query with deployed contract make interact-write # transact with deployed contract
Update .env (see the "Configuration" section for more details):
- Add your private key, before running the deploy command.
- Add deployed contract address, before running verify or the interact commands.
- Compile workflow:
make compilebuilds the Counter contract. - Test workflow:
make testruns the test suite for Counter. - Deploy workflow:
make deploydeploys Counter to Injective EVM Testnet. - Verify workflow:
make verifyverifies the deployed contract on Blockscout. - Interact workflow:
make interact-readandmake interact-writedemonstrate read and write contract calls on the Counter contract.
- Counter contract: Canonical hello-world smart contract example for extending the starter.
- Minimal Foundry config:
foundry.tomlkeeps the repo bare while supporting the required workflows. - Env placeholders:
.env.exampleavoids hardcoded user-specific values.
├── src/
│ └── Counter.sol # Canonical hello-world smart contract
├── test/
│ └── Counter.t.sol # Matching Foundry test suite
├── .env.example # RPC, key, verifier, and contract placeholders
├── foundry.toml # Foundry configuration and Injective RPC alias
├── Makefile # Helper targets for compile, test, deploy, verify, and interact
└── README.md
Copy .env.example to .env and replace placeholders before using the networked workflows.
PRIVATE_KEYis required formake deployandmake interact-write.CONTRACT_ADDRESSis required formake verify,make interact-read, andmake interact-write.
MIT