Using Hardhat
This section is a guide on how to deploy a smart contract on the Orange Chain using Hardhat.
Hardhat is a popular smart contract development frameworks. It is used in the Orange rollup as a default for deploying and automatically verifying smart contracts.
Initial setup
Get some test BTC from Bitcoin Testnet faucet, and cross chain the test BTC from Bitcoin Testnet to Orange Chain Testnet by test bridge.
Install Hardhat and dependencies
Copy
Run npx hardhat init to init a new project, and you will be shown some options to facilitate project creation:
Copy
Open the hardhat.config.js file and paste the below code:
Copy
Add contract code and scripts
Create a new contract code file, in the contracts folder, named Storage.sol
Copy the below code and paste it in the Storage contract code:
Copy
Create a new file in the scripts folder deploy-storage.js
Add the code below to the deploy-counter.js file:
Copy
Before compiling the contract, you need to install the toolbox. You may need to change directory to install outside the project. Use this command:
Copy
Compile your contract code (i.e., go back to the project root in the CLI):
Copy
Now run the scripts:
Copy
Last updated