This repository contains the smart contracts for the FOOM platform's content verification and publishing system.
GeniusToken.sol: ERC20 token contract used for content publishing and verification, created per each GeniusFoomGeniusAnswer.sol: Main contract for managing verified content publishing
- Clone the repository
- Install dependencies:
forge installforge buildRun tests:
forge testRun tests with gas reporting:
forge test --gas-reportRun tests with more verbosity:
forge test -vvv- Create a
.envfile with your private key:
echo "PRIVATE_KEY=your_private_key_here" > .env- Deploy to a network:
Testnet (Sepolia):
forge script script/Deploy.s.sol:DeployScript --rpc-url $SEPOLIA_RPC_URL --broadcast --verify -vvvvMainnet:
forge script script/Deploy.s.sol:DeployScript --rpc-url $MAINNET_RPC_URL --broadcast --verify -vvvvThe deployment script automatically verifies contracts if you use the --verify flag. Make sure you have set up your API keys:
export ETHERSCAN_API_KEY=your_etherscan_api_keyThe deployment configuration can be modified in script/Deploy.s.sol:
INITIAL_SUPPLY: Initial supply of genius tokens (default: 1 billion)INITIAL_PUBLISH_COST: Initial cost to publish an answer (default: 100 tokens)
- The contracts use OpenZeppelin's secure implementations
- ReentrancyGuard is implemented to prevent reentrancy attacks
- Token burning mechanism is implemented using transfer to address(0)
- Access control is implemented using Ownable
MIT