Comments (15)
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.
Integrating on Orna
from hey.
what @jamesfinnerty wrote.
Sounds very fun, imho more fun and interesting ways to collect is sth we should experiment with more.
from hey.
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.
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.
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.
this is genius, agnostic tokens fits perfectly with the permissionless philosophy. I want to see this across the whole lensverse.
from hey.
Amazing feature Paul. Would love to see this implemented!! ❤️
from hey.
this is a great initiative! I applaud this 👏
from hey.
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.
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.
Awesome feature - would love to see it implemented. We would support with creator tokens on P00LS
from hey.
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.
Deployed on SOCLLY too! ✨
from hey.
Totally make sense. How to integrate it?
from hey.
Related Issues (20)
- When any picture is opened it blends with the rest of the UI HOT 4
- Local Development: unable to post on testnet HOT 3
- Can not post on Hey HOT 3
- Local development - no way to create a testnet account HOT 2
- Navigation bar is not fixed HOT 4
- Geographical segmentation of views counts on posts leaks users country HOT 4
- Video playback failed HOT 3
- Post link preview displayed incorrectly HOT 1
- Some handle links are rendered as text in posts HOT 2
- Random logouts and unable to log back in unless I clear cookies
- Unable to delete post you have mirrored HOT 2
- Tips are counted as Collects
- Add disable state for follow button when it's not finalized on-chain HOT 1
- Is this open source? HOT 2
- Migrate the composer to Prosekit HOT 6
- Mentions dropdown not getting hidden if we not selecting from the list HOT 3
- Handles with _ not rendering HOT 3
- Hey Profile in role in guild . xyz HOT 1
- Subgraph endpoint update required HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hey.