Skip to content
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

createHatできる人の制御の仕方を検討・実装 #235

Closed
yu23ki14 opened this issue Jan 6, 2025 · 1 comment
Closed

createHatできる人の制御の仕方を検討・実装 #235

yu23ki14 opened this issue Jan 6, 2025 · 1 comment
Assignees
Labels
High Priority High

Comments

@yu23ki14
Copy link
Member

yu23ki14 commented Jan 6, 2025

Issue

Description

HatプロトコルではcreateHatできるのはAdmin(親HatもしくはTopHatのwearer)のみになっている。
そこで、Toban上でcreateHatできる人をどのように制御するかが問題になる。

ぱっと思いつくオプションは以下

  • HatterHatとしてtimeframeHatterModuleだけでなく、HatsHatCreatorModuleコントラクトをつくってToban独自のルールでcreateHatできるようにする。

Notes

  • ファイルは /contract/contracts/hatsmodule/HatsHatCreatorModule.sol にする
  • 機能
    • createHatができる人をアドレス単位で制限できるようにする
      • 権限の追加・削除(grantとrevoke)ができるようにする
    • Hats.solのcreateHat関数を叩く
    • BigBang.solのbigbang関数の実行をしたら、hatsTimeframeModuleと同じようにデプロイされて、HatterHatがミントされる

Screenshots

If applicable, add screenshots to help explain your problem.

@tanapl tanapl self-assigned this Jan 6, 2025
@tanapl
Copy link
Collaborator

tanapl commented Jan 9, 2025

@yu23ki14

I’ve successfully built a custom HatsHatCreatorModule that deploys from BigBang.sol and controls who can call createHat(...). The core flow is in place:

  • BigBang mints a topHat to itself (address(this)),
  • creates a new sub-hat via Hats.createHat(...),
  • deploys HatsHatCreatorModule and HatsTimeFrameModule,
  • then transfers the topHat to _owner.
  • includes grantCreateHat and revokeCreateHat so its owner can add or remove permission

However, the test is failing with “Transaction reverted without a reason string,” likely due to a silent revert in one of the Hats calls (e.g. createHat, mintHat, or transferHat). The usual culprit is an admin check in Hats (the caller must still be wearing the admin hat). I'm verifying that...BigBang? (address(this)) remains the topHat’s wearer at the time of calling createHat(...). Console logging or try/catch around each step can pinpoint exactly where it reverts and confirm the admin logic. Once that’s resolved, the HatsHatCreatorModule integration should work as intended.

main...issue/235

@yu23ki14 yu23ki14 assigned yawn-c111 and unassigned tanapl Jan 20, 2025
@yu23ki14 yu23ki14 added the High Priority High label Jan 20, 2025
@yawn-c111 yawn-c111 linked a pull request Jan 20, 2025 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
High Priority High
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants