This project demonstrates how to use hardhat or foundry to deploy a contract in Scroll testnet. This project contains a simple contract which will lock certain amounts of Ether in the deployed contract for 1 year.
- Run
yarn install
to install dependency. - 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 in Scroll testnet.
- Install Foundry.
curl -L https://foundry.paradigm.xyz | bash foundryup
- Build the project.
forge build
- Deploy the contract.
forge create --rpc-url https://prealpha.scroll.io/l2 \ --value <lock_amount> \ --constructor-args <unlock_time> \ --private-key <your_private_key> \ --legacy \ contracts/Lock.sol:Lock