-
Notifications
You must be signed in to change notification settings - Fork 3
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
Create top hat #91
Create top hat #91
Conversation
Original message posted on June 20 as follows: The goal of this effort is to allow a single transaction to do two things:
Hats protocol doesn't support "predicting" Top Hat IDs ahead of time, like Safe does with their Safe Proxy contracts. Top Hat IDs are simple auto-incrementing integers. The concern is that if we try to "predict" the next ID ahead of time in our UI, it's possible that another transaction will be included before ours which creates a new Top Hat, and then all of a sudden the Top Hat we create has an ID that we weren't expecting, and so now the rest of our pre-generated transaction data to "declare" the Top Hat into First thought to overcome that (and confirmed with Hats team) is to make a simple contract that does the Top Hat creation call, gets the ID back, then uses that ID in solidity to do "whatever other onchain things we need to do" with that Top Hat ID. "Whatever other onchain things we need to do", in our case, includes "declaring the Top Hat ID in However, But that means if we have another address besides the Safe calling So, then I thought, let me This worked well, EXCEPT for the fact that the log that Dead end after dead end. Not sure what the best path forward is. In this PR are two implementations of the different ways I'm seeing we can approach this problem:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall - looks good
From the code it looks straightforward that Hat will be minted with the details given and image specified, but just to make sure - do you mind adding a test case covering that?
Assuming deployment of the contract will happen after merging this PR - I'm cool if we'll get this test case at that point
@mudrila i have more code to push into this branch, to support adding admin hat and child hats in this transaction Also @mudrila I can't really test that because I'm just mocking out my Hats implementation. I don't do anything with those paramaters in my mock function. I mean I guess I could start creating more structure and state in HatsMock, but idk if that's really the point. |
yo @mudrila actually yeah I can't really think of any other tests to write at the moment. Can you? |
I feel like trying to make |
Yeah AFAIK there's no quick/easy way to deploy the actual Hats Protocol into our test environment, so that's why I made this I think it's not relevant to add anything more to |
Bah there are more tests I can write, i'm just being lazy. let me get to it |
Ok this is ready for review again (I didn't add more tests) |
Closing this PR, the other one will just have all of this new code |
Closes #92