initialize_controller
Permissionless - Callable once per deployed program
Flow
Checks
Anchor IDL accounts checks
Validates: check decimal input parameter
Handler
Initialises the
controller
PDAInitialises the
redeemable_mint
PDAWrites initial
controller
dataEmits Anchor
InitializeControllerEvent
event
Specificities
There can ever only be a single Controller
for a given deployed program due to the seed derivation being a function of a static string and the programID
This instruction is preferably called right after program deployment. In the very unlikely event that someone front run you, nothing at stake yet so wipe and redeploy and call it faster.
This instruction is preferably called by a multisig/DAO instead of a specific user account, for safety.
Parameters
redeemable_mint_decimals
the number of decimal the redeemable mint
(UXD in our case) should be created with
Accounts input
Last updated
Was this helpful?