First & Based
Be the first person to mint a unique NFT in each new block on Base
Overview
First & Based is an generative NFT collection experiment, where each NFT represents a unique Base block. The uniqueness is enforced by tying the NFT's identifier (token ID) directly to the Base block number at the time of minting. This creates an exclusive opportunity for users to claim a specific block's NFT.
Contracts
FirstBased.sol
- An ERC-721 NFT contract where each token represents a unique Base block.
- The contract allows for the minting of NFTs, where each token is associated with the block number as its unique identifier.
- Inherits from OpenZeppelin's
ERC721
andOwnable
.
MetadataRenderer.sol
- A contract that implements the
IMetadataRenderer
interface. - Responsible for generating on-chain SVG images and metadata for each
FirstBased
NFT. - SVG images include the phrase "1ST ONCHAIN" followed by the Ethereum block number at which the NFT is minted.
IMetadataRenderer.sol
- An interface outlining the functions for a metadata renderer, used by
FirstBased
.
Base64.sol
- A utility library for Base64 encoding, used in
MetadataRenderer
for encoding SVG images and metadata.
Installation
To get started with this project, clone the repository and install the dependencies:
git clone https://github.com/wbnns/first-and-based.git
cd first-based
npm install
Deployment
The contracts are deployed using Hardhat. To deploy the contracts:
- Set up your
hardhat.config.js
with the desired network configurations. - Compile the contracts using
npx hardhat compile
. - Run the deployment script:
npx hardhat run scripts/deploy.js --network <network-name>
Verification
After deployment, verify the FirstBased
contract on Basescan by providing the constructor arguments used during the deployment process.
Contributing
Based contributions to the First and Based are welcome! To contribute:
- Fork the repository.
- Create a new branch for your feature (
git checkout -b feature/BasedFeature
). - Commit your changes (
git commit -m 'Add some BasedFeature'
). - Push to the branch (
git push origin feature/BasedFeature
). - Open a pull request.
Repository Structure
contracts/
: Contains the Solidity contracts.scripts/
: Contains the deployment script.test/
: Contains the tests for the contracts (if applicable).hardhat.config.js
: Hardhat configuration file.
License
This project is licensed under the MIT License.