Various code improvements to reduce duplicate code:
Move the following functions to higher class abstraction levels, instead of redefining them for every single contract + version + adapter:
getAddress
estimateGas
encode
Use basic ContractFunction type in all contract implementations
Add JS docs to all contract functions
How this PR fixes it
Changing the abstraction order of the contract classes: abstract at adapter level before abstracting at contract-level. This allows to move the getAddress, encode + estimateGas functions into the abstract adapter-level classes (e.g. BaseContractEthers) instead of defining them for each contract individually.
Introducing the BaseContract class to handle the logic of selecting the appropriate ABI and the address from contract deployments. This new class replaces all the contract-specific base classes, such as SafeBaseContract.
What it solves
Various code improvements to reduce duplicate code:
getAddress
estimateGas
encode
ContractFunction
type in all contract implementationsHow this PR fixes it
Changing the abstraction order of the contract classes: abstract at adapter level before abstracting at contract-level. This allows to move the
getAddress
,encode
+estimateGas
functions into the abstract adapter-level classes (e.g.BaseContractEthers
) instead of defining them for each contract individually.Introducing the
BaseContract
class to handle the logic of selecting the appropriate ABI and the address from contract deployments. This new class replaces all the contract-specific base classes, such asSafeBaseContract
.