Deploy a contract

Prerequisites

  • A wallet with some testnet KAS (can receive this from the faucet).

  • The private key to the account with testnet KAS on Kasplex.

Step1:Obtain the Bytecode

After successful compilation, in the Solidity Compiler panel, locate the compiled contract. Click the Bytecode button to view the compiled bytecode (a hexadecimal string starting with 0x). Copy the object field from the bytecode section.

Step2:Prepare the Kaspa Payload

  • Kasplex L2 enables EVM-compatible smart contracts on Kaspa by embedding EVM bytecode in Kaspa L1 transaction payloads.

  • Take the bytecode (with encoded constructor parameters, if any) from Step 1.

  • Format the payload with the Kasplex identifier and submit the transaction to the Kaspa L1 network.

The Ethereum Virtual Machine limits smart contract bytecode size to 24,576 bytes (24 KB) as per EIP-170. However, due to Kaspa's mass parameter restrictions, some smart contracts approaching this size limit may not fit into a Kaspa L1 transaction payload. To address this, users need to compress the smart contract bytecode using zlib compression and include the compressed data in the payload.

Last updated