This project demonstrates a smart contract for tracking Twitter engagement and rewarding creators with NFTs. The contract is deployed on the Monad testnet.
Monad testnet: 0x5FbDB2315678afecb367f032d93F642f64180aa3
-
Install dependencies:
pnpm install
-
Compile the contracts:
pnpm hardhat compile
-
Deploy the contracts to the Monad testnet:
pnpm hardhat run scripts/deploy.js --network monadTestnet
-
Verify the deployment:
pnpm hardhat verify --network monadTestnet <DEPLOYED_CONTRACT_ADDRESS>
-
Start a local node:
pnpm hardhat node
-
Deploy the contract locally:
pnpm hardhat run scripts/deploy.js --network localhost
-
Interact with the contract using the Hardhat console:
pnpm hardhat console --network localhost
Example commands:
const Momo = await ethers.getContractFactory("Momo"); const momo = await Momo.attach("<DEPLOYED_CONTRACT_ADDRESS>"); // Take a tweet snapshot await momo.takeTweetSnapshot( "0xCreatorAddress", "tweetId123", 1000, // views 100, // retweets 50, // comments 200, // likes "https://metadata.url" ); // Get creator's score const score = await momo.getCreatorScore("0xCreatorAddress"); console.log("Creator's score:", score.toString());
-
Pause the contract:
await momo.pauseEvent();
-
Restart the contract:
await momo.restartEvent();
-
Update multipliers:
await momo.updateMultipliers(2, 3, 1);
-
Update NFT metadata:
await momo.updateNFTMetadata( 1, // tokenId 1500, // views 200, // retweets 100, // comments 300, // likes "https://new.metadata.url" );
Run the tests:
pnpm hardhat test
This project is licensed under the MIT License.