Skip to content

Commit

Permalink
easier interaction
Browse files Browse the repository at this point in the history
  • Loading branch information
SamBorisov committed Apr 24, 2024
1 parent 903dc41 commit 28f0af8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/InRangeEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const EXAMPLE_BLOCK = 1300500; // 17:23 19.04.2024 1300500 block
const CONTRACT_ADDRESS = "0x0000000000000000000000000000000000000105";
const CONTRACT_NAME = "RewardPool";
const EVENT = "ValidatorRewardDistributed(address indexed validator, uint256 amount)";
const VALIDATOR_ADDRESS = "PUT ADDRESS HERE";
const VALIDATOR_ADDRESS = "PUT_ADDRESS_HERE";
const YOUR_START_BLOCK = EXAMPLE_BLOCK - 1000;
const YOUR_END_BLOCK = EXAMPLE_BLOCK;

Expand Down
11 changes: 10 additions & 1 deletion scripts/SumBlockForOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { ethers } from "hardhat";
// Input parameters for the function:
const blockNumber = 1301000;
const maxBlockNumber = 1335500;
const validatorAddress = "PUT ADDRESS HERE";
const validatorAddress = "PUT_ADDRESS_HERE";
const contractAddress = "0x0000000000000000000000000000000000000105";
const functionName = "distributeRewardsFor";

Expand Down Expand Up @@ -41,6 +41,15 @@ function getAddressBigNumber(data: any, address: any) {

// Get the sum of signed blocks for user
async function getSumBlocks() {
console.log(
`
_________________________________
Summing the signed blocks
for ${validatorAddress}
from ${blockNumber} to ${maxBlockNumber} block
_________________________________`
);
let sum: number = 0;
for (let i = blockNumber; i < maxBlockNumber; i += 500) {
const blocks = await getTransactionsByBlock(i);
Expand Down

0 comments on commit 28f0af8

Please sign in to comment.