CHEOMA처마

Docs · GIWA Sepolia testnet

CHEOMA documentation

How to lay a tile, what the contract guarantees, how the artwork and metadata are built on-chain, and how to build or deploy the project yourself.

What CHEOMA is 처마

CHEOMA is a digital giwa-bulsa (기와불사). At Korean temples, visitors donate roof tiles and ink a wish, or the name of someone they love, onto the clay before a new hall is built. CHEOMA brings that tradition on-chain: a shared roof of 2,048 tiles on a 64 × 32 grid, where every tile is a fully on-chain ERC-721 with its own glaze color and wish.

One contract, Cheoma.sol, on GIWA Sepolia generates the artwork and metadata. There is no backend, no IPFS, and no server to keep running. The web app is static files that read the chain directly.

Key terms

TermMeaning
RoofThe shared 64 × 32 grid: 2,048 spots.
TileOne spot once it is laid. It is an ERC-721 token whose id is the spot index.
GiverThe wallet that laid the tile. Stored on-chain and never changed, even after a transfer.
GlazeThe tile's color, a 24-bit RGB value.
WishThe inscription on the tile, up to 140 bytes.
Sumaksae (수막새)The round end-cap ornament on a roof tile. It is the tile's artwork.
MilestoneAn event emitted each time the roof reaches a multiple of 256 tiles.

Quick start

  1. Get a wallet. Use GIWA Wallet or any injected EVM wallet such as MetaMask.
  2. Open the app. Go to the live app. You can look at the roof without connecting a wallet.
  3. Connect and switch network. Click Connect wallet. If your wallet is not on GIWA Sepolia, the app asks it to switch, and adds the network first if needed.
  4. Get testnet ETH. Laying a tile costs gas, paid in GIWA Sepolia ETH. Testnet ETH has no real value.
  5. Lay a tile. Click an empty spot, pick a glaze, write your wish, optionally add a donation, then sign once.

Network details

ItemValue
NetworkGIWA Sepolia (testnet)
Chain ID91342 (0x164ce)
RPChttps://sepolia-rpc.giwa.io
Flashblocks RPChttps://sepolia-rpc-flashblocks.giwa.io. The app checks transaction receipts here for faster preconfirmations.
Explorersepolia-explorer.giwa.io
Native currencyETH (18 decimals)
Contract0xc62a7cb1afbde2f2c84febd4d35fa0e023faec2e, verified on the explorer

Tile rules

These limits are enforced by the contract, not by the web app. Anyone calling the contract directly gets the same rules.

RuleValue
Roof size64 × 32 = 2,048 spots (TOTAL_TILES)
Spot idid = y * 64 + x, from 0 to 2047. coordinates(id) converts back to (x, y).
One giver per spotFirst transaction to land wins. A laid tile cannot be replaced.
Wish lengthUp to 140 bytes of UTF-8 (MAX_WISH_BYTES)
GlazeAny 24-bit RGB value
Wallet capEach address can lay at most 16 tiles (MAX_PER_WALLET). The cap counts tiles laid, not tiles held.
DonationOptional. ETH sent with layTile is forwarded to roofFund in the same transaction.
MilestonesRoofMilestone(count) is emitted at 256, 512, 768, 1024, 1280, 1536, 1792 and 2048 tiles.

Laying a tile

Laying a tile is one transaction, layTile(id, color, wish), with an optional ETH value. In that transaction the contract:

  • checks that the spot is on the roof and empty, that the wish fits in 140 bytes, and that your wallet is under the 16-tile cap;
  • records you as the giver, and stores the glaze, the wish and the block timestamp;
  • mints the tile to you, emitting Transfer from the zero address and TileLaid;
  • emits RoofMilestone if this tile brought the roof to a multiple of 256;
  • forwards any attached ETH to roofFund.

In the app, you first see a Flashblocks preconfirmation, then the block confirmation. The toast shows both times.

There is no function to edit a wish, clear a spot, or burn a tile. Read your wish carefully before you sign.

Wishes & metadata

The wish is stored as UTF-8 bytes. The limit is in bytes, not characters. ASCII letters take one byte. Korean Hangul takes three bytes per syllable, and Turkish letters such as ş, ğ, ı, ö, ü and ç take two. The input shows the live byte count.

tokenURI(id) returns a base64 JSON data URI with this shape:

{
  "name": "CHEOMA Tile #330",
  "description": "<the wish>",
  "attributes": [
    { "trait_type": "X", "value": 10 },
    { "trait_type": "Y", "value": 5 },
    { "trait_type": "Glaze", "value": "#1fb6a3" }
  ],
  "image": "data:image/svg+xml;base64,..."
}

Quotes and backslashes in the wish are escaped so the JSON stays valid. Control characters become spaces. tokenURI and tileOf revert with empty spot for spots nobody has laid.

