From 25635fe4ac76637331690aa93aea651a17f62445 Mon Sep 17 00:00:00 2001 From: Daniel McCartney Date: Wed, 30 Oct 2024 15:36:28 -0700 Subject: [PATCH] fix: use RocketDepositPool instead of RocketVault for NS rETH available --- web/src/contracts.js | 5 + .../contracts/RocketDepositPool.json | 288 ++++++++++++++++++ web/src/pages/NodeSetPage.js | 8 +- 3 files changed, 296 insertions(+), 5 deletions(-) create mode 100644 web/src/generated/contracts/RocketDepositPool.json diff --git a/web/src/contracts.js b/web/src/contracts.js index 0b7727c..220d977 100644 --- a/web/src/contracts.js +++ b/web/src/contracts.js @@ -1,4 +1,5 @@ import OperatorDistributor from "./generated/contracts/OperatorDistributor.json"; +import RocketDepositPool from "./generated/contracts/RocketDepositPool.json"; import RocketMerkleDistributorMainnet from "./generated/contracts/RocketMerkleDistributorMainnet.json"; import RocketMinipoolBase from "./generated/contracts/RocketMinipoolBase.json"; import RocketMinipoolDelegate from "./generated/contracts/RocketMinipoolDelegate.json"; @@ -23,6 +24,10 @@ const contracts = { address: "0x102809fE582ecaa527bB316DCc4E99fc35FBAbb9", abi: OperatorDistributor.abi, }, + RocketDepositPool: { + address: "0xDD3f50F8A6CafbE9b31a427582963f465E745AF8", + abi: RocketDepositPool.abi, + }, RocketMerkleDistributorMainnet: { address: [ "0x5cE71E603B138F7e65029Cc1918C0566ed0dBD4B", diff --git a/web/src/generated/contracts/RocketDepositPool.json b/web/src/generated/contracts/RocketDepositPool.json new file mode 100644 index 0000000..59e77de --- /dev/null +++ b/web/src/generated/contracts/RocketDepositPool.json @@ -0,0 +1,288 @@ +{ + "name": "RocketDepositPool", + "abi": [ + { + "inputs": [ + { + "internalType": "contract RocketStorageInterface", + "name": "_rocketStorageAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "minipool", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "time", + "type": "uint256" + } + ], + "name": "DepositAssigned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "time", + "type": "uint256" + } + ], + "name": "DepositReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "time", + "type": "uint256" + } + ], + "name": "DepositRecycled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "time", + "type": "uint256" + } + ], + "name": "ExcessWithdrawn", + "type": "event" + }, + { + "inputs": [], + "name": "assignDeposits", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "deposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "getBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getExcessBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMaximumDepositAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNodeBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getUserBalance", + "outputs": [ + { + "internalType": "int256", + "name": "", + "type": "int256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maybeAssignDeposits", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "nodeCreditWithdrawal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_totalAmount", + "type": "uint256" + } + ], + "name": "nodeDeposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "receiveVaultWithdrawalETH", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "recycleDissolvedDeposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "recycleExcessCollateral", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "recycleLiquidatedStake", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_amount", + "type": "uint256" + } + ], + "name": "withdrawExcessBalance", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/web/src/pages/NodeSetPage.js b/web/src/pages/NodeSetPage.js index c2fbb18..0b64d89 100644 --- a/web/src/pages/NodeSetPage.js +++ b/web/src/pages/NodeSetPage.js @@ -534,14 +534,12 @@ function NodeSetMiniPoolsColumn() { let { data: xREthBalance } = useBalance({ address: contracts.OperatorDistributor.address, }); - let { data: rEthBalance } = useBalance({ - address: contracts.RocketVault.address, - }); + let { data: rEthBalance } = useK.RocketDepositPool.Read.getBalance(); let moreMinipoolCountByXREth = xREthBalance?.value .div(ethers.utils.parseEther("8")) .toNumber(); - let moreMinipoolCountByREth = rEthBalance?.value - .div(ethers.utils.parseEther("24")) + let moreMinipoolCountByREth = rEthBalance + ?.div(ethers.utils.parseEther("24")) .toNumber(); let moreMinipoolCountByRpl = maxMinipoolCountByRpl - activeMinipools.length; let rplPerMinipool = ethers.utils