Is there a way to override or skip calling a parent's constructor? For example, I have the following:
contract Ape {
constructor() {
// Initialise some stuff in Ape constructor
}
}
contract Human is Ape {
constructor() {
// Initialise some stuff WITHOUT running whatever that is in Ape.constructor
}
}
Currently, I notice that the parent constructor will always be called. In my case, I'm creating mock contract which inherits a target contract for
testing
and I don't want anything in the parent contract's constructor to be initialized so that I can test things out.
Is there any way in some languages where the parent constructor will be only called by super()
?
In my case, I would like to omit
super()
so nothing in the parent constructor is called.
uint
, "" forstring
, false forbool
, address(0) foraddress
, etc. So you could initialize them with their default values to reproduce the same scenario.