Skip to content

Commit b468d73

Browse files
committed
merge testnet51 into main / bring in the latest production deploy code
2 parents 1a1e2ef + 74498d8 commit b468d73

21 files changed

+3435
-2394
lines changed

.envrc.example

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
export ETHEREUM_MAINNET_RPC_URL=''
21
export OPTIMISM_MAINNET_RPC_URL=''
3-
4-
export ETHEREUM_GOERLI_RPC_URL=''
5-
export OPTIMISM_GOERLI_RPC_URL=''
6-
7-
export ARBITRUM_SEPOLIA_RPC_URL=''
82
export OPTIMISM_SEPOLIA_RPC_URL=''
93

.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierignore

Lines changed: 0 additions & 10 deletions
This file was deleted.

README.md

Lines changed: 93 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,132 @@
88

99
### CLI
1010

11-
The `@generationsoftware/pt-v5-cli` [node module package](https://www.npmjs.com/package/@generationsoftware/pt-v5-cli) is a Node command line interface (CLI) to interact with the **PoolTogether V5 protocol**. The CLI uses the `v5-autotasks-library` modules to fetch and run calculations/computations for essential PoolTogether V5 tasks.
11+
The `@generationsoftware/pt-v5-cli` [node module package](https://www.npmjs.com/package/@generationsoftware/pt-v5-cli) is a Node command line interface (CLI) to interact with the **PoolTogether V5 protocol**. The CLI uses the `pt-v5-utils-js` package to fetch and run calculations/computations for essential PoolTogether V5 tasks.
1212

1313
Primary CLI Commands (help)
1414

1515
```sh
16-
npx @generationsoftware/pt-v5-cli help compute drawPrizes
16+
npx @generationsoftware/pt-v5-cli help utils vaultAccounts
17+
npx @generationsoftware/pt-v5-cli help utils concatWinners
1718
```
1819

1920
# ⌨️ CLI Installation
2021

2122
<!-- usage -->
23+
2224
```sh-session
2325
$ npm install -g @generationsoftware/pt-v5-cli
2426
$ ptv5 COMMAND
2527
running command...
2628
$ ptv5 (--version)
27-
@generationsoftware/pt-v5-cli/1.0.9 darwin-arm64 node-v18.16.0
29+
@generationsoftware/pt-v5-cli/1.1.1 darwin-arm64 node-v18.17.0
2830
$ ptv5 --help [COMMAND]
2931
USAGE
3032
$ ptv5 COMMAND
3133
...
3234
```
35+
3336
<!-- usagestop -->
3437

3538
# Commands
3639

37-
## Compute Draw Prizes
40+
## Compute Vault Accounts
41+
42+
```sh-session
43+
ptv5 utils vaultAccounts
44+
```
45+
46+
Computes the previous draw's depositors with a non-zero balance for a PrizePool to a target output directory.
47+
48+
JSON is in the format required by the [@GenerationSoftware/foundry-winner-calc](https://github.com/@GenerationSoftware/foundry-winner-calc) repo to quickly winners.
49+
50+
Simply pass a `chainId`, `prizePool` and `outDir` to compute and locally save the results.
51+
52+
```
53+
USAGE
54+
$ ptv5 utils vaultAccounts --chainId 1 --outDir ./temp --prizePool '0xdd4d117723C257CEe402285D3aCF218E9A8236E1'
55+
56+
DESCRIPTION
57+
Computes the previous draw's depositors with a non-zero balance for a PrizePool to a target output directory.
58+
59+
EXAMPLES
60+
$ ptv5 utils vaultAccounts --chainId 1 --prizePool 0x0000000000000000000000000000000000000000 --outDir ./temp
61+
Running utils:vaultAccounts on chainId: 1
62+
```
63+
64+
## Vaults Files ([vaultAddress].json)
65+
66+
```json
67+
{
68+
"chainId": 10,
69+
"prizePoolAddress": "0xe32e5E1c5f0c80bD26Def2d0EA5008C107000d6A",
70+
"vaultAddress": "0xf0B19f02c63d51B69563A2b675e0160e1C34397C",
71+
"userAddresses": [
72+
"0x07967251f6db5f9d095119379bd8fc4fce60b3e1",
73+
"0x084039db4e3c6775eabfc59cbd3725d3d9a6d752"
74+
// ...
75+
]
76+
}
77+
```
78+
79+
## Status File (status.json)
80+
81+
```json
82+
{
83+
"status": "LOADING",
84+
"createdAt": "11"
85+
}
86+
```
87+
88+
### Success
89+
90+
```json
91+
{
92+
"status": "SUCCESS",
93+
"createdAt": 1693423691768,
94+
"updatedAt": 1693423805132,
95+
"runtime": 114,
96+
"meta": {
97+
"numVaults": 7,
98+
"numTiers": 3,
99+
"numPrizeIndices": 21,
100+
"numAccounts": 3830
101+
}
102+
}
103+
```
104+
105+
### Failure
106+
107+
```json
108+
{
109+
"status": "FAILURE",
110+
"createdAt": "11",
111+
"updatedAt": "33",
112+
"runtime": "22",
113+
"error": "ErrorCode"
114+
}
115+
```
116+
117+
## Concat Winners
38118

39119
```sh-session
40-
ptv5 compute drawPrizes
120+
ptv5 utils concatWinners
41121
```
42122

43-
Computes the previous draw's prizes for a PrizePool to a target output directory.
123+
Receives all of the winners by vault JSON files created by the [foundry-winner-calc](https://github.com/GenerationSoftware/foundry-winner-calc?tab=readme-ov-file) tool and ties them into one winners.json file. Therefore is dependent on `foundry-winner-calc` running prior to concatWinners being run.
44124

45125
Simply pass a `chainId`, `prizePool` and `outDir` to compute and locally save the results.
46126

47127
```
48128
USAGE
49-
$ ptv5 compute drawPrizes --chainId 1 --outDir ./temp --prizePool '0xdd4d117723C257CEe402285D3aCF218E9A8236E1'
129+
$ ptv5 utils concatWinners --chainId 1 --outDir ./temp --prizePool '0xdd4d117723C257CEe402285D3aCF218E9A8236E1'
50130
51131
DESCRIPTION
52-
Computes the previous draw's prizes for a PrizePool to a target output directory.
132+
Ingests foundry-winner-calc output files and ties them into one winners.json file.
53133
54134
EXAMPLES
55-
$ ptv5 compute drawPrizes --chainId 1 --prizePool 0x0000000000000000000000000000000000000000 --outDir ./temp
56-
Running compute:drawPrizes on chainId: 1
135+
$ ptv5 utils concatWinners --chainId 1 --prizePool 0x0000000000000000000000000000000000000000 --outDir ./temp
136+
Running utils:concatWinners on chainId: 1
57137
```
58138

59139
## Prizes File (prizes.json)
@@ -100,24 +180,7 @@ EXAMPLES
100180
"numVaults": 7,
101181
"numTiers": 3,
102182
"numPrizeIndices": 21,
103-
"numAccounts": 3830,
104-
"numPrizes": 21,
105-
"prizePoolReserve": "431450369493570544008",
106-
"amountsTotal": "318001330964753848953",
107-
"tierPrizeAmounts": {
108-
"0": "271304907889060131200",
109-
"1": "45062486366179690039",
110-
"2": "1633936709514027714"
111-
},
112-
"vaultPortions": {
113-
"0x0410cae69dd01f58224d54881648e35c6cb874fa": "12491920408565",
114-
"0x0bfe04201c496a9994b920deb6087a60bdadfbbb": "973235150974337855",
115-
"0x4b7a2e1a70ea05523542c9189fa51b133884f321": "232229504251603",
116-
"0x9e11c3d53a68c07f6d839e5d89a94052753cedcb": "5916502876505634",
117-
"0xb9a647d3391b939cb49b44d3c5e93c63d96ad4a4": "9173734225780914",
118-
"0xe2ef926250b0e8a07578d76d9f57e5092340a6fa": "11429890498715426",
119-
"0xffb08a9ffc360806be7ef8cf815c1274ef92cea9": "0"
120-
}
183+
"numAccounts": 3830
121184
}
122185
}
123186
```
@@ -160,8 +223,8 @@ DESCRIPTION
160223

161224
### Using the tool in dev
162225

163-
You can test the CLI while developing by using the following, with whichever chain / prizePool flags you want to test with:
226+
You can test the CLI while developing by using the following, with whichever chain & prizePool flags you want to test with:
164227

165228
```
166-
./bin/run.js compute drawPrizes --chainId 80001 -o ./temp -p '0xA32C8f94191c9295634f0034eb2b0e2749e77974'
229+
./bin/run.js utils vaultAccounts --chainId 80001 -o ./temp -p '0xA32C8f94191c9295634f0034eb2b0e2749e77974'
167230
```

bin/dev

Lines changed: 0 additions & 17 deletions
This file was deleted.

bin/dev.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning
2+
3+
import { execute } from "@oclif/core";
4+
5+
await execute({ development: true, dir: import.meta.url });

bin/run

Lines changed: 0 additions & 5 deletions
This file was deleted.

bin/run.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env node
2+
3+
import { execute } from "@oclif/core";
4+
5+
await execute({ dir: import.meta.url });

package.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@
66
"url": "https://github.com/generationsoftware"
77
},
88
"license": "MIT",
9-
"version": "1.0.9",
9+
"version": "1.1.1",
1010
"repository": "https://github.com/generationsoftware/pt-v5-cli",
1111
"homepage": "https://github.com/generationsoftware/pt-v5-cli",
1212
"bugs": "https://github.com/generationsoftware/pt-v5-cli/issues",
13+
"type": "module",
1314
"main": "dist/index.js",
1415
"files": [
1516
"/bin",
@@ -18,15 +19,13 @@
1819
"/oclif.manifest.json"
1920
],
2021
"bin": {
21-
"ptv5": "./bin/run"
22+
"ptv5": "./bin/run.js"
2223
},
2324
"scripts": {
24-
"build": "shx rm -rf dist && tsc",
25-
"prepack": "oclif manifest && oclif readme",
26-
"postpack": "shx rm -f oclif.manifest.json",
25+
"build": "shx rm -rf dist && tsc && yarn manifest",
2726
"manifest": "oclif manifest",
2827
"version": "oclif readme && git add README.md",
29-
"_ptv5": "./bin/run"
28+
"_ptv5": "./bin/run.js"
3029
},
3130
"engines": {
3231
"node": ">=12.0.0"
@@ -37,28 +36,30 @@
3736
"@ethersproject/bignumber": "^5.5.0",
3837
"@ethersproject/contracts": "^5.5.0",
3938
"@ethersproject/providers": "^5.5.3",
40-
"@generationsoftware/pt-v5-utils-js": "1.0.10",
41-
"@oclif/core": "^2.8.5",
42-
"@oclif/plugin-help": "^5",
43-
"@oclif/plugin-plugins": "^3.0.1",
39+
"@generationsoftware/pt-v5-utils-js": "^1.1.2",
40+
"@oclif/core": "^3",
41+
"@oclif/plugin-help": "^6",
42+
"@oclif/plugin-plugins": "^4",
4443
"ajv": "^8.10.0",
4544
"ethers": "^5.7.2",
4645
"graphql": "^16.3.0",
4746
"graphql-request": "^4.0.0",
47+
"lodash": "^4.17.0",
48+
"lodash.pickby": "^4.6.0",
4849
"piscina": "^3.2.0",
4950
"spawn-promise": "^0.1.8",
5051
"yarn": "^1.22.19"
5152
},
5253
"devDependencies": {
53-
"@oclif/test": "^2.3.20",
54+
"@oclif/test": "^3",
5455
"@pooltogether/evm-chains-extended": "^0.6.4-beta.1",
5556
"@types/chai": "^4",
5657
"@types/mocha": "^9.0.0",
5758
"@types/node": "^16.9.4",
5859
"chai": "^4",
5960
"globby": "^11",
6061
"mocha": "^9",
61-
"oclif": "^3.9.0",
62+
"oclif": "^4",
6263
"shx": "^0.3.3",
6364
"ts-node": "^10.2.1",
6465
"tslib": "^2.3.1",

0 commit comments

Comments
 (0)