KlimaDAO
  • Welcome to KlimaDAO
  • What is KlimaDAO?
  • Why KlimaDAO Exists
  • 🌍Ecosystem
    • Digital Carbon
    • Carbon Pools
    • The Role of KlimaDAO
  • ⚙️Economics
    • Overview
    • Operational Mechanics
      • Intrinsic Value
      • Protocol Owned Liquidity (POL)
      • Fungible Carbon Credits
    • Dynamics
      • Supply Expansion
      • Supply Contraction
      • Green Ratio
    • Purpose
      • Means of Exchange
      • Store of Value
      • Unit of Account
  • 🛠️Developers
    • Overview
    • Retirement Aggregator
    • Automation
    • Bug Bounty
    • Contracts
      • DAO Wallet
      • Policy
      • Retirement
        • V2 - Diamond
          • Generalized Retirement
          • Bridge-Specific Tooling
      • Staking
      • Tokens
      • Treasury
    • Data Sources
    • Deployment Addresses
    • Guides
      • Stake KLIMA
      • Wrap sKLIMA
      • Retire Carbon
      • Retirement Aggregator V1 Contract Guide
      • Retirement UI Integration Guide
    • Integration Examples
    • Testing
  • 🔄Auto Compounder
    • Auto Compounder App Guide
    • Auto Compounder FAQ
  • 🏛️DAO
    • Governance Framework
    • Organizational Structure
  • 📚References
    • FAQ
    • History
    • Glossary
    • Links
    • Translations
    • FAQ Carbon Markets
    • About Verified Carbon Credits
    • Estimating Carbon Emissions
  • 🙋‍♀️Get Involved
    • Community Discord
    • Governance Forum
    • Contact Us
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Developers
  2. Contracts
  3. Retirement

V2 - Diamond

PreviousRetirementNextGeneralized Retirement

Last updated 1 year ago

Was this helpful?

The second version of the KlimaDAO retirement tooling is an implementation of an multi-facet proxy that allows for a unified experience against one contract address while utilizing logic from multiple other contracts. In addition, the developer experience is made more intuitive as certain parameters were abstracted away.

All facets and internal libraries share a common storage space using the AppStorage pattern.

Main diamond contract is deployed to 0x8cE54d9625371fb2a068986d32C85De8E6e995f8 on Polygon.

  • View on

  • View on

There are currently two main types of facets within the Diamond.

  • Generalized Retirement

  • Bridge Specific Tooling

The General Retirement functions should be sufficient for all retirement calls. However, Bridge Specific Tooling becomes useful for Redeem functions and allows for explicit specification of the retiringEntityString , set by default to "KlimaDAO Retirement Aggregator".

All retirement transactions initiated through this contract emit the following event.

event CarbonRetired(
    LibRetire.CarbonBridge carbonBridge,
    address indexed retiringAddress,
    string retiringEntityString,
    address indexed beneficiaryAddress,
    string beneficiaryString,
    string retirementMessage,
    address indexed carbonPool,
    address carbonToken,
    uint256 retiredAmount
);
Field
Type
Description

carbonBridge

LibRetire.CarbonBridge

This enum is used for the source of the carbon retired.

retiringAddress

Address

Address calling the retirement. Currently the msg.sender value for the retiring transaction.

retiringEntityString

String

String representation of the retiring entity calling the transaction.

beneficiaryAddress

Address

Address for the beneficiary of the retirement. Any NFT certificates created during the retirement will be sent to this address.

beneficiaryString

string

String representation of the beneficiary.

retirementMessage

string

Specific message related to this retirement.

carbonPool

address

Carbon pool token used to retire. If none, the zero address is used.

carbonToken

address

The token address for the specific carbon project token being retired. If none, the zero address is used.

retiredAmount

uint256

Amount of carbon retired. This uses the token's native decimals.

🛠️
0 = TOUCAN
1 = MOSS
2 = C3
EIP-2535
Generalized Retirement
Louper
Polygonscan