Global Contract Configuration #1363
Unanswered
justingreenberg
asked this question in
Ideas
Replies: 2 comments 1 reply
-
Thanks for the feedback! We have an in-progress feature that achieves something similar. Expect more on it soon. |
Beta Was this translation helpful? Give feedback.
1 reply
-
came here looking for exactly this |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Motivation
Generally speaking, contract deployments and respective ABIs are static and known at build time and dynamic runtime values are mapped by chain. The current constraints seem to reliably create some frustrating DX:
address
andabi
const
Proposal
Allow contracts to be defined on the WagmiProvider.
Possible solution:
Hook usage
We would want to add one additional hook to access chain-aware deployments
useDeployment
which returns the correct address in order to facilitate composition with other hooksWhile this is mainly to improve the DX for react developers, the benefits could be extended to core library by accepting configuration when instantiating client
Similar to other configurations, global configuration would always be overridden by config passed to hooks
Beta Was this translation helpful? Give feedback.
All reactions