Contract deployment
The Wischain Sepolia Testnet enables developers to deploy smart contracts seamlessly. This tutorial will guide you through the process of deploying a contract on Wischain Sepolia using popular Ethereum development tools. We’ll demonstrate contract deployment with both Hardhat and Foundry.
Getting Testnet ETH
Before you begin deploying your contract, you’ll need to acquire test tokens. This can be done by requesting test ETH from a Sepolia faucet and utilizing the bridge to transfer the test ETH from Sepolia to Wischain Sepolia. Alternatively, you can obtain Wischain Sepolia ETH directly. For detailed instructions, refer to our Faucet and Bridge guides.
Deploying Contracts with Hardhat
Install Node.js and Yarn: Ensure you have Node.js and Yarn installed on your machine.
Clone the Repository and Install Dependencies:
Configure Environment Variables: Create a
.env
file in the root directory, using.env.example
as a template. Update thePRIVATE_KEY
variable with your own account's private key.Compile the Contract: Execute the following command to compile your smart contract:
Deploy the Contract: Deploy your contract to the Wischain Sepolia Testnet using:
Run Hardhat Tests: To run tests for your contract, use:
Deploying Contracts with Foundry
Clone the Repository:
Install Foundry:
Build the Project: Use the following command to compile your project:
Deploy Your Contract with Foundry: Use the following command to create and deploy your contract:
Replace
<lock_amount>
with the amount of test ETH to be locked in the contract (e.g., set a small amount like0.00000001ether
).Replace
<unlock_time>
with a future Unix timestamp after which the funds will be available for withdrawal (e.g.,1696118400
, corresponding to October 1, 2023).
Example:
By following these steps, you will successfully deploy a smart contract on the Wischain Sepolia Testnet, utilizing either Hardhat or Foundry as your development environment.
Last updated