@raac/rpc 1.1.0-beta.81 → 1.1.0-beta.83
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.
|
@@ -4,11 +4,10 @@ const _helpers_1 = require("./_helpers");
|
|
|
4
4
|
async function getRWAVaultInfo(chainId, provider) {
|
|
5
5
|
try {
|
|
6
6
|
const rwaVaultContract = await (0, _helpers_1.getRWAVaultContract)(chainId, provider);
|
|
7
|
-
const [totalAssets, pricePerShare, vaultToken,
|
|
7
|
+
const [totalAssets, pricePerShare, vaultToken, stabilityPool, vrfConsumer, indexTokenMintingFee, feeCollector, vrfRequestDelay, allowVRFRequest,] = await Promise.all([
|
|
8
8
|
rwaVaultContract.totalAssets(),
|
|
9
9
|
rwaVaultContract.pricePerShare(),
|
|
10
10
|
rwaVaultContract.vaultToken(),
|
|
11
|
-
rwaVaultContract.underlyingAssetToken(),
|
|
12
11
|
rwaVaultContract.stabilityPool(),
|
|
13
12
|
rwaVaultContract.vrfConsumer(),
|
|
14
13
|
rwaVaultContract.indexTokenMintingFee(),
|
|
@@ -20,7 +19,6 @@ async function getRWAVaultInfo(chainId, provider) {
|
|
|
20
19
|
totalAssets: totalAssets.toString(),
|
|
21
20
|
pricePerShare: pricePerShare.toString(),
|
|
22
21
|
vaultToken,
|
|
23
|
-
underlyingAssetToken,
|
|
24
22
|
stabilityPool,
|
|
25
23
|
vrfConsumer,
|
|
26
24
|
indexTokenMintingFee: indexTokenMintingFee.toString(),
|
package/dist/scripts/index.js
CHANGED
|
@@ -140,8 +140,11 @@ async function setup() {
|
|
|
140
140
|
// console.log(tx);
|
|
141
141
|
// let tx = await StabilityPoolContract.setLiquidationVaultTokenSplit(2_50, 2_50, 90_00, 5_00)
|
|
142
142
|
// await tx.wait();
|
|
143
|
-
console.log(await raacNFTContract.hasRole(await raacNFTContract.ADMIN_ROLE(), signer.address))
|
|
144
|
-
|
|
143
|
+
// console.log(await raacNFTContract.hasRole(await raacNFTContract.ADMIN_ROLE(), signer.address))
|
|
144
|
+
console.log(await housePriceContract.oracle());
|
|
145
|
+
// await (await housePriceContract.setOracle(signer.address)).wait();
|
|
146
|
+
// return;
|
|
147
|
+
await (await housePriceContract.setHousePrice("8", ethers_1.ethers.parseEther("63500"))).wait();
|
|
145
148
|
return;
|
|
146
149
|
await (await RWAVaultContract.registerDepositableAdapter("0x322813Fd9A801c5507c9de605d63CEA4f2CE6c44")).wait();
|
|
147
150
|
// // console.log(await rpc.wallet.assets.getBalance(chainId, "rwaindextoken", signer.address, provider))
|
|
@@ -53,27 +53,43 @@ async function setupLiquidityPool() {
|
|
|
53
53
|
rpc.address = signer.address;
|
|
54
54
|
rpc.provider = provider;
|
|
55
55
|
rpc.chainId = chainId;
|
|
56
|
-
const MockLiquidityPoolAddress = "
|
|
56
|
+
const MockLiquidityPoolAddress = "0x0cAa0daa4f5EC8934428Ae406965B044f42F7D49";
|
|
57
57
|
const MockLiquidityPoolABI = [
|
|
58
58
|
"function add_liquidity(uint256[2] amounts, uint256 min_mint_amount, address receiver) external",
|
|
59
59
|
];
|
|
60
60
|
const MockLiquidityPoolContract = new ethers_1.ethers.Contract(MockLiquidityPoolAddress, MockLiquidityPoolABI, signer);
|
|
61
61
|
// mint 200 million in crvusd
|
|
62
62
|
console.log("Minting 100 million in crvusd");
|
|
63
|
-
await rpc.wallet.assets.mintAsset(chainId, "crvusd",
|
|
63
|
+
await rpc.wallet.assets.mintAsset(chainId, "crvusd", 9800000n, signer.address, signer);
|
|
64
64
|
// deposit 100 million in the RWA Vault
|
|
65
|
-
console.log("Depositing 5 million in the RWA Vault");
|
|
66
|
-
await rpc.wallet.assets.approveAsset(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
await rpc.pools.rwaVault.
|
|
65
|
+
// console.log("Depositing 5 million in the RWA Vault");
|
|
66
|
+
// await rpc.wallet.assets.approveAsset(
|
|
67
|
+
// chainId,
|
|
68
|
+
// "crvusd",
|
|
69
|
+
// await rpc.pools.rwaVault.getAdapterAddress(chainId, "crvusdadapter")
|
|
70
|
+
// .address,
|
|
71
|
+
// "100000000",
|
|
72
|
+
// signer
|
|
73
|
+
// );
|
|
74
|
+
// const d1 = new ethers.AbiCoder().encode(
|
|
75
|
+
// ["uint256"],
|
|
76
|
+
// [ethers.parseEther("5000000")]
|
|
77
|
+
// );
|
|
78
|
+
// await rpc.pools.rwaVault.depositToRWAVault(
|
|
79
|
+
// chainId,
|
|
80
|
+
// "crvusdadapter",
|
|
81
|
+
// d1,
|
|
82
|
+
// signer.address,
|
|
83
|
+
// "0",
|
|
84
|
+
// signer
|
|
85
|
+
// );
|
|
70
86
|
// deposit 100 million in the Mock Liquidity Pool
|
|
71
87
|
console.log("Depositing 5 million in the Mock Liquidity Pool");
|
|
72
|
-
await rpc.wallet.assets.approveAsset(chainId, "crvusd", MockLiquidityPoolAddress, "
|
|
88
|
+
await rpc.wallet.assets.approveAsset(chainId, "crvusd", MockLiquidityPoolAddress, "9800000", signer);
|
|
73
89
|
const indextokenBalance = (await rpc.wallet.assets.getBalance(chainId, "rwaindextoken", signer.address, provider)).balance;
|
|
74
90
|
await rpc.wallet.assets.approveAsset(chainId, "rwaindextoken", MockLiquidityPoolAddress, indextokenBalance, signer);
|
|
75
91
|
await (await MockLiquidityPoolContract.add_liquidity([
|
|
76
|
-
ethers_1.ethers.parseEther("
|
|
92
|
+
ethers_1.ethers.parseEther("9800000"),
|
|
77
93
|
ethers_1.ethers.parseEther(indextokenBalance.toString()),
|
|
78
94
|
], 0, signer.address)).wait();
|
|
79
95
|
return;
|