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.
The AstaVerde platform uses a Dutch auction mechanism for pricing carbon credit batches. Here are the key features of the auction:
basePrice
(default: 230 USDC) per unit.priceFloor
(default: 40 USDC) per unit is enforced for all batches.priceDecreaseRate
(default: 1 USDC) per day for unsold tokens.basePrice
for new batches is adjusted based on recent sales:
dayIncreaseThreshold
days (default: 2) of the last price adjustment, the basePrice
increases by priceDelta
(default: 10 USDC).dayDecreaseThreshold
days (default: 4), the basePrice
decreases according to the daily reduction rate.100 - platformSharePercentage
% (default: 70%) of each sale goes to the token producer, while platformSharePercentage
% (default: 30%) goes to the platform.The smart contract owner can adjust various parameters, including:
platformSharePercentage
: The percentage of sales that goes to the platformmaxBatchSize
: The maximum number of tokens in a batchbasePrice
: The starting price for new batchespriceFloor
: The minimum price for tokenspriceDelta
: The amount by which the base price increases after a quick salepriceDecreaseRate
: The daily price reduction ratedayIncreaseThreshold
: The number of days within which a sale triggers a price increasedayDecreaseThreshold
: The number of days without sales that trigger a price decreaseThese 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.
Clone the repository:
git clone git@github.com:orpheuslummis/AstaVerde.git
cd AstaVerde
Install dependencies:
npm install
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.
Compile the contracts:
npm run compile
Start a local Hardhat node:
npm run node
In a new terminal, deploy contracts to the local network:
npm run deploy:local
Start the webapp in development mode:
npm run webapp:dev
(Optional) For automatic recompilation and redeployment on contract changes:
npm run watch:dev
(Optional) For local minting:
npm run task:mintlocal
OWNER_ADDRESS=0x... p deploy:testnet
git clone git@github.com:orpheuslummis/AstaVerde.git && cd AstaVerde
./deploy.sh
./mint.sh
Deploy contract on testnet:
npm run test
npm run compile && npm run postinstall
npm run deploy:contracts -- --network base-sepolia
Set environment variables on Vercel:
.env.local
file with the correct paths.npm run task:mint
/scripts/events/index.mjs
.npm run task:events
When updating the contract, remember to update the contract address and ABI in:
webapp/src/lib/contracts.ts
scripts/events/contracts.mjs
.env.local
for minting scriptsThis project is licensed under the MIT License - see the LICENSE file for details.
.env.local
and webapp/.env.local
files are up to date and never committed to the repository.