This is the NFT smart contract for the Stars project, which enables authors to tokenize their articles as NFTs.
- Mint article NFTs with customizable parameters
- Set royalty fees for secondary sales
- Control maximum supply per article
- Option to limit one NFT per address
- Platform fee mechanism (10%)
Network | Contract Address | Chain ID |
---|---|---|
Ethereum Sepolia | 0x5c83f2287833F567b1D80D7B981084eb5CaeF445 | 11155111 |
Telos Testnet | 0x903e48Ca585dBF4dFeb74f2864501feB6f0dF369 | 41 |
Edu Testnet | 0xcA3Dbe8eF976e606B8c96052aaC22763aDeAEE0A | 656476 |
This project uses Hardhat for development and testing.
npm install
# Run all tests
npx hardhat test
# Run specific test file
npx hardhat test test/ArticleNFT.test.js
# Start local node
npx hardhat node
# Deploy to local network
npx hardhat run scripts/deploy.js --network localhost
npx hardhat run scripts/deploy.js --network sepolia
-
Get test TLOS from faucet:
- Visit https://app.telos.net/testnet/faucet
- Enter your wallet address
- Request test tokens
-
Deploy contract:
npx hardhat run scripts/deploy.js --network telosTestnet
-
Ensure you have TLOS in your wallet for deployment
-
Deploy contract:
npx hardhat run scripts/deploy.js --network telosMainnet
npx hardhat verify --network sepolia <CONTRACT_ADDRESS>
Contract verification can be done on the Telos testnet explorer: https://testnet.teloscan.io/
- Get the flattened contract:
npx hardhat flatten contracts/ArticleNFT.sol > ArticleNFTFlat.sol
- Go to Telos Explorer:
- Visit https://www.teloscan.io/
- Find your contract
- Click "Verify & Publish"
- Select Solidity Single File
- Compiler Version: v0.8.28
- Optimization: Yes (200 runs)
- License: MIT
- Paste the flattened contract code
- Submit for verification
- Local Testing:
# Start local node in one terminal
npx hardhat node
# Deploy in another terminal
npx hardhat run scripts/deploy.js --network localhost
# Run tests
npx hardhat test
- Testnet Testing:
# Deploy to testnet
npx hardhat run scripts/deploy.js --network telosTestnet
# Interact using console
npx hardhat console --network telosTestnet
# In console:
> const ArticleNFT = await ethers.getContractFactory("ArticleNFT")
> const articleNFT = await ArticleNFT.attach("DEPLOYED_CONTRACT_ADDRESS")
> const [owner] = await ethers.getSigners()
> await articleNFT.owner() // Should return your address
MIT