-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Support "Pay What You Want" Collects #4865
Comments
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. |
what @jamesfinnerty wrote. |
this is genius, agnostic tokens fits perfectly with the permissionless philosophy. I want to see this across the whole lensverse. |
Amazing feature Paul. Would love to see this implemented!! ❤️ |
this is a great initiative! I applaud this 👏 |
Totally make sense. How to integrate it? |
Integrating on Orna |
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 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,
},
}); |
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. |
hey @iPaulPro i very well understood the part of implementation |
Sure thing! The main thing to note is that the 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 |
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. |
Awesome feature - would love to see it implemented. We would support with creator tokens on P00LS |
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 |
Deployed on SOCLLY too! ✨ |
Summary
I have created a new type of Collect Module that allows users to "pay what you want". This affords collectors the ability to use any denomination of any ERC-20 token to collect a publication.
Mainnet: 0x7fbD7496CaE2DAcad7a62350DA8488E31eC026eA
Testnet: 0x3d06AA6ca4FC7eE0D5581B85CB52CA7714175e43
Notes
CollectPublicationAction
module.Implement
The init calldata is almost identical to
MultirecipientFeeCollectModule
:and the process calldata:
CollectPublicationAction
This Collect Module is registered with the CollectPublicationAction (the same module used with
SimpleFeeCollectModule
andMultirecipientFeeCollectModule
). The init calldata is just the Collect Module address and the encoded collect init calldata (above):And to process:
Testnet
I have completed a successful
act
call with the PWYW module: https://amoy.polygonscan.com/tx/0xceff77ea12000814d07d3e8bc2b0218ae6ff91e286a08d91872e97b817f4a259The text was updated successfully, but these errors were encountered: