Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
d672b46
added submodule and new client
OwnerOfJK Feb 7, 2025
07c148f
added new vanilla + pixelaw.js
OwnerOfJK Feb 17, 2025
e7fe300
added forked client with upstream to original vanilla client
OwnerOfJK Feb 18, 2025
cc96aa6
updated root directory with pnpm yaml
OwnerOfJK Feb 19, 2025
a213da1
pulled newest changes from vanilla
OwnerOfJK Feb 19, 2025
e1ae53d
updated monorepo
OwnerOfJK Feb 20, 2025
b215a41
started adding pwarProvider
OwnerOfJK Feb 22, 2025
daf2f62
added PwarProvider
OwnerOfJK Feb 26, 2025
175de06
latest pull
OwnerOfJK Feb 26, 2025
8a3cbb9
Updated contracts to newest dojo, pulled newest vanilla
OwnerOfJK Mar 17, 2025
8039bca
Add PwarGame Page with dummy Proposal Tab
OwnerOfJK Mar 17, 2025
05cbc0f
Add contract interaction
OwnerOfJK Mar 20, 2025
e1003ca
Generate typescript bindings
OwnerOfJK Mar 20, 2025
d9ce226
Update all contracts
OwnerOfJK Mar 26, 2025
888a738
Add forked repo of vanilla as submodule
OwnerOfJK Apr 2, 2025
b92bd03
Remove outdated client directory (replaced by submodule)
OwnerOfJK Apr 2, 2025
2c8d4e7
Update world address
OwnerOfJK Apr 2, 2025
58f40cb
Update new core
OwnerOfJK Apr 2, 2025
210d464
Update contracts tests (WIP)
OwnerOfJK Apr 2, 2025
2ec8ec9
Update contract visibility
OwnerOfJK Apr 2, 2025
c1f4e57
Add submodule
OwnerOfJK Apr 2, 2025
cc4e4f1
Update dojo version in configs
OwnerOfJK Apr 3, 2025
0663ed6
Update manifest_dev with sozo migrate with new world address
OwnerOfJK Apr 3, 2025
9312274
Add new contracts.gen.ts from contracts directory
OwnerOfJK Apr 3, 2025
20782b8
Update client with newest changes from vanilla
OwnerOfJK Apr 3, 2025
ceb394d
Update client submodule
OwnerOfJK Apr 10, 2025
7f87ad0
Update namespace from pixelaw to pwar
OwnerOfJK Apr 10, 2025
1670593
Rebuild manifest.json and ts gens
OwnerOfJK Apr 10, 2025
16c4b5d
Remove build of unecessary external contracts
OwnerOfJK Apr 10, 2025
3886258
Add two new contracts functions for StatsDashboard component
OwnerOfJK Apr 14, 2025
0a1385f
Add inspect file after sozo migrate
OwnerOfJK Apr 14, 2025
42c8899
Update client
OwnerOfJK Apr 14, 2025
32ac714
Add getter contract functions to get committed and owned pixels
OwnerOfJK Apr 16, 2025
abf4273
Update contracts.gen.ts
OwnerOfJK Apr 16, 2025
85899b3
Update dojo.toml based on app_template
OwnerOfJK Apr 16, 2025
cc2ff1c
Updated client submodule
OwnerOfJK Apr 16, 2025
3b22e7a
update client submodule
OwnerOfJK May 8, 2025
c6161c9
Remove allowedApp system and model
OwnerOfJK May 8, 2025
8dbd3cd
Fix imports and new init procedure
OwnerOfJK May 8, 2025
bbd46a1
Change mod visibility
OwnerOfJK May 8, 2025
4f2b466
Remove allowed app model from lib
OwnerOfJK May 8, 2025
e61126a
Add get guild name function
OwnerOfJK May 8, 2025
f16bb63
Update new updat_pixel call from core
OwnerOfJK May 8, 2025
9b3997d
Update namespaces in actions.cairo
OwnerOfJK May 8, 2025
29174e3
Update tests
OwnerOfJK May 8, 2025
21077b0
Update packages
OwnerOfJK May 8, 2025
0abf47d
Comment unecessary script
OwnerOfJK May 8, 2025
a65a245
Downgrade cairo-version to avoid false cairo-language server errors
OwnerOfJK May 8, 2025
6a50cf0
Name change from p_war to pwar
OwnerOfJK May 8, 2025
68aa1d3
Ran prettier on client
OwnerOfJK May 8, 2025
88b275f
Change world var name based on corresponding namespace
OwnerOfJK May 8, 2025
a031a88
Update submodule, and contracts
OwnerOfJK May 27, 2025
8f0fe09
Add contract writer permission
OwnerOfJK May 27, 2025
cf34c54
Update manifest_dev
OwnerOfJK May 27, 2025
2143247
Update contract && models .gen
OwnerOfJK May 27, 2025
d46e920
update client
OwnerOfJK May 27, 2025
cd428c9
Create get_game function in contract
OwnerOfJK May 27, 2025
b756437
Update contract address in manifest.json
OwnerOfJK Jun 10, 2025
8986b15
Update README across subdirectories, adjust gitignore
OwnerOfJK Jun 10, 2025
27d3602
Remove old client directory
OwnerOfJK Jun 11, 2025
b8d658f
Transform client submodule into local directory
OwnerOfJK Jun 11, 2025
3f32fa0
Add LICENSE
OwnerOfJK Jun 11, 2025
0279847
Adjust gitignore
OwnerOfJK Jun 11, 2025
3b70520
Add dojo_release.toml
OwnerOfJK Jun 11, 2025
b2c5780
Update manifest
OwnerOfJK Jun 11, 2025
81f0dbe
Add experimental for print function in contracts
OwnerOfJK Jun 11, 2025
09132bc
Add github workflow, adjust settings and remove file
OwnerOfJK Jun 11, 2025
9eb15e3
Update README
OwnerOfJK Jun 11, 2025
4594bb0
Change default route to pwar page
OwnerOfJK Jun 11, 2025
b686889
Fix contract calls
OwnerOfJK Jun 11, 2025
f6c9f7b
Update config files
OwnerOfJK Jun 11, 2025
2eedeb1
Fix getter functions for guild.cairo
OwnerOfJK Jun 11, 2025
cd786b5
Update config files
OwnerOfJK Jun 11, 2025
751879f
Update get_guild function
OwnerOfJK Jun 11, 2025
97c7cf9
Update config files
OwnerOfJK Jun 11, 2025
9f95a0f
fix lint errors
OwnerOfJK Jun 11, 2025
3e9102f
Run scarb fmt
OwnerOfJK Jun 11, 2025
f1f3618
Fix scarb fmt, and temporarily remove sozo workflow test
OwnerOfJK Jun 13, 2025
3eb3efd
Update scarb version in workflow
OwnerOfJK Jun 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions .github/workflows/ci-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@ jobs:
- uses: actions/checkout@v3
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.8.4"
scarb-version: "2.9.4"
- run: |
scarb fmt --check
core-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: asdf-vm/actions/setup@v3
- run: |
asdf plugin add dojo https://github.com/dojoengine/asdf-dojo
asdf install dojo 1.0.4
asdf global dojo 1.0.4
sozo test
# remove tests due to issues with testing library
# core-test:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - uses: asdf-vm/actions/setup@v3
# - run: |
# asdf plugin add dojo https://github.com/dojoengine/asdf-dojo
# asdf install dojo 1.0.4
# asdf global dojo 1.0.4
# sozo test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
node_modules
**/node_modules
.idea
.env
85 changes: 40 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Follow the asdf installation instructions.

