-
Notifications
You must be signed in to change notification settings - Fork 62
feat(examples): Add "Spending limit account" account abstraction example #8959
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 6 Skipped Deployments
|
TheMrAI
left a comment
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.
Haven't checked the tests yet, just skimmed the rest.
|
|
||
| public fun authenticate<T>( | ||
| account: &SpendLimit, | ||
| coins: &vector<Coin<T>>, |
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.
I don't get how this authenticate function prevents me from spending from the account. Some coins are passed here as auth inputs, but who to say that there are no more coins as PTB inputs that the authenticated transactions can spend?
On another note, spending limit without a time frame is rather useless, no? If I can spend $100 at a time, but I can repeat it as many times as I can then it's pretty easy to overspend ![]()
If the intention is to have an account where you can only spend $X/period, it's pretty tought to implement without write access in the auth function.
1ed444b to
ad3bcf7
Compare
92f7cee to
c7c6101
Compare
f083f09 to
ce24754
Compare
ce24754 to
0bb3460
Compare
| } | ||
|
|
||
| public fun authenticate( | ||
| account: &mut SpendLimit, |
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.
Right, this must be account: &SpendLimit. Check comment in authenticate_with_amount
…uthentication of passing a u64 amount
…h, introduced a few extra helper functions in programmable_transaction
…w logic, added a few new tests
…wProof and adjusting error handling
…, added a few tests, deposits now are accepted from any address.
…ate test helper function
…nding limit authentication, updated ptb references
…ity, correct formatting in Move.toml
…functions and tests
088a7bc to
7c23b76
Compare
e2b0af4 to
e36de78
Compare
Dkwcs
left a comment
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.
LGTM, left few comments
04114eb
into
vm-lang/aa-auth/8805-beta-feature-branch
…ple (#8959) # Description of change Implement "Account with Spending limit" example for abstract accounts. ## Links to any relevant issues fixes #8651 ## How the change has been tested - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [ ] I have added tests that prove my fix is effective or that my feature works - [x] I have checked that new and existing unit tests pass locally with my changes --------- Co-authored-by: miker83z <mirko.zichichi@iota.org>
…ple (#8959) # Description of change Implement "Account with Spending limit" example for abstract accounts. ## Links to any relevant issues fixes #8651 ## How the change has been tested - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [ ] I have added tests that prove my fix is effective or that my feature works - [x] I have checked that new and existing unit tests pass locally with my changes --------- Co-authored-by: miker83z <mirko.zichichi@iota.org>
…ple (#8959) # Description of change Implement "Account with Spending limit" example for abstract accounts. ## Links to any relevant issues fixes #8651 ## How the change has been tested - [x] Basic tests (linting, compilation, formatting, unit/integration tests) - [ ] Patch-specific tests (correctness, functionality coverage) - [ ] I have added tests that prove my fix is effective or that my feature works - [x] I have checked that new and existing unit tests pass locally with my changes --------- Co-authored-by: miker83z <mirko.zichichi@iota.org>
Description of change
Implement "Account with Spending limit" example for abstract accounts.
Links to any relevant issues
fixes #8651
How the change has been tested