- Setup new
chainConfigs
file setting 1. fee recipient, and 2. owner for factory contracts - Run forge/foundry deploy script
- Update deployed addresses file
yarn run update-new-deployment-addresses
- Verify
addresses/CHAINID.json
exists. - Ensure contracts are verified on block explorer.
- Add a changeset with
npx changeset
- Make PR with new addresses json files and changeset.
/package/wagmiGenerated.ts
- smart contract abis and deployment addresses./package/chainConfigs.ts
- configuration of smart contracts by chainId
Diagram of the deploying + publishing workflow:
Publishing happens in the following steps:
- Some changes are made to the repo; this can include smart contract changes or additions, if smart contracts are changed, tests should be created or updated to reflect the changes.
- The changes are committed to a branch which is pushed to github.
- A pr is opened for this branch.
- The changes are reviewed, if they are approved:
- If there are changes to the smart contracts that should be deployed: the contract should be. Deploying the contract results in the addresses of the deployed contracts being updated in the corresponding
./addresses/{chainId}.json
file. This file should be committed and pushed to github. - Running the command
npx changeset
will generate a new changeset in the./changesets
directory. This changeset will be used to determine the next version of the bundled packages; this commit should then be pushed. - The changeset and smart contract addresses are pushed to the branch.
- The pr is merged into main - any changesets in the PR are detected by a github action
release
, which will then open a new PR with proper the versions and readme updated in each each package. If more changesets are pushed to main before this branch is merged, the PR will continuously update the version of the packages according to the changeset specifiction.
-
That version is merged into main along with the new versions.
-
The package is the published to npm with the command:
yarn publish-packages
and the package is published.
In a future version, the when the version branch is merged into main, it can publish the new repos to github.
Some active questions:
- How do we ensure the contract version matches the package version? Or does it need to match? Sometimes there is a js package update without a smart contract update.
Future ideas:
- Allow deployment to happen via github actions:
- Deployments can be added to changesets through some command. If a changeset is pushed to main and a deployment is detected in it, a deployment task is added to the PR that's created. When that PR is merged, the deployment happens, and a new package is built and publised to npm with the new versions.