Smart contracts for the Nocena challenge completion platform.
npm install
npx hardhat compile
npx hardhat testCreate .env file:
PRIVATE_KEY=0x_your_private_key_hereERC20 token earned through challenge completions.
- Symbol: NCT
- Decimals: 18
- Minting: Authorized minter only
- Ownership: Automatically renounced after deployment
Manages reward distribution for AI-verified challenges.
- Daily: 100 NCT (24h cooldown)
- Weekly: 500 NCT (7d cooldown)
- Monthly: 2500 NCT (30d cooldown)
- Security: Backend-signed proofs, replay protection, reentrancy protection
// Complete daily challenge
challengeRewards.completeDailyChallenge(ipfsHash, signature);
// Complete weekly challenge
challengeRewards.completeWeeklyChallenge(ipfsHash, signature);
// Complete monthly challenge
challengeRewards.completeMonthlyChallenge(ipfsHash, signature);npx hardhat test # Run all tests
npx hardhat test test/Nocenite.test.js # Test NCT token
npx hardhat test test/ChallengeRewards.test.js # Test rewardsnpx hardhat node # Start local node
npx hardhat run scripts/deploy.js --network localhostnpx hardhat run scripts/deploy.js --network flowTestnetThe deployment script automatically:
- Deploys Nocenite with deployer as owner
- Deploys ChallengeRewards with backend signer and deployer as owner
- Sets ChallengeRewards as authorized minter on Nocenite
- Renounces Nocenite ownership for full decentralization