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

Commit 39e9865

Browse files
authored
update readme, clean contract of hardhat dep (#1)
1 parent f0eb749 commit 39e9865

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Scroll Contract Deployment Demo
22

3-
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.
3+
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 a specified amount of time.
44

55
## Deploy with Hardhat
6-
7-
1. Run `yarn install` to install dependency.
8-
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`.
9-
3. Run `yarn compile` to compile the contract.
10-
4. Run `yarn deploy:scrollTestnet` to deploy the contract in Scroll testnet.
6+
1. If you haven't already, install [nodejs](https://nodejs.org/en/download/) and [yarn](https://classic.yarnpkg.com/lang/en/docs/install).
7+
2. Run `yarn install` to install dependencies.
8+
3. 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`.
9+
4. Run `yarn compile` to compile the contract.
10+
5. Run `yarn deploy:scrollTestnet` to deploy the contract on the Scroll Pre-Alpha Testnet.
1111

1212
## Deploy with Foundry
1313

@@ -29,3 +29,5 @@ This project demonstrates how to use hardhat or foundry to deploy a contract in
2929
--legacy \
3030
contracts/Lock.sol:Lock
3131
```
32+
- `<lock_amount>` is the amount of `TSETH` to be locked in the contract. Try setting this to some small amount, like `0.0000001ether`.
33+
- `<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, like `1696118400` (this Unix timestamp corresponds to October 1, 2023).

contracts/Lock.sol

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
// SPDX-License-Identifier: UNLICENSED
22
pragma solidity ^0.8.9;
33

4-
// Import this file to use console.log
5-
import "hardhat/console.sol";
6-
74
contract Lock {
85
uint public unlockTime;
96
address payable public owner;
@@ -21,9 +18,6 @@ contract Lock {
2118
}
2219

2320
function withdraw() public {
24-
// Uncomment this line to print a log in your terminal
25-
// console.log("Unlock time is %o and block timestamp is %o", unlockTime, block.timestamp);
26-
2721
require(block.timestamp >= unlockTime, "You can't withdraw yet");
2822
require(msg.sender == owner, "You aren't the owner");
2923

0 commit comments

Comments
 (0)