CCC Docs
    Preparing search index...

    Function createMutant

    • Create a native Rust Mutant: an immutable cell whose data is a RISC-V ELF executed by the Spore contract through CKB-VM2 spawn/wait (spore-contract#75). The contract runs the ELF once at creation.

      The v3 Mutant preset is empty until the contracts are deployed; pass scriptInfo explicitly to target a custom or pre-release deployment.

      Parameters

      • params: {
            signer: Signer;
            code: BytesLike;
            payment?: NumLike;
            to?: ScriptLike;
            tx?: TransactionLike;
            scriptInfo?: SporeScriptInfoLike;
        }
        • signer: Signer

          who takes the responsibility to balance and sign the transaction

        • code: BytesLike

          the RISC-V ELF stored as the Mutant cell's data

        • Optionalpayment?: NumLike

          optional minimal mint payment in shannons, appended to the Mutant ID

        • Optionalto?: ScriptLike

          the owner of the Mutant cell, which will be replaced with signer if not provided

        • Optionaltx?: TransactionLike

          the transaction skeleton, if not provided, a new one will be created

        • OptionalscriptInfo?: SporeScriptInfoLike

          the Mutant extension script info

      Returns Promise<{ tx: Transaction; id: `0x${string}` }>

      • tx: a new transaction that contains the created Mutant cell
      • id: the Mutant ID