On-chain price board that stores token prices and renders a small SVG dashboard. Built with Foundry for quick local iteration and testing.
- Owner-managed price registry; symbols are case-sensitive and reverts on empty input.
- Emits
PriceUpdatedfor every write; keeps an ordered list of symbols for deterministic SVG rows. - Renders a dark, monospace SVG card showing every tracked symbol/value pair and reverts if no prices exist.
- Install Foundry (
forge,cast):curl -L https://foundry.paradigm.xyz | bashthenfoundryup. - Install deps (includes
forge-std):forge install. - Run tests:
forge test. - Format (if you touch Solidity):
forge fmt.
- Deploy:
forge create src/PriceSVG.sol:PriceSVG --rpc-url $RPC_URL --private-key $PK. - Update a price (owner only):
cast send $ADDRESS "setPrice(string,int256)" "ETH" 1800 --rpc-url $RPC_URL --private-key $PK. - Read a price:
cast call $ADDRESS "priceOf(string)(int256,bool)" "ETH" --rpc-url $RPC_URL. - Render SVG:
cast call $ADDRESS "svg()(string)" --rpc-url $RPC_URL.
src/PriceSVG.sol: Contract logic for storing prices and composing the SVG output.test/PriceSVG.t.sol: Coverage for owner writes, empty symbols, missing prices, and SVG content.foundry.toml: Build/profile config (Solidity 0.8.23, optimizer enabled).remappings.txt,lib/: Dependency wiring forforge-std.scripts/: Reserved for future deployment/interaction scripts.