Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
/**
* Compile contracts/ERC20.sol into a committed artifact (contracts/ERC20.json)
* holding the ABI and creation bytecode that `hood deploy-token` deploys.
*
* Reproducible: pin solc 0.8.28, optimizer 200 runs. Regenerate with
* npm i -D [email protected] && npm run compile-erc20
* (solc is not a runtime dependency — the artifact is committed and shipped.)
*/
import { readFileSync, writeFileSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
import { dirname, join } from 'node:path'
import { createRequire } from 'node:module'
const require = createRequire(import.meta.url)
const solc = require('solc')
const here = dirname(fileURLToPath(import.meta.url))
const root = join(here, '..')
const source = readFileSync(join(root, 'contracts/ERC20.sol'), 'utf8')
const input = {
language: 'Solidity',
sources: { 'ERC20.sol': { content: source } },
settings: {
optimizer: { enabled: true, runs: 200 },
evmVersion: 'paris',
outputSelection: { '*': { '*': ['abi', 'evm.bytecode.object'] } },
},
}
const output = JSON.parse(solc.compile(JSON.stringify(input)))
const errors = (output.errors ?? []).filter((e) => e.severity === 'error')
if (errors.length) {
for (const e of errors) console.error(e.formattedMessage)
process.exit(1)
}
const contract = output.contracts['ERC20.sol'].HoodToken
const artifact = {
contractName: 'HoodToken',
source: 'contracts/ERC20.sol',
compiler: { name: 'solc', version: solc.version(), optimizer: { enabled: true, runs: 200 }, evmVersion: 'paris' },
abi: contract.abi,
bytecode: `0x${contract.evm.bytecode.object}`,
}
writeFileSync(join(root, 'contracts/ERC20.json'), JSON.stringify(artifact, null, 2) + '\n')
// Emit a typed TS module so the bundled CLI carries the artifact inline (no
// JSON-file resolution at runtime, no import-outside-rootDir warnings).
const ts =
`// AUTO-GENERATED by scripts/compile-erc20.mjs from contracts/ERC20.sol — do not edit.\n` +
`// Compiler: ${artifact.compiler.version}, optimizer 200 runs, evmVersion paris.\n` +
`import type { Abi } from 'viem'\n\n` +
`export const HOOD_TOKEN_ABI = ${JSON.stringify(artifact.abi)} as const satisfies Abi\n\n` +
`export const HOOD_TOKEN_BYTECODE = '${artifact.bytecode}' as const\n\n` +
`export const HOOD_TOKEN_COMPILER = ${JSON.stringify(artifact.compiler)} as const\n`
writeFileSync(join(root, 'src/generated/erc20.ts'), ts)
console.log(`compiled HoodToken with ${solc.version()} → contracts/ERC20.json + src/generated/erc20.ts (${artifact.bytecode.length / 2 - 1} bytes)`)