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
-
clone my forked lens repo (branch:
feature/madfi-sponsor-module
) -
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
- find the docker container name with
docker ps
and run another bash session
export USERID=root && docker exec -it <docker-container-name> bash
-
deploy their contracts
npm run compile && npm run full-deploy-local
-
come back here and deploy the superfluid protocol + sponsor module
yarn compile && npx hardhat deploy-superfluid --network docker && yarn deploy:docker
-
back in the docker container, whitelist the deployed sponsor module with
npx hardhat whitelist-sponsor-module --network localhost
-
assuming that worked, you have to unpause the lens protocol with
npx hardhat unpause --network localhost
-
back in this repo, you can create a profile (make sure to set some ENV variables defined
.env.template
) by runningnpx hardhat create-profile --network docker
. also create another profile for the sponsor by changing the handle and using the signer forsponsor
(line 24 increate-profile.ts
) -
finally, create a post and attach our deployed
SponsorModule
as the reference modulenpx hardhat create-post --network docker
-
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