Hello, developers!
Tell me please how do you override events from interface.
I am trying to implement ERC20 contract and I have an error with events.
My linter shows error "Event with same name and parameters defined twice"

Dec 20, 2021, 11:30 PM
As the error says, youve defined an event that's already defined elsewhere (perhaps in some of the ERC20 code you've imported?).
Dec 20, 2021, 11:37 PM
I imported only ERC20 interface :)
Look at this please
Dec 20, 2021, 11:38 PM
I'd have to see your full code but surely somewhere is a duplicate
Dec 20, 2021, 11:39 PM
I will show you it for now. It is short
I am sure that your compiler will show same error
Dec 20, 2021, 11:46 PM
Yeah you can't define them each twice like that. Pick one or the other
Dec 20, 2021, 11:47 PM
If I will remove them from interface may I be sured that in place where needed IERC20 my contract will be available for work?
Dec 20, 2021, 11:48 PM
Hard to parse your question
Dec 20, 2021, 11:48 PM
Okay
Dec 20, 2021, 11:49 PM
You can just keep what's in the interface, no need to redefine them in your code, thus the compiler message
Dec 20, 2021, 11:50 PM
Thanks for your help! :)
Dec 20, 2021, 11:50 PM
No prob
Dec 20, 2021, 11:50 PM
Are you specify the “override” keyword?
Dec 21, 2021, 3:55 AM

© 2024 Draquery.com All rights reserved.