Quickstart
- Clone the Primodium Developer repository:
git clone https://github.com/primodiumxyz/developer.git
- Change your active directory:
cd developer/examples/WriteDemo/packages/contracts
- Install the necessary packages:
pnpm i
-
Update namespaces in scripts (choose your own to avoid collision).
-
Build the project:
pnpm build
- Update addresses and private keys in
.env
cp .env.example .env
- Test the project:
forge test
- Do a dry-run of deployment:
forge script script/RegisterWriteDemoSystem.s.sol --fork-url https://primodium-sepolia.rpc.caldera.xyz/http
- Deploy the System:
forge script script/RegisterWriteDemoSystem.s.sol --fork-url https://primodium-sepolia.rpc.caldera.xyz/http --broadcast
- Use a script to delegate permission and interact with the system:
forge script script/BuildIronMine.s.sol --fork-url https://primodium-sepolia.rpc.caldera.xyz/http --broadcast
File Structure
The WriteDemo (opens in a new tab) consists of four main files:
- System Contract:
src/systems/WriteDemoSystem.sol
(opens in a new tab) - System Tests:
test/WriteDemoSystem.t.sol
(opens in a new tab) - Deployment Script:
script/RegisterWriteDemoSystem.s.sol
(opens in a new tab) - Interaction Script:
script/BuildIronMine.s.sol
(opens in a new tab)