2

I have a smart contract with an event where an account address is stored/indexed, and I want to get/advise about this event each time the account address is trigger by the event.

By eg, my solidity event: myEvent( address indexed _sellerAddress) where _sellerAddress is a personal account address

I want to know/be informed each time my _sellerAddress is mentioned is this event, but I don't know at this stage the smart contract address.

let me know if I'm not clear.

thanks

1

Ok I found my way by my self.

Just set an eth.filter like above with web3.py by e.g :

    event_signature_hash = w3.sha3(text='myEvent(address)').hex() #Event name without input arguments

    my_event = w3.eth.filter({
    "fromBlock":0,
    "toBlock":"latest",
    "topics":[event_signature_hash,
    my_seller_address_hexa],
    }
    )
    my_event.get_all_entires()

And I got all events logs where _sellerAddress is stored/mentioned as event parametre.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.