samrataiandbi-cmd/sample-contract

Create a file for interacting with blockchain functions like `getBalance` and `getCurrentBlock`

Open

#1 aperta il 6 ott 2025

Vedi su GitHub
 (2 commenti) (0 reazioni) (2 assegnatari)JavaScript (1 fork)auto 404
enhancementgood first issuehacktoberfesthacktoberfest-acceptedhacktoberfest2025help wanted

Metriche repository

Star
 (0 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Add a new JavaScript file (e.g., blockchainInfo.js) that interacts directly with the blockchain using Ethers.js. The file should include basic read-only functions such as:

  • getBalance(address) → Returns the ETH balance of a given address
  • getCurrentBlock() → Returns the current block number

Suggestions:

  • Use ethers.providers.JsonRpcProvider() for connection
  • Display the results clearly in the console
  • Handle errors gracefully

Guida contributor