- Network setup: https://guide.scroll.io/user-guide/setup
- If you haven't already, install nodejs and yarn.
- Run
yarn install
to 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 Alpha Testnet. - Run
yarn test
for hardhat tests.
- Install Foundry.
curl -L https://foundry.paradigm.xyz | bash foundryup
- Build the project.
forge build
- Deploy the contract.
forge create --rpc-url https://alpha-rpc.scroll.io/l2 \ --value 0.0000001 \ --constructor-args 1696118400 \ --private-key 8953122ef7969e14f90b8d56846fc727e18009d29ee4109a1d9027c2cb828d0d \ --legacy \ contracts/Lock.sol:Lock
<lock_amount>
is the amount ofETH
to be locked in the contract. Try setting this to some small amount, like ≈.<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:
forge create --rpc-url https://alpha-rpc.scroll.io/l2 --value 0.00000000002ether --constructor-args 1696118400 --private-key 8953122ef7969e14f90b8d56846fc727e18009d29ee4109a1d9027c2cb828d0d --legacy contracts/Lock.sol:Lock