@raac/rpc 1.1.0-beta.72 → 1.1.0-beta.73

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.
@@ -17,7 +17,7 @@
17
17
  "raachouseprices": {
18
18
  "id": "raachouseprices",
19
19
  "name": "RAAC House Prices",
20
- "contract": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9"
20
+ "contract": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9"
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": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853"
40
+ "contract": "0x0165878A594ca255338adfa4d48449f69242Eb8F"
41
41
  },
42
42
  "treasury": {
43
43
  "id": "treasury",
44
44
  "name": "Treasury",
45
- "contract": "0x0165878A594ca255338adfa4d48449f69242Eb8F"
45
+ "contract": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707"
46
46
  },
47
47
  "repairfund": {
48
48
  "id": "repairfund",
@@ -57,7 +57,7 @@
57
57
  "rwavault": {
58
58
  "id": "rwavault",
59
59
  "name": "RWA Vault",
60
- "contract": "0x59b670e9fA9D0A427751Af201D676719a970857b"
60
+ "contract": "0xc6e7DF5E7b4f2A278906862b61205850344D4e7d"
61
61
  },
62
62
  "complianceregistry": {
63
63
  "id": "complianceregistry",
@@ -67,7 +67,7 @@
67
67
  "rwaindextokencollector": {
68
68
  "id": "rwaindextokencollector",
69
69
  "name": "RWA Index Token Collector",
70
- "contract": "0xc6e7DF5E7b4f2A278906862b61205850344D4e7d"
70
+ "contract": "0x3Aa5ebB10DC797CAC828524e59A333d0A371443c"
71
71
  },
72
72
  "raactokencollector": {
73
73
  "id": "raactokencollector",
@@ -89,19 +89,19 @@
89
89
  "stabilitypool": {
90
90
  "id": "stabilitypool",
91
91
  "name": "Stability Pool",
92
- "contract": "0x68B1D87F95878fE05B998F19b66F4baba5De1aed"
92
+ "contract": "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE"
93
93
  },
94
94
  "lendingpool": {
95
95
  "id": "lendingpool",
96
96
  "name": "Lending Pool",
97
- "contract": "0x9A676e781A523b5d0C0e43731313A708CB607508"
97
+ "contract": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82"
98
98
  }
99
99
  },
100
100
  "nfts": {
101
101
  "raacnft": {
102
102
  "id": "raacnft",
103
103
  "name": "RAAC NFT",
104
- "contract": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707"
104
+ "contract": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9"
105
105
  }
106
106
  },
107
107
  "assets": {
@@ -121,13 +121,13 @@
121
121
  "id": "rtoken",
122
122
  "name": "RToken",
123
123
  "decimals": 18,
124
- "contract": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318"
124
+ "contract": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6"
125
125
  },
126
126
  "detoken": {
127
127
  "id": "detoken",
128
128
  "name": "DEToken",
129
129
  "decimals": 18,
130
- "contract": "0x0B306BF915C4d645ff596e518fAf3F9669b97016"
130
+ "contract": "0x9A676e781A523b5d0C0e43731313A708CB607508"
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": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788"
148
+ "contract": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318"
149
149
  },
150
150
  "rwaindextoken": {
151
151
  "id": "rwaindextoken",
152
152
  "name": "Index Token",
153
153
  "decimals": 18,
154
- "contract": "0x3Aa5ebB10DC797CAC828524e59A333d0A371443c"
154
+ "contract": "0x68B1D87F95878fE05B998F19b66F4baba5De1aed"
155
155
  },
156
156
  "complianceregistry": {
157
157
  "id": "complianceregistry",
@@ -163,7 +163,7 @@
163
163
  "id": "rwaindextokencollector",
164
164
  "name": "RWA Index Token Collector",
165
165
  "decimals": 18,
166
- "contract": "0xc6e7DF5E7b4f2A278906862b61205850344D4e7d"
166
+ "contract": "0x3Aa5ebB10DC797CAC828524e59A333d0A371443c"
167
167
  },
168
168
  "raactokencollector": {
169
169
  "id": "raactokencollector",
@@ -177,13 +177,13 @@
177
177
  "raacnftadapter": {
178
178
  "id": "raacnftadapter",
179
179
  "name": "RAAC NFT Adapter",
180
- "contract": "0x09635F643e140090A9A8Dcd712eD6285858ceBef",
180
+ "contract": "0x7a2088a1bFc9d81c55368AE168C2C02570cB814F",
181
181
  "type": "ERC721"
182
182
  },
183
183
  "rwaindextokenadapter": {
184
184
  "id": "rwaindextokenadapter",
185
185
  "name": "RWA Index Token",
186
- "contract": "0x7a2088a1bFc9d81c55368AE168C2C02570cB814F",
186
+ "contract": "0x4A679253410272dd5232B3Ff7cF5dbB88f295319",
187
187
  "type": "ERC20"
188
188
  }
189
189
  },
@@ -191,13 +191,13 @@
191
191
  "raacnftadapter": {
192
192
  "id": "raacnftadapter",
193
193
  "name": "RAAC NFT Adapter",
194
- "contract": "0xa85233C63b9Ee964Add6F2cffe00Fd84eb32338f",
194
+ "contract": "0x322813Fd9A801c5507c9de605d63CEA4f2CE6c44",
195
195
  "type": "ERC721"
196
196
  },
197
197
  "crvusdadapter": {
198
198
  "id": "crvusdadapter",
199
199
  "name": "CRVUSD Adapter",
200
- "contract": "0x322813Fd9A801c5507c9de605d63CEA4f2CE6c44",
200
+ "contract": "0x4ed7c70F96B99c776995fB64377f0d4aB3B0e1C1",
201
201
  "type": "ERC20"
202
202
  }
203
203
  }
@@ -53,15 +53,18 @@ async function setupLiquidityPool() {
53
53
  rpc.address = signer.address;
54
54
  rpc.provider = provider;
55
55
  rpc.chainId = chainId;
56
- const MockLiquidityPoolAddress = "0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E";
57
- const MockLiquidityPoolABI = ["function add_liquidity(uint256[2] amounts, uint256 min_mint_amount, address receiver) external"];
56
+ const MockLiquidityPoolAddress = "0x9E545E3C0baAB3E08CdfD552C960A1050f373042";
57
+ const MockLiquidityPoolABI = [
58
+ "function add_liquidity(uint256[2] amounts, uint256 min_mint_amount, address receiver) external",
59
+ ];
58
60
  const MockLiquidityPoolContract = new ethers_1.ethers.Contract(MockLiquidityPoolAddress, MockLiquidityPoolABI, signer);
59
61
  // mint 10 million in crvusd
60
62
  console.log("Minting 100 million in crvusd");
61
63
  await rpc.wallet.assets.mintAsset(chainId, "crvusd", 200000000n, signer.address, signer);
62
64
  // deposit 5 million in the RWA Vault
63
65
  console.log("Depositing 5 million in the RWA Vault");
64
- await rpc.wallet.assets.approveAsset(chainId, "crvusd", await rpc.pools.rwaVault.getAdapterAddress(chainId, "crvusdadapter").address, "100000000", signer);
66
+ await rpc.wallet.assets.approveAsset(chainId, "crvusd", await rpc.pools.rwaVault.getAdapterAddress(chainId, "crvusdadapter")
67
+ .address, "100000000", signer);
65
68
  const d1 = new ethers_1.ethers.AbiCoder().encode(["uint256"], [ethers_1.ethers.parseEther("100000000")]);
66
69
  await rpc.pools.rwaVault.depositToRWAVault(chainId, "crvusdadapter", d1, signer.address, "0", signer);
67
70
  // deposit 5 million in the Mock Liquidity Pool
@@ -69,7 +72,10 @@ async function setupLiquidityPool() {
69
72
  await rpc.wallet.assets.approveAsset(chainId, "crvusd", MockLiquidityPoolAddress, "100000000", signer);
70
73
  const indextokenBalance = (await rpc.wallet.assets.getBalance(chainId, "rwaindextoken", signer.address, provider)).balance;
71
74
  await rpc.wallet.assets.approveAsset(chainId, "rwaindextoken", MockLiquidityPoolAddress, indextokenBalance, signer);
72
- await (await MockLiquidityPoolContract.add_liquidity([ethers_1.ethers.parseEther("100000000"), ethers_1.ethers.parseEther(indextokenBalance.toString())], 0, signer.address)).wait();
75
+ await (await MockLiquidityPoolContract.add_liquidity([
76
+ ethers_1.ethers.parseEther("100000000"),
77
+ ethers_1.ethers.parseEther(indextokenBalance.toString()),
78
+ ], 0, signer.address)).wait();
73
79
  return;
74
80
  }
75
81
  async function setupLendingPool() {
@@ -105,7 +111,7 @@ async function initiateLiquidation(adapter, user, data) {
105
111
  const lendingPoolABI = (0, artifacts_1.getABI)("lendingpool");
106
112
  const lendingPoolContract = new ethers_1.ethers.Contract(lendingPoolAddress, lendingPoolABI, signer);
107
113
  const adapterAddress = rpc.pools.lendingPool.getAdapterAddress(chainId, adapter).address;
108
- await (await lendingPoolContract.initiateLiquidation(adapterAddress, user, data));
114
+ await await lendingPoolContract.initiateLiquidation(adapterAddress, user, data);
109
115
  console.log("Liquidation initiated");
110
116
  }
111
117
  async function liquidate(pooladapter, vaultadapter, user, data) {
@@ -121,7 +127,7 @@ async function liquidate(pooladapter, vaultadapter, user, data) {
121
127
  const StabilityPoolContract = new ethers_1.ethers.Contract(StabilityPoolAddress, StabilityPoolABI, signer);
122
128
  const adapterAddress = rpc.pools.lendingPool.getAdapterAddress(chainId, pooladapter).address;
123
129
  const vaultAddress = rpc.pools.rwaVault.getAdapterAddress(chainId, vaultadapter).address;
124
- await (await StabilityPoolContract.liquidateBorrower(adapterAddress, vaultAddress, user, data, 0));
130
+ await await StabilityPoolContract.liquidateBorrower(adapterAddress, vaultAddress, user, data, 0);
125
131
  console.log("Position liquidated.");
126
132
  }
127
133
  const updateNFTPrice = async (tokenId, price) => {
@@ -148,10 +154,23 @@ const updateNFTPrice = async (tokenId, price) => {
148
154
  * 4. Initiate the liquidation
149
155
  * 5. Liquidate
150
156
  */
151
- // setupLiquidityPool()
152
- // setupLendingPool()
153
- // updateNFTPrice("1", "730000")
154
- // getPosition("raacnftadapter", "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", new ethers.AbiCoder().encode(["uint256"], ["1"]))
155
- // initiateLiquidation("raacnftadapter", "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", new ethers.AbiCoder().encode(["uint256"], ["1"]))
156
- liquidate("raacnftadapter", "raacnftadapter", "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", new ethers_1.ethers.AbiCoder().encode(["uint256"], ["1"]));
157
+ setupLiquidityPool();
158
+ // setupLendingPool();
159
+ // updateNFTPrice("1", "760000");
160
+ // getPosition(
161
+ // "raacnftadapter",
162
+ // "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
163
+ // new ethers.AbiCoder().encode(["uint256"], ["1"])
164
+ // );
165
+ // initiateLiquidation(
166
+ // "raacnftadapter",
167
+ // "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
168
+ // new ethers.AbiCoder().encode(["uint256"], ["1"])
169
+ // );
170
+ // liquidate(
171
+ // "raacnftadapter",
172
+ // "raacnftadapter",
173
+ // "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
174
+ // new ethers.AbiCoder().encode(["uint256"], ["1"])
175
+ // );
157
176
  // npx ts-node-dev --transpile-only --env-file=.env scripts/liquidation.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raac/rpc",
3
- "version": "1.1.0-beta.72",
3
+ "version": "1.1.0-beta.73",
4
4
  "description": "RPC Library for RAAC ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types/index.d.ts",