I'm almost done with my contract but I've done (almost) everything to reduce the byte size of my contract and I'm still missing like two features. That's why I need to split the contract in order to reduce size even more. I've already extracted a part of my code into two other contracts. Bar is abstract and will be extended by my main contract and Baz will be initialized and called from the main contract. Example:
contract Foo extends Bar {
Baz baz;
constructor() {
baz = new Baz();
}
}
That worked out but my contract size didn't really decrease. Should I inject Baz instead of initializing it on the main contract? How would I do that since something like that
contract Foo extends Bar {
Baz baz;
constructor(address barAdress) {
baz = address;
}
}
will throw Type address is not implicitly convertible to expected type contract Baz. obviously.
Does an extended abstract contract even reduce the byte code or will it be combined in compilation and result in the same size?