Template repository for getting started quickly with Catapulta.sh and Hardhat projects.
This template uses Scaffold-ETH 2.
Before you begin, you need to install the following tools:
- Node (v18 LTS)
- Yarn (v1 or v2+)
- Git
- Clone this repo & install dependencies
git clone https://github.com/catapulta-sh/catapulta-hardhat-template
cd catapulta-hardhat-template
yarn install
- Generate a new private key with Catapulta, is stored offline in your .env, or add your own as
PRIVATE_KEY
in the .env file stored at the root of the project
cd packages/hardhat
npx catapulta wallet
# Output:
# Wallet address: 0x6B193d5604e09f1737E33cFc4B06fb3f2C7fC3CE
# Private key appended to your .env file.
-
Get funds for your Ethereum address at the Alchemy Sepolia faucet
-
Setup your
CATAPULTA_API_KEY
into your .env from, generate one for free at Catapulta dashboard -
Deploy the contract into Sepolia testnet with Catapulta
catapulta deploy --network sepolia
#Output:
Catapulta.sh 🏏 Hardhat deployment (0.1.36)
===========================================
Project name: Ghost Deployments
Project URL: https://catapulta.sh/project/64e6272a59b37a3a4a7afb55
Deployment UUID: 6c7f65cb-52e0-459e-9b58-a5b3d5f296f2
📀 Building artifacts...
🗜 Compressing artifacts...
📤 Uploading artifacts to the Catapulta DB...
✅ Artifacts uploaded successfully.
📡 Broadcasting deployments to Catapulta Gateway RPC:
📜 Running Hardhat script: yarn run hardhat --network catapulta-6c7f65c2-52e0-459e-9b58-a5b3d5f296f2 deploy
deploying "YourContract"
(tx: 0x9f4532ec9c34fed74d8295d0991d9935be194e582616a0660b6c51154204bf88)...
: deployed at 0xF31540a002a49bda9963caAcCeF3e25d0a09810e with 534015 gas
📝 Updated TypeScript contract definition file on ../nextjs/generated/deployedContracts.ts
✅ Deployment successfully broadcasted
- Etherscan verification request sent. Check the dashboard for keeping track verifications. If contracts are not verified in 10 minutes, contact support at Discord.
💾 Artifacts stored at:
- https://users-artifacts.s3.eu-west-1.amazonaws.com/6c7f65cb-52e0-459e-9b52-a5b3d5f296f2-deployment-artifacts/artifacts.zip
📸 Check your deployment report at:
- https://catapulta.sh/project/64e6272a59b37a3a4a7afb55/op/6c7f25cb-52e0-459e-9b58-a5b3d5f296f2
- Check the deployment report at the Catapulta UI, and enjoy delegated Etherscan verification without any extra configs or Etherscan API keys.
To get started with Scaffold-ETH 2, follow the steps below:
- Clone this repo & install dependencies
git clone https://github.com/scaffold-eth/scaffold-eth-2.git
cd scaffold-eth-2
yarn install
- Run a local network in the first terminal:
yarn chain
This command starts a local Ethereum network using Hardhat. The network runs on your local machine and can be used for testing and development. You can customize the network configuration in hardhat.config.ts
.
- On a second terminal, deploy the test contract:
yarn deploy
This command deploys a test smart contract to the local network. The contract is located in packages/hardhat/contracts
and can be modified to suit your needs. The yarn deploy
command uses the deploy script located in packages/hardhat/deploy
to deploy the contract to the network. You can also customize the deploy script.
- On a third terminal, start your NextJS app:
yarn start
Visit your app on: http://localhost:3000
. You can interact with your smart contract using the contract component or the example ui in the frontend. You can tweak the app config in packages/nextjs/scaffold.config.ts
.
Run smart contract test with yarn hardhat:test
- Edit your smart contract
YourContract.sol
inpackages/hardhat/contracts
- Edit your frontend in
packages/nextjs/pages
- Edit your deployment scripts in
packages/hardhat/deploy
Visit our docs to learn how to start building with Scaffold-ETH 2.
To know more about its features, check out our website.
We welcome contributions to Scaffold-ETH 2!
Please see CONTRIBUTING.MD for more information and guidelines for contributing to Scaffold-ETH 2.