Skip to content
This repository has been archived by the owner on Jun 5, 2024. It is now read-only.

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
icemelon committed Oct 7, 2022
1 parent 2300eef commit f0eb749
Showing 1 changed file with 26 additions and 31 deletions.
57 changes: 26 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,31 @@
# Scroll Contract Deploy Demo
# Scroll Contract Deployment Demo

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.

## Deploy with hardhat
## Deploy with Hardhat

1. Run `yarn install` to install dependency.
2. Create a file `.env` in the directory, or just copy `.env.example` to `.env`.
3. Change `PRIVATE_KEY` and `SCROLL_TESTNET_URL` to the correct one in file `.env`.
4. Run `yarn compile` to compile the contract.
5. Run `yarn deploy:scrollTestnet` to deploy the contract in Scroll testnet.

## Deploy with foundry

### Installation

```
curl -L https://foundry.paradigm.xyz | bash
```

### Build

```
forge build
```

### Deploy

```
forge create --rpc-url <SCROLL_TESTNET_URL> \
--value <lock_amount>
--constructor-args <unlock_time> \
--interactive \
--legacy \
contracts/Lock.sol:Lock
```
2. Create a `.env` file following the example `.env.example` in the root directory. Change `PRIVATE_KEY` to your own account private key in the `.env`.
3. Run `yarn compile` to compile the contract.
4. Run `yarn deploy:scrollTestnet` to deploy the contract in Scroll testnet.

## Deploy with Foundry

1. Install Foundry.
```shell
curl -L https://foundry.paradigm.xyz | bash
foundryup
```
2. Build the project.
```
forge build
```
3. 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
```

0 comments on commit f0eb749

Please sign in to comment.