The artwork

The image is a 360 × 360 SVG generated by tileSVG(id), drawn in the giver's glaze:

  • a dark square background and a round tile disc;
  • an outer ring and a center boss in the glaze color;
  • 6, 7 or 8 petals in the glaze, drawn as rotated ellipses. This is the sumaksae end-cap;
  • a caption at the bottom with the tile number and grid position, for example #330 (10,5).

The petal count is deterministic. It is 6 + (first byte of keccak256(abi.encodePacked(id, giver)) % 3), so it is 6, 7 or 8. Because the original giver is part of the seed, the petal count stays the same after a transfer.

Ownership & transfers

  • The token is CHEOMA with symbol TILE.
  • Tiles are standard ERC-721 tokens. The contract supports transferFrom, both safeTransferFrom overloads, approve, setApprovalForAll, getApproved and isApprovedForAll.
  • After a transfer, tileOf(id).giver and the original TileLaid event still name the first giver.
  • Transfers do not change the wallet cap. A wallet that has laid 16 tiles stays at 16, even if it sends them all away.
  • The contract supports ERC-165, ERC-721 and ERC-721 Metadata. It does not implement ERC-721 Enumerable. To list the tiles a wallet holds, use balanceOf with Transfer events, or read the roof with getRange.

Donations

  • Donations are optional. Attach ETH to layTile and it goes straight to roofFund.
  • roofFund is set once at deploy time and cannot change. Read the current value with roofFund() on the explorer.
  • The contract keeps no ETH balance. It has no receive function, so a plain ETH transfer to the contract address reverts.
  • If the forward to roofFund fails, the whole lay reverts with donation failed, and the tile is not minted.

Contract reference

Source: src/Cheoma.sol. Single file, no dependencies.

Functions

FunctionKindWhat it does
layTile(uint256 id, uint24 color, string wish)write, payableLays a tile at id. Attach ETH to donate.
tileOf(uint256 id)viewReturns (giver, color, laidAt, wish). Reverts for an empty spot.
getRange(uint256 start, uint256 count)viewReturns givers[] and colors[] for a span of spots. Empty spots return zero values. Reverts if the span leaves the roof.
coordinates(uint256 id)pureReturns (x, y) for a spot id.
tileSVG(uint256 id)viewReturns the sumaksae artwork as an SVG string.
tokenURI(uint256 id)viewReturns the base64 JSON metadata data URI. Reverts for an empty spot.
laidCount()viewNumber of tiles laid so far, from 0 to 2048.
tilesLaidBy(address)viewNumber of tiles this address has laid. Capped at 16.
roofFund()viewAddress that receives donations.
ownerOf, balanceOf, approve, getApproved, setApprovalForAll, isApprovedForAll, transferFrom, safeTransferFromERC-721Standard token functions. ownerOf reverts for an empty spot.
supportsInterface(bytes4)pureERC-165 check for ERC-165, ERC-721 and ERC-721 Metadata.
name(), symbol()viewCHEOMA and TILE.
WIDTH, HEIGHT, TOTAL_TILES, MAX_PER_WALLET, MAX_WISH_BYTES, MILESTONEconstants64, 32, 2048, 16, 140, 256.

Events

EventEmitted when
TileLaid(uint256 indexed id, address indexed giver, uint24 color, string wish, uint256 donation)A tile is laid. This is the event the app listens to for live updates.
RoofMilestone(uint256 count)The roof reaches a multiple of 256 tiles.
Transfer(address indexed from, address indexed to, uint256 indexed tokenId)A tile is minted (from the zero address) or transferred.
Approval, ApprovalForAllApprovals are set or changed.

Revert messages

MessageMeaning
off the roofid is 2048 or higher.
tile takenThe spot is already laid.
wish too longThe wish is more than 140 bytes.
wallet capYour wallet has already laid 16 tiles.
donation failedThe ETH forward to roofFund was rejected.
empty spotA read or transfer targeted a spot nobody has laid.
rangegetRange asked for spots past the end of the roof.
wrong from, not allowed, to=0, unsafe receiverThe usual ERC-721 transfer and approval checks.

Reading the roof from JavaScript

This example uses ethers v6 with a human-readable ABI:

import { ethers } from "ethers";

const ADDRESS = "0xc62a7cb1afbde2f2c84febd4d35fa0e023faec2e";
const abi = [
  "function tileOf(uint256 id) view returns (tuple(address giver, uint24 color, uint64 laidAt, string wish))",
  "function getRange(uint256 start, uint256 count) view returns (address[] givers, uint24[] colors)",
  "function layTile(uint256 id, uint24 color, string wish) payable",
  "event TileLaid(uint256 indexed id, address indexed giver, uint24 color, string wish, uint256 donation)"
];

