Contract ABIs are produced by building the community-staking-module and copying the following interface build artifacts.
- ICSBondCore.json
- ICSBondCurve.json
- ICSBondLock.json
These interfaces are combined into a single ABI to access all functions within the CSAccounting contract. CSModule has its own contract and its ABI is from the build artifacts.
- ICSModule.json
These are necessary to reproduce the getClaimableBondShares() function.
Returns the total Bond. Include any excess bond accumulated through daily rebasing.
Recreates the private function getClaimableBondShares().
uint256 current = CSBondCore.getBondShares(nodeOperatorId);
uint256 required = _sharesByEth(
CSBondCurve.getBondAmountByKeysCount(
CSM.getNodeOperatorNonWithdrawnKeys(nodeOperatorId),
CSBondCurve.getBondCurve(nodeOperatorId)
) + CSBondLock.getActualLockedBond(nodeOperatorId)
);
Gets the values of the CSM Rewards Proof for the Node Operator from GitHub.
Returns the Eth distributed to the NO (not verified)
-
Clone the repository:
git clone <repository-url> cd <repository-directory>
-
Install dependencies:
npm install
-
Create a
.env
file:Create a
.env
file in the root directory of the project and add the following environment variables:RPC_URL= <your_rpc_url> GITHUB_URL=https://raw.githubusercontent.com/ REWARDS_PROOF_FILE=lidofinance/csm-rewards/refs/heads/mainnet/proofs.json CSACCOUNTING_CONTRACT_ADDRESS=0x4d72BFF1BeaC69925F8Bd12526a39BAAb069e5Da CSMODULE_CONTRACT_ADDRESS=0xdA7dE2ECdDfccC6c3AF10108Db212ACBBf9EA83F POOLED_ETH_SHARES__PROXY_CONTRACT=0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84 DIST_SHARES_PROXY_CONTRACT=0xD99CC66fEC647E68294C6477B40fC7E0F6F618D0 ETHERSCAN_API_KEY= <your_etherscan_api_key> ETHERSCAN_URL=http://api.etherscan.io
-
Run the app:
node csmrewards.js <nodeOperatorID>
Replace
<nodeOperatorID>
with the ID of the node operator you want to query.
To run the app for node operator ID 5
, use the following command:
node csmrewards.js 5