Discourse 解锁

Hi all,

We developed an Unlock protocol plugin for Discourse. It let you lock topics behind a “crypto” paywall.

People have to buy your NFT with their crypto wallet (Mestamask, Wallet connect) to access topics. You can configure it with any ERC20 on Ethereum, xDai, Polygon…Since last week, you can also unlock with credit card payment.

ezgif-3-eda9d8c4547d

You can test it on the unlock protocol community forum : https://unlock.community, for example this topic is locked : https://unlock.community/t/introducing-the-dao/68 (on xDai).

You could use the same lock to also give access your users to Discord private channels with https://swordybot.com/.

Plugin repo : GitHub - discourse/discourse-unlock
Documentation : Unlock Discourse plugin - 🧙‍♂️ Developers - Unlock

Don’t hesitate if you have any questions.

32 个赞

Interesting, I wonder if there is a financial vehicle that could be engineered in the Ethereum (or other crypto engines) for repeat transactions. Would be kind of cool to offer a subscription service where you opt to pay X every month.

9 个赞

Can we setup unlock for comment? Only comment first or comment second not topic title and content main?
And, can we add charge by dollar via Visa or paypal not Crypto?

1 个赞

Hello @sam,

It is possible with unlock protcol : Recurring Memberships | Unlock: The Web's new business model

But for the moment it’s not implanted in the plugin. Will add it in the next version.

7 个赞

Not sure to understand that part.

Yes, it’s also possible to pay with credit card : Credit Card Support

2 个赞

Mean Unlock comment but topic unstill display

2 个赞

Hi Sam! I am Julien, the founder of Unlock Protocol!

Indeed, it is possible like @kam44 said.

The core mechanism is to use the “approval” mechanism that the ERC20 contracts provide.
The core idea is to approve a 3rd party contract, called the “purchaser” whose single job is to purchase memberships on behalf of users when they are either expired (or soon to be expired). So basically a membership can only be “renewed” when it is either nearly expired, or fully expired.

One of the challenges that we’re trying to solve is to find who will trigger the transaction on that purchaser contract. Rigth now, the approach is to make the purchase “pay back” the person triggering the transaction so that this covers the gas fees. I think we can leverage the “flashbots” who have been doing arbitrage to do that!

It is definitely one of the things we’re trying to work on!

3 个赞

Amazing, I find some of the financial vehicles smart contracts have on offer to be fascinating. I think this could be extremely powerful as a way of funding the right community.

In particular we already have Discourse Subscriptions so perhaps a PR to allow for a “Unlock” mode vs “Stripe” may be an interesting path to take.

8 个赞

@kam44
any news about “unlock comments” ?

3 个赞

Any Update
This plugin seems interesting

Great Job Man !

1 个赞

我在 unlock dashboard 上创建了 2 个锁定合约
A. 锁定代币数量在 1000 到 5000 之间的用户
B. 锁定代币数量超过 5000 的用户

对于 A,我想将他们添加到 discourse 的 group A
对于 B,我想将他们添加到 discourse 的 group B

目前 Unlock 插件仅支持在 discourse 上使用一个锁定合约。有什么方法可以实现这个目标吗?

2 个赞

您是否找到了使用多个合同的解决方案?

我正在尝试下载 Unlock Protocol 插件。我遇到了以下页面/错误。请告知我如何解决此问题:


1 个赞

你好,欢迎你 @thesidsridhar :slightly_smiling_face:

由于这是一个非官方插件,我已经将你的帖子移至“解锁插件”主题,我认为那里会得到更多了解它的人的支持。:+1:

1 个赞

事实上,该插件现在由 Discourse 团队管理,正如你在此处所见:https://github.com/discourse/discourse-unlock

抄送 @zogstrip

5 个赞

哦,我的歉意。:pray: 我错过了那个交换。谢谢你指出来。:+1:

4 个赞

没关系,我们没在任何地方提到过。

2 个赞

您好 @zogstrip,我想再次就上述问题向您咨询。如何解决 HasCustomFields:NotPreloadedError?

3 个赞

恐怕由于假日季,此插件的支持有点少,但(就我所知)我刚刚在我的测试站点上安装了它,也遇到了“哎呀 - 错误 500”并被锁定,日志中出现相同的错误:

消息

HasCustomFields::NotPreloadedError (尝试访问 Category 类的未预加载自定义字段 'unlock-lock'。为防止 N+1 查询,此操作被禁止。)
app/models/concerns/has_custom_fields.rb:175:in `[]'
(eval):37:in `_fast_attributes'
(eval):6:in `_fast_attributes'
app/controllers/application_controller.rb:637:in `preload_current_user_data'
app/controllers/application_controller.rb:437:in `preload_json'
app/controllers/application_controller.rb:413:in `block in with_resolved_locale'
app/controllers/application_controller.rb:413:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
lib/middleware/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:368:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/enforce_hostname.rb:23:in `call'
lib/middleware/request_tracker.rb:209:in `call'

回溯

app/models/concerns/has_custom_fields.rb:175:in `[]'
plugins/discourse-unlock/plugin.rb:63:in `block (2 levels) in activate!'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:375:in `include?'
(eval):37:in `_fast_attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:456:in `attributes'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:480:in `_serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:359:in `serializable_hash'
active_model_serializers (0.8.4) lib/active_model/serializer.rb:347:in `as_json'
plugins/chat/app/serializers/chat_channel_serializer.rb:51:in `chatable'
(eval):6:in `_fast_attributes'

我认为这与 Chat 插件存在某种冲突。如果我在 rails 控制台中禁用 Chat,我就可以正常访问我的站点(包括 /admin/plugins/discourse-unlock 页面)。

6 个赞

太棒了!我该如何在 Rails 控制台中禁用聊天?

2 个赞