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

アンロックダッシュボードで2つのロックコントラクトを作成しました。
A. トークンを保有しているユーザー(1000 < amount < 5000)向けのロック
B. 5000トークン以上を保有しているユーザー向けのロック

Aについては、ディスコースの「グループA」に追加したいと考えています。
Bについては、ディスコースの「グループB」に追加したいと考えています。

現在、Unlockプラグインはディスコースで1つのロックコントラクトしかサポートしていません。目標を達成するためのトリックはありますか?

「いいね!」 2

複数の契約を使用する方法を見つけましたか?

Unlock Protocol プラグインをダウンロードしようとしていますが、以下のページ/エラーが表示されます。解決方法を教えてください。


「いいね!」 1

こんにちは、@thesidsridhar さん、ようこそ:slightly_smiling_face:

こちらは非公式プラグインのため、より詳しい方からサポートを得られる可能性が高い「Unlock plugin」トピックに投稿を移動させていただきました。:+1:

「いいね!」 1

実際、プラグインは現在、Discourseチームによって管理されています。こちらで確認できます: https://github.com/discourse/discourse-unlock

cc @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

素晴らしい!レールコンソール経由でチャットを無効にするにはどうすればよいですか?

「いいね!」 2