Contracts written in Cairo using Dojo to showcase a Pixel World with app interoperability. Its interoperability is made possible with core actions. Apps are any other contracts that are deployed to the Pixel World.
Follow the asdf installation instructions.
asdf plugin add dojo https://github.com/dojoengine/asdf-dojo
asdf install dojo
asdf plugin add scarb
asdf install scarb 2.7.0
And after moving into contracts directory, the versions for these libs are set in the .tool-versions file.
To clone this repository with all submodules, run:
git clone https://github.com/pixelaw/pwar.git
cd pwarPwar runs inside the PixeLAW Core World, which is why we initally have to spin up an empty PixeLAW world.
For this we have built a docker container that builds the PixeLAW world:
cd client
docker compose up --buildThis docker container builds the PixeLAW world and runs Torii and Katana.
Find client/docker-compose.yml for more information.
Feel free to:
docker exec -it pixelaw-core bash
klogTo find katana logs or tlog for torii logs.
Once we initialised the PixeLAW world and its contracts, we now have to deploy the pwar contracts.
cd contracts
sozo build
sozo migrateIn order to spin up the pwar client run:
cd client
pnpm install
pnpm run devIf you would like to make changes feel free to raise a PR. Changes for the client inside client, and changes for the contracts inside contracts. Be sure to test the contracts.
For that you will have to repeat to
sozo build --typescript
sozo migrateCopy the generated typescript files in contracts/bindings/typescript (i.e. contracts.gen.ts and models.gen.ts into client/src/config.
Lastly you will also have to copy the contract section inside contracts/manifest_dev.json into client/src/config/manifest.contracts.ts (be sure to only replace the contracts array).
For any questions reach out to us in our Discord or Twitter.