Skip to content

attikusfinch/TON-banners

Repository files navigation

TON Banners

Acton + React prototype for a TON image-board game.

Players send a TON transfer with a standard text comment. The contract parses the comment, stores the image URL for a board cell, and sends the cell price to the creator payout wallet. The frontend attaches an extra gas buffer; the contract refunds unused value back to the player.

Rules

  • Board size: 32x32.
  • Deploy seed is stored in contract data so one wallet can deploy multiple independent boards by changing the seed.
  • Empty cell price: 0.02 TON.
  • Repurchasing the same cell costs 2x the previous paid price.
  • The frontend sends the cell price plus a gas buffer.
  • The contract sends the cell price to the creator payout wallet and refunds unused extra value to the player.
  • The contract exposes a pixels get method that returns occupied cells as map<uint32, Pixel>.
  • Accepted image URL kinds: jpg, jpeg, png, webp.
  • Transfer comment format:
pb:<xx><yy>:<jpg|png|webp>:<url>

Example:

pb:021f:png:https://example.com/image.png

Contract

acton build
acton check
acton fmt --check
acton test

Regenerate wrappers after ABI changes:

acton wrapper PixelBoard
acton wrapper PixelBoard --ts

Frontend

npm install
npm run dev

Open http://127.0.0.1:5173.

The frontend uses TON Connect directly. There is no backend: React creates the deploy stateInit and transfer comment payload locally, then the wallet signs and broadcasts the transaction.

TON Connect uses the manifest from the GitHub repo by default: https://attikusfinch.github.io/TON-banners/tonconnect-manifest.json. After manifest/icon changes, push master so wallets can fetch the latest HTTPS version. Override with VITE_TONCONNECT_MANIFEST_URL if you deploy the app to your own domain later. The icon is a 180x180 PNG because TON Connect wallets do not accept SVG icons in manifests.

The UI has two separate flows:

  • Deploy your own board and choose the payout wallet.
  • Change or randomize the board seed before deploy to create another board from the same wallet.
  • Paste any existing board address and buy cells on that board.

The board refresh button reads the pixels get method, so it works with boards deployed from the current contract code. Older deployed boards need redeploying or a transaction-history fallback because contract code cannot be upgraded in place.

About

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors