brownie icon indicating copy to clipboard operation
brownie copied to clipboard

Brownie prints (unknown) events

Open RomanHiden opened this issue 4 years ago • 7 comments

Environment information

  • brownie Version: 1.11.5
  • OS: linux

What was wrong?

tx.info() gives the following output:

   Events In This Transaction
   --------------------------
   (unknown)
      topic1: 0xb23479169712c443e6b00fb0cec3506a5f5926f541df4243d313e11c8c5c71ed
      topic2: 0x00000000000000000000000033a4622b82d4c04a53e170c638b944ce27cffce3
      topic3: 0x000000000000000000000000e7ed6747fac5360f88a2efc03e00d25789f69291
      topic4: 0x9a15be031be64ef562b032ebb7a307c5ec0a21e748ea61314048ece6b41685e4
      data: 0x0000000000000000000000000000000000000000000000000212dcef31035eb0
   Transfer
      from: 0x420b1099B9eF5baba6D92029594eF45E19A04A4A
      to: 0xE7eD6747FaC5360f88a2EFC03E00d25789F69291
      value: 99467013698630136996
   Transfer
      from: 0x6951b5Bd815043E3F842c1b026b0Fa888Cc2DD85
      to: 0x420b1099B9eF5baba6D92029594eF45E19A04A4A
      value: 9897215293396033531
   LoanSwap
      loanId: 0x9a15be031be64ef562b032ebb7a307c5ec0a21e748ea61314048ece6b41685e4
      sourceToken: 0xE7eD6747FaC5360f88a2EFC03E00d25789F69291
      destToken: 0x6951b5Bd815043E3F842c1b026b0Fa888Cc2DD85
      borrower: 0x33A4622B82D4c04a53e170c638B944ce27cffce3
      sourceAmount: 99616438356164383572
      destAmount: 9897215293396033531
 

as you can see there is an unknown event. I have noticed this is happening when events are declared externally for example in other contract or file.

RomanHiden avatar Oct 01 '20 15:10 RomanHiden

This is expected behavior if the source file isn't available for the contract where the event was emitted, and Brownie hasn't ever seen the topic.

You can try adding autofetch_sources: True to the config for your project, and if the source is available on etherscan the event will then be decoded.

iamdefinitelyahuman avatar Oct 02 '20 00:10 iamdefinitelyahuman

this test was run in localy using ganache-cli. there were nothing to fetch from etherscan everything was available in the repo. I will try out autofetch_sources

RomanHiden avatar Oct 02 '20 11:10 RomanHiden

Oh, that's strange then. Can you link me to the contract where the undecoded event is defined?

iamdefinitelyahuman avatar Oct 02 '20 12:10 iamdefinitelyahuman

here are some events declared

https://github.com/bZxNetwork/contractsV2/blob/development/contracts/events/FeesEvents.sol

RomanHiden avatar Oct 05 '20 07:10 RomanHiden

I also faced this issue. I think this would happen in mainnet forking though I set autofetch_sources:True. In my test Uniswap V2 pair' Swap event becomes unknown . But the other external contracts' events are showed correctly. when a external contract (contract A) calls an other external contract (contract B) , B's event might become unknown, I think.

スクリーンショット 2022-02-12 15 18 18

massun-onibakuchi avatar Feb 12 '22 06:02 massun-onibakuchi

I also noticed that if tx is failing then events decoded properly. if tx is successful then events are not decoded

RomanHiden avatar Feb 12 '22 16:02 RomanHiden

I'm running into this issue as well...

rbinnun avatar Apr 15 '22 13:04 rbinnun