Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export used events (and errors) instead of just declared #9765

Closed
dariusdev opened this issue Sep 9, 2020 · 9 comments · Fixed by #10996
Closed

Export used events (and errors) instead of just declared #9765

dariusdev opened this issue Sep 9, 2020 · 9 comments · Fixed by #10996
Assignees
Labels
medium effort Default level of effort medium impact Default level of impact protocol design 🔮 Potential changes to ABI, meta data, standard JSON selected for development It's on our short-term development

Comments

@dariusdev
Copy link

https://etherscan.io/address/0x1e0447b19bb6ecfdae1e4ae1694b0c3659614e4e#code
Proxy to https://etherscan.io/address/0x56e7d4520abfecf10b38368b00723d9bd3c21ee1#code

Contract ABI not include event like: LogTrade, LogSell

not sure it is Etherscan problem or solidy compiler?

@chriseth
Copy link
Contributor

chriseth commented Sep 9, 2020

Are you saying that events declared in the library are listed in the library's ABI, but they are not listed in the ABI of the contract that emits the library's events?

If yes, then this is not a bug, but it is probably something we want to think over, especially as we provide more access to elements at the file-level:

We could provide access to errors and events that are used from a function of a contract, even if they are not defined in that contract.

@chriseth chriseth changed the title Events declared in library are missed in contract ABI Export used events (and errors) instead of just declared Sep 9, 2020
@dariusdev
Copy link
Author

events declared in the library are not listed in any ABI.
At least it looks reviewing code provided by etherscan for addresses :
https://etherscan.io/address/0x1e0447b19bb6ecfdae1e4ae1694b0c3659614e4e#code and
https://etherscan.io/address/0x56e7d4520abfecf10b38368b00723d9bd3c21ee1#code

@chriseth
Copy link
Contributor

chriseth commented Sep 9, 2020

Remix shows the 'LogTrade' event in the "Events" library in the first code for me. Where are you looking for the events?

@dariusdev
Copy link
Author

etherscan ABI section
image

@chriseth
Copy link
Contributor

chriseth commented Sep 9, 2020

That's only the ABI for the contract at that address, not for the library it uses.

@dariusdev
Copy link
Author

This is the library address: https://etherscan.io/address/0x56e7d4520abfecf10b38368b00723d9bd3c21ee1#code
And ABI is empty without events.

@dariusdev
Copy link
Author

If contract is using this library for execution and firing these events - these event should appear in contracts ABI in my opinion

@chriseth
Copy link
Contributor

chriseth commented Sep 9, 2020

The library address you mention is for a different library. The Events library does not have any code that can be deployed, so it does not have an address. So the events are listed in the ABI for the library, but you cannot retrieve it via Etherscan's interface.

In any case, we should find a way to export the used events as the title of the issue says.

@hrkrshnn
Copy link
Member

hrkrshnn commented Feb 4, 2021

For future reference, this would need #10332 for a proper implementation.

The following cases need to be supported:

  1. emit L.Event() inside a contract function, where L is a library.
  2. emit L.Event() inside a free function that gets called from a contract.
  3. emit Event() inside an internal library function (almost similar to the free function.)

Relevant: https://matrix.to/#/!poXqlbVpQfXKWGseLY:gitter.im/$KPcOdAbVwm-8MthR8QHgkyIpoIRynETJycsvFq5tCHA?via=gitter.im&via=matrix.org&via=ekpyron.org

@chriseth chriseth self-assigned this Feb 23, 2021
@cameel cameel added enhancement protocol design 🔮 Potential changes to ABI, meta data, standard JSON labels Dec 10, 2021
@cameel cameel added selected for development It's on our short-term development medium effort Default level of effort medium impact Default level of impact labels Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
medium effort Default level of effort medium impact Default level of impact protocol design 🔮 Potential changes to ABI, meta data, standard JSON selected for development It's on our short-term development
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants