Kadena Developer Documentation

website·Indexed 35 days ago

https://docs.kadena.io/quickstart

Documentation for the Kadena ecosystem, featuring the Pact smart contract language, the @kadena/client TypeScript library, and the kadena CLI. Includes guides on smart contract development, Chainweb node interaction, Pact REPL functions, and EVM integration via foundry-chainweb.

Tokens
205.2K
Snippets
1.1K
Records
1.6K
Agent score
67%

What's inside Kadena

  1. Overview of the Marmalade Guard Policy

    The Marmalade guard policy contract ensures that token-related actions—including minting, burning, transferring, buying, and selling—are restricted to authorized parties. When applying this policy during token creation, developers can specify the authorization requirements for each type of token activity.
  2. Overview of the Kadena RWA Token Standard

    The Kadena RWA token standard provides a set of open-source smart contracts written in Pact for issuing, managing, and transferring permissioned tokens on the Kadena blockchain. It is designed to be similar to the Ethereum ERC-3643 standard, enabling the tokenization of physical assets (e.g., real estate, art) and financial instruments (e.g., stocks, bonds) with built-in regulatory compliance and permissioned tracking.
  3. Overview of Marmalade Token Standard Architecture

    Marmalade defines a poly-fungible token standard and token policy management system for the Kadena blockchain using Pact smart contracts. The architecture is multi-layered to separate concerns between core ledger operations, policy enforcement, and sales mechanics, ensuring transactions occur in the correct order and comply with predefined rules.
  4. Overview of the mvp-token RWA contract

    The mvp-token contract is a sample real-world asset (RWA) token implementation on Kadena. It extends the fungible-v2 interface to provide customized mint, burn, transfer, and forced-transfer operations. It includes built-in functionality for pausing the entire contract or freezing specific investor accounts, and utilizes an identity registry to manage investor information. The contract is designed to be compatible with custom compliance rules via the compliance-compatible-v1 interface.
  5. Overview of Pact Guards

    Guards in Pact are predicate functions used to enforce authorization rules that grant or restrict access to accounts, privileged operations, or information. A guard returns true (pass) or false (fail) when evaluated using the enforce-guard function. Guards can be stored in the Pact database using the guard type.

    Supported guard types include:

    • Keyset guard
    • KeysetRef guard
    • User guard
    • Capability guard

    Note: Module guards and Pact guards are DEPRECATED and considered unsafe.

  6. Overview of Pact database operations

    Pact smart contracts use a key-row data model where rows are accessed via a single primary key. This model does not support traditional SQL-style joins, though relational logic can be implemented by performing sequential lookups across tables.

    Key constraints include:

    • No NULL values: To ensure transaction totality and safety, NULLs are not allowed. Reading a missing column value via with-read will result in an error.
    • No Delete operation: Pact does not provide a native delete function. To remove data, developers typically implement an active column to mark rows as active or inactive.
    • Versioned History: Every change to a column value is versioned by a transaction identifier, allowing for historical data retrieval of specific changes per transaction.
  7. Overview of the Marmalade Royalty Policy

    The royalty policy extends the base kip.token-policy-v2 interface to implement specific rules for token actions and royalty payouts during the sale of non-fungible tokens (NFTs). It ensures that creators receive agreed-upon royalties when a token is sold.
  8. Overview of @kadena/client

    The @kadena/client is a Node.js package that provides an API for JavaScript and TypeScript applications to interact with the Kadena blockchain. It abstracts the logic required to perform common blockchain tasks such as checking account balances, creating accounts, transferring assets, executing smart contract functions, and signing transactions.
  9. Overview of the foundry-chainweb package

    The Chainweb.sol contract in the foundry-chainweb package provides core features for testing and deploying Solidity projects on the Kadena Chainweb EVM multi-chain network. It manages chain identifier mapping, switching between chains, fork creation, and multi-fork testing environments through four base contracts: Chainweb, ChainwebConfigReader, ChainwebTest, and ChainwebScript.
  10. Overview of Chainweaver for Pact Development

    Chainweaver is an integrated development environment (IDE) for the Pact programming language on the Kadena blockchain. It combines wallet and account management with tools for writing, testing, and deploying smart contracts. Key capabilities include:

    • A built-in read-eval-print-loop (REPL) for interactive code execution.
    • Smart contract module and function exploration.
    • Management of authorization rules via keysets.
    • Deployment and updating of contracts on local development, test, and main networks.
    • Formal verification to mathematically prove code correctness and security.
  11. Overview of Kadena Smart Contract Development Documentation

    The Kadena developer documentation is structured into three main areas to support the development of smart contracts using the Pact programming language:

    1. Smart Contracts: Focuses on learning the Pact language, understanding blockchain-specific concepts, and implementing common programming patterns for secure applications.
    2. Reference: Provides a comprehensive technical directory of Pact syntax, keywords, built-in functions, and CLI tools for interacting with the Kadena blockchain across development, test, and production environments.
    3. Coding Projects: Offers hands-on coding challenges and sample projects (located in the pact-coding-projects repository) to apply theoretical knowledge to real-world use cases.
  12. Overview of Pact time management functions

    Pact provides a set of built-in functions to manipulate, calculate, and format time-based information. These functions allow for adding/subtracting time intervals, calculating differences between timestamps, and converting between UTC values and formatted strings.
    FunctionDescription
    add-timeAdd a specified number of seconds to a time.
    daysSpecify a number of days to add or subtract from a given time.
    diff-timeCompute the difference in seconds between two specified times.
    format-timeFormat a time value using a specified format.
    hoursAdd a specific number of hours to a given time.
    minutesAdd a specific number of minutes to a given time.
    parse-timeConstruct time from a UTC value using a specified format.
    timeConstruct a time object from a UTC value using the %Y-%m-%dT%H:%M:%SZ format.