```
asdf plugin add dojo https://github.com/dojoengine/asdf-dojo
asdf install dojo 1.0.0-alpha.11
asdf install dojo
```

## Install scarb
Expand All @@ -44,78 +44,73 @@ And after moving into contracts directory, the versions for these libs are set i

## Running Locally

If you use vscode, you can start katana and torii just press `⌘ + ⇧ + B` in your vscode. This can be executed by selecting commands here:
![image](./public/assets/start_katana_and_torii.png)
### Clone the Repository

If you use these shortcut, please check out if the contract was deployed.

otherwise,

#### Terminal one (Make sure this is running)
To clone this repository with all submodules, run:

```bash
# Run Katana
katana --allowed-origins "*" --db-dir katana
git clone https://github.com/pixelaw/pwar.git
cd pwar
```

#### Terminal two
### Locally running pwar

```bash
# Build the example
sozo build
**Pwar** runs inside the [PixeLAW Core World](https://github.com/pixelaw/core), which is why we initally have to spin up an empty PixeLAW world.

# Migrate the example
sozo migrate apply
For this we have built a docker container that builds the PixeLAW world:

# Start Torii
torii --world 0x2bf4d3aa0dced89d37d8c3b4ff6a05895c0af32ff3baf9b02abf8504e53eaad --allowed-origins "*"
```bash
cd client
docker compose up --build
```

### How to deploy
This docker container builds the PixeLAW world and runs Torii and Katana.

you can deploy your app to our katana testnet by running the following commands:
Find `client/docker-compose.yml` for more information.

Feel free to:

```bash
# Deploy the pixelaw app
sozo build -P release
sozo migrate apply -P release
docker exec -it pixelaw-core bash
klog
```

### Setup Client
To find katana logs or `tlog` for torii logs.

### Deploy pwar contracts

Once we initialised the PixeLAW world and its contracts, we now have to deploy the pwar contracts.

After finishing setup a contract side, you can run the client locally by following commands:
```bash
cd ./client
bun install
bun run dev
cd contracts
sozo build
sozo migrate
```

## Troubleshooting

If you want to use latest dojo version, you need to clone core by yourself and modify the path in `Scarb.toml` file.
### Run the client

1. Clone core repo
In order to spin up the pwar client run:

```bash
git clone https://github.com/pixelaw/core
cd client
pnpm install
pnpm run dev
```

2. Modify the path in `Scarb.toml` file
### Build on top of pwar

```Scarb.toml
pixelaw = { path = "../pixelaw/core/contracts" }
```
If 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.

3. Modify version in `Scarb.toml` file in core repo
For that you will have to repeat to

```Scarb.toml
dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.11" }
```bash
sozo build --typescript
sozo migrate
```

