github-actions
released this
07 Sep 10:53
·
1174 commits
to main
since this release
Minor Changes
-
#1403
55377ffe
Thanks @holic! - We now use@latticexyz/abi-ts
to generate TS type declaration files (.d.ts
) for each ABI JSON file. This replaces our usage TypeChain everywhere.If you have a MUD project created from an older template, you can replace TypeChain with
abi-ts
by first updating your contracts'package.json
:-"build": "pnpm run build:mud && pnpm run build:abi && pnpm run build:typechain", +"build": "pnpm run build:mud && pnpm run build:abi && pnpm run build:abi-ts", -"build:abi": "forge clean && forge build", +"build:abi": "rimraf abi && forge build --extra-output-files abi --out abi --skip test script MudTest.sol", +"build:abi-ts": "mud abi-ts --input 'abi/IWorld.sol/IWorld.abi.json' && prettier --write '**/*.abi.json.d.ts'", "build:mud": "mud tablegen && mud worldgen", -"build:typechain": "rimraf types && typechain --target=ethers-v5 out/IWorld.sol/IWorld.json",
And update your client's
setupNetwork.ts
with:-import { IWorld__factory } from "contracts/types/ethers-contracts/factories/IWorld__factory"; +import IWorldAbi from "contracts/abi/IWorld.sol/IWorld.abi.json"; const worldContract = createContract({ address: networkConfig.worldAddress as Hex, - abi: IWorld__factory.abi, + abi: IWorldAbi,