build-onchain-apps
build-onchain-apps copied to clipboard
Feature Request: Automatic contracts and UI abi syncing
Describe the solution you'd like
Currently, it's a manual process to update abi generated from a smart contract and to copy-pasta to UI
Once a contract has been deployed, we need to update which chain and the new address as well.
There are several ways to do this... let's discuss!
Describe alternatives you've considered.
No response
cc @Sneh1999
There are several ways to do this... let's discuss!
Tell me more.
Was it a wagmi
tool for that also we could reuse?
Yes wagmi/cli can do it: https://wagmi.sh/cli/getting-started
Ahh yes, the wagmi/cli
integration is something I started working on, I can try to add this capability as well
There are two integrations steps.
Contract Build
User runs forge build
and generates a new abi. User copies the abi from contracts/out/$Name.sol/$Name.json
to web/src/contract/$Name.json
This is what wagmi/cli
is handle by knowing the deployed contract address.
Contract Deploy
User runs forge script ...
and copies the contract address to web/src/hooks/contracts.ts
Does forge script ...
outputs the deployed address somewhere?
Perhaps we want a "contract configuration file" that lives at the root of the web
folder where either user inputs the address or somehow we do that for the user.
Another thing that would be cool is to deploy your own contract instance for the example apps.