/
check-deployment.ts
232 lines (212 loc) · 7.44 KB
/
check-deployment.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
/* eslint-disable no-console */
import "@nomiclabs/hardhat-ethers";
import { deployments, ethers } from "hardhat";
import {
SoulboundCreditScore,
SoulboundCreditScore__factory,
SoulboundIdentity,
SoulboundIdentity__factory,
SoulLinker__factory,
SoulName,
SoulName__factory,
SoulStore,
SoulStore__factory
} from "../typechain";
import { SoulLinker } from "../typechain/contracts/SoulLinker";
import { getEnvParams } from "./utils/EnvParams";
/**
* main function
*/
async function main() {
const [admin] = await ethers.getSigners();
const network = await ethers.provider.getNetwork();
const chainId = network.chainId;
const env = getEnvParams(network.name);
const { address: soulboundIdentityAddress } = await deployments.get(
"SoulboundIdentity"
);
const { address: soulboundCreditScoreAddress } = await deployments.get(
"SoulboundCreditScore"
);
const { address: soulbound2FAAddress } = await deployments.get(
"Soulbound2FA"
);
const { address: soulNameAddress } = await deployments.get("SoulName");
const { address: soulStoreAddress } = await deployments.get("SoulStore");
const { address: soulLinkerAddress } = await deployments.get("SoulLinker");
console.log(
"=============================================================================="
);
console.log(`Account address: ${admin.address}`);
console.log(`ChainId: ${chainId}`);
console.log(`Network: ${network.name}`);
console.log("");
console.log(`SoulboundIdentity address: ${soulboundIdentityAddress}`);
console.log(`SoulboundCreditScore address: ${soulboundCreditScoreAddress}`);
console.log(`Soulbound2FA address: ${soulbound2FAAddress}`);
console.log(`SoulName address: ${soulNameAddress}`);
console.log(`SoulStore address: ${soulStoreAddress}`);
console.log(`SoulLinker address: ${soulLinkerAddress}`);
console.log("");
// create contract instances
const soulboundIdentity: SoulboundIdentity =
SoulboundIdentity__factory.connect(soulboundIdentityAddress, admin);
const soulName: SoulName = SoulName__factory.connect(soulNameAddress, admin);
const soulLinker: SoulLinker = SoulLinker__factory.connect(
soulLinkerAddress,
admin
);
const soulStore: SoulStore = SoulStore__factory.connect(
soulStoreAddress,
admin
);
const soulboundCreditScore: SoulboundCreditScore =
SoulboundCreditScore__factory.connect(soulboundCreditScoreAddress, admin);
console.log("");
console.log(
"=============================================================================="
);
const IDENTITY_MINTER_ROLE = await soulboundIdentity.MINTER_ROLE();
console.log(
`SoulboundIdentity.hasRole(MINTER_ROLE, SoulStore): ${await soulboundIdentity.hasRole(
IDENTITY_MINTER_ROLE,
soulStoreAddress
)}`
);
console.log(
`SoulboundIdentity.SoulName: ${await soulboundIdentity.getSoulName()}`
);
console.log(
"=============================================================================="
);
const NAME_MINTER_ROLE = await soulName.MINTER_ROLE();
console.log(
`SoulName.hasRole(MINTER_ROLE, SoulboundIdentity): ${await soulName.hasRole(
NAME_MINTER_ROLE,
soulboundIdentityAddress
)}`
);
console.log(
`SoulName.hasRole(MINTER_ROLE, SoulStore): ${await soulName.hasRole(
NAME_MINTER_ROLE,
soulStoreAddress
)}`
);
console.log(
`SoulName.SoulboundIdentity: ${await soulName.soulboundIdentity()}`
);
console.log(`SoulName.extension: ${await soulName.extension()}`);
console.log(
"=============================================================================="
);
console.log(
`SoulLinker.SoulboundIdentity: ${await soulLinker.soulboundIdentity()}`
);
console.log(`SoulLinker.masaToken: ${await soulLinker.masaToken()}`);
console.log(`SoulLinker.stableCoin: ${await soulLinker.stableCoin()}`);
console.log(
`SoulLinker.wrappedNativeToken: ${await soulLinker.wrappedNativeToken()}`
);
console.log(`SoulLinker.swapRouter: ${await soulLinker.swapRouter()}`);
console.log(`SoulLinker.reserveWallet: ${await soulLinker.reserveWallet()}`);
console.log(
`SoulLinker.getEnabledPaymentMethods: ${await soulLinker.getEnabledPaymentMethods()}`
);
console.log(
"=============================================================================="
);
console.log(
`SoulStore.SoulboundIdentity: ${await soulStore.soulboundIdentity()}`
);
console.log(`SoulStore.masaToken: ${await soulStore.masaToken()}`);
console.log(`SoulStore.stableCoin: ${await soulStore.stableCoin()}`);
console.log(
`SoulStore.wrappedNativeToken: ${await soulStore.wrappedNativeToken()}`
);
console.log(`SoulStore.swapRouter: ${await soulStore.swapRouter()}`);
console.log(`SoulStore.reserveWallet: ${await soulStore.reserveWallet()}`);
console.log(
`SoulStore.getEnabledPaymentMethods: ${await soulStore.getEnabledPaymentMethods()}`
);
console.log(
`SoulStore.getNameRegistrationPricePerYear(1): ${await soulStore.getNameRegistrationPricePerYear(
"1"
)}`
);
console.log(
`SoulStore.getNameRegistrationPricePerYear(2): ${await soulStore.getNameRegistrationPricePerYear(
"22"
)}`
);
console.log(
`SoulStore.getNameRegistrationPricePerYear(3): ${await soulStore.getNameRegistrationPricePerYear(
"333"
)}`
);
console.log(
`SoulStore.getNameRegistrationPricePerYear(4): ${await soulStore.getNameRegistrationPricePerYear(
"4444"
)}`
);
console.log(
`SoulStore.getNameRegistrationPricePerYear(5): ${await soulStore.getNameRegistrationPricePerYear(
"55555"
)}`
);
console.log(
"=============================================================================="
);
console.log(
`SoulboundCreditScore.SoulboundIdentity: ${await soulboundCreditScore.soulboundIdentity()}`
);
console.log(
`SoulboundCreditScore.masaToken: ${await soulboundCreditScore.masaToken()}`
);
console.log(
`SoulboundCreditScore.stableCoin: ${await soulboundCreditScore.stableCoin()}`
);
console.log(
`SoulboundCreditScore.wrappedNativeToken: ${await soulboundCreditScore.wrappedNativeToken()}`
);
console.log(
`SoulboundCreditScore.swapRouter: ${await soulboundCreditScore.swapRouter()}`
);
console.log(
`SoulboundCreditScore.reserveWallet: ${await soulboundCreditScore.reserveWallet()}`
);
console.log(
`SoulboundCreditScore.getEnabledPaymentMethods: ${await soulboundCreditScore.getEnabledPaymentMethods()}`
);
console.log(
`SoulboundCreditScore.mintPrice: ${await soulboundCreditScore.mintPrice()}`
);
console.log(
`SoulboundCreditScore.mintPriceMASA: ${await soulboundCreditScore.mintPriceMASA()}`
);
console.log(
`SoulboundCreditScore.addLinkPrice: ${await soulboundCreditScore.addLinkPrice()}`
);
console.log(
`SoulboundCreditScore.addLinkPriceMASA: ${await soulboundCreditScore.addLinkPriceMASA()}`
);
console.log(
`SoulboundCreditScore.readDataPrice: ${await soulboundCreditScore.queryLinkPrice()}`
);
console.log(
`SoulboundCreditScore.readDataPriceMASA: ${await soulboundCreditScore.queryLinkPriceMASA()}`
);
console.log(
`SoulboundCreditScore.authorities(${
env.AUTHORITY_WALLET
}): ${await soulboundCreditScore.authorities(env.AUTHORITY_WALLET)}`
);
console.log(
"=============================================================================="
);
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});