Closed
Conversation
…id before removal
Contributor
Author
|
After some feedback, we're going to change this implementation a bit to not use Actions for |
Contributor
Author
|
Superseded by #35 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull Request adds the following:
AuthorizationLockwhich allows an authority to pre-authorize a number of tokens given its mint and set an expiry. This will ensure the SWIG doesn't overspend in the case of pre-authorization a transaction before settlement allowing for delayed settlment from SWIGs.ManageAuthorizationLockpermission required to addAuthorizationLocksAddActionsToRoleV1andRemoveActionsFromRoleV1new instructions to allow for in-place addition/removal ofActionson a givenRole.get_all_actionsHere's how things are set up:
ManageAuthorizationLockorAllpermissions can add/removeAuthorizationLockAuthorizationLockcan technically be added to any role/authority, but it applies to the entire SwigAuthorizationLocks, they are additive when they are added for the same asset. For example, if you have 3AuthorizationLocks that have different expirations sometime in the future for USDC of 100 USDC each, then they will combine to be a 300 USDCAuthorizationLockcheckSignV1, if it's a SOL or SPL transfer, no matter if the role hasAllor not, if the swig has at least 1AuthorizationLockthen the before/after balances are checked against allAuthorizationLocks for the asset(s) being transferred.AuthorizationLockcan only be removed in 2 ways; it expires or it is manually removedAuthorizationLockcan manually remove it before its expiry.AuthorizationLockis expired, it is automatically cleaned up from the SWIG on the nextSignV1call or it can be manually removed by the authority/role that added it.AuthorizationLocks on it has 0 CU overhead in comparison to before this functionalityAuthorizationLocks is benched at roughly +700 CUs overhead required