Since the data package and the subgraph app need the Semaphore contract interface (ABI), that JSON file must currently be copied manually every time the contract changes. The ABI could be automatically copied into the utils package, which can, in turn, be used by data and subgraph.
Contract interfaces are generated when the yarn compile command is executed in the packages/contracts folder. A script could be run immediately after compilation to copy the file artifacts/contracts/Semaphore.sol/Semaphore.json to packages/utils/src/semaphore-abi.json. Then all packages/apps that need the interface can import it from @semaphore-protocol/utils.
Additionally, all devs or external apps that need the Semaphore ABI will be able to import it directly from the @semaphore-protocol/utils package.
Description
Since the
data
package and thesubgraph
app need the Semaphore contract interface (ABI), that JSON file must currently be copied manually every time the contract changes. The ABI could be automatically copied into theutils
package, which can, in turn, be used bydata
andsubgraph
.Contract interfaces are generated when the
yarn compile
command is executed in thepackages/contracts
folder. A script could be run immediately after compilation to copy the fileartifacts/contracts/Semaphore.sol/Semaphore.json
topackages/utils/src/semaphore-abi.json
. Then all packages/apps that need the interface can import it from@semaphore-protocol/utils
.Additionally, all devs or external apps that need the Semaphore ABI will be able to import it directly from the
@semaphore-protocol/utils
package.