# aORC Contract Deployment — Algorand Mainnet Deploy the aORC Minter and Registry contracts to Algorand mainnet. ## Prerequisites ```bash npm install algosdk tsx ``` You need an Algorand account with at least 3 ALGO. Algorand is inexpensive — transactions cost 0.001 ALGO. ## Auto Deploy ```bash cd contracts/ # Set your deployer mnemonic and run ALGO_MNEMONIC="word1 word2 word3 ... word25" npx tsx deploy.ts ``` The deployer will: 1. Deploy **aORC Minter** contract (NFT mint registration) 2. Deploy **aORC Registry** contract (chain verification + box storage) 3. Fund both contracts (1 ALGO minter, 5 ALGO registry for box MBR) 4. Verify both are on-chain and readable 5. Print App IDs for frontend config 6. Save results to `deploy-result.json` Output: ``` ======================================== DEPLOYMENT COMPLETE ======================================== Minter App ID: 12345678 Registry App ID: 12345679 Frontend config (browser console): localStorage.setItem('aORC_minterAppId', '12345678'); localStorage.setItem('aORC_registryAppId', '12345679'); ``` ## Verify Existing Deployment ```bash ALGO_MNEMONIC="..." npx tsx deploy.ts verify 12345678 ``` Shows creator, balance, min balance, and global state. ## Frontend Configuration After deploying, set App IDs in the live site. Either: **Option A — Browser console** (per device): ```javascript localStorage.setItem('aORC_minterAppId', '12345678'); localStorage.setItem('aORC_registryAppId', '12345679'); ``` **Option B — Hardcode** (in `minter.html` and `register.html`): ```javascript const MINTER_APP_ID = 12345678; const REGISTRY_APP_ID = 12345679; ``` ## Contracts Overview ### aORC Minter (`aORC-minter.algo.ts`) - Registers NFT mints on-chain - Sender-mints pattern: user creates ASA, contract validates + logs - 0.001 ALGO per mint - Deploy cost: ~0.5 ALGO ### aORC Registry (`aORC-registry.algo.ts`) - On-chain chain verification registry - Box storage for connection data (RPCs, explorers, currency) - 1 ALGO per chain listing / verification - Deploy cost: ~0.5 ALGO + box MBR ## Costs Summary | Action | Cost | |--------|------| | Deploy both contracts | ~1 ALGO | | Fund minter | 1 ALGO | | Fund registry (box MBR) | 5 ALGO | | **Total initial** | **~7 ALGO** | | Per NFT mint | 0.001 ALGO | | Per chain listing | 1 ALGO | | Per chain verification | 1 ALGO | ## Compilation If you need to compile from source first: ```bash # Install Puya TypeScript compiler npm install -g @algorandfoundation/puya-ts # Compile both contracts npx puya-ts aORC-minter.algo.ts npx puya-ts aORC-registry.algo.ts ``` This produces TEAL files in `output/` which `deploy.ts` reads. ## Explorer Links After deployment, view your contracts on Pera Explorer: ``` https://explorer.perawallet.app/application/ ```