-
Notifications
You must be signed in to change notification settings - Fork 46
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
Support Multi Token Rewards #136
Comments
I guess it would make sense at this point to also specify that it should support an arbitrary array length of permits. Then, technically, we can easily make a tool to generate a new payment link with all of the outstanding (unclaimed) permits for the contributor. |
Yes, I actually meant that this issue should support claiming an array of permits
I didn't get it. This issue implies that ubiquity/ubiquibot#769 will refactor the permit URL to contain a base64 encoded array of permits for different reward tokens. So I don't really understand what is the "new payment link" you're referring to. |
The original vision was to enable support for the following scenario:
However I expanded the vision to accomodate the following continuation of the scenario:
Until we complete the "permit rollup" idea (leveraging the database for accounting, and only generating permits when the contributor wants to cash out) it could be interesting to build a simple tool that will aggregate all of these unclaimed permits and combine them into a single link for the contributor to conveniently be able to claim everything. This could be either inside of the pay.ubq.fi dApp directly, a bot command, or somewhere else. I have a feeling it would be most elegant from inside of the dApp though. |
The audit page does pretty much the same thing. We could add a new "Combine permits" button there. So for a bounty hunter the flow would be this one:
|
It doesn't make sense from a user experience perspective. To clarify: the audit tool is intended for Perhaps it makes sense to import that logic into the Rewards dApp from the Audit dApp? |
This all sticks to github API rate limits. We can't use the bot's installation token for all of our dapps because we would quickly reach github's API rate limits. The Audit dApp uses github PAT provided by an end user. So the user must manually generate a new github PAT, paste it in the "GITHUB PERSONAL ACCESS TOKEN" text field and run the audit script. Overall this is not a great UX. For all of the future dapps (Rewards dApp, Combine Permits dApp, etc...) we should find a more user friendly way to get users' github access tokens. Github apps support generating user-based tokens. This brings us 2 options (regarding the "combine permit URLs" feature):
Option 1:
|
@rndquu small update but work.ubq.fi has a serverless (Supabase) GitHub login already implemented. I use this to make authenticated requests to load all the issue details. One part that isn't clear to me, but must the bot invalidate all of the posted permits across all of the GitHub issues first? Ideally if the user can somehow invalidate them instead of Ubiquity, this would be cheaper for us from a gas perspective. Once they are all invalidated, I assume only then it is safe to generate the new, rolled up permit? |
@whilefoo this seems not too different from the last project you implemented, the NFT claims. Perhaps you can finish this up quickly this week? |
The latest bot's release supports rolled up permits stored in the DB, right? |
If a rolled up permit is technically the same as a normal permit (but in practice we modify the total compensation public.permits schema id integer,
created timestamp with time zone not null default now(),
updated timestamp with time zone null,
amount text not null,
nonce text not null,
deadline text not null,
signature character(132) not null,
token_id integer null,
partner_id integer null,
beneficiary_id integer not null,
transaction character(66) null,
location_id integer null, The issue is that the functional permits are encoded and embedded in the pay.ubq.fi comment link on GitHub, so even if we remove Supabase entirely from the equation, the contributor can still use the valid permit information from the GitHub comment. |
How rolled up permit generation works under the hood? Suppose user solves 2 issues worth 10 USD and 20 USD. In the
Right? |
Perhaps there is a simpler way to design this ledger (like a single table with positive and negative
I'm assuming something like this, but I have mixed feelings on waiting for a transaction to complete before proceeding with the operation (I feel like there might be an entirely different and more streamlined approach that I can't think of right now) #139 (comment) |
When I implemented NFT claim I made support for multiple tokens that can be either ERC20 or ERC721 We could delay permit generation until the user goes to pay.ubq.fi logins with Github and requests payout, then we generate a permit based on credits and debits. Then we don't need to do invalidation and rolled-up permits, but that might make it less transparent where you got that amount from. Also it will be a problem with multi token support because different tokens have different USD exchange rates so we would need to keep track of credit and debits for each user and for each token. |
I think this is the best approach.
We can keep track in our database for auditing reasons.
I don't have a clear vision/solution for this but I see two paths:
Anyways this requires more thought. Maybe the simple answer is to only enable penalties on whitelisted tokens? Excellent questions! |
I don't think bounty hunters will be happy getting payout permits in such volatile tokens as ETH. The simplest/fastest approach seems to allow any tokens for settlement but disable USD conversion. It also not clear where to fetch the |
Counterpoint: I realized that this centralizes banking further and may appeal less to decentralization maxis. Posting payment permits is more tedious to deal with but more "decentralization friendly" |
! action has an uncaught error |
Closing it until the new specs are ready ubiquity/ubiquibot#753 (comment) |
# Issue was not closed as completed. Skipping. |
Depends on ubiquity/ubiquibot#769
Original meta issue
Right now when a bounty hunter opens a permit URL (example) then he is able to redeem only a single token reward. When multiple token rewards feature is implemented then the permit URL query will contain a base64 encoded array of permits which should allow bounty hunters to redeem multiple token rewards for a single issue.
What should be done:
P.S. Don't forget to refactor the "invalidate nonce" button (which should be displayed for each reward row only for permit owner)
The text was updated successfully, but these errors were encountered: