televerse-dao-typechain-types 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -147
- package/package.json +2 -3
- package/README +0 -16
package/README.md
CHANGED
|
@@ -1,152 +1,16 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Televerse DAO Typechain Types
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Purpose
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
pnpm install
|
|
9
|
-
pnpx hardhat compile # builds the contracts
|
|
10
|
-
pnpm prepare # NOTE: this adds a post-checkout hook for the purpose of generating typechain types (equivalent of pnpm typechain:generate)
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Once installed, let's create our .env file based on the .env.sample, fill in its missing fields:
|
|
14
|
-
|
|
15
|
-
```sh
|
|
16
|
-
touch .env
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Note: the COINMARKETCAP_API_KEY field is necessary to return usd value of transactions during eth gas estimation
|
|
20
|
-
|
|
21
|
-
We can compile and clean (only if compilation or test results are not as expected) the contracts within this project with the following commands:
|
|
22
|
-
|
|
23
|
-
```sh
|
|
24
|
-
npx hardhat compile
|
|
25
|
-
npx hardhat clean
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Development
|
|
29
|
-
|
|
30
|
-
For local development run the following command:
|
|
31
|
-
|
|
32
|
-
```sh
|
|
33
|
-
pnpm dev
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
This will start:
|
|
5
|
+
These types allow us to access the smart contract factories for creating
|
|
6
|
+
interfaces to the Telverse DAO contracts. It also exports via the factories the
|
|
7
|
+
abi references needed by Viem.
|
|
37
8
|
|
|
38
|
-
|
|
39
|
-
2. a local http server listening here: `http://127.0.0.1:6061`
|
|
9
|
+
## Example Use
|
|
40
10
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
```sh
|
|
48
|
-
pnpm hardhat node
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
2. Obtain the `PRIVATE_KEY_MASTER` from any account and update the `.env` file accordingly.
|
|
52
|
-
|
|
53
|
-
3. Deploy the contracts with the following command (`deploy:all` knows the correct order for deployment):
|
|
54
|
-
|
|
55
|
-
```sh
|
|
56
|
-
pnpm hardhat deploy:all
|
|
11
|
+
```ts
|
|
12
|
+
import {
|
|
13
|
+
type Governance,
|
|
14
|
+
Governance__factory,
|
|
15
|
+
} from 'typechain-types';
|
|
57
16
|
```
|
|
58
|
-
|
|
59
|
-
For additional information relating to integrating with the TSPN, refer to the README.md in the TSPN repo [here](https://github.com/DCConnect-Global/tspn)
|
|
60
|
-
|
|
61
|
-
4. the `zkEvm` and its deployed contracts are now available the local url (or, if deployed to the televerse staging server, at `https://m8kkp6.televersedao.com/rpc`)
|
|
62
|
-
|
|
63
|
-
## Deployment: Staging
|
|
64
|
-
|
|
65
|
-
There is a `.github/workflows/deploy-staging.yml` for deployment to staging. Note that the target (host) requires the following nginx configuration for the deployment to work:
|
|
66
|
-
|
|
67
|
-
```nginx
|
|
68
|
-
server {
|
|
69
|
-
server_name m8kkp6.televersedao.com;
|
|
70
|
-
|
|
71
|
-
root /var/www/html;
|
|
72
|
-
index index.html;
|
|
73
|
-
|
|
74
|
-
# Serve index.html for /
|
|
75
|
-
location = / {
|
|
76
|
-
try_files $uri $uri/ =404;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
location = /contract_addresses {
|
|
80
|
-
root /var/www;
|
|
81
|
-
try_files /contracts.staging.json =404;
|
|
82
|
-
default_type application/json;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
location /rpc {
|
|
86
|
-
proxy_pass http://127.0.0.1:8545/;
|
|
87
|
-
proxy_http_version 1.1;
|
|
88
|
-
proxy_set_header Upgrade $http_upgrade;
|
|
89
|
-
proxy_set_header Connection 'upgrade';
|
|
90
|
-
proxy_set_header Host $host;
|
|
91
|
-
proxy_cache_bypass $http_upgrade;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
listen 443 ssl; # managed by Certbot
|
|
95
|
-
ssl_certificate /etc/letsencrypt/live/m8kkp6.televersedao.com/fullchain.pem; # managed by Certbot
|
|
96
|
-
ssl_certificate_key /etc/letsencrypt/live/m8kkp6.televersedao.com/privkey.pem; # managed by Certbot
|
|
97
|
-
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
|
98
|
-
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
This is served at `https://m8kkp6.televersedao.com/` (staging).
|
|
104
|
-
|
|
105
|
-
## Environment
|
|
106
|
-
|
|
107
|
-
Depending on the target environment (set in the `.env` file as `ZKEVM_ENV={local,staging,production}`) a corresponding `zkevmNetwork` file will be loaded. These are located
|
|
108
|
-
in the `./settings/zkevmNetwork.<ZKEMV_ENV>.json`. The format for which is:
|
|
109
|
-
|
|
110
|
-
```json
|
|
111
|
-
{
|
|
112
|
-
"network_rpc": "http://127.0.0.1:8545"
|
|
113
|
-
}
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
## Testing
|
|
117
|
-
|
|
118
|
-
We can run our coverage and gas estimation tests with the following commands:
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
$ npx hardhat coverage --solcoverjs ./.solcover.js
|
|
122
|
-
$ npx hardhat test
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## E2E Testing
|
|
126
|
-
|
|
127
|
-
A new version of the end-to-end contract test suite has been made to run on a local hardhat instance.
|
|
128
|
-
Those tests can be found in the e2e folder within this hardhat project. In order to make those
|
|
129
|
-
tests run properly one must do the following in addition to unit test suite setup:
|
|
130
|
-
|
|
131
|
-
1. Finally change the test path location in the hardhat config file from ./test to ./e2e
|
|
132
|
-
2. Run the npx hardhat test command listed above in the Testing section
|
|
133
|
-
|
|
134
|
-
## Additional Support
|
|
135
|
-
|
|
136
|
-
If running into any errors we suggest checking that all .env variables in use are populated correctly
|
|
137
|
-
Following the stack trace to the exact line should quickly reveal if the problem is an .env variable
|
|
138
|
-
Please post and error and its stack trace in the discord chat for further help
|
|
139
|
-
|
|
140
|
-
## Additional Instruction
|
|
141
|
-
|
|
142
|
-
You can find detailed instructions on using this repository and many tips in [its documentation](https://hardhat.org/tutorial).
|
|
143
|
-
|
|
144
|
-
- [Writing and compiling contracts](https://hardhat.org/tutorial/writing-and-compiling-contracts/)
|
|
145
|
-
- [Setting up the environment](https://hardhat.org/tutorial/setting-up-the-environment/)
|
|
146
|
-
- [Testing Contracts](https://hardhat.org/tutorial/testing-contracts/)
|
|
147
|
-
- [Setting up Metamask](https://hardhat.org/tutorial/boilerplate-project#how-to-use-it)
|
|
148
|
-
- [Hardhat's full documentation](https://hardhat.org/docs/)
|
|
149
|
-
|
|
150
|
-
For a complete introduction to Hardhat, refer to [this guide](https://hardhat.org/getting-started/#overview).
|
|
151
|
-
|
|
152
|
-
**Happy _building_!**
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "televerse-dao-typechain-types",
|
|
3
3
|
"sourceType": "commonjs",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"description": "The typechain types for the Televerse DAO smart contracts.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"files": [
|
|
8
|
-
"typechain-types"
|
|
9
|
-
"README"
|
|
8
|
+
"typechain-types"
|
|
10
9
|
],
|
|
11
10
|
"exports": {
|
|
12
11
|
".": {
|
package/README
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
# Televerse DAO Typechain Types
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
|
|
5
|
-
These types allow us to access the smart contract factories for creating
|
|
6
|
-
interfaces to the Telverse DAO contracts. It also exports via the factories the
|
|
7
|
-
abi references needed by Viem.
|
|
8
|
-
|
|
9
|
-
## Example Use
|
|
10
|
-
|
|
11
|
-
```ts
|
|
12
|
-
import {
|
|
13
|
-
type Governance,
|
|
14
|
-
Governance__factory,
|
|
15
|
-
} from 'typechain-types';
|
|
16
|
-
```
|