Skip to content

Commit 08bbc59

Browse files
authored
Scripts for populating data and separating the contracts CLI to be on its own (#237)
* Add in mock data for many projects * Move scripts for contracts into a contracts folder inside /scripts * Add team genesis addresses * Set up contract cli funcs to be exportable to other code * Turn all contract scripts into exportable objects * Overhaul CLI contract objects. Works for CLI and exportable for npm * Update mock data * Populate data for graph token, did reg, ens, gns * Get curation data populated * Finish populating data for the contracts with staking and service reg * Fix shares down to 1 for curation redeem * Clean code * Update README * Refactor populateData and all cli code to use wallet and provider from start. Less complex * Configure all single contract scripts to take --network parameter * Add in ganache addresses to address book * Address the rest of the comments * Remove migrate npm command. Only use deploy * Run updated prettier
1 parent e322e6a commit 08bbc59

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2151
-1007
lines changed

addresses.json

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,210 @@
203203
"txHash": "0x2be17f242352c6c31d2c24c8d17693e251defba8dea7a3fb8ef3a51c1f860f0b"
204204
}
205205
},
206+
"1337": {
207+
"EpochManager": {
208+
"address": "0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab",
209+
"constructorArgs": [
210+
{
211+
"name": "governor",
212+
"value": "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1"
213+
},
214+
{
215+
"name": "lengthInBlocks",
216+
"value": 5760
217+
}
218+
],
219+
"creationCodeHash": "0x195aa9d9c834d9a85d9b0405e337677093cf63b7a25e976788c5c429d955e0e4",
220+
"runtimeCodeHash": "0x82d5bf7222c80f1b7877587f77bcb9c35e3f91adb5baa7e191b1f6b23c0a39d1",
221+
"txHash": "0x8af59e62b7dc571bacf1225a54494393bec624fb8f2ea3b07d0b0bd39358061f"
222+
},
223+
"GNS": {
224+
"address": "0x5b1869D9A4C187F2EAa108f3062412ecf0526b24",
225+
"constructorArgs": [
226+
{
227+
"name": "governor",
228+
"value": "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1"
229+
},
230+
{
231+
"name": "didRegistry",
232+
"value": "0xdca7ef03e98e0dc2b855be647c39abe984fcf21b"
233+
}
234+
],
235+
"creationCodeHash": "0x9e554d8038b75dbc61a0cd1df5f3f6e035631811f3667c9bde1a0481c9edaa48",
236+
"runtimeCodeHash": "0xce6e8120abb40fe8c8532133d8ae9aacfb65a228aa4cfc74ebdcdab392e70049",
237+
"txHash": "0x2c8657e441a9af1e5ef15153a496dc4c50ce55c0a746fbfed3669c4219ea17a1"
238+
},
239+
"GraphToken": {
240+
"address": "0xCfEB869F69431e42cdB54A4F4f105C19C080A601",
241+
"constructorArgs": [
242+
{
243+
"name": "governor",
244+
"value": "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1"
245+
},
246+
{
247+
"name": "initialSupply",
248+
"value": "10000000000000000000000000"
249+
}
250+
],
251+
"creationCodeHash": "0x560bd3397b5317d8fff2c0e12464160462c47512035adedbe1bd910dcbfa072b",
252+
"runtimeCodeHash": "0xec09fe8bb28d8e1e5971c984cd03b71d2b0303dbfcfe53a136a61c86335522de",
253+
"txHash": "0xd08351dbf909df0396121890fb6a278d18d5fd9a59f85de2a8e87f20ae1446a9"
254+
},
255+
"ServiceRegistry": {
256+
"address": "0x254dffcd3277C0b1660F6d42EFbB754edaBAbC2B",
257+
"creationCodeHash": "0x7621576815191ce113f36846e467ae9e841159d894a8a7b5664fa348ab013529",
258+
"runtimeCodeHash": "0x891d1f7e93a2a42069778d924e1e4fee268ea7daf3f7af6d7d0939c321e74d7d",
259+
"txHash": "0x41696698c65f6dd2a26d10854f20f987a4117a00a07e80e36945ffddf6a90966"
260+
},
261+
"Curation": {
262+
"address": "0xC89Ce4735882C9F0f0FE26686c53074E09B0D550",
263+
"constructorArgs": [
264+
{
265+
"name": "governor",
266+
"value": "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1"
267+
},
268+
{
269+
"name": "token",
270+
"value": "0xCfEB869F69431e42cdB54A4F4f105C19C080A601"
271+
},
272+
{
273+
"name": "reserveRatio",
274+
"value": 500000
275+
},
276+
{
277+
"name": "minimumCurationStake",
278+
"value": "100000000000000000000"
279+
}
280+
],
281+
"creationCodeHash": "0x58ba874b34778293f295a2d3c3ef8a87d78294fbbb3d8da46f20895b95ef0820",
282+
"runtimeCodeHash": "0x10e2bdbc3808a3ed6477a0a2bea6532a449390397283a4c4f3637d7c20d7457f",
283+
"txHash": "0xcf1456657f9ad6f153d61cee8ad8594bd497bf3f804ab2418e57bc4f6cf7fe71"
284+
},
285+
"RewardsManager": {
286+
"address": "0xD833215cBcc3f914bD1C9ece3EE7BF8B14f841bb",
287+
"constructorArgs": [
288+
{
289+
"name": "governor",
290+
"value": "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1"
291+
}
292+
],
293+
"creationCodeHash": "0xc4796872631ad7b7a608475af364b8806fae41115aa885ba367ec964107782ff",
294+
"runtimeCodeHash": "0x936684d09b7f949e715084ece3abe05f9ede12be72f6bd685061b19eb9f6df66",
295+
"txHash": "0x83e406678723e0585bf1007bee9e060473a9ceeb0fd044be065fa05688519e07"
296+
},
297+
"Staking": {
298+
"address": "0x9561C133DD8580860B6b7E504bC5Aa500f0f06a7",
299+
"constructorArgs": [
300+
{
301+
"name": "governor",
302+
"value": "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1"
303+
},
304+
{
305+
"name": "token",
306+
"value": "0xCfEB869F69431e42cdB54A4F4f105C19C080A601"
307+
},
308+
{
309+
"name": "epochManager",
310+
"value": "0xe78A0F7E598Cc8b0Bb87894B0F60dD2a88d6a8Ab"
311+
}
312+
],
313+
"creationCodeHash": "0x93bc7c8d0a5dddd114e787faedffe44ec05a8eee8abfd0cbd7f095c5233f129d",
314+
"runtimeCodeHash": "0xc2e9b4cf7cdab5f3edf095032076c055a8b7b768dc03fbb34e2ab841bcfc6f63",
315+
"txHash": "0x282c96ae5ea75bfdcf475be4640a80a5beeef9e9116180c52c719c5caa244651"
316+
},
317+
"DisputeManager": {
318+
"address": "0xe982E462b094850F12AF94d21D470e21bE9D0E9C",
319+
"constructorArgs": [
320+
{
321+
"name": "governor",
322+
"value": "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1"
323+
},
324+
{
325+
"name": "arbitrator",
326+
"value": "0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1"
327+
},
328+
{
329+
"name": "token",
330+
"value": "0xCfEB869F69431e42cdB54A4F4f105C19C080A601"
331+
},
332+
{
333+
"name": "staking",
334+
"value": "0x9561C133DD8580860B6b7E504bC5Aa500f0f06a7"
335+
},
336+
{
337+
"name": "minimumDeposit",
338+
"value": "100000000000000000000"
339+
},
340+
{
341+
"name": "fishermanRewardPercentage",
342+
"value": 1000
343+
},
344+
{
345+
"name": "slashingPercentage",
346+
"value": 1000
347+
}
348+
],
349+
"creationCodeHash": "0xa957dd61c3b0fae3c260eb260a1cc6f2b532df6b2c26bdd49c4c1c8266fecaaf",
350+
"runtimeCodeHash": "0x1cf3c11fe32dc41cc623f8ca2a93625c3f39bdf692dbe02ea5b8d7a58f86ca6c",
351+
"txHash": "0x94f6875e190f480fd8bedec0a031227eadcd551e632ce7a49412d816171730c7"
352+
},
353+
"IndexerCTDT": {
354+
"address": "0x59d3631c86BbE35EF041872d502F218A39FBa150",
355+
"creationCodeHash": "0x361173cc42107a121ce345575bd8716a36a1b192e117e5b8b706e02d747983ca",
356+
"runtimeCodeHash": "0x14766ed022e02676f1db45c0a9c90b818d4329b250ec7ee8ed88bb3239370782",
357+
"txHash": "0x5507299a89531c36a49c2b454ebe132ea148c88c48e496b2382b5f5c25241666"
358+
},
359+
"IndexerSingleAssetInterpreter": {
360+
"address": "0x0290FB167208Af455bB137780163b7B7a9a10C16",
361+
"creationCodeHash": "0x08863ebe18a36c31305875ec9446059043308432aa2a9c9e971236ab82bc5c61",
362+
"runtimeCodeHash": "0x7ad00fc2867794871d2f5dc2d12c6ba9ed3039460b9caf86b473f4f1abd85654",
363+
"txHash": "0xbf3a1605ca2801f7b592758aa49226702b77fec4a1be781533964112245b7f5b"
364+
},
365+
"IndexerMultiAssetInterpreter": {
366+
"address": "0x9b1f7F645351AF3631a656421eD2e40f2802E6c0",
367+
"creationCodeHash": "0xf180b4b36c13e92196a950b05cea667156ac4c0bbf2c5316f0ef6e1e14ce89e9",
368+
"runtimeCodeHash": "0x832440ffd2d73095a824c9805eafc17ad0c29993dc0a44ba5bbc2a9ec99d14a3",
369+
"txHash": "0xdd8a6500b1a135d721d51fcf8f49efc1cdc63aaaf6d070d21255a1d55a092484"
370+
},
371+
"IndexerWithdrawInterpreter": {
372+
"address": "0x67B5656d60a809915323Bf2C40A8bEF15A152e3e",
373+
"creationCodeHash": "0x778e7da684dbef1004e02c15fc720d323ee83bb5719141c8fcc64c7815bbd3b7",
374+
"runtimeCodeHash": "0xcbe4abd7dcc9bffc390c1115816d5c124d765e3d7b559ac81b8b6a2e8afcafb8",
375+
"txHash": "0x031cacc8f501cc0549a304a34b674399cbbdda39bb887a0742077f07a202aa1c"
376+
},
377+
"MinimumViableMultisig": {
378+
"address": "0x2612Af3A521c2df9EAF28422Ca335b04AdF3ac66",
379+
"constructorArgs": [
380+
{
381+
"name": "node",
382+
"value": "0x0000000000000000000000000000000000000000"
383+
},
384+
{
385+
"name": "staking",
386+
"value": "0x9561C133DD8580860B6b7E504bC5Aa500f0f06a7"
387+
},
388+
{
389+
"name": "CTDT",
390+
"value": "0x59d3631c86BbE35EF041872d502F218A39FBa150"
391+
},
392+
{
393+
"name": "singleAssetInterpreter",
394+
"value": "0x0290FB167208Af455bB137780163b7B7a9a10C16"
395+
},
396+
{
397+
"name": "multiAssetInterpreter",
398+
"value": "0x9b1f7F645351AF3631a656421eD2e40f2802E6c0"
399+
},
400+
{
401+
"name": "withdrawInterpreter",
402+
"value": "0x67B5656d60a809915323Bf2C40A8bEF15A152e3e"
403+
}
404+
],
405+
"creationCodeHash": "0xeb199bfba54763e4fe4205848785237d3a1934b450a90a52e9bdc38db0cc7542",
406+
"runtimeCodeHash": "0xcb3a520f02fc2be80c4007a2b48501051396925fbe667c1eabdc86cca9e439dc",
407+
"txHash": "0x8312018ae2babce4cc58facadf758d8b9916f24e21e2f22aac898971dc94c7be"
408+
}
409+
},
206410
"kovan": {
207411
"ens": "0xB66B2f307B6e46a6D038a85997B401aE87455772",
208412
"ensTestRegistrar": "0x327033bA7B23A6E3a3Ca165e44D619E3dd675f8b",

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,8 @@
6565
"build": "./scripts/build",
6666
"clean": "rm -rf build/ cache/ dist/",
6767
"compile": "buidler compile",
68-
"deploy": "npm run migrate",
68+
"deploy": "buidler migrate",
6969
"deploy-kovan": "npm run migrate -- --force --network kovan",
70-
"migrate": "buidler migrate",
7170
"test": "scripts/test",
7271
"coverage": "SOLIDITY_COVERAGE=true npm run evm:test",
7372
"evm:test": "scripts/evm",

scripts/README.md

Lines changed: 11 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Scripts
2-
1+
# Scripts / CLI
2+
## Setup
33
These are convenience scripts for interacting with the contracts.
44

55
The scripts expect a `.env` file with the following setup:
@@ -16,51 +16,12 @@ npm run build
1616
`chmod+x` can be run on the files first, and then you will not need to pass `ts-node` in any of
1717
the script calls.
1818

19-
To see specific functionality of the scripts, review the comments in each file,
20-
or run the scripts and see them printed out.
21-
22-
## GNS
23-
```js
24-
publishNewSubgraph()
25-
publishNewVersion()
26-
deprecate()
27-
```
28-
29-
## ENS
30-
```js
31-
setRecord()
32-
setText()
33-
checkOwner()
34-
```
35-
36-
## Ethereum DID Registry
37-
```js
38-
setAttribute()
39-
```
40-
41-
## Graph Token
42-
```js
43-
mint()
44-
approve()
45-
transfer()
46-
```
47-
48-
## Service Registry
49-
```js
50-
register()
51-
unregister()
52-
```
53-
54-
## Curation
55-
```js
56-
stake()
57-
redeem()
58-
```
59-
60-
## Staking
61-
```js
62-
stake()
63-
unstake()
64-
withdraw()
65-
allocate()
66-
```
19+
## Usage
20+
There are two aspects to the CLI right now
21+
- `/cli`
22+
- This folder is a CLI that allows for deploying contracts to ethereum networks
23+
- `/contracts`
24+
- This is a CLI that allows for single calls to interact with deployed contracts
25+
- It also has `populateData` , which calls all functions the subgraph ingests, so that whenever
26+
contracts are lauched on a new network, we can quickly test, and get the front end filled
27+
with data. This data is in `/mockdata`

0 commit comments

Comments
 (0)