Sitelet https://github.com/ithacaxyz/account/pull/105
Skip to content

fix: make non-superadmins unable to spend without a spend limit - #105

Merged
joshieDo merged 3 commits into
mainfrom
vectorized/default-spend-limits
Apr 8, 2025
Merged

joshieDo merged 3 commits into
mainfrom
vectorized/default-spend-limits

Conversation

@Vectorized

Copy link
Copy Markdown
Contributor
  • Remove tests on set and spend in the same batch. Unable to test this, because once we have added the check to revert when setting spend limits for a super admin, this cannot happen.

  • non-superadmins cannot spend without a spend limit.

@Vectorized
Vectorized requested a review from joshieDo April 8, 2025 01:04
@Vectorized Vectorized changed the title feat: make non-superadmins unable to spend without a spend limit fix: make non-superadmins unable to spend without a spend limit Apr 8, 2025
@joshieDo
joshieDo merged commit 1e345c5 into main Apr 8, 2025
@joshieDo joshieDo linked an issue Apr 8, 2025 that may be closed by this pull request
joshieDo added a commit to ithacaxyz/relay that referenced this pull request Apr 11, 2025
bumps account 

breaking changes (ithacaxyz/account#105
ithacaxyz/account#108
ithacaxyz/account#106):
* super admins cannot have spend permissions set .
* P256 cannot be super admins
* non-admin keys need to have spend permissions set before they can
transact any token.
* compensating from a normal key contributes to the spending limit

``` rust
        /// @dev In order to spend a token, it must have spend permissions set.
        error NoSpendPermissions();
        /// @dev Super admin keys can spend anything.
        error SuperAdminCanSpendAnything();
        /// @dev The `keyType` cannot be super admin.
        error KeyTypeCannotBeSuperAdmin();
        error ExceededSpendLimit(address token);
```
yongkangc pushed a commit to ithacaxyz/relay that referenced this pull request Aug 5, 2025
bumps account 

breaking changes (ithacaxyz/account#105
ithacaxyz/account#108
ithacaxyz/account#106):
* super admins cannot have spend permissions set .
* P256 cannot be super admins
* non-admin keys need to have spend permissions set before they can
transact any token.
* compensating from a normal key contributes to the spending limit

``` rust
        /// @dev In order to spend a token, it must have spend permissions set.
        error NoSpendPermissions();
        /// @dev Super admin keys can spend anything.
        error SuperAdminCanSpendAnything();
        /// @dev The `keyType` cannot be super admin.
        error KeyTypeCannotBeSuperAdmin();
        error ExceededSpendLimit(address token);
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Limit session key spending

2 participants