Skip to content

Commit

Permalink
fix: use RocketDepositPool instead of RocketVault for NS rETH available
Browse files Browse the repository at this point in the history
  • Loading branch information
dmccartney committed Oct 30, 2024
1 parent 483f9c0 commit 25635fe
Show file tree
Hide file tree
Showing 3 changed files with 296 additions and 5 deletions.
5 changes: 5 additions & 0 deletions web/src/contracts.js
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -23,6 +24,10 @@ const contracts = {
address: "0x102809fE582ecaa527bB316DCc4E99fc35FBAbb9",
abi: OperatorDistributor.abi,
},
RocketDepositPool: {
address: "0xDD3f50F8A6CafbE9b31a427582963f465E745AF8",
abi: RocketDepositPool.abi,
},
RocketMerkleDistributorMainnet: {
address: [
"0x5cE71E603B138F7e65029Cc1918C0566ed0dBD4B",
Expand Down
288 changes: 288 additions & 0 deletions web/src/generated/contracts/RocketDepositPool.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
8 changes: 3 additions & 5 deletions web/src/pages/NodeSetPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 25635fe

Please sign in to comment.