orpheuslummis / AstaVerde

NFT marketplace for carbon offsets uses Dutch auctions for pricing, batch minting, and redemption of certified credits.
https://asta-verde.vercel.app
2 stars 1 forks source link
carbon-credits dutch-auction erc1155

AstaVerde

AstaVerde is a platform for trading verified carbon offsets as non-fungible tokens (NFTs). Built on Ethereum using the ERC-1155 standard, it employs a Dutch Auction mechanism for pricing carbon credit batches.

Dutch Auction Mechanism

The AstaVerde platform uses a Dutch auction mechanism for pricing carbon credit batches. Here are the key features of the auction:

The smart contract owner can adjust various parameters, including:

These parameters allow for fine-tuning of the auction mechanism to respond to market conditions and platform requirements. The contract owner can modify these values using specific setter functions provided in the smart contract.

User Roles

Prerequisites

Local Development Setup

  1. Clone the repository:

    git clone git@github.com:orpheuslummis/AstaVerde.git
    cd AstaVerde
  2. Install dependencies:

    npm install
  3. Set up environment variables:

    cp .env.local.example .env.local
    cp ./webapp/.env.local.example ./webapp/.env.local

    Edit .env.local and webapp/.env.local with your specific private values.

  4. Compile the contracts:

    npm run compile
  5. Start a local Hardhat node:

    npm run node
  6. In a new terminal, deploy contracts to the local network:

    npm run deploy:local
  7. Start the webapp in development mode:

    npm run webapp:dev
  8. (Optional) For automatic recompilation and redeployment on contract changes:

    npm run watch:dev
  9. (Optional) For local minting:

    npm run task:mintlocal

Deployment

Deploy for an owner address

Using Docker

  1. Install Docker Desktop from https://docs.docker.com/desktop/install/mac-install/
  2. Clone the repository:
    git clone git@github.com:orpheuslummis/AstaVerde.git && cd AstaVerde
  3. To deploy: Configure and run ./deploy.sh
  4. To mint: Configure and run ./mint.sh

Manual Deployment

  1. Deploy contract on testnet:

    npm run test
    npm run compile && npm run postinstall
    npm run deploy:contracts -- --network base-sepolia
  2. Set environment variables on Vercel:

    • CHAIN_SELECTION
    • ALCHEMY_API_KEY
    • WALLET_CONNECT_PROJECT_ID

Minting

  1. Prepare a CSV file with token metadata and an image folder.
  2. Update the .env.local file with the correct paths.
  3. Run npm run task:mint

Reading Events

  1. Update default values in /scripts/events/index.mjs.
  2. Run npm run task:events

Updating the Contract

When updating the contract, remember to update the contract address and ABI in:

License

This project is licensed under the MIT License - see the LICENSE file for details.

Security