const provider = new ethers.JsonRpcProvider("https://sepolia-rpc.giwa.io", 91342, { staticNetwork: true });
const cheoma = new ethers.Contract(ADDRESS, abi, provider);

const tile = await cheoma.tileOf(330);           // x = 10, y = 5
console.log(tile.giver, tile.wish);

const [givers, colors] = await cheoma.getRange(0, 64); // the first row of the roof

To lay a tile, connect a signer with cheoma.connect(signer) and call layTile(id, color, wish, { value }). Read the roof in pages with getRange, as the app does, rather than fetching all 2,048 spots in one call.

Developer guide

Repository layout

PathWhat it is
src/Cheoma.solThe whole contract. No external dependencies.
test/Cheoma.t.solFoundry test suite (14 tests).
script/Deploy.s.solDeployment script for GIWA Sepolia.
broadcast/Deployment records from Foundry.
docs/The static site: the app (index.html), this page, the deck, the one-pager and the team page.
foundry.toml, lib/forge-stdFoundry configuration and the forge-std submodule.

Run the tests

You need Foundry. Clone with submodules, since lib/forge-std is a git submodule:

git clone --recursive https://github.com/izzetcakmak/cheoma
cd cheoma
forge test -vv

If you already cloned without --recursive, run git submodule update --init --recursive.

Deploy to GIWA Sepolia

export PRIVATE_KEY=0x...   # deployer key. Never commit it.
export ROOF_FUND=0x...     # optional. Defaults to the deployer address.

forge script script/Deploy.s.sol --rpc-url https://sepolia-rpc.giwa.io --broadcast

Verify on the explorer

Verify with the Blockscout verifier:

forge verify-contract <DEPLOYED_ADDRESS> src/Cheoma.sol:Cheoma \
  --verifier blockscout \
  --verifier-url https://sepolia-explorer.giwa.io/api \
  --chain-id 91342 \
  --constructor-args $(cast abi-encode "constructor(address)" $ROOF_FUND)

Run the site locally

The site is plain HTML, CSS and JavaScript in docs/. It loads ethers v6 from cdnjs, so there is no build step. Serve the folder and open it in a browser:

python -m http.server 8080 --directory docs

Then open http://localhost:8080.

Hosting

The live copy runs on Vercel. docs/vercel.json adds a few security headers: nosniff, a referrer policy and a permissions policy. Any static host works.

FAQ

Do I need a wallet to look at the roof?

No. Browsing the roof and the wish wall works without a wallet or any ETH.

Do I have to donate?

No. The donation is optional, and you can lay a tile with zero ETH attached.

Can I edit or remove my wish later?

No. The contract has no function to change or clear a wish. Write it carefully before you sign.

Can I give my tile to another wallet?

Yes. It is a standard ERC-721 transfer. The original giver stays recorded on-chain.

Why can't I lay more tiles?

Each wallet can lay up to 16 tiles in total. Transferring a tile away does not free a slot.

Why does a spot say it is taken?

Someone else laid it first. Each spot has one giver, and the first transaction to land wins.

Why was my wish rejected as too long?

The limit is 140 bytes, not characters. Korean and some accented letters take more than one byte each. The input shows the live byte count.

Where does a donation go?

It is forwarded to roofFund in the same transaction. The contract keeps none of it. Read roofFund() on the explorer for the current recipient.

Which wallets work?

Any injected EVM wallet that can use GIWA Sepolia, including GIWA Wallet and MetaMask.

Limits & safety

  • Testnet only. The app runs on GIWA Sepolia. Nothing here has real-world value.
  • Experimental. This repository does not include a security audit. Treat the contract as unaudited.
  • Public and permanent. Wishes are public on-chain and cannot be edited or deleted. Do not write personal data, contact details or secrets.
  • No admin controls. Cheoma.sol has no owner, no pause and no upgrade path. The only fixed setting is the roofFund address.
  • Public RPC dependency. The app reads from public RPC endpoints. If they are unreachable, it keeps the last state it loaded.
Never put a real private key or seed phrase into the deploy commands or any file in this repo. Use a throwaway testnet key.

Roadmap

These are plans, not commitments. For the full pitch, see the deck and the one-pager.

StagePlan
NowTestnet MVP live on GIWA Sepolia, with a verified contract and the live app.
NextGIWA Wallet mini-app, Dojang (EAS) badges for verified givers, and pilots with Korean temples and brands. A donated on-chain tile would mirror a physical giwa-bulsa tile.
MainnetPaid donation tiles with a small protocol fee, collab and seasonal roofs. Donations would fund Korean public goods and ecosystem grants.
LaterA multi-roof platform, where any community can raise its own roof.