Contract Deployment Tutorial
The Scroll Sepolia Testnet allows anyone to deploy a smart contract on Scroll. In this tutorial, you will learn how to deploy a contract on Scroll Sepolia using common tools for developing on Ethereum. This demo repo illustrates contract deployment with Hardhat and Foundry.
Deploy contracts with Hardhat
-
Clone the repo and install dependencies:
-
Create a
.env
file following the example.env.example
in the root directory. ChangePRIVATE_KEY
to your own account private key in the.env
. -
Run
yarn compile
to compile the contract. -
Run
yarn deploy:scrollTestnet
to deploy the contract on the Scroll Sepolia Testnet. -
Run
yarn test
for hardhat tests.
Deploy contracts with Foundry
-
Clone the repo:
-
Install Foundry:
-
Run
forge build
to build the project. -
Deploy your contract with Foundry:
<lock_amount>
is the amount of testETH
to be locked in the contract. Try setting this to some small amount, like0.0000001ether
.<unlock_time>
is the Unix timestamp after which the funds locked in the contract will become available for withdrawal. Try setting this to some Unix timestamp in the future, like1696118400
(this Unix timestamp corresponds to October 1, 2023).
For example:
Questions and Feedback
Thank you for participating in and developing on the Scroll Sepolia Testnet! If you encounter any issues, join our Discord and ask us in the #testnet-devs
channel.