@raac/rpc 1.1.0-beta.32 → 1.1.0-beta.34
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": "
|
|
20
|
+
"contract": "0x30bBf92E5D437b9aaE7881AAd4CA7bAd75575538"
|
|
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": "0xa9758cE2E401c8471e291bF30c963688dEf64Bc1"
|
|
41
41
|
},
|
|
42
42
|
"treasury": {
|
|
43
43
|
"id": "treasury",
|
|
44
44
|
"name": "Treasury",
|
|
45
|
-
"contract": "
|
|
45
|
+
"contract": "0x2D3845b51BB7A0dA87889F27C0089b9AaC0fAB0B"
|
|
46
46
|
},
|
|
47
47
|
"repairfund": {
|
|
48
48
|
"id": "repairfund",
|
|
@@ -57,26 +57,26 @@
|
|
|
57
57
|
"rwavault": {
|
|
58
58
|
"id": "rwavault",
|
|
59
59
|
"name": "RWA Vault",
|
|
60
|
-
"contract": "
|
|
60
|
+
"contract": "0x0b01E3D22BCf5c19F7503D3AE9fBFcDD5D1452F6"
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"pools": {
|
|
64
64
|
"stabilitypool": {
|
|
65
65
|
"id": "stabilitypool",
|
|
66
66
|
"name": "Stability Pool",
|
|
67
|
-
"contract": "
|
|
67
|
+
"contract": "0x58D68CA6453a30BC03eF633f3353eacB8a983752"
|
|
68
68
|
},
|
|
69
69
|
"lendingpool": {
|
|
70
70
|
"id": "lendingpool",
|
|
71
71
|
"name": "Lending Pool",
|
|
72
|
-
"contract": "
|
|
72
|
+
"contract": "0x6936885f6c83659122C0A502BB1416d390873B00"
|
|
73
73
|
}
|
|
74
74
|
},
|
|
75
75
|
"nfts": {
|
|
76
76
|
"raacnft": {
|
|
77
77
|
"id": "raacnft",
|
|
78
78
|
"name": "RAAC NFT",
|
|
79
|
-
"contract": "
|
|
79
|
+
"contract": "0x699fd98C81A5135374e1faCAACA3cC6a5c7fc249"
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
"assets": {
|
|
@@ -90,43 +90,43 @@
|
|
|
90
90
|
"id": "crvusd",
|
|
91
91
|
"name": "CRVUSD",
|
|
92
92
|
"decimals": 18,
|
|
93
|
-
"contract": "
|
|
93
|
+
"contract": "0x4A11C6304dc283Bce75b0D27a8764762b0d4b976"
|
|
94
94
|
},
|
|
95
95
|
"rtoken": {
|
|
96
96
|
"id": "rtoken",
|
|
97
97
|
"name": "RToken",
|
|
98
98
|
"decimals": 18,
|
|
99
|
-
"contract": "
|
|
99
|
+
"contract": "0x6ABa2d21236c887A38Fe5a0729d57F458BdC70a8"
|
|
100
100
|
},
|
|
101
101
|
"detoken": {
|
|
102
102
|
"id": "detoken",
|
|
103
103
|
"name": "DEToken",
|
|
104
104
|
"decimals": 18,
|
|
105
|
-
"contract": "
|
|
105
|
+
"contract": "0x00CFCc3A3418a920502B90e75097E7505b0BAA3A"
|
|
106
106
|
},
|
|
107
107
|
"raactoken": {
|
|
108
108
|
"id": "raactoken",
|
|
109
109
|
"name": "RAAC",
|
|
110
110
|
"decimals": 18,
|
|
111
|
-
"contract": "
|
|
111
|
+
"contract": "0xB5206Ec6c6007c7f36eea85658a02DD8dEc02222"
|
|
112
112
|
},
|
|
113
113
|
"veraac": {
|
|
114
114
|
"id": "veraac",
|
|
115
115
|
"name": "VERAAC",
|
|
116
116
|
"decimals": 18,
|
|
117
|
-
"contract": "
|
|
117
|
+
"contract": "0xc7a42334D33D378a013c5b5DaC4242a7Df07B7F8"
|
|
118
118
|
},
|
|
119
119
|
"debttoken": {
|
|
120
120
|
"id": "debttoken",
|
|
121
121
|
"name": "Debt Token",
|
|
122
122
|
"decimals": 18,
|
|
123
|
-
"contract": "
|
|
123
|
+
"contract": "0x9AcD9D63b4fCa83Cd494a3e2e223f4c07B232A80"
|
|
124
124
|
},
|
|
125
125
|
"rwaindextoken": {
|
|
126
126
|
"id": "rwaindextoken",
|
|
127
127
|
"name": "RWA Index Token",
|
|
128
128
|
"decimals": 18,
|
|
129
|
-
"contract": "
|
|
129
|
+
"contract": "0x353d6be8d15f8aB007f2e2226d89BC029562AC36"
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
132
|
"adapters": {
|
|
@@ -134,13 +134,13 @@
|
|
|
134
134
|
"raacnftadapter": {
|
|
135
135
|
"id": "raacnftadapter",
|
|
136
136
|
"name": "RAAC NFT Adapter",
|
|
137
|
-
"contract": "
|
|
137
|
+
"contract": "0x0961d517AEC88ef60B485F018434f16Abd44B330",
|
|
138
138
|
"type": "ERC721"
|
|
139
139
|
},
|
|
140
140
|
"rwaindextokenadapter": {
|
|
141
141
|
"id": "rwaindextokenadapter",
|
|
142
142
|
"name": "RWA Index Token",
|
|
143
|
-
"contract": "
|
|
143
|
+
"contract": "0xA81b80600f5B215f46fa9b91AF93d259AD4595A7",
|
|
144
144
|
"type": "ERC20"
|
|
145
145
|
}
|
|
146
146
|
},
|
|
@@ -148,13 +148,13 @@
|
|
|
148
148
|
"raacnftadapter": {
|
|
149
149
|
"id": "raacnftadapter",
|
|
150
150
|
"name": "RAAC NFT Adapter",
|
|
151
|
-
"contract": "
|
|
151
|
+
"contract": "0x00491119422D4eA74a3Bd42cb9Ae1D0a6eCDDc28",
|
|
152
152
|
"type": "ERC721"
|
|
153
153
|
},
|
|
154
154
|
"crvusdadapter": {
|
|
155
155
|
"id": "crvusdadapter",
|
|
156
156
|
"name": "CRVUSD Adapter",
|
|
157
|
-
"contract": "
|
|
157
|
+
"contract": "0xae961586910a41058EE31aD0D13b5F37062b3BFD",
|
|
158
158
|
"type": "ERC20"
|
|
159
159
|
}
|
|
160
160
|
}
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"raacnft": {
|
|
77
77
|
"id": "raacnft",
|
|
78
78
|
"name": "RAAC NFT",
|
|
79
|
-
"contract": "
|
|
79
|
+
"contract": "0x1613beB3B2C4f22Ee086B2b38C1476A3cE7f78E8"
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
"assets": {
|
|
@@ -134,13 +134,13 @@
|
|
|
134
134
|
"raacnftadapter": {
|
|
135
135
|
"id": "raacnftadapter",
|
|
136
136
|
"name": "RAAC NFT Adapter",
|
|
137
|
-
"contract": "
|
|
137
|
+
"contract": "0xf5059a5D33d5853360D16C683c16e67980206f36",
|
|
138
138
|
"type": "ERC721"
|
|
139
139
|
},
|
|
140
140
|
"rwaindextokenadapter": {
|
|
141
141
|
"id": "rwaindextokenadapter",
|
|
142
142
|
"name": "RWA Index Token",
|
|
143
|
-
"contract": "
|
|
143
|
+
"contract": "0x851356ae760d987E095750cCeb3bC6014560891C",
|
|
144
144
|
"type": "ERC20"
|
|
145
145
|
}
|
|
146
146
|
},
|
|
@@ -148,13 +148,13 @@
|
|
|
148
148
|
"raacnftadapter": {
|
|
149
149
|
"id": "raacnftadapter",
|
|
150
150
|
"name": "RAAC NFT Adapter",
|
|
151
|
-
"contract": "
|
|
151
|
+
"contract": "0x70e0bA845a1A0F2DA3359C97E0285013525FFC49",
|
|
152
152
|
"type": "ERC721"
|
|
153
153
|
},
|
|
154
154
|
"crvusdadapter": {
|
|
155
155
|
"id": "crvusdadapter",
|
|
156
156
|
"name": "CRVUSD Adapter",
|
|
157
|
-
"contract": "
|
|
157
|
+
"contract": "0x67d269191c92Caf3cD7723F116c85e6E9bf55933",
|
|
158
158
|
"type": "ERC20"
|
|
159
159
|
}
|
|
160
160
|
}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const _helpers_1 = require("./_helpers");
|
|
7
|
+
const getAdapterAddress_1 = require("./getAdapterAddress");
|
|
8
|
+
const getAllowance_1 = __importDefault(require("../../wallet/assets/getAllowance"));
|
|
4
9
|
async function depositToRWAVault(chainId, adapter, data, receiver, signer) {
|
|
5
10
|
if (!signer) {
|
|
6
11
|
throw new Error("Wallet not connected");
|
|
7
12
|
}
|
|
8
13
|
try {
|
|
9
14
|
const rwaVaultContract = await (0, _helpers_1.getRWAVaultContract)(chainId, signer);
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
const adapterAddress = await (0, getAdapterAddress_1.getAdapterAddress)(chainId, adapter);
|
|
16
|
+
console.log("adapterAddress", adapterAddress.address);
|
|
17
|
+
console.log("data", data);
|
|
18
|
+
console.log("receiver", receiver);
|
|
19
|
+
console.log(await (0, getAllowance_1.default)(chainId, "crvusd", await signer.getAddress(), adapterAddress.address, signer.provider));
|
|
20
|
+
const tx = await rwaVaultContract.depositAsset(adapterAddress.address, data, receiver);
|
|
13
21
|
console.log(`Deposit transaction sent to RWA Vault:`, tx.hash);
|
|
14
22
|
const receipt = await tx.wait();
|
|
15
23
|
console.log(`Deposited to RWA Vault successfully:`, receipt?.hash);
|
package/dist/scripts/index.js
CHANGED
|
@@ -9,6 +9,7 @@ const chains_1 = __importDefault(require("../configs/chains"));
|
|
|
9
9
|
const RPCLibrary_1 = __importDefault(require("../RPCLibrary"));
|
|
10
10
|
const contracts_1 = require("../utils/contracts");
|
|
11
11
|
const artifacts_1 = require("../utils/artifacts");
|
|
12
|
+
const _helpers_1 = require("../pools/rwaVault/_helpers");
|
|
12
13
|
const chainId = 8453;
|
|
13
14
|
const config = chains_1.default[chainId];
|
|
14
15
|
const TEST_MNEMONIC = process.env.TEST_MNEMONIC;
|
|
@@ -116,7 +117,44 @@ const execute = async () => {
|
|
|
116
117
|
rpc.address = signer.address;
|
|
117
118
|
rpc.provider = provider;
|
|
118
119
|
rpc.chainId = chainId;
|
|
119
|
-
|
|
120
|
+
// await rpc.wallet.assets.mintAsset(
|
|
121
|
+
// chainId,
|
|
122
|
+
// "crvusd",
|
|
123
|
+
// 10000000n,
|
|
124
|
+
// signer.address,
|
|
125
|
+
// signer
|
|
126
|
+
// );
|
|
127
|
+
// Minting Fee collection
|
|
128
|
+
const feeCollectorAddress = (0, contracts_1.getContractAddress)(chainId, "feecollector");
|
|
129
|
+
const feeCollectorABI = (0, artifacts_1.getABI)("feecollector");
|
|
130
|
+
const feeCollectorContract = new ethers_1.ethers.Contract(feeCollectorAddress, feeCollectorABI, signer);
|
|
131
|
+
const rwaVaultContract = await (0, _helpers_1.getRWAVaultContract)(chainId, signer);
|
|
132
|
+
const erc20AdapterAddress = rpc.pools.rwaVault.getAdapterAddress(chainId, "crvusdadapter").address;
|
|
133
|
+
const abi = (0, artifacts_1.getABI)("erc20vaultadapter");
|
|
134
|
+
const erc20AdapterContract = new ethers_1.ethers.Contract(erc20AdapterAddress, abi, signer);
|
|
135
|
+
const crvusdAddress = await erc20AdapterContract.getAssetToken();
|
|
136
|
+
const crvusdABI = (0, artifacts_1.getABI)("crvusd");
|
|
137
|
+
const crvusdContract = new ethers_1.ethers.Contract(crvusdAddress, crvusdABI, signer);
|
|
138
|
+
const vaultTokenAddress = await rwaVaultContract.vaultToken();
|
|
139
|
+
const vaultTokenABI = (0, artifacts_1.getABI)("rwaindextoken");
|
|
140
|
+
const vaultTokenContract = new ethers_1.ethers.Contract(vaultTokenAddress, vaultTokenABI, signer);
|
|
141
|
+
// console.log("CRVUSD address", await getContractAddress(chainId, "crvusd"));
|
|
142
|
+
// console.log("CRVUSD address", await erc20AdapterContract.getAssetToken());
|
|
143
|
+
// console.log("Total value", await erc20AdapterContract.totalValue());
|
|
144
|
+
// console.log("Price oracle", await erc20AdapterContract.priceOracle());
|
|
145
|
+
// await feeCollectorContract.addClaimableToken(getContractAddress(chainId, "rwaindextoken"));
|
|
146
|
+
// await feeCollectorContract.addFeeType(MINT_FEE, 10000, 0, 0, 0, 0, 0);
|
|
147
|
+
// console.log(await rwaVaultContract.supportedDepositableAdapters(erc20AdapterAddress));
|
|
148
|
+
// console.log(await rwaVaultContract.depositableAdapters(1));
|
|
149
|
+
// await rwaVaultContract.setIndexTokenMintingFee(0);
|
|
150
|
+
await rpc.wallet.assets.approveAsset(chainId, "crvusd", erc20AdapterAddress, "200", signer);
|
|
151
|
+
const data = new ethers_1.ethers.AbiCoder().encode(["uint256"], [ethers_1.ethers.parseEther("200")]);
|
|
152
|
+
await rpc.pools.rwaVault.depositToRWAVault(chainId, "crvusdadapter", data, signer.address, signer);
|
|
153
|
+
console.log(await rwaVaultContract.pricePerShare());
|
|
154
|
+
console.log(await vaultTokenContract.balanceOf(signer.address));
|
|
155
|
+
console.log(await crvusdContract.balanceOf(signer.address));
|
|
156
|
+
console.log(await crvusdContract.balanceOf(erc20AdapterAddress));
|
|
157
|
+
console.log(await crvusdContract.allowance(signer.address, await rwaVaultContract.getAddress()));
|
|
120
158
|
};
|
|
121
159
|
const updateNFTPrice = async (id, price) => {
|
|
122
160
|
const provider = await getProvider();
|