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
| Term | Meaning |
|---|---|
| Roof | The shared 64 × 32 grid: 2,048 spots. |
| Tile | One spot once it is laid. It is an ERC-721 token whose id is the spot index. |
| Giver | The wallet that laid the tile. Stored on-chain and never changed, even after a transfer. |
| Glaze | The tile's color, a 24-bit RGB value. |
| Wish | The inscription on the tile, up to 140 bytes. |
| Sumaksae (수막새) | The round end-cap ornament on a roof tile. It is the tile's artwork. |
| Milestone | An event emitted each time the roof reaches a multiple of 256 tiles. |
Quick start
- Get a wallet. Use GIWA Wallet or any injected EVM wallet such as MetaMask.
- Open the app. Go to the live app. You can look at the roof without connecting a wallet.
- 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.
- Get testnet ETH. Laying a tile costs gas, paid in GIWA Sepolia ETH. Testnet ETH has no real value.
- Lay a tile. Click an empty spot, pick a glaze, write your wish, optionally add a donation, then sign once.
Network details
| Item | Value |
|---|---|
| Network | GIWA Sepolia (testnet) |
| Chain ID | 91342 (0x164ce) |
| RPC | https://sepolia-rpc.giwa.io |
| Flashblocks RPC | https://sepolia-rpc-flashblocks.giwa.io. The app checks transaction receipts here for faster preconfirmations. |
| Explorer | sepolia-explorer.giwa.io |
| Native currency | ETH (18 decimals) |
| Contract | 0xc62a7cb1afbde2f2c84febd4d35fa0e023faec2e, 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.
| Rule | Value |
|---|---|
| Roof size | 64 × 32 = 2,048 spots (TOTAL_TILES) |
| Spot id | id = y * 64 + x, from 0 to 2047. coordinates(id) converts back to (x, y). |
| One giver per spot | First transaction to land wins. A laid tile cannot be replaced. |
| Wish length | Up to 140 bytes of UTF-8 (MAX_WISH_BYTES) |
| Glaze | Any 24-bit RGB value |
| Wallet cap | Each address can lay at most 16 tiles (MAX_PER_WALLET). The cap counts tiles laid, not tiles held. |
| Donation | Optional. ETH sent with layTile is forwarded to roofFund in the same transaction. |
| Milestones | RoofMilestone(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
Transferfrom the zero address andTileLaid; - emits
RoofMilestoneif 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.
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, bothsafeTransferFromoverloads,approve,setApprovalForAll,getApprovedandisApprovedForAll. - After a transfer,
tileOf(id).giverand the originalTileLaidevent 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
balanceOfwithTransferevents, or read the roof withgetRange.
Donations
- Donations are optional. Attach ETH to
layTileand it goes straight toroofFund. roofFundis set once at deploy time and cannot change. Read the current value withroofFund()on the explorer.- The contract keeps no ETH balance. It has no
receivefunction, so a plain ETH transfer to the contract address reverts. - If the forward to
roofFundfails, the whole lay reverts withdonation failed, and the tile is not minted.
Contract reference
Source: src/Cheoma.sol. Single file, no dependencies.
Functions
| Function | Kind | What it does |
|---|---|---|
layTile(uint256 id, uint24 color, string wish) | write, payable | Lays a tile at id. Attach ETH to donate. |
tileOf(uint256 id) | view | Returns (giver, color, laidAt, wish). Reverts for an empty spot. |
getRange(uint256 start, uint256 count) | view | Returns givers[] and colors[] for a span of spots. Empty spots return zero values. Reverts if the span leaves the roof. |
coordinates(uint256 id) | pure | Returns (x, y) for a spot id. |
tileSVG(uint256 id) | view | Returns the sumaksae artwork as an SVG string. |
tokenURI(uint256 id) | view | Returns the base64 JSON metadata data URI. Reverts for an empty spot. |
laidCount() | view | Number of tiles laid so far, from 0 to 2048. |
tilesLaidBy(address) | view | Number of tiles this address has laid. Capped at 16. |
roofFund() | view | Address that receives donations. |
ownerOf, balanceOf, approve, getApproved, setApprovalForAll, isApprovedForAll, transferFrom, safeTransferFrom | ERC-721 | Standard token functions. ownerOf reverts for an empty spot. |
supportsInterface(bytes4) | pure | ERC-165 check for ERC-165, ERC-721 and ERC-721 Metadata. |
name(), symbol() | view | CHEOMA and TILE. |
WIDTH, HEIGHT, TOTAL_TILES, MAX_PER_WALLET, MAX_WISH_BYTES, MILESTONE | constants | 64, 32, 2048, 16, 140, 256. |
Events
| Event | Emitted 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, ApprovalForAll | Approvals are set or changed. |
Revert messages
| Message | Meaning |
|---|---|
off the roof | id is 2048 or higher. |
tile taken | The spot is already laid. |
wish too long | The wish is more than 140 bytes. |
wallet cap | Your wallet has already laid 16 tiles. |
donation failed | The ETH forward to roofFund was rejected. |
empty spot | A read or transfer targeted a spot nobody has laid. |
range | getRange asked for spots past the end of the roof. |
wrong from, not allowed, to=0, unsafe receiver | The 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
| Path | What it is |
|---|---|
src/Cheoma.sol | The whole contract. No external dependencies. |
test/Cheoma.t.sol | Foundry test suite (14 tests). |
script/Deploy.s.sol | Deployment 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-std | Foundry 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.solhas no owner, no pause and no upgrade path. The only fixed setting is theroofFundaddress. - Public RPC dependency. The app reads from public RPC endpoints. If they are unreachable, it keeps the last state it loaded.
Roadmap
These are plans, not commitments. For the full pitch, see the deck and the one-pager.
| Stage | Plan |
|---|---|
| Now | Testnet MVP live on GIWA Sepolia, with a verified contract and the live app. |
| Next | GIWA 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. |
| Mainnet | Paid donation tiles with a small protocol fee, collab and seasonal roofs. Donations would fund Korean public goods and ecosystem grants. |
| Later | A multi-roof platform, where any community can raise its own roof. |