@raac/rpc 1.1.0-beta.65 → 1.1.0-beta.67
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/dist/configs/chains/11155111.json +20 -20
- package/dist/scripts/index.js +29 -31
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"raachouseprices": {
|
|
18
18
|
"id": "raachouseprices",
|
|
19
19
|
"name": "RAAC House Prices",
|
|
20
|
-
"contract": "
|
|
20
|
+
"contract": "0x5B2b86931846A66C178725CFd8fCae4bf2A08617"
|
|
21
21
|
},
|
|
22
22
|
"auctionfactory": {
|
|
23
23
|
"id": "auctionfactory",
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"feecollector": {
|
|
38
38
|
"id": "feecollector",
|
|
39
39
|
"name": "Fee Collector",
|
|
40
|
-
"contract": "
|
|
40
|
+
"contract": "0x66070bd2B077Dd3E0aced5d0c74188D1CBAaC6BF"
|
|
41
41
|
},
|
|
42
42
|
"treasury": {
|
|
43
43
|
"id": "treasury",
|
|
44
44
|
"name": "Treasury",
|
|
45
|
-
"contract": "
|
|
45
|
+
"contract": "0x1bCE0e1C1aB90936C5975d9755FBAc4a00c3f145"
|
|
46
46
|
},
|
|
47
47
|
"repairfund": {
|
|
48
48
|
"id": "repairfund",
|
|
@@ -57,17 +57,17 @@
|
|
|
57
57
|
"rwavault": {
|
|
58
58
|
"id": "rwavault",
|
|
59
59
|
"name": "RWA Vault",
|
|
60
|
-
"contract": "
|
|
60
|
+
"contract": "0xeD8502C80753740ac4ADd5Caf10aC96aed01de69"
|
|
61
61
|
},
|
|
62
62
|
"complianceregistry": {
|
|
63
63
|
"id": "complianceregistry",
|
|
64
64
|
"name": "Compliance Registry",
|
|
65
|
-
"contract": "
|
|
65
|
+
"contract": "0x0cFF98a49D62541eBb990C2B397297d477D3Ef34"
|
|
66
66
|
},
|
|
67
67
|
"rwaindextokencollector": {
|
|
68
68
|
"id": "rwaindextokencollector",
|
|
69
69
|
"name": "RWA Index Token Collector",
|
|
70
|
-
"contract": "
|
|
70
|
+
"contract": "0x59EFAae9b107d8B503e6CF1Cb7233CA359F8251C"
|
|
71
71
|
},
|
|
72
72
|
"raactokencollector": {
|
|
73
73
|
"id": "raactokencollector",
|
|
@@ -77,31 +77,31 @@
|
|
|
77
77
|
"raachousepriceoracle": {
|
|
78
78
|
"id": "raachousepriceoracle",
|
|
79
79
|
"name": "RAAC House Price Oracle",
|
|
80
|
-
"contract": "
|
|
80
|
+
"contract": "0xB1497d797c3c02e7e007bA0cB241aFDd70ab5249"
|
|
81
81
|
},
|
|
82
82
|
"raacprimerateoracle": {
|
|
83
83
|
"id": "raacprimerateoracle",
|
|
84
84
|
"name": "RAAC Prime Rate Oracle",
|
|
85
|
-
"contract": "
|
|
85
|
+
"contract": "0x685510e5921Da45a46D6348769910668C5a25B79"
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
"pools": {
|
|
89
89
|
"stabilitypool": {
|
|
90
90
|
"id": "stabilitypool",
|
|
91
91
|
"name": "Stability Pool",
|
|
92
|
-
"contract": "
|
|
92
|
+
"contract": "0x2F03459d4CEdcD156C4f8071c0F4F8A7bAa53568"
|
|
93
93
|
},
|
|
94
94
|
"lendingpool": {
|
|
95
95
|
"id": "lendingpool",
|
|
96
96
|
"name": "Lending Pool",
|
|
97
|
-
"contract": "
|
|
97
|
+
"contract": "0xE281dB3E652f1c649F324aa621Fc1917f74a5243"
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
100
|
"nfts": {
|
|
101
101
|
"raacnft": {
|
|
102
102
|
"id": "raacnft",
|
|
103
103
|
"name": "RAAC NFT",
|
|
104
|
-
"contract": "
|
|
104
|
+
"contract": "0x7421e594B65414d1b3eb5b798bc7bEeB2f834b6F"
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
"assets": {
|
|
@@ -115,19 +115,19 @@
|
|
|
115
115
|
"id": "crvusd",
|
|
116
116
|
"name": "CRVUSD",
|
|
117
117
|
"decimals": 18,
|
|
118
|
-
"contract": "
|
|
118
|
+
"contract": "0x990c1Aa9162d2c5B51378F86420f1752874e034B"
|
|
119
119
|
},
|
|
120
120
|
"rtoken": {
|
|
121
121
|
"id": "rtoken",
|
|
122
122
|
"name": "RToken",
|
|
123
123
|
"decimals": 18,
|
|
124
|
-
"contract": "
|
|
124
|
+
"contract": "0x062a641EF54810B321f123487fFf083cadB50989"
|
|
125
125
|
},
|
|
126
126
|
"detoken": {
|
|
127
127
|
"id": "detoken",
|
|
128
128
|
"name": "DEToken",
|
|
129
129
|
"decimals": 18,
|
|
130
|
-
"contract": "
|
|
130
|
+
"contract": "0xE9594c6923a909528336009f0Ab916d72d28478e"
|
|
131
131
|
},
|
|
132
132
|
"raactoken": {
|
|
133
133
|
"id": "raactoken",
|
|
@@ -145,13 +145,13 @@
|
|
|
145
145
|
"id": "debttoken",
|
|
146
146
|
"name": "Debt Token",
|
|
147
147
|
"decimals": 18,
|
|
148
|
-
"contract": "
|
|
148
|
+
"contract": "0xa4F93e2d2AFd4658e638a26dCE189acFd542fC0E"
|
|
149
149
|
},
|
|
150
150
|
"rwaindextoken": {
|
|
151
151
|
"id": "rwaindextoken",
|
|
152
152
|
"name": "RWA Index Token",
|
|
153
153
|
"decimals": 18,
|
|
154
|
-
"contract": "
|
|
154
|
+
"contract": "0x531b322933ebc65b4A139a11139534A3872bEB1a"
|
|
155
155
|
}
|
|
156
156
|
},
|
|
157
157
|
"adapters": {
|
|
@@ -159,13 +159,13 @@
|
|
|
159
159
|
"raacnftadapter": {
|
|
160
160
|
"id": "raacnftadapter",
|
|
161
161
|
"name": "RAAC NFT Adapter",
|
|
162
|
-
"contract": "
|
|
162
|
+
"contract": "0x151AB3Ae431978948559dE0E73Bad073CD3F8D68",
|
|
163
163
|
"type": "ERC721"
|
|
164
164
|
},
|
|
165
165
|
"rwaindextokenadapter": {
|
|
166
166
|
"id": "rwaindextokenadapter",
|
|
167
167
|
"name": "RWA Index Token",
|
|
168
|
-
"contract": "
|
|
168
|
+
"contract": "0x9899379d4d9B206A48F126F358ff4327414c0706",
|
|
169
169
|
"type": "ERC20"
|
|
170
170
|
}
|
|
171
171
|
},
|
|
@@ -173,13 +173,13 @@
|
|
|
173
173
|
"raacnftadapter": {
|
|
174
174
|
"id": "raacnftadapter",
|
|
175
175
|
"name": "RAAC NFT Adapter",
|
|
176
|
-
"contract": "
|
|
176
|
+
"contract": "0x2a8AAca13E882e496c75068c33E72825d7B36843",
|
|
177
177
|
"type": "ERC721"
|
|
178
178
|
},
|
|
179
179
|
"crvusdadapter": {
|
|
180
180
|
"id": "crvusdadapter",
|
|
181
181
|
"name": "CRVUSD Adapter",
|
|
182
|
-
"contract": "
|
|
182
|
+
"contract": "0x9C731Cfc4161d8BF5fc38a7B2421ef0263d69AeE",
|
|
183
183
|
"type": "ERC20"
|
|
184
184
|
}
|
|
185
185
|
}
|
package/dist/scripts/index.js
CHANGED
|
@@ -11,7 +11,7 @@ const contracts_1 = require("../utils/contracts");
|
|
|
11
11
|
const artifacts_1 = require("../utils/artifacts");
|
|
12
12
|
const _helpers_1 = require("../pools/rwaVault/_helpers");
|
|
13
13
|
const ethers5_1 = require("ethers5");
|
|
14
|
-
const chainId =
|
|
14
|
+
const chainId = 11155111;
|
|
15
15
|
const config = chains_1.default[chainId];
|
|
16
16
|
const TEST_MNEMONIC = process.env.TEST_MNEMONIC;
|
|
17
17
|
const TEST_PRIVATE_KEY = process.env.TEST_PRIVATE_KEY;
|
|
@@ -66,15 +66,13 @@ async function setup() {
|
|
|
66
66
|
const TreasuryAddress = (0, contracts_1.getContractAddress)(chainId, "treasury");
|
|
67
67
|
const TreasuryABI = (0, artifacts_1.getABI)("treasury");
|
|
68
68
|
const TreasuryContract = new ethers_1.ethers.Contract(TreasuryAddress, TreasuryABI, signer);
|
|
69
|
-
console.log(await LendingPoolContract.parameters());
|
|
70
|
-
// await rpc.pools.lendingPool.openVaultPosition(chainId, signer);
|
|
71
|
-
console.log(await lendingPoolContract.vaultOpened(signer.address));
|
|
72
69
|
// const secretsReference = await encryptSecrets(chainId, {
|
|
73
70
|
// apiKey: process.env.FRED_API_KEY as string,
|
|
74
71
|
// }, "encryptedFunctionsPrimeRateSecrets.json", signerV5);
|
|
75
72
|
// console.log(secretsReference);
|
|
76
73
|
// return;
|
|
77
|
-
|
|
74
|
+
await rpc.contracts.housePrices.setOracle(chainId, signer.address, signer);
|
|
75
|
+
// const encryptedURL = await encryptSecretURLs(chainId, ["https://emerald-many-grasshopper-318.mypinata.cloud/ipfs/bafkreifvuyg7rsfx2wbyeulc267mvg5nwak2ggaxnr723zbekuzycjiysa"], signerV5);
|
|
78
76
|
// console.log(encryptedURL);
|
|
79
77
|
// const secretReference = await generateSecretReference(chainId, {
|
|
80
78
|
// ATTESTATIONS_AUDITOR_BISCUIT: process.env.ATTESTATIONS_AUDITOR_BISCUIT as string,
|
|
@@ -130,12 +128,8 @@ async function setup() {
|
|
|
130
128
|
// signer
|
|
131
129
|
// );
|
|
132
130
|
// set the base uri to instruxi data gateway
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
// "http://3.86.253.54:3000/v1/properties/",
|
|
136
|
-
// signer
|
|
137
|
-
// );
|
|
138
|
-
// return;
|
|
131
|
+
await rpc.nfts.setBaseUri(chainId, "http://3.86.253.54:3000/v1/properties/", signer);
|
|
132
|
+
return;
|
|
139
133
|
const RWAVaultAddress = (0, contracts_1.getContractAddress)(chainId, "rwavault");
|
|
140
134
|
const RWAVaultABI = (0, artifacts_1.getABI)("rwavault");
|
|
141
135
|
const RWAVaultContract = new ethers_1.ethers.Contract(RWAVaultAddress, RWAVaultABI, signer);
|
|
@@ -147,38 +141,42 @@ async function setup() {
|
|
|
147
141
|
// if (chainId !== 8453) {
|
|
148
142
|
// return;
|
|
149
143
|
// }
|
|
150
|
-
console.log("hello");
|
|
151
144
|
// // // set the oracle address of the RAACHousePrice. TEmporarily simulating that I AM THE ORACLE
|
|
152
145
|
// await rpc.contracts.housePrices.setOracle(chainId, signer.address, signer);
|
|
153
146
|
const raacNFTAddress = (0, contracts_1.getContractAddress)(chainId, "raacnft");
|
|
154
147
|
const raacNFTABI = (0, artifacts_1.getABI)("raacnft");
|
|
155
148
|
const raacNFTContract = new ethers_1.ethers.Contract(raacNFTAddress, raacNFTABI, signer);
|
|
156
|
-
const countTokens =
|
|
149
|
+
const countTokens = 100;
|
|
157
150
|
// // // // Generate 10 house prices between 100K and 2M
|
|
158
151
|
const housePrices = [];
|
|
159
152
|
for (let i = 1; i <= countTokens; i++) {
|
|
160
153
|
const price = Math.floor(Math.random() * (2000000 - 100000) + 100000);
|
|
161
|
-
housePrices.push(price);
|
|
154
|
+
housePrices.push(ethers_1.ethers.parseEther(price.toString()));
|
|
162
155
|
}
|
|
163
156
|
// // // Mint the new properties
|
|
164
|
-
for (let i = 1; i <=
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
}
|
|
157
|
+
// for (let i = 1; i <= 5; i++) {
|
|
158
|
+
// const tx = await raacNFTContract.minterMint(signer.address, i);
|
|
159
|
+
// await tx.wait();
|
|
160
|
+
// console.log("Minted NFT", i);
|
|
161
|
+
// }
|
|
162
|
+
const tokenIds = new Array(countTokens).fill(0).map((_, i) => BigInt(i + 1));
|
|
163
|
+
await (await housePriceContract.setHousePrices(tokenIds, housePrices)).wait();
|
|
169
164
|
// // set house prices
|
|
170
|
-
for (let i = 1; i <= countTokens; i++) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
165
|
+
// for (let i = 1; i <= countTokens; i++) {
|
|
166
|
+
// const tx = await housePriceContract.setHousePrice(
|
|
167
|
+
// i,
|
|
168
|
+
// parseEther(housePrices[i - 1].toString())
|
|
169
|
+
// );
|
|
170
|
+
// await tx.wait();
|
|
171
|
+
// console.log("Price set for house", i);
|
|
172
|
+
// }
|
|
173
|
+
// for (let i = 1; i <= countTokens; i++) {
|
|
174
|
+
// const price = await rpc.nfts.getHousePrice(chainId, i, provider);
|
|
175
|
+
// console.log("Price for house", i, price);
|
|
176
|
+
// if (price !== housePrices[i - 1].toString() + ".0") {
|
|
177
|
+
// throw new Error("Price not set correctly");
|
|
178
|
+
// }
|
|
179
|
+
// }
|
|
182
180
|
}
|
|
183
181
|
const execute = async () => {
|
|
184
182
|
const provider = await getProvider();
|