Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🧹 Migrate settled bids list #198

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
396e3c3
DC7 (#1)
kevincharm Mar 28, 2024
fc0fbd5
🐔 Setup next repo (#2)
b-tarczynski Apr 4, 2024
ec909c0
💅 Enable styled components in next app (#3)
b-tarczynski Apr 8, 2024
ee226c9
🏎️ Migrate to turbo and pnpm (#4)
b-tarczynski Apr 10, 2024
94a2d33
🥷 Remove outdated code (#5)
b-tarczynski Apr 11, 2024
3629e80
🐔 Configure wagmi (#6)
b-tarczynski Apr 11, 2024
1b68408
🤟 Migrate Information component (#8)
b-tarczynski Apr 15, 2024
d5f04ea
👐 Add winners count to useReadAuctionParams (#9)
b-tarczynski Apr 15, 2024
bfc475a
👩‍🚀 Update auction ABI to the latest version (#10)
b-tarczynski Apr 15, 2024
5800c37
👖 Add a linter coinfiguration (#11)
p-sad Apr 16, 2024
1223af1
👩‍🚒 Add bids provider (#12)
b-tarczynski Apr 16, 2024
7efc05c
🦀 Run lint in CI (#13)
p-sad Apr 17, 2024
23c96aa
🎈 Use correct branch in CI job (#15)
b-tarczynski Apr 17, 2024
363777e
Update deployment scripts (#7)
kevincharm Apr 17, 2024
6ea254e
🪄 Support Hardhat chain in frontend app (#16)
b-tarczynski Apr 17, 2024
0c0aaa5
📜 Migrate bids list on homepage (#14)
b-tarczynski Apr 17, 2024
dc89cfa
Add back button component
b-tarczynski Apr 18, 2024
159d4ed
Add header component
b-tarczynski Apr 18, 2024
7cde73d
Add bids page
b-tarczynski Apr 18, 2024
d2c97dd
Move common components to separate directory
b-tarczynski Apr 18, 2024
1d267a7
Extract bidToBidWithPlace
b-tarczynski Apr 18, 2024
dea84fc
Lint
b-tarczynski Apr 18, 2024
9c0d255
Add CloseButton
b-tarczynski Apr 18, 2024
160cca7
Add useAuctionWinners hook
b-tarczynski Apr 18, 2024
5a74aa1
Add useDebounce hook
b-tarczynski Apr 18, 2024
be91ad9
Display all bids
b-tarczynski Apr 18, 2024
9f7e07e
Use correct place number
b-tarczynski Apr 18, 2024
014c09c
Lint
b-tarczynski Apr 18, 2024
1d88631
Update useMemo deps
b-tarczynski Apr 18, 2024
2414d08
Simplify splitting bids into auction and raffle
b-tarczynski Apr 18, 2024
58bb974
Reorder files
b-tarczynski Apr 18, 2024
4fbaa8a
Change useMatchBid to be regular function
b-tarczynski Apr 18, 2024
cbb16b5
Extract useExplorerAddressLink.ts
b-tarczynski Apr 18, 2024
0c2d925
Display settled bids list
b-tarczynski Apr 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
37 changes: 37 additions & 0 deletions .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Install Node and package dependencies
description: "Install Node dependencies with pnpm"

runs:
using: "composite"
steps:
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v3
with:
version: 8.3.1
run_install: false

- name: Get pnpm cache directory
id: pnpm-cache-dir
shell: bash
run: echo "dir=$(pnpm store path)" >> $GITHUB_OUTPUT

- name: Cache PNPM
uses: actions/cache@v4
id: pnpm-cache
with:
path: |
${{ steps.pnpm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-node-

- name: Install packages
shell: bash
run: pnpm install --frozen-lockfile

- name: Build everything in the monorepo
shell: bash
run: pnpm build
16 changes: 16 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CI
on:
pull_request:
push:
branches:
- master
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
clean: false
- name: Install Node and dependencies
uses: ./.github/actions/install-dependencies
- run: pnpm run lint
113 changes: 0 additions & 113 deletions .github/workflows/ci.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ tsconfig.tsbuildinfo
# Eslint cache
.eslintcache

# Build files
.turbo

# Generated by Certora
.certora_*
.last_confs
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

7 changes: 7 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use-lockfile-v6=true
strict-peer-dependencies=false
auto-install-peers=false
dedupe-peer-dependents=false
resolve-peers-from-workspace-root=false
save-workspace-protocol=true
resolution-mode=highest
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@
## Running Hardhat node
Change directory to `packages/contracts` and execute:
```shell
yarn node:run
pnpm node:run
```
This will start a Hardhat node, deploy the contracts and place initial bids using the first twenty auto-generated accounts.

## Custom tasks
A number of custom Hardhat tasks were defined to aid testing.

### Managing local node
- `yarn node:increase-time [--value <INT>]` - increase block time by *value* seconds, defaults to six hour
- `yarn node:accounts` - print a list of available accounts
- `pnpm node:increase-time [--value <INT>]` - increase block time by *value* seconds, defaults to six hour
- `pnpm node:accounts` - print a list of available accounts

### Interacting with AuctionRaffle contract

#### Hardhat
- `yarn hardhat:bid --account <STRING> --amount <STRING>` - using *account* place bid of *amount* ETH
- `yarn hardhat:bid-random --amount <INT> [--account <INT>]` - using randomly generated accounts place *amount* of bids using funds from account with index *account* (defaults to `0`)
- `yarn hardhat:settle-auction` - settle auction
- `yarn hardhat:settle-raffle` - settle raffle using random numbers
- `yarn hardhat:settle` - increase time, settle auction and raffle
- `pnpm hardhat:bid --account <STRING> --amount <STRING>` - using *account* place bid of *amount* ETH
- `pnpm hardhat:bid-random --amount <INT> [--account <INT>]` - using randomly generated accounts place *amount* of bids using funds from account with index *account* (defaults to `0`)
- `pnpm hardhat:settle-auction` - settle auction
- `pnpm hardhat:settle-raffle` - settle raffle using random numbers
- `pnpm hardhat:settle` - increase time, settle auction and raffle

#### Arbitrum Rinkeby
- `yarn rinkeby:generate-dotenv [--path <STRING>] [--count <INT>]` - generate .env file needed for other tasks, *path* - output path, *count* - number of private keys to generate
- `yarn rinkeby:transfer-ether` - transfer ether from `DEPLOYER` to `PRIVATE_KEYS` accounts
- `yarn rinkeby:init-bids` - place initial bids using `PRIVATE_KEYS` accounts
- `pnpm rinkeby:generate-dotenv [--path <STRING>] [--count <INT>]` - generate .env file needed for other tasks, *path* - output path, *count* - number of private keys to generate
- `pnpm rinkeby:transfer-ether` - transfer ether from `DEPLOYER` to `PRIVATE_KEYS` accounts
- `pnpm rinkeby:init-bids` - place initial bids using `PRIVATE_KEYS` accounts

#### Ethereum Mainnet
- `yarn ethereum:generate-random-numbers --blocks <ARRAY> --secret <STRING>` - generate random numbers for raffle settlement, *blocks* - array of block numbers from which extract block hash (e.g. "[1234, 5678]"), *secret* - secret number represented as 32 bytes hex string
- `pnpm ethereum:generate-random-numbers --blocks <ARRAY> --secret <STRING>` - generate random numbers for raffle settlement, *blocks* - array of block numbers from which extract block hash (e.g. "[1234, 5678]"), *secret* - secret number represented as 32 bytes hex string

16 changes: 6 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,14 @@
"name": "devcon-raffle",
"private": true,
"version": "0.0.1",
"packageManager": "pnpm@8.3.1",
"scripts": {
"lint": "wsrun -c lint",
"build": "wsrun -te -c build",
"test": "wsrun -c test",
"verify": "wsrun -m -c verify",
"update": "git submodule update --remote"
"lint": "turbo lint --filter=frontend",
"build": "turbo build",
"test": "turbo test",
"verify": "turbo verify"
},
"workspaces": [
"packages/contracts",
"packages/frontend"
],
"devDependencies": {
"wsrun": "^5.2.4"
"turbo": "^1.13.2"
}
}
1 change: 0 additions & 1 deletion packages/backend
Submodule backend deleted from 234ccf
9 changes: 9 additions & 0 deletions packages/contracts/.prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@
"options": {
"printWidth": 120
}
},
{
"files": "*.ts",
"options": {
"semi": false,
"singleQuote": true,
"printWidth": 120,
"bracketSpacing": true
}
}
]
}
Loading