export type BridgeIdl = { "address": ""; "metadata": { "name": "bridge"; "version": "1.0.0"; "spec": "0.1.0"; "description": "Super awesome n1 bridging and state settlement contract"; }; "instructions": [ { "name": "allowAppVersion"; "discriminator": [ 37, 106, 252, 165, 124, 88, 212, 139 ]; "accounts": [ { "name": "app"; "writable": true; }, { "name": "appOwner"; "signer": true; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; } ]; "args": [ { "name": "appVersion"; "type": { "array": [ "u8", 32 ]; }; }, { "name": "allow"; "type": "bool"; } ]; }, { "name": "appCreateApprove"; "discriminator": [ 197, 24, 144, 254, 92, 176, 67, 217 ]; "accounts": [ { "name": "appOwner"; "docs": [ "NOTE: Must check that the owner matches up." ]; "signer": true; }, { "name": "app"; "docs": [ "During initialization, we already set the space and rent to match", "up to `App`, but wrote in `AppConfig`.`" ]; "writable": true; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; } ]; "args": []; }, { "name": "appCreateCancel"; "discriminator": [ 210, 14, 220, 132, 186, 152, 50, 21 ]; "accounts": [ { "name": "global"; "pda": { "seeds": [ { "kind": "const"; "value": [ 103, 108, 111, 98, 97, 108 ]; } ]; }; }, { "name": "globalOwner"; "signer": true; }, { "name": "app"; "writable": true; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; } ]; "args": []; }, { "name": "appCreatePropose"; "discriminator": [ 140, 171, 221, 171, 114, 250, 235, 111 ]; "accounts": [ { "name": "payer"; "writable": true; "signer": true; }, { "name": "global"; "pda": { "seeds": [ { "kind": "const"; "value": [ 103, 108, 111, 98, 97, 108 ]; } ]; }; }, { "name": "globalOwner"; "signer": true; }, { "name": "app"; "writable": true; "signer": true; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; } ]; "args": [ { "name": "config"; "type": { "defined": { "name": "appConfig"; }; }; } ]; }, { "name": "challengeBlock"; "discriminator": [ 44, 184, 95, 207, 222, 9, 34, 224 ]; "accounts": [ { "name": "payer"; "writable": true; "signer": true; }, { "name": "app"; }, { "name": "childBlocks"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 104, 105, 108, 100, 95, 98, 108, 111, 99, 107, 115 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "arg"; "path": "prevStateFactsCommitment"; } ]; }; }, { "name": "validator"; "signer": true; }, { "name": "validatorAclEntry"; "pda": { "seeds": [ { "kind": "const"; "value": [ 97, 99, 108 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "account"; "path": "validator"; } ]; }; }, { "name": "challengeNullifier"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 104, 97, 108, 108, 101, 110, 103, 101, 95, 110, 117, 108, 108, 105, 102, 105, 101, 114 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "arg"; "path": "prevStateFactsCommitment"; }, { "kind": "arg"; "path": "blockId"; }, { "kind": "account"; "path": "validator"; } ]; }; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; } ]; "args": [ { "name": "prevStateFactsCmtmt"; "type": { "defined": { "name": "commitment"; }; }; }, { "name": "blockId"; "type": "u64"; } ]; }, { "name": "depositCreate"; "discriminator": [ 136, 0, 132, 178, 254, 101, 187, 71 ]; "accounts": [ { "name": "payer"; "writable": true; "signer": true; }, { "name": "app"; }, { "name": "event"; "writable": true; "signer": true; }, { "name": "assetConfig"; "pda": { "seeds": [ { "kind": "const"; "value": [ 97, 115, 115, 101, 116, 95, 99, 111, 110, 102, 105, 103 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "account"; "path": "fromAccount.mint"; } ]; }; }, { "name": "fromAccount"; "writable": true; }, { "name": "tokenAccount"; "writable": true; "pda": { "seeds": [ { "kind": "account"; "path": "tokenAuthority"; }, { "kind": "account"; "path": "tokenProgram"; }, { "kind": "account"; "path": "fromAccount.mint"; } ]; "program": { "kind": "const"; "value": [ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89 ]; }; }; }, { "name": "tokenAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 116, 111, 107, 101, 110, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; }, { "name": "tokenProgram"; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; } ]; "args": [ { "name": "user"; "type": "pubkey"; }, { "name": "amount"; "type": "u64"; } ]; }, { "name": "emitCrumb"; "discriminator": [ 96, 96, 18, 122, 83, 60, 102, 37 ]; "accounts": [ { "name": "app"; }, { "name": "crumbAuthority"; "docs": [ "Need a PDA to ensure that only this contract is allowed to", "call this instruction; the contract storage account is", "chosen since pretty much every other ix uses it, so this", "avoids having to introduce a new account." ]; "signer": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; } ]; "args": []; }, { "name": "eventQueue"; "discriminator": [ 77, 86, 223, 153, 163, 135, 241, 12 ]; "accounts": [ { "name": "payer"; "writable": true; "signer": true; }, { "name": "app"; "writable": true; }, { "name": "unqueuedEvent"; "writable": true; }, { "name": "queuedEvent"; "writable": true; }, { "name": "prevQueuedEvent"; "optional": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 113, 117, 101, 117, 101, 100, 95, 101, 118, 101, 110, 116 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "account"; "path": "app.lastEventIndex"; "account": "app"; } ]; }; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; } ]; "args": []; }, { "name": "finalizeBlock"; "discriminator": [ 63, 101, 92, 132, 135, 251, 98, 177 ]; "accounts": [ { "name": "app"; "writable": true; }, { "name": "childBlocks"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 104, 105, 108, 100, 95, 98, 108, 111, 99, 107, 115 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "account"; "path": "app.finaStateFacts"; "account": "app"; } ]; }; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; } ]; "args": []; }, { "name": "freeze"; "discriminator": [ 255, 91, 207, 84, 251, 194, 254, 63 ]; "accounts": [ { "name": "app"; "writable": true; }, { "name": "authority"; "signer": true; }, { "name": "aclEntry"; "pda": { "seeds": [ { "kind": "const"; "value": [ 97, 99, 108 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "account"; "path": "authority"; } ]; }; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; } ]; "args": [ { "name": "freeze"; "type": "bool"; } ]; }, { "name": "initializeGlobal"; "discriminator": [ 47, 225, 15, 112, 86, 51, 190, 231 ]; "accounts": [ { "name": "payer"; "writable": true; "signer": true; }, { "name": "program"; "docs": [ "Marked as signer to avoid races. This key should be thrown away after initialization." ]; "signer": true; }, { "name": "global"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 103, 108, 111, 98, 97, 108 ]; } ]; }; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; } ]; "args": [ { "name": "globalOwner"; "type": "pubkey"; } ]; }, { "name": "proposeBlock"; "discriminator": [ 147, 21, 105, 53, 152, 116, 128, 187 ]; "accounts": [ { "name": "payer"; "writable": true; "signer": true; }, { "name": "app"; "writable": true; }, { "name": "operator"; "signer": true; }, { "name": "childBlocks"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 104, 105, 108, 100, 95, 98, 108, 111, 99, 107, 115 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "arg"; "path": "facts.prevStateFacts"; } ]; }; }, { "name": "lastQueuedEvent"; "optional": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 113, 117, 101, 117, 101, 100, 95, 101, 118, 101, 110, 116 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "arg"; "path": "facts.nextStateFacts.lastEventIndex"; } ]; }; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; } ]; "args": [ { "name": "facts"; "type": { "defined": { "name": "blockFacts"; }; }; } ]; }, { "name": "pruneBlock"; "discriminator": [ 194, 217, 26, 203, 34, 224, 39, 39 ]; "accounts": [ { "name": "app"; }, { "name": "childBlocks"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 104, 105, 108, 100, 95, 98, 108, 111, 99, 107, 115 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "arg"; "path": "prevStateFactsCmtmt"; } ]; }; }, { "name": "headrRefundAccount"; "writable": true; }, { "name": "blockRefundAccount"; "writable": true; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; } ]; "args": [ { "name": "prevStateFactsCmtmt"; "type": { "defined": { "name": "commitment"; }; }; }, { "name": "blockId"; "type": "u64"; } ]; }, { "name": "pruneEffectNullifier"; "discriminator": [ 57, 78, 112, 70, 48, 156, 50, 64 ]; "accounts": [ { "name": "app"; }, { "name": "childBlocks"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 104, 105, 108, 100, 95, 98, 108, 111, 99, 107, 115 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "arg"; "path": "prevStateFactsCmtmt"; } ]; }; }, { "name": "effectNullifier"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 101, 102, 102, 101, 99, 116, 95, 110, 117, 108, 108, 105, 102, 105, 101, 114 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "arg"; "path": "prevStateFactsCmtmt"; }, { "kind": "arg"; "path": "blockId"; }, { "kind": "arg"; "path": "leafIndex"; } ]; }; }, { "name": "refundAccount"; "writable": true; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; } ]; "args": [ { "name": "prevStateFactsCmtmt"; "type": { "defined": { "name": "commitment"; }; }; }, { "name": "blockId"; "type": "u64"; }, { "name": "leafIndex"; "type": "u64"; } ]; }, { "name": "setBlockLifetime"; "discriminator": [ 186, 30, 220, 208, 40, 93, 142, 123 ]; "accounts": [ { "name": "global"; "pda": { "seeds": [ { "kind": "const"; "value": [ 103, 108, 111, 98, 97, 108 ]; } ]; }; }, { "name": "globalOwner"; "signer": true; }, { "name": "app"; "writable": true; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; } ]; "args": [ { "name": "blockLifetime"; "type": "u64"; } ]; }, { "name": "setChallengeConsensusThreshold"; "discriminator": [ 201, 93, 221, 132, 109, 250, 47, 155 ]; "accounts": [ { "name": "global"; "pda": { "seeds": [ { "kind": "const"; "value": [ 103, 108, 111, 98, 97, 108 ]; } ]; }; }, { "name": "globalOwner"; "signer": true; }, { "name": "app"; "writable": true; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; } ]; "args": [ { "name": "challengeConsensusThreshold"; "type": "u16"; } ]; }, { "name": "setChallengePeriodSlots"; "discriminator": [ 70, 49, 127, 12, 166, 233, 75, 49 ]; "accounts": [ { "name": "global"; "pda": { "seeds": [ { "kind": "const"; "value": [ 103, 108, 111, 98, 97, 108 ]; } ]; }; }, { "name": "globalOwner"; "signer": true; }, { "name": "app"; "writable": true; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; } ]; "args": [ { "name": "challengePeriodSlots"; "type": "u64"; } ]; }, { "name": "setMinDeposit"; "discriminator": [ 15, 182, 74, 248, 251, 148, 186, 171 ]; "accounts": [ { "name": "app"; }, { "name": "appOwner"; "signer": true; }, { "name": "assetConfig"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 97, 115, 115, 101, 116, 95, 99, 111, 110, 102, 105, 103 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "account"; "path": "mint"; } ]; }; }, { "name": "mint"; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; } ]; "args": [ { "name": "minDeposit"; "type": "u64"; } ]; }, { "name": "setOperator"; "discriminator": [ 238, 153, 101, 169, 243, 131, 36, 1 ]; "accounts": [ { "name": "global"; "pda": { "seeds": [ { "kind": "const"; "value": [ 103, 108, 111, 98, 97, 108 ]; } ]; }; }, { "name": "globalOwner"; "signer": true; }, { "name": "app"; "writable": true; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; } ]; "args": [ { "name": "operator"; "type": "pubkey"; } ]; }, { "name": "setPermission"; "discriminator": [ 70, 126, 41, 194, 245, 189, 128, 8 ]; "accounts": [ { "name": "global"; "pda": { "seeds": [ { "kind": "const"; "value": [ 103, 108, 111, 98, 97, 108 ]; } ]; }; }, { "name": "globalOwner"; "signer": true; }, { "name": "payer"; "writable": true; "signer": true; }, { "name": "app"; }, { "name": "aclEntry"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 97, 99, 108 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "arg"; "path": "addr"; } ]; }; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; } ]; "args": [ { "name": "addr"; "type": "pubkey"; }, { "name": "mask"; "type": { "defined": { "name": "permissionSet"; }; }; }, { "name": "value"; "type": { "defined": { "name": "permissionSet"; }; }; } ]; }, { "name": "setTargetFinaStateFacts"; "discriminator": [ 84, 23, 48, 167, 62, 59, 105, 168 ]; "accounts": [ { "name": "global"; "pda": { "seeds": [ { "kind": "const"; "value": [ 103, 108, 111, 98, 97, 108 ]; } ]; }; }, { "name": "globalOwner"; "signer": true; }, { "name": "app"; "writable": true; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; } ]; "args": [ { "name": "targetFinaStateFacts"; "type": { "option": { "defined": { "name": "stateFacts"; }; }; }; } ]; }, { "name": "setWithdrawalRateLimit"; "discriminator": [ 223, 228, 217, 48, 144, 211, 153, 146 ]; "accounts": [ { "name": "app"; }, { "name": "appOwner"; "signer": true; }, { "name": "mint"; }, { "name": "assetConfig"; "pda": { "seeds": [ { "kind": "const"; "value": [ 97, 115, 115, 101, 116, 95, 99, 111, 110, 102, 105, 103 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "account"; "path": "mint"; } ]; }; }, { "name": "withdrawalLimiter"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 108, 105, 109, 105, 116, 101, 114 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "account"; "path": "mint"; } ]; }; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; } ]; "args": [ { "name": "limiterConfig"; "type": { "defined": { "name": "config"; }; }; } ]; }, { "name": "whitelistAsset"; "discriminator": [ 113, 64, 172, 191, 33, 33, 57, 18 ]; "accounts": [ { "name": "payer"; "writable": true; "signer": true; }, { "name": "app"; }, { "name": "appOwner"; "signer": true; }, { "name": "assetConfig"; "docs": [ "New asset config PDA account to be created", "This account is owned by the bridge program and stores the asset configuration" ]; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 97, 115, 115, 101, 116, 95, 99, 111, 110, 102, 105, 103 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "account"; "path": "mint"; } ]; }; }, { "name": "withdrawalLimiter"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 108, 105, 109, 105, 116, 101, 114 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "account"; "path": "mint"; } ]; }; }, { "name": "mint"; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; } ]; "args": [ { "name": "minDeposit"; "type": "u64"; }, { "name": "limiterConfig"; "type": { "defined": { "name": "config"; }; }; } ]; }, { "name": "withdraw"; "discriminator": [ 183, 18, 70, 156, 148, 109, 161, 34 ]; "accounts": [ { "name": "payer"; "writable": true; "signer": true; }, { "name": "app"; }, { "name": "childBlocks"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 104, 105, 108, 100, 95, 98, 108, 111, 99, 107, 115 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "arg"; "path": "claim.prevStateFactsCmtmt"; } ]; }; }, { "name": "effectNullifier"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 101, 102, 102, 101, 99, 116, 95, 110, 117, 108, 108, 105, 102, 105, 101, 114 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "arg"; "path": "claim.prevStateFactsCmtmt"; }, { "kind": "arg"; "path": "claim.blockId"; }, { "kind": "arg"; "path": "claim.leafIndex"; } ]; }; }, { "name": "fromAccount"; "writable": true; "pda": { "seeds": [ { "kind": "account"; "path": "tokenAuthority"; }, { "kind": "account"; "path": "tokenProgram"; }, { "kind": "account"; "path": "toAccount.mint"; } ]; "program": { "kind": "const"; "value": [ 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, 132, 4, 142, 123, 216, 219, 233, 248, 89 ]; }; }; }, { "name": "toAccount"; "writable": true; }, { "name": "withdrawalLimiter"; "writable": true; "pda": { "seeds": [ { "kind": "const"; "value": [ 119, 105, 116, 104, 100, 114, 97, 119, 97, 108, 95, 108, 105, 109, 105, 116, 101, 114 ]; }, { "kind": "account"; "path": "app"; }, { "kind": "account"; "path": "toAccount.mint"; } ]; }; }, { "name": "tokenAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 116, 111, 107, 101, 110, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "crumbAuthority"; "pda": { "seeds": [ { "kind": "const"; "value": [ 99, 114, 117, 109, 98, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121 ]; }, { "kind": "account"; "path": "app"; } ]; }; }, { "name": "program"; }, { "name": "tokenProgram"; }, { "name": "systemProgram"; "address": "11111111111111111111111111111111"; } ]; "args": [ { "name": "claim"; "type": { "defined": { "name": "withdrawalClaim"; }; }; } ]; } ]; "accounts": [ { "name": "app"; "discriminator": [ 67, 135, 84, 79, 153, 49, 239, 169 ]; }, { "name": "appConfig"; "discriminator": [ 35, 142, 177, 102, 131, 31, 162, 52 ]; }, { "name": "assetConfig"; "discriminator": [ 57, 112, 247, 166, 247, 64, 140, 23 ]; }, { "name": "effectNullifier"; "discriminator": [ 138, 66, 66, 124, 33, 209, 105, 159 ]; }, { "name": "global"; "discriminator": [ 167, 232, 232, 177, 200, 108, 114, 127 ]; }, { "name": "permissionSet"; "discriminator": [ 64, 79, 161, 47, 53, 27, 139, 36 ]; }, { "name": "queuedEvent"; "discriminator": [ 5, 61, 32, 124, 1, 68, 182, 41 ]; }, { "name": "tokenBucket"; "discriminator": [ 64, 212, 194, 121, 213, 38, 100, 53 ]; }, { "name": "unqueuedEvent"; "discriminator": [ 198, 208, 170, 230, 58, 90, 225, 167 ]; } ]; "errors": [ { "code": 6001; "name": "appConfigInvalid"; "msg": "app is invalid or already approved"; }, { "code": 6002; "name": "appFrozen"; "msg": "app is frozen"; }, { "code": 6003; "name": "minDepositInvalid"; "msg": "Min deposit must be greater than 0"; }, { "code": 6101; "name": "globalOwnerInvalid"; "msg": "provided global owner does not match configured global owner"; }, { "code": 6102; "name": "appOwnerInvalid"; "msg": "app owner account does not match configured app's app_owner field"; }, { "code": 6103; "name": "operatorInvalid"; "msg": "Operator account does not match configured app operator"; }, { "code": 6104; "name": "permissionsInsufficient"; "msg": "signer does not have sufficient acl permissions"; }, { "code": 6105; "name": "notAValidator"; "msg": "Ix was not signed with a registered validator account"; }, { "code": 6201; "name": "withdrawalRateLimitExceeded"; "msg": "Total withdrawals in the last period exceeded the rate limit"; }, { "code": 6202; "name": "merkleRootMismatch"; }, { "code": 6203; "name": "effectAlreadyExecuted"; }, { "code": 6301; "name": "eventRootInvalid"; }, { "code": 6302; "name": "eventIndicesGoBackwards"; }, { "code": 6303; "name": "depositTooSmall"; }, { "code": 6401; "name": "blockEmpty"; "msg": "Block does not contain a state transition"; }, { "code": 6403; "name": "blockNotFinalized"; "msg": "Block must be finalized before this operation"; }, { "code": 6404; "name": "blockAlreadyFinalized"; "msg": "Block already finalized"; }, { "code": 6405; "name": "blockAlreadyChallenged"; "msg": "Block already challenged by this validator"; }, { "code": 6406; "name": "blockDoesNotExist"; }, { "code": 6407; "name": "blockIsFinaTip"; "msg": "Cannot prune current finalized block tip"; }, { "code": 6408; "name": "blockTooRecent"; "msg": "Block is not old enough to be pruned"; }, { "code": 6409; "name": "blockHasUnexecutedEffects"; "msg": "Block’s effects have not all been executed"; }, { "code": 6410; "name": "refundAccountInvalid"; "msg": "Refund account does not match the one stored in the block."; }, { "code": 6411; "name": "blockNotPruned"; "msg": "Block hasn't yet been pruned"; }, { "code": 6412; "name": "childBlocksInvalid"; "msg": "ChildBlocks account does not exist or is invalid"; }, { "code": 6413; "name": "childBlocksNoFinaCandidates"; "msg": "ChildBlocks account contains no finalizable candidates"; }, { "code": 6414; "name": "actionsGoBackwards"; }, { "code": 6415; "name": "challengePeriodExpired"; }, { "code": 6501; "name": "appVersionNotAllowed"; "msg": "App version of block is not whitelisted for proposals or finalizations"; }, { "code": 6502; "name": "appVersionsTooMany"; "msg": "App already at max allowed app versions capacity"; } ]; "types": [ { "name": "app"; "docs": [ "The central state of an app instance.", "", "# Multitenancy", "The bridge contract is multitenant. There may be multiple independent", "[`App`] instances owned by a single bridge program.", "", "Accounts owned by an app *instance* are PDAs \"namespaced\" by including", "the [`App`] address in their seeds." ]; "type": { "kind": "struct"; "fields": [ { "name": "owner"; "type": "pubkey"; }, { "name": "frozen"; "docs": [ "Freeze all non-owner operations on this app" ]; "type": "bool"; }, { "name": "operator"; "docs": [ "Authority allowed to make proposals." ]; "type": "pubkey"; }, { "name": "challengeConsensusThreshold"; "docs": [ "Number of challenges required to disqualify a block from finalization.", "For consensus fraud proof on proposed blocks.", "", "Value of 0 means every block becomes unfinalizable, halting withdrawals", "indefinitely.", "", "Value greater than validator set size means *any* block can be finalized", "immediately even if challenged, defeating the fraud-proof mechanism." ]; "type": "u16"; }, { "name": "challengePeriodSlots"; "docs": [ "Initial number of slots during which a block can be challenged", "", "Value of 0 means challenge window closes in the same slot; honest", "validators cannot react, enabling malicious block finalization.", "", "Value very large means blocks remain \"Proposed\" for years, preventing", "finalization and liquidity exit (economic DoS)." ]; "type": "u64"; }, { "name": "lastBlockId"; "docs": [ "Last block id that was proposed. Highest valid block id.", "Blocks created and this counter bumped exclusively on proposal.", "", "NOTE: this *could* be instead a separate counter per ChildBlocks account but", "this global counter makes it a little easier to track the timeline of", "when blocks where proposed." ]; "type": "u64"; }, { "name": "lastEventIndex"; "docs": [ "Last event index that was made. Highest valid event index.", "Deposits created and this counter bumped exclusively on deposit." ]; "type": "u64"; }, { "name": "finaStateFactsPrevCmtmt"; "docs": [ "`prev_state_facts.hash()` of the latest finalized block.", "Used to find the ChildBlocks layer holding the latest finalized block." ]; "type": { "defined": { "name": "commitment"; }; }; }, { "name": "finaStateFacts"; "docs": [ "Recent-most finalized state facts.", "This corresponds to the next_state_facts of the last finalized block." ]; "type": { "defined": { "name": "stateFacts"; }; }; }, { "name": "targetFinaStateFacts"; "docs": [ "If set, only blocks working towards these state facts will be", "finalizable. Once the target reached, this is unset.", "", "If set to a statefacts in the past or impossible to \"work towards\",", "the app will not accept any finalizations.", "", "Can be manually set to None by the owner to remove the restriction." ]; "type": { "option": { "defined": { "name": "stateFacts"; }; }; }; }, { "name": "blockLifetime"; "docs": [ "Block retention policy.", "Blocks where slot_proposed + block_lifetime < slot_current are prunable." ]; "type": "u64"; }, { "name": "allowedAppVersions"; "docs": [ "Allowed app versions for new proposals and finalizations.", "", "We only need to allow up to 2 versions concurrently in a typical upgrade", "scenario: one for the state translation and one for the new app version.", "", "We allow up to ALLOWED_APP_VERSIONS_LEN_MAX > 2 for some extra", "maneuverability in case it is needed." ]; "type": { "vec": { "defined": { "name": "commitment"; }; }; }; } ]; }; }, { "name": "appConfig"; "type": { "kind": "struct"; "fields": [ { "name": "owner"; "type": "pubkey"; }, { "name": "operator"; "type": "pubkey"; }, { "name": "challengeConsensusThreshold"; "type": "u16"; }, { "name": "challengePeriodSlots"; "type": "u64"; }, { "name": "initialAppStateCommitment"; "type": { "array": [ "u8", 32 ]; }; }, { "name": "blockLifetime"; "type": "u64"; } ]; }; }, { "name": "assetConfig"; "type": { "kind": "struct"; "fields": [ { "name": "minDeposit"; "type": "u64"; } ]; }; }, { "name": "blockFacts"; "docs": [ "State transition block facts." ]; "type": { "kind": "struct"; "fields": [ { "name": "appVersion"; "type": { "defined": { "name": "commitment"; }; }; }, { "name": "prevStateFacts"; "type": { "defined": { "name": "stateFacts"; }; }; }, { "name": "nextStateFacts"; "type": { "defined": { "name": "stateFacts"; }; }; }, { "name": "daCommitment"; "type": { "defined": { "name": "commitment"; }; }; }, { "name": "effectsRoot"; "type": { "defined": { "name": "commitment"; }; }; }, { "name": "effectsCount"; "type": "u64"; } ]; }; }, { "name": "commitment"; "repr": { "kind": "transparent"; }; "type": { "kind": "struct"; "fields": [ { "array": [ "u8", 32 ]; } ]; }; }, { "name": "config"; "type": { "kind": "struct"; "fields": [ { "name": "maxBurst"; "type": "u64"; }, { "name": "ratePerSlot"; "type": "u64"; } ]; }; }, { "name": "effectNullifier"; "type": { "kind": "struct"; "fields": [ { "name": "refundAccount"; "docs": [ "Who to refund the rent of this nullifier to." ]; "type": "pubkey"; } ]; }; }, { "name": "event"; "repr": { "kind": "rust"; }; "type": { "kind": "enum"; "variants": [ { "name": "deposit"; "fields": [ { "name": "transfer"; "type": { "defined": { "name": "transferParams"; }; }; } ]; } ]; }; }, { "name": "global"; "type": { "kind": "struct"; "fields": [ { "name": "owner"; "type": "pubkey"; } ]; }; }, { "name": "permissionSet"; "type": { "kind": "struct"; "fields": [ "u16" ]; }; }, { "name": "queuedEvent"; "type": { "kind": "struct"; "fields": [ { "name": "event"; "type": { "defined": { "name": "event"; }; }; }, { "name": "prevEventRoot"; "type": { "defined": { "name": "commitment"; }; }; } ]; }; }, { "name": "stateFacts"; "repr": { "kind": "c"; }; "type": { "kind": "struct"; "fields": [ { "name": "appStateCommitment"; "type": { "defined": { "name": "commitment"; }; }; }, { "name": "eventRoot"; "type": { "defined": { "name": "commitment"; }; }; }, { "name": "lastEventIndex"; "type": "u64"; }, { "name": "lastActionId"; "type": "u64"; } ]; }; }, { "name": "tokenBucket"; "type": { "kind": "struct"; "fields": [ { "name": "cfg"; "type": { "defined": { "name": "config"; }; }; }, { "name": "tokens"; "type": "u64"; }, { "name": "lastUpdate"; "type": "u64"; } ]; }; }, { "name": "transferParams"; "type": { "kind": "struct"; "fields": [ { "name": "authority"; "type": "pubkey"; }, { "name": "mint"; "type": "pubkey"; }, { "name": "amount"; "type": "u64"; } ]; }; }, { "name": "unqueuedEvent"; "type": { "kind": "struct"; "fields": [ { "name": "event"; "type": { "defined": { "name": "event"; }; }; } ]; }; }, { "name": "withdrawalClaim"; "type": { "kind": "struct"; "fields": [ { "name": "user"; "type": "pubkey"; }, { "name": "amount"; "type": "u64"; }, { "name": "prevStateFactsCmtmt"; "type": { "defined": { "name": "commitment"; }; }; }, { "name": "blockId"; "type": "u64"; }, { "name": "proof"; "type": { "vec": { "defined": { "name": "commitment"; }; }; }; }, { "name": "leafIndex"; "type": "u64"; }, { "name": "leavesCount"; "type": "u64"; } ]; }; } ]; };