AstaVerde is a platform for the trading of verified carbon offsets as non-fungible tokens (NFTs). It is built on Ethereum as an ERC-1155 smart contract. Each carbon credit is part of a batch. The batch follows a Dutch Auction mechanism.
The auction starts at 230 USDC/unit and decays linearly over four days to a floor price of 40 USDC/unit. The price is recalculated every 24 hours using a specific formula. Buyers can purchase at any time within the auction window, but they must buy the entire batch.
- Credit Producers: Generate and verify carbon offsets, then list them as NFTs.
- Platform Owner: Mints new batches of NFTs and manages the auction.
- Buyers: Bid on and purchase batches of NFTs.
Wallet. We recommend Metamask to interact with the webapp ETH for transaction fee USDC for buying batches
Interact with the platform via EcoTradeZone. As a Credit Producer, generate and verify carbon offsets, then list them. As a Buyer, browse available batches and use the buyBatch function to purchase. As the Platform Owner, maintain the smart contract, mint new batches, and oversee the auction.
Pause the market if USDC becomes depegged.
Understand the smart contract implementation, identify potential improvements or security vulnerabilities, and contribute to the codebase by implementing new features or optimizations.
The contract AstaVerde.sol includes functions for setting the platform share percentage, price floor, starting price, and maximum batch size. It also includes functions for minting batches, getting the current price, buying batches, and redeeming tokens. The contract uses OpenZeppelin's ERC1155, ERC1155Burnable, Ownable, Pausable, and ReentrancyGuard contracts
Obtain and run tests locally:
git clone git@github.com:orpheuslummis/AstaVerde.git
cd AstaVerde
npm i
npm run test
Deploy contract on testnet:
npm run test
npm run compile && npm run postinstall
npm run deploy:contracts -- --network base-sepolia
Configuring and minting:
cp .env.example .env
- Fill out the parameters in
.env
(PRIVATE_KEY, ALCHEMY_APIKEY, etc) - Obtain CSV and image folder
npm run task:mint
Reading events:
- Go to
/scripts/events/index.mjs
and follow the instructions to update the default values - Run
npm run task:events