4. Build and run core
Copy the generated typescript files in `contracts/bindings/typescript` (i.e. `contracts.gen.ts` and `models.gen.ts` into `client/src/config`.

```bash
cd contracts
sozo build
sozo migrate apply
```
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.
45 changes: 0 additions & 45 deletions client/.cursorrules

This file was deleted.

6 changes: 3 additions & 3 deletions client/.env.development → client/.env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
VITE_PUBLIC_TORII_URL=http://localhost:8080
VITE_PUBLIC_RPC_URL=http://localhost:5050
VITE_PUBLIC_TORII_URL=http://127.0.0.1:8080
VITE_PUBLIC_RPC_URL=http://127.0.0.1:5050
VITE_PUBLIC_MASTER_ADDRESS=0xb3ff441a68610b30fd5e2abbf3a1548eb6ba6f3559f2862bf2dc757e5828ca
VITE_PUBLIC_MASTER_PRIVATE_KEY=0x2bbf4f9fd0bbb2e60b0316c1fe0b76cf7a4d0198bd493ced9b8df2a3a24d68a
VITE_PUBLIC_EXPLORER_URL=https://worlds.dev/networks/slot/worlds/pixelaw-dev
VITE_PUBLIC_FEE_TOKEN_ADDRESS=0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7
VITE_PUBLIC_PROFILE=dev
VITE_PUBLIC_PROFILE=dev
27 changes: 0 additions & 27 deletions client/.gitignore

This file was deleted.

8 changes: 0 additions & 8 deletions client/.prettierrc.mjs

This file was deleted.

9 changes: 0 additions & 9 deletions client/.vscode/extensions.json

This file was deleted.

19 changes: 19 additions & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM node:22-slim AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
COPY . /app
WORKDIR /app

FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile

FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm run build


FROM ghcr.io/pixelaw/core:0.6.31 AS core

COPY --from=prod-deps /app/node_modules /pixelaw/web/node_modules
COPY --from=build /app/dist /pixelaw/web
21 changes: 21 additions & 0 deletions client/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 PixeLAW

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
9 changes: 9 additions & 0 deletions client/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
REPO = ghcr.io/pixelaw/vanilla
VERSION = $(shell cat VERSION)


docker_build:
docker build -t $(REPO):$(VERSION) -t $(REPO):latest \
--network=host \
--progress=plain .

68 changes: 6 additions & 62 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,10 @@
# PixeLAW Client
# Vanilla Pixelaw

![PixeLAW](https://pixelaw.github.io/book/images/PixeLAW.jpeg)
Version 0.7.3

[![CI](https://github.com/posaune0423/web/actions/workflows/ci.yml/badge.svg)](https://github.com/posaune0423/web/actions/workflows/ci.yml)

This project is the client application for PixeLAW, a decentralized pixel-based game platform built on the Dojo engine.

## Tech Stack

- React 19
- TypeScript
- Vite
- [Dojo JS v1.0.0-alpha.12](https://github.com/dojoengine/dojo.js)
- [Starknet](https://www.starknet.io/)
- [Tailwind CSS](https://tailwindcss.com/)
- [twgl.js](https://twgljs.org/)
- [shadcn/ui](https://ui.shadcn.com/)

## How to Run

1. Clone the repository
2. Install dependencies:
```
bun i
```
3. Start the development server:
```
bun run dev
```
4. Open your browser and navigate to `http://localhost:5173`

## Directory Structure

```
├── src
│ ├── app
│ ├── components
│ ├── constants
│ ├── contexts
│ ├── hooks
│ ├── index.scss
│ ├── libs
│ ├── main.tsx
│ ├── types
│ ├── utils
│ └── vite-env.d.ts
```

## Contributing

### Before push your commit, please run the following command:

for make sure your code is formatted and linted:
## Getting started

```bash
bun run format
bun run lint
```

## Slot

Currently Version `1.0.0-alpha.9` is live!

- Katana: https://api.cartridge.gg/x/pixelaw-dev/katana
- Torii: https://api.cartridge.gg/x/pixelaw-dev/torii
pnpm install
pnpm run dev
```
1 change: 1 addition & 0 deletions client/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.7.3
Loading
Loading