Investigate contract inefficiencies #3540
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was wrong?
w3.ens
), set all initializing vars tow3._ens
which is the reference thatw3.ens
looks for. This leaves the check for an emptyw3._ens
followed by subsequent instantiation for whenw3.ens
is called directly by the user, not for any internal setup.Contract
init, as well as for theContractCaller
. The caller is instantiated in theContract
init when we setself.caller = ContractCaller(...)
. Pass along the already builtContractFunctions
to theContractCaller
so that it doesn't have to re-build them.How was it fixed?
w3._ens
rather thanw3.ens
(which initializes an ENS instance if it is empty).contract_functions: ContractFunctions
to theContractCaller
class so that we can pass the functions around instead of rebuilding them everywhere they are needed.Todo:
Cute Animal Picture
0_o