is it possible to override a function in base class which has already overridden a function from inherited contract of openzepplin but doesn't have virtual keyword in base class while overriding it.

Jul 10, 2021, 9:27 AM
can you explain a bit better?
override(override1, override2, override3, etc.)
Jul 10, 2021, 11:00 AM
Say there is a erc20 contract that has transfer function which over rides transfer function present in openzepplin erc20 library.

Now if I upgrade the contract with inheritance of original contract, and want to change behaviour of tranfer function, will it be possible to over ride the transfer function in original contract in new inherited contract
Jul 10, 2021, 11:02 AM
yes
override(openzeppelinERC20, OldContract)
on the new one
Jul 10, 2021, 11:06 AM
Thing to notice here is Old contract doesn't specify virtual keyword
Jul 10, 2021, 11:06 AM
thats ok
Jul 10, 2021, 11:09 AM
This isn't true. Unable to get this working. It keeps complaining that OldContract needs to have virtual keyword to override it's function in child contract
Jul 15, 2021, 7:21 PM

© 2024 Draquery.com All rights reserved.