Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/partial carbon retirement collect module #2

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,22 @@ Tagline: **Lens collect partial carbon retirements**

## Implementation

### Partial carbon retirement collect module (PCRCM)
- use KlimaDAO's retirement aggregator (RA) for maximum flexibility https://github.com/KlimaDAO/klimadao-solidity/tree/main/src/infinity
- RA performs the token swap from collect currency to carbon token and the token retirement
- allow any collect currency that is whitelisted by Lens and any carbon token that is included in the RA
- at module init, check if swap path & liquidity exists. If not, revert.
- at collect process, check if swap path & liquidity exists. If not:
- process collect without retirement (do not revert)
- send retirement amount to publisher, deduct treasury fee, but send an event on blockchain to signal to publisher that they should perform retirement manually to cover all such failed retirements.
- include retirement messages to make it possible to search for all retirements by a Lens profile, publication

### Frontend
- follow Lenster
- Set collection rule: choose "carbon percentage" instead of everything
- Collection workflow: make visible that collection will retire carbon

# Repository structure

The repo consists of different more or less dependent folders. Each one contains an own readme.

- **hardhat**:
- **lens-app**: A separate frontend from the hackathon
- **lens-protocol**: Local copy of github/lens-protocol, contains all functionality of lens protocol and our smart contracts
- **lenster-main**: Local copy of github/lenster, frontend of Lenster with our modifications
- **utils**: Folder with helper stuff

# Deployments
## Lenster app local deployment (Frontend)
See readme in lenster-main

## Deploy Lens protocol on local fork (Smart Contracts)
See readme in lens-protocol
14 changes: 11 additions & 3 deletions lens-app/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@
import './globals.css'
import { configureChains, createClient, WagmiConfig } from 'wagmi'
//import { mainnet, polygon } from 'wagmi/chains'
import { goerli, polygonMumbai } from 'wagmi/chains'
import { polygon, polygonMumbai, localhost } from 'wagmi/chains'
import { publicProvider } from 'wagmi/providers/public'
import { LensProvider, LensConfig, development } from '@lens-protocol/react-web'

import { LensProvider, LensConfig, development, production } from '@lens-protocol/react-web'
import { bindings as wagmiBindings } from '@lens-protocol/wagmi'
//const { provider, webSocketProvider } = configureChains([polygon, mainnet], [publicProvider()])
const { provider, webSocketProvider } = configureChains([polygonMumbai, goerli], [publicProvider()])
const { provider, webSocketProvider } = configureChains(
[
//polygonMumbai,
//polygon,
localhost],
[publicProvider()]
)

const client = createClient({
autoConnect: true,
Expand All @@ -17,6 +24,7 @@ const client = createClient({

const lensConfig: LensConfig = {
bindings: wagmiBindings(),
//environment: development,
environment: development,
};

Expand Down
139 changes: 89 additions & 50 deletions lens-app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions lens-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"eslint": "8.42.0",
"eslint-config-next": "13.4.4",
"ethers": "^5.7.2",
"next": "13.4.4",
"next": "^13.4.19",
"postcss": "8.4.24",
"react": "18.2.0",
"react-dom": "18.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tailwindcss": "3.3.2",
"typescript": "5.1.3",
"wagmi": "^0.12.7"
Expand Down
Loading