You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
This filter has no impact on the Remix VM (Cancun) environment although it can function properly if it is in the Injected Provider environment.
To Reproduce
Steps to reproduce the behavior:
Deploy a sol file containing event TextMessage(address indexed, string); via Remix IDE
Emits the event more than twice with different addresses
Run this typescript in Remix IDE:
import{ethers}from'ethers'// the version is v^5consttest=async()=>{constreq=ethers.utils.solidityPack(['address'],[contractAddr])constprovider=ethers.providers.Web3Provider(web3Provider)constsigner=provider.getSigner()constcontract=newethers.Contract(contractAddr,contractABI,provider)constfilter=contract.filters.Recovered(awaitsigner.getAddress())constlogs=awaitcontract.queryFilter(filter)console.log(logs.length)}constcontractABI=['event TextMessage(address indexed, string)']test()
See the console
The length of the array in the output is more than one
Expected behavior
Array length should be one.
Desktop (please complete the following information):
OS: Windows
Browser chrome
The text was updated successfully, but these errors were encountered:
Thanks for the report,
Unfortunately, I am not able to reproduce this issue. In both case (VM and injected/sepolia) I have right values.
The script I am using is:
import { ethers } from 'ethers' // the version is v^5
const test = async (contractAddr) => {
const provider = new ethers.providers.Web3Provider(web3Provider)
const signer = provider.getSigner()
const contract = new ethers.Contract(contractAddr, contractABI, provider)
const filter = contract.filters.TextMessage(await signer.getAddress())
const logs = await contract.queryFilter(filter)
console.log(logs.length)
}
const contractABI = ['event TextMessage(address indexed, string)']
test("0x27b07C05B74c45C8EBfc970aeF6B32180065e801").then(() => {
test("0xF2404a336381b2138b8D573e7F6b80445cc5F024")
})
The event is emitted with emit TextMessage(msg.sender, "test");
Describe the bug
This filter has no impact on the
Remix VM (Cancun)
environment although it can function properly if it is in theInjected Provider
environment.To Reproduce
Steps to reproduce the behavior:
event TextMessage(address indexed, string);
via Remix IDEExpected behavior
Array length should be one.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: