UNPKG

@pushchain/core

Version:

Push Chain is a true universal L1 that is 100% EVM compatible. It allows developers to deploy once and make their apps instantly compatible with users from all other L1s (Ethereum, Solana, etc) with zero on-chain code change.

1,536 lines (1,535 loc) 110 kB
{ "address": "CFVSincHYbETh2k7w6u1ENEkjbSLtveRCEBupKidw2VS", "metadata": { "name": "universal_gateway", "version": "0.1.0", "spec": "0.1.0", "description": "Universal Gateway for Solana - Cross-chain bridge and transaction router" }, "instructions": [ { "name": "execute_universal_tx", "docs": [ "@notice TSS-verified execute arbitrary Solana instruction with SOL", "@param tx_id Transaction ID from Push chain event", "@param amount Amount of SOL to transfer to cea authority", "@param target_program Target Solana program to invoke", "@param sender EVM sender address (same as origin_caller in EVM)", "@param accounts Ordered list of accounts for target program", "@param ix_data Instruction data for target program" ], "discriminator": [ 248, 132, 87, 87, 210, 51, 117, 76 ], "accounts": [ { "name": "caller", "writable": true, "signer": true }, { "name": "config", "pda": { "seeds": [ { "kind": "const", "value": [ 99, 111, 110, 102, 105, 103 ] } ] } }, { "name": "vault_sol", "docs": [ "Vault SOL PDA - holds all bridged SOL" ], "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 118, 97, 117, 108, 116 ] } ] } }, { "name": "cea_authority", "docs": [ "CEA (Chain Executor Account) - persistent identity per Push Chain user", "This PDA represents the user on Solana and can sign for target programs", "Auto-created by Solana on first transfer, persists across transactions" ], "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 112, 117, 115, 104, 95, 105, 100, 101, 110, 116, 105, 116, 121 ] }, { "kind": "arg", "path": "sender" } ] } }, { "name": "tss_pda", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 116, 115, 115, 112, 100, 97 ] } ] } }, { "name": "executed_tx", "docs": [ "Executed transaction tracker (replay protection)", "Relayer pays for this account creation and gets reimbursed via gas_fee" ], "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 101, 120, 101, 99, 117, 116, 101, 100, 95, 116, 120 ] }, { "kind": "arg", "path": "tx_id" } ] } }, { "name": "destination_program" }, { "name": "system_program", "address": "11111111111111111111111111111111" } ], "args": [ { "name": "tx_id", "type": { "array": [ "u8", 32 ] } }, { "name": "amount", "type": "u64" }, { "name": "target_program", "type": "pubkey" }, { "name": "sender", "type": { "array": [ "u8", 20 ] } }, { "name": "accounts", "type": { "vec": { "defined": { "name": "GatewayAccountMeta" } } } }, { "name": "ix_data", "type": "bytes" }, { "name": "gas_fee", "type": "u64" }, { "name": "rent_fee", "type": "u64" }, { "name": "signature", "type": { "array": [ "u8", 64 ] } }, { "name": "recovery_id", "type": "u8" }, { "name": "message_hash", "type": { "array": [ "u8", 32 ] } }, { "name": "nonce", "type": "u64" } ] }, { "name": "execute_universal_tx_token", "docs": [ "@notice TSS-verified execute arbitrary Solana instruction with SPL tokens", "@param tx_id Transaction ID from Push chain event", "@param amount Amount of SPL tokens to transfer to cea ATA", "@param target_program Target Solana program to invoke", "@param sender EVM sender address (same as origin_caller in EVM)", "@param accounts Ordered list of accounts for target program", "@param ix_data Instruction data for target program" ], "discriminator": [ 109, 179, 159, 72, 154, 247, 19, 188 ], "accounts": [ { "name": "caller", "writable": true, "signer": true }, { "name": "config", "pda": { "seeds": [ { "kind": "const", "value": [ 99, 111, 110, 102, 105, 103 ] } ] } }, { "name": "vault_authority", "docs": [ "Vault authority PDA - owner of all vault ATAs" ], "pda": { "seeds": [ { "kind": "const", "value": [ 118, 97, 117, 108, 116 ] } ] } }, { "name": "vault_ata", "docs": [ "Vault ATA for this mint" ], "writable": true }, { "name": "cea_authority", "docs": [ "CEA (Chain Executor Account) - persistent identity per Push Chain user", "This PDA represents the user on Solana and can sign for target programs" ], "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 112, 117, 115, 104, 95, 105, 100, 101, 110, 116, 105, 116, 121 ] }, { "kind": "arg", "path": "sender" } ] } }, { "name": "cea_ata", "docs": [ "CEA ATA for this user+mint", "Created per-tx, closed after (rent reclaim)" ], "writable": true }, { "name": "mint", "docs": [ "Token mint" ] }, { "name": "tss_pda", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 116, 115, 115, 112, 100, 97 ] } ] } }, { "name": "vault_sol", "docs": [ "Vault SOL PDA (needed for rent_fee transfer to CEA and gas_fee reimbursement to relayer)" ], "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 118, 97, 117, 108, 116 ] } ] } }, { "name": "executed_tx", "docs": [ "Executed transaction tracker (replay protection)", "Relayer pays for this account creation and gets reimbursed via gas_fee" ], "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 101, 120, 101, 99, 117, 116, 101, 100, 95, 116, 120 ] }, { "kind": "arg", "path": "tx_id" } ] } }, { "name": "destination_program" }, { "name": "token_program", "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" }, { "name": "system_program", "address": "11111111111111111111111111111111" }, { "name": "rent", "address": "SysvarRent111111111111111111111111111111111" }, { "name": "associated_token_program", "address": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL" } ], "args": [ { "name": "tx_id", "type": { "array": [ "u8", 32 ] } }, { "name": "amount", "type": "u64" }, { "name": "target_program", "type": "pubkey" }, { "name": "sender", "type": { "array": [ "u8", 20 ] } }, { "name": "accounts", "type": { "vec": { "defined": { "name": "GatewayAccountMeta" } } } }, { "name": "ix_data", "type": "bytes" }, { "name": "gas_fee", "type": "u64" }, { "name": "rent_fee", "type": "u64" }, { "name": "signature", "type": { "array": [ "u8", 64 ] } }, { "name": "recovery_id", "type": "u8" }, { "name": "message_hash", "type": { "array": [ "u8", 32 ] } }, { "name": "nonce", "type": "u64" } ] }, { "name": "get_sol_price", "docs": [ "@notice View function for SOL price (locker-compatible)", "@dev Anyone can fetch SOL price in USD" ], "discriminator": [ 230, 145, 206, 175, 43, 184, 97, 110 ], "accounts": [ { "name": "price_update" } ], "args": [], "returns": { "defined": { "name": "PriceData" } } }, { "name": "init_tss", "discriminator": [ 47, 31, 100, 111, 115, 2, 22, 208 ], "accounts": [ { "name": "tss_pda", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 116, 115, 115, 112, 100, 97 ] } ] } }, { "name": "config", "pda": { "seeds": [ { "kind": "const", "value": [ 99, 111, 110, 102, 105, 103 ] } ] } }, { "name": "authority", "writable": true, "signer": true }, { "name": "system_program", "address": "11111111111111111111111111111111" } ], "args": [ { "name": "tss_eth_address", "type": { "array": [ "u8", 20 ] } }, { "name": "chain_id", "type": "string" } ] }, { "name": "initialize", "docs": [ "@notice Initialize the gateway" ], "discriminator": [ 175, 175, 109, 31, 13, 152, 155, 237 ], "accounts": [ { "name": "config", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 99, 111, 110, 102, 105, 103 ] } ] } }, { "name": "vault", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 118, 97, 117, 108, 116 ] } ] } }, { "name": "admin", "writable": true, "signer": true }, { "name": "system_program", "address": "11111111111111111111111111111111" } ], "args": [ { "name": "admin", "type": "pubkey" }, { "name": "pauser", "type": "pubkey" }, { "name": "tss", "type": "pubkey" }, { "name": "min_cap_usd", "type": "u128" }, { "name": "max_cap_usd", "type": "u128" }, { "name": "pyth_price_feed", "type": "pubkey" } ] }, { "name": "pause", "docs": [ "@notice Pause the gateway" ], "discriminator": [ 211, 22, 221, 251, 74, 121, 193, 47 ], "accounts": [ { "name": "config", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 99, 111, 110, 102, 105, 103 ] } ] } }, { "name": "pauser", "signer": true } ], "args": [] }, { "name": "remove_whitelist_token", "docs": [ "@notice Remove token from whitelist" ], "discriminator": [ 65, 182, 42, 255, 198, 163, 73, 46 ], "accounts": [ { "name": "config", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 99, 111, 110, 102, 105, 103 ] } ] } }, { "name": "whitelist", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 119, 104, 105, 116, 101, 108, 105, 115, 116 ] } ] } }, { "name": "admin", "writable": true, "signer": true }, { "name": "system_program", "address": "11111111111111111111111111111111" } ], "args": [ { "name": "token", "type": "pubkey" } ] }, { "name": "reset_nonce", "discriminator": [ 104, 139, 110, 85, 234, 155, 132, 248 ], "accounts": [ { "name": "tss_pda", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 116, 115, 115, 112, 100, 97 ] } ] } }, { "name": "authority", "signer": true } ], "args": [ { "name": "new_nonce", "type": "u64" } ] }, { "name": "revert_universal_tx", "docs": [ "@notice TSS-verified revert withdraw for SOL (EVM parity: `revertUniversalTx`)", "@param tx_id Transaction ID for tracking" ], "discriminator": [ 124, 49, 81, 233, 23, 147, 82, 122 ], "accounts": [ { "name": "config", "pda": { "seeds": [ { "kind": "const", "value": [ 99, 111, 110, 102, 105, 103 ] } ] } }, { "name": "vault", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 118, 97, 117, 108, 116 ] } ] } }, { "name": "tss_pda", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 116, 115, 115, 112, 100, 97 ] } ] } }, { "name": "recipient", "writable": true }, { "name": "executed_tx", "docs": [ "Executed transaction tracker (EVM parity: isExecuted[txID])" ], "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 101, 120, 101, 99, 117, 116, 101, 100, 95, 116, 120 ] }, { "kind": "arg", "path": "tx_id" } ] } }, { "name": "caller", "docs": [ "The caller/relayer who pays for the transaction (including executed_tx account creation)" ], "writable": true, "signer": true }, { "name": "system_program", "address": "11111111111111111111111111111111" } ], "args": [ { "name": "tx_id", "type": { "array": [ "u8", 32 ] } }, { "name": "amount", "type": "u64" }, { "name": "revert_instruction", "type": { "defined": { "name": "RevertInstructions" } } }, { "name": "gas_fee", "type": "u64" }, { "name": "signature", "type": { "array": [ "u8", 64 ] } }, { "name": "recovery_id", "type": "u8" }, { "name": "message_hash", "type": { "array": [ "u8", 32 ] } }, { "name": "nonce", "type": "u64" } ] }, { "name": "revert_universal_tx_token", "docs": [ "@notice TSS-verified revert withdraw for SPL tokens (EVM parity: `revertUniversalTxToken`)", "@param tx_id Transaction ID for tracking" ], "discriminator": [ 139, 196, 1, 242, 109, 31, 98, 32 ], "accounts": [ { "name": "config", "pda": { "seeds": [ { "kind": "const", "value": [ 99, 111, 110, 102, 105, 103 ] } ] } }, { "name": "whitelist" }, { "name": "vault", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 118, 97, 117, 108, 116 ] } ] } }, { "name": "token_vault", "writable": true }, { "name": "tss_pda", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 116, 115, 115, 112, 100, 97 ] } ] } }, { "name": "recipient_token_account", "docs": [ "Recipient token account (ATA for fund_recipient + token_mint)" ], "writable": true }, { "name": "token_mint" }, { "name": "executed_tx", "docs": [ "Executed transaction tracker (EVM parity: isExecuted[txID])" ], "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 101, 120, 101, 99, 117, 116, 101, 100, 95, 116, 120 ] }, { "kind": "arg", "path": "tx_id" } ] } }, { "name": "caller", "docs": [ "The caller/relayer who pays for the transaction (including executed_tx account creation)" ], "writable": true, "signer": true }, { "name": "vault_sol", "docs": [ "Vault SOL PDA (needed for gas_fee transfer to caller)" ], "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 118, 97, 117, 108, 116 ] } ] } }, { "name": "token_program", "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" }, { "name": "system_program", "address": "11111111111111111111111111111111" } ], "args": [ { "name": "tx_id", "type": { "array": [ "u8", 32 ] } }, { "name": "amount", "type": "u64" }, { "name": "revert_instruction", "type": { "defined": { "name": "RevertInstructions" } } }, { "name": "gas_fee", "type": "u64" }, { "name": "signature", "type": { "array": [ "u8", 64 ] } }, { "name": "recovery_id", "type": "u8" }, { "name": "message_hash", "type": { "array": [ "u8", 32 ] } }, { "name": "nonce", "type": "u64" } ] }, { "name": "send_universal_tx", "docs": [ "@notice Universal transaction entrypoint with internal routing (EVM parity).", "@dev Native amount parameter mirrors `msg.value` on EVM chains.", "All routing (gas / funds / batching) is handled inside the deposit module." ], "discriminator": [ 145, 19, 164, 55, 165, 220, 23, 97 ], "accounts": [ { "name": "config", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 99, 111, 110, 102, 105, 103 ] } ] } }, { "name": "vault", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 118, 97, 117, 108, 116 ] } ] } }, { "name": "user_token_account", "docs": [ "For native SOL routes, pass vault account as dummy (not used)." ], "writable": true }, { "name": "gateway_token_account", "docs": [ "For native SOL routes, pass vault account as dummy (not used)." ], "writable": true }, { "name": "user", "writable": true, "signer": true }, { "name": "price_update" }, { "name": "rate_limit_config", "docs": [ "Rate limit config - REQUIRED for universal entrypoint" ], "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 114, 97, 116, 101, 95, 108, 105, 109, 105, 116, 95, 99, 111, 110, 102, 105, 103 ] } ] } }, { "name": "token_rate_limit", "docs": [ "Token rate limit - REQUIRED for universal entrypoint", "NOTE: For native SOL, use Pubkey::default() as the token_mint when deriving this PDA" ], "writable": true }, { "name": "token_program", "address": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" }, { "name": "system_program", "address": "11111111111111111111111111111111" } ], "args": [ { "name": "req", "type": { "defined": { "name": "UniversalTxRequest" } } }, { "name": "native_amount", "type": "u64" } ] }, { "name": "set_block_usd_cap", "docs": [ "@notice Set block-based USD cap for rate limiting" ], "discriminator": [ 205, 253, 33, 164, 220, 216, 42, 50 ], "accounts": [ { "name": "config", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 99, 111, 110, 102, 105, 103 ] } ] } }, { "name": "rate_limit_config", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 114, 97, 116, 101, 95, 108, 105, 109, 105, 116, 95, 99, 111, 110, 102, 105, 103 ] } ] } }, { "name": "admin", "writable": true, "signer": true }, { "name": "system_program", "address": "11111111111111111111111111111111" } ], "args": [ { "name": "block_usd_cap", "type": "u128" } ] }, { "name": "set_caps_usd", "docs": [ "@notice Set USD caps" ], "discriminator": [ 136, 160, 17, 54, 239, 108, 125, 129 ], "accounts": [ { "name": "config", "writable": true, "pda": { "seeds": [ { "kind": "const", "value": [ 99, 111, 110, 102, 105, 103 ] } ] } }, {