GithubHelp home page GithubHelp logo

Comments (15)

jamesfinnerty avatar jamesfinnerty commented on June 15, 2024 3

This is a feature that should be available in all Lens front-end apps. Giving collectors the flexibility to pay what they want using their token of choice will allow creators to expand their offerings to a wider user base.

from hey.

mvanhalen avatar mvanhalen commented on June 15, 2024 3

Integrating on Orna

from hey.

punkess avatar punkess commented on June 15, 2024 2

what @jamesfinnerty wrote.
Sounds very fun, imho more fun and interesting ways to collect is sth we should experiment with more.

from hey.

iPaulPro avatar iPaulPro commented on June 15, 2024 2

Totally make sense. How to integrate it?

It can be added to publications just like any other other Open Action. Only difference with Collect Modules is that they're registered with the existing CollectPublicationAction rather than as their own Actions.

Here's a code snippet on how to create the init calldata:

import { encodeData } from '@lens-protocol/client';
import { ZeroAddress } from 'ethers';

const EMPTY_RECIPIENT = [ZeroAddress, '0'];

// First, create the PWYW Collect Module init data
const collectInitData = encodeData([
    { type: 'uint160', name: 'amountFloor' },
    { type: 'uint96', name: 'collectLimit' },
    { type: 'address', name: 'currency' },
    { type: 'uint16', name: 'referralFee' },
    { type: 'bool', name: 'followerOnly' },
    { type: 'uint72', name: 'endTimestamp' },
    {
        type: 'tuple(address,uint16)[5]',
        name: 'recipients',
        components: [
            { type: 'address', name: 'recipient' },
            { type: 'uint16', name: 'split' },
        ],
    },
], [
    '0', // amount floor, zero to allow free collects
    '10', // number of mints allowed
    ZeroAddress, // optionally limit to a specific token
    '10', // mirror referral percentage
    false, // minting only for followers
    '0', // optional end date
    [
        ['0x10E1DEB36F41b4Fad35d10d0aB870a4dc52Dbb2c', '10000'], // the recipient
        EMPTY_RECIPIENT, // can be up to 5 recipients
        EMPTY_RECIPIENT,
        EMPTY_RECIPIENT,
        EMPTY_RECIPIENT
    ],
]);

// Next, create the CollectPublicationAction init data
const data = encodeData(
    [
        { type: 'address', name: 'collectModule' },
        { type: 'bytes', name: 'collectModuleInitData' },
    ],
    [
       '0x7fbD7496CaE2DAcad7a62350DA8488E31eC026eA', // the PWYW Collect Module address
       collectInitData
    ],
);

// Add as an `unknownOpenAction` to the publication
openActionModules.push({
    unknownOpenAction: {
        address: '0x0D90C58cBe787CD70B5Effe94Ce58185D72143fB', // the CollectPublicationAction address
        data,
    },
});

from hey.

Prateekrajput1999 avatar Prateekrajput1999 commented on June 15, 2024 2

hey @iPaulPro i very well understood the part of implementation
could u share the act implementation as well...it would be helpful
i am going to integrate it to SOCLLY soon 🚀

from hey.

ludmila-omlopes avatar ludmila-omlopes commented on June 15, 2024 2

Up vote to have this feature applied to Hey!

While I don't believe all actions should be implemented by all apps on Lens, Hey is usually the first and main contact with the protocol and so suitable for this new monetization feature.

from hey.

mrsalitre avatar mrsalitre commented on June 15, 2024 1

this is genius, agnostic tokens fits perfectly with the permissionless philosophy. I want to see this across the whole lensverse.

from hey.

whoisanku avatar whoisanku commented on June 15, 2024 1

Amazing feature Paul. Would love to see this implemented!! ❤️

from hey.

carstenpoetter avatar carstenpoetter commented on June 15, 2024 1

this is a great initiative! I applaud this 👏

from hey.

Supersigil avatar Supersigil commented on June 15, 2024 1

I've been pestering devs about PWYW for NFTs for years! Makes so much sense, especially for music, given how successful this feature has been on Bandcamp (when given this option, ~50% of fans pay more than the minimum price). I hope this gets implemented across the web3 ecosystem.

from hey.

iPaulPro avatar iPaulPro commented on June 15, 2024 1

hey @iPaulPro i very well understood the part of implementation could u share the act implementation as well...it would be helpful i am going to integrate it to SOCLLY soon 🚀

Sure thing! The main thing to note is that the act is on the CollectPublicationAction (0x0D90C58cBe787CD70B5Effe94Ce58185D72143fB) and not the Collect Module, itself, however, the allowance approval must be done with the Collect Module.

Here's an example of process for a 1 BONSAI collect:

import { ethers } from "ethers";
import { encodeData } from "@lens-protocol/client";

const processCollectData = encodeData([
  { type: "address", name: "currency" },
  { type: "uint256", name: "amount" },
], [
  "0x3d2bD0e15829AA5C362a4144FdF4A1112fa29B5c",
  ethers.utils.parseUnits("1", 18).toString(),
]);

const processActionData = encodeData(
  [
    { type: "address", name: "collectNftRecipient" },
    { type: "bytes", name: "collectData" },
  ],
  [RECIPIENT, processCollectData],
);

Where RECIPIENT is the address receiving the Collect NFT.

from hey.

hugoreno avatar hugoreno commented on June 15, 2024 1

Awesome feature - would love to see it implemented. We would support with creator tokens on P00LS

from hey.

iPaulPro avatar iPaulPro commented on June 15, 2024 1

I created a standalone repository for the PWYW Collect module, with integration instructions:

https://github.com/iPaulPro/pwyw-collect-module

If you want to test it out locally, there's also a branch with it in Scaffold Lens:

https://github.com/iPaulPro/scaffold-lens/tree/feat/pwyw-collect

from hey.

Prateekrajput1999 avatar Prateekrajput1999 commented on June 15, 2024 1

Deployed on SOCLLY too! ✨

from hey.

metatxn avatar metatxn commented on June 15, 2024

Totally make sense. How to integrate it?

from hey.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.