A complete step-by-step guide to deploying all 6 KLEAN-KUT smart contracts to Ethereum Mainnet using Foundry. From zero to live in under 20 minutes.
Foundry is the Solidity-native development toolkit used to deploy the contracts. Install it with a single command.
curl -L https://foundry.paradigm.xyz | bash && foundryup
After running, close and reopen your terminal, then run foundryup.
Copy .env.example to .env and fill in your three credentials: deployer private key, Alchemy/Infura RPC URL, and Etherscan API key.
DEPLOYER_PRIVATE_KEY=your_private_key_without_0x MAINNET_RPC_URL=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY ETHERSCAN_API_KEY=YOUR_ETHERSCAN_KEY
Never share your .env file. Your private key gives full control of the deployer wallet.
Execute the single deployment command. Foundry will deploy all 6 contracts in sequence, verify them on Etherscan, and print all contract addresses.
forge script script/DeployKleanKut.s.sol:DeployKleanKut \ --rpc-url $MAINNET_RPC_URL \ --private-key $DEPLOYER_PRIVATE_KEY \ --broadcast \ --verify \ --etherscan-api-key $ETHERSCAN_API_KEY \ -vvvv
Deployment takes 5-15 minutes. You need ~0.1-0.3 ETH in your deployer wallet for gas.
After deployment, the script prints a summary of all 6 deployed contract addresses. Save these - they are your permanent on-chain assets.
KleanKutTreasury: 0x... KleanKutInsurance: 0x... KleanKutReputation: 0x... KleanKutLending: 0x... KleanKutRWA: 0x... KleanKutAgentLayer: 0x...
Verify all contracts at etherscan.io to confirm successful deployment and source code verification.