This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.13; | |
/* | |
EtherStore is a contract where you can deposit and withdraw ETH. | |
This contract is vulnerable to re-entrancy attack. | |
Let's see why. | |
1. Deploy EtherStore | |
2. Deposit 1 Ether each from Account 1 (Alice) and Account 2 (Bob) into EtherStore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {ContractTransaction, ContractReceipt} from "ethers"; | |
let tx: ContractTransaction = await contract.calledFunc(); | |
let receipt: ContractReceipt = await tx.wait(); | |
const events = receipt.events!.filter((x) => {return x.event == "EventName"}); | |
console.log(events[0].args); |
OlderNewer