Skip to content

d347h-eth/terraforms-fanpack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Terraforms by Mathcastles

About this repo

This is unofficial/fan repo with Terraforms source code, useful tooling and documentation.

Quick start (Foundry)

  • clone repo
  • init submodules:
git submodule update --init --recursive
  • build:
forge build

Project structure

.
├── artifacts/
├── docs/
├── lib/
├── scripts/
└── src/
  • artifacts: storage for pretty-formatted artifacts for quick access
    • animation-v0.js: animation script for V0 rendered token
    • animation-v2.js: animation script for V2 rendered token
    • blades.js: JSON dump of all blade patterns for each token
    • response-tokenURI.json: example JSON with tokenURI() response from the main contract
  • docs: AI-generated documentation
    • beacon.md: Beacon/Satellite/Antenna system
    • events.md: all events Terraforms can emit (including V2)
    • reference.md: full public/private API reference
  • lib: dependencies from OpenZeppelin and Forge standard libraries required for Terraforms compilation
  • scripts
    • perlin_noise_audit: script & report with analysis of PerlinNoise.sol to verify that there's no hidden data in the noise
    • getparcel/: TypeScript + viem CLI to fetch a parcel's HTML/SVG (current state or any variation)
    • video_capture/: headless Chromium + ffmpeg pipeline to record Terraforms HTML into MP4 (see its README for full details)
  • src: smart contracts
    • interfaces/: contract interfaces
    • lib/: shared libraries (e.g., Base64.sol, ToString.sol, Types.sol)
    • Key contracts: Terraforms.sol, TerraformsData.sol, TerraformsSVG.sol
    • V2 rendering and the Beacon system: TerraformsData_v2_0.sol, TerraformsBeacon_v2_0.sol (source for TerraformsSVG_v2_0.sol remains private so far)

Use scripts/getparcel to fetch parcel content

Requirements:

  • Node 20+
  • npm install inside scripts/getparcel

You can control which JSON-RPC node to call with $ETH_RPC_URL (defaults to a public mainnet endpoint).

  1. Install and fetch parcel #1 in the current state:
cd scripts/getparcel
npm install
npm run getparcel -- 1
  1. See full usage (any version/state/canvas):
npm run getparcel -- --help
  1. Example with custom canvas (1024 decimal digits), renderer index, and status:
npm run getparcel -- 5308 --status terraformed --version 2 --canvas "<1024 decimals>"

Use scripts/video_capture to record Terraforms HTML animations

This Node/Puppeteer + ffmpeg script loads any standalone Terraforms HTML and writes frames plus capture.mp4 under tmp/capture_<timestamp>.

cd scripts/video_capture
npm install
NODE_OPTIONS=--expose-gc npm run capture -- path/to/animation.html

Full options, pipeline notes, and customization tips live in scripts/video_capture/README.md.

Contract addresses

When calling implementation ABIs, use the proxy address as the target; storage lives at the proxy.

Original

V1

V2

About

Unofficial fanpack of "Terraforms by Mathcastles": smart contracts, tools and documentation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors