Instruction: whitelist_asset
This instruction allows the operator to whitelist an asset for depositing and withdrawing.
Input parameters
asset: Pubkey: The public key for the asset to configure.min_deposit: u64: The minimum deposit required for this asset.
Accounts
operator: The operator account that is whitelisting the asset.Signer: Yes.
Init: No.
PDA: No.
Mutable: No.
Constraints: Must have the same public key as
contract_storage.operatorand enough lamports to pay for account-creation costs.
contract_storage: The global contract storage.Signer: No.
Init: No.
PDA: Yes (derived from
CONTRACT_STORAGE_SEEDwith bump).Mutable: No.
Constraints: Must be a
ContractStorageaccount.
asset_config: The asset-configuration account matching the public key.Signer: No.
Init: Yes.
PDA: Yes (derived from
ASSET_CONFIG_SEEDandassetwith bump).Mutable: Yes.
Constraints: Must be a new account initialized with space
8 + 8(discriminator +AssetConfigsize), and themin_depositinput parameter must be greater than zero.
Additional checks and behavior
Creates and stores a new
AssetConfigwith themin_depositfrom the input parameters.Logs a
WhitelistAssetevent.
CPI
N/A.