shunkakinoki / madfi-sponsor-module

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

madfi-sponsor-module

A Lens Reference Module that enables real-time monetization of your content.

Frontend repo: https://github.com/c0rv0s/madfi-fe

Forked lens repo (for local dev): https://github.com/imthatcarlos/lens-protocol/tree/feature/madfi-sponsor-module

Attempt at adding to LenHub updatePostWithSig(): imthatcarlos/lens-protocol#1

setup

first - clone and install lens-protocol repo, then create a symlink

git clone git@github.com:aave/lens-protocol.git
npm link

then clone this repo and link

nvm use
yarn
npm link lens-protocol

compile contracts

yarn compile

deploy contracts

yarn deploy:mumbai

local lens protocol setup

  1. clone my forked lens repo (branch: feature/madfi-sponsor-module)

  2. spin up the docker container with their contracts env, and run hardhat node in there

export USERID=root && docker-compose build && docker-compose run -p 8545:8545 contracts-env bash

...

npx hardhat node
  1. find the docker container name with docker ps and run another bash session
export USERID=root && docker exec -it <docker-container-name> bash
  1. deploy their contracts npm run compile && npm run full-deploy-local

  2. come back here and deploy the superfluid protocol + sponsor module yarn compile && npx hardhat deploy-superfluid --network docker && yarn deploy:docker

  3. back in the docker container, whitelist the deployed sponsor module with npx hardhat whitelist-sponsor-module --network localhost

  4. assuming that worked, you have to unpause the lens protocol with npx hardhat unpause --network localhost

  5. back in this repo, you can create a profile (make sure to set some ENV variables defined .env.template) by running npx hardhat create-profile --network docker. also create another profile for the sponsor by changing the handle and using the signer for sponsor (line 24 in create-profile.ts)

  6. finally, create a post and attach our deployed SponsorModule as the reference module npx hardhat create-post --network docker

  7. create a money stream between the sponsor and the user for the user's latest publication, and then the sponsor attempts to mirror it npx hardhat create-mirror --network docker

ezoic increase your site revenue

About


Languages

Language:TypeScript 56.4%Language:JavaScript 23.6%Language:Solidity 20.0%