DepositFinalized
events whenever deposits from BNB Chain occur.package.json
file. You can then install the ethers library.
index.js
.
With this DApp, we listen to the DepositFinalized
event on the opBNB Bridge smart contract, 0x4200000000000000000000000000000000000010
in this case. This even is emitted when a deposit is made, you can use this data to monitor activity.
Note that this address is a proxy contract. To find the contract event to use in the code, check the actual bridge contract: 0xc0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d30010. The event is defined in the contract as the following:
YOUR_CHAINSTACK_NODE
— your opBNB node endpoint"YOUR_CHAINSTACK_NODE"
with your actual Chainstack node URL.
DepositFinalized
event. This ABI tells Ethers.js how to interpret the event data.
DepositFinalized
events.
DepositFinalized
event is defined. If needed, this filter can be customized to listen for specific events based on additional parameters.
DepositFinalized
event is detected.
from
address and the amount
of BNB deposited are extracted from the event arguments and logged. The amount is formatted to be readable in BNB units.DepositFinalized
events on the opBNB Bridge and prints relevant details to the console whenever such an event is emitted by the smart contract.
DepositFinalized
events on the opBNB Bridge. This allows you to capture and analyze deposit events in real-time, providing valuable insights into the activity on the opBNB network.