Description
Currently, regarding the PRT smart contracts, we provide the following artifacts:
- The source code of all PRT smart contracts
- A script that deploys a top tournament contract for a custom initial machine state hash
- Unit tests for the PRT smart contracts
In addition to those, we would like to also provide:
- The compilation artifacts of all PRT smart contracts
- Deployment scripts for all shared PRT smart contracts
- The deployment addresses of each shared PRT smart contract, per network
In order to provide these artifacts, we need to have a way to deploy smart contracts to different networks and have a way to distribute their addresses to other projects that might need them. Forge has support for Solidity scripts, which can do pretty much anything, but therefore don't have a defined deployment artifact format. Meanwhile, Hardhat Deploy has a defined format, and can be used to reutilize deployed contracts from other projects without redeployment.
To avoid friction with the Cartesi Rollups contracts, we can use Hardhat Deploy to deploy the PRT smart contracts and distribute their deployment artifacts. In order to do so, we will need to make prt/contracts
an npm
package, and add hardhat-deploy
(among other packages) as dependencies. The deployment scripts will be written in TypeScript. The release process can be later made automatic through GitHub workflows. The npm
package would have a structure similar to that of @cartesi/rollups
.
Later, we can make the same thing for the PRT smart contracts for Cartesi Rollups. To do so, we can make the whole dave
repo an npm
workspace, with two packages (PRT "core", and PRT for Cartesi Rollups).