👮Smart Delegate

// PDA Seeds: ['smart-delegate']
pub struct SmartDelegate {
    pub bump: u8, // The canocial bump in the PDA seed
}

The Smart Delegate account (github) is a singleton PDA of the program. For a pre-authorization to be usable, this account needs to be set as the token account's delegate (token program github, token2022 program github) and the delegate_amount needs to be set to u64::MAX. This is so that the program can sign on behalf of a valid pre-authorization to transfer/debit the funds via the SPL Token / Token2022 program. This delegation inherits the security guarantees of the pre-authorized-debit-v1 program as the program itself is not upgradeable (note: the mainnet program will remain upgradeable until we finish the SDK and UI to allow for any bug/vulnerabity fixes that might be discovered by then but the devnet program is already frozen).

For each instance of the program (i.e. mainnet and devnet), our team has already initialized the smart_delegate accounts and the addresses are below:

  • Mainnet: 5xwfb7dPwdbgnMFABbF9mqYaD79ocSngiR9GMSY9Tfzb

  • Devnet: 5xwfb7dPwdbgnMFABbF9mqYaD79ocSngiR9GMSY9Tfzb

Our SDK (currently WIP) will expose convenience methods to set the delegate of a token account to this smart delegate PDA with the appropriate amount.

Last updated