You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
getPermittedAppsForPkps and getUnpermittedAppsForPkps now return deleted Apps. A new isDeleted property has been added to the return value of these methods to indicate if each returned App is currently marked as deleted
Copy file name to clipboardExpand all lines: packages/libs/contracts-sdk/contracts/facets/VincentUserViewFacet.sol
+36-49Lines changed: 36 additions & 49 deletions
Original file line number
Diff line number
Diff line change
@@ -96,11 +96,13 @@ contract VincentUserViewFacet is VincentBase {
96
96
* @param appId The ID of the permitted app
97
97
* @param version The permitted version of the app
98
98
* @param versionEnabled Whether the permitted version is currently enabled
99
+
* @param isDeleted Whether the app has been deleted
99
100
*/
100
101
struct PermittedApp {
101
102
uint40 appId;
102
103
uint24 version;
103
104
bool versionEnabled;
105
+
bool isDeleted;
104
106
}
105
107
106
108
/**
@@ -109,11 +111,13 @@ contract VincentUserViewFacet is VincentBase {
109
111
* @param appId The ID of the unpermitted app
110
112
* @param previousPermittedVersion The last permitted version before unpermitting
111
113
* @param versionEnabled Whether the previous permitted version is currently enabled
114
+
* @param isDeleted Whether the app has been deleted
112
115
*/
113
116
struct UnpermittedApp {
114
117
uint40 appId;
115
118
uint24 previousPermittedVersion;
116
119
bool versionEnabled;
120
+
bool isDeleted;
117
121
}
118
122
119
123
/**
@@ -177,15 +181,14 @@ contract VincentUserViewFacet is VincentBase {
177
181
}
178
182
179
183
/**
180
-
* @dev Gets all permitted app versions for a specific app and PKP token
184
+
* @dev Gets the permitted app version for a specific app and PKP token, even if the app has been deleted
181
185
* @param pkpTokenId The PKP token ID
182
186
* @param appId The app ID
183
-
* @return An array of app versions that are permitted for the PKP token
187
+
* @return The permitted app version for the PKP token and app
184
188
*/
185
189
function getPermittedAppVersionForPkp(uint256pkpTokenId, uint40appId)
186
190
external
187
191
view
188
-
appNotDeleted(appId)
189
192
returns (uint24)
190
193
{
191
194
// Check for invalid PKP token ID and app ID
@@ -228,56 +231,40 @@ contract VincentUserViewFacet is VincentBase {
228
231
229
232
/**
230
233
* @notice DEPRECATED: Use {getPermittedAppsForPkps} instead. This function will be removed in future releases.
231
-
* @dev Gets all app IDs that have permissions for a specific PKP token, excluding deleted apps, with pagination support.
234
+
* @dev Gets all app IDs that have permissions for a specific PKP token, including deleted apps, with pagination support.
232
235
* @dev Migration guidance: Replace calls to this function with {getPermittedAppsForPkps}, which returns both app IDs and their permitted versions for a PKP token. Update your code to handle the new return type and logic as needed.
233
236
* @param pkpTokenId The PKP token ID
234
237
* @param offset The offset of the first app ID to retrieve
235
-
* @return An array of app IDs that have permissions for the PKP token and haven't been deleted
238
+
* @return An array of app IDs that have permissions for the PKP token (including deleted apps)
236
239
*/
237
240
function getAllPermittedAppIdsForPkp(uint256pkpTokenId, uint256offset) externalviewreturns (uint40[] memory) {
0 commit comments