Smart Contracts Built for
the AI Era.

Cadence is a safe, resource-oriented programming language built for the Flow blockchain. Designed for digital ownership and optimized for AI-driven development.

·
$/plugin marketplace add onflow/flow-ai-tools
docs

Architectural Pillars

SAFETY

Resource Oriented

Assets live in account storage as first-class objects. They cannot be lost, duplicated, or forgotten. The type system enforces physical-world scarcity.

ACCESS

Capabilities

Security via object-capabilities. Authority is granted by holding a reference to a resource, removing the need for error-prone permission lists.

// The system enforces ownership
access(all) resource NFT {
    access(all) let id: UInt64
    init() { self.id = self.uuid }
}

// Moves are explicit and safe
access(all) fun transfer(token: @NFT) {
    // '@' denotes a resource that MUST be handled
    Receiver.deposit(token: <- token)
}
The Paradigm Shift

LEDGER VS. RESOURCES

The Old Way (Ledger)

Centralized Accounting

Assets are just entries in a contract's private dictionary. To move value, you update two numbers. This "ledger" model is prone to reentrancy bugs.

mapping(address => uint) balances;
function transfer(address to, uint val) {
  balances[msg.sender] -= val;
  balances[to] += val;
}
The Cadence Way

Direct Ownership

Tokens live in the user's account as vault resources. Withdrawing creates a new resource the compiler tracks: it must be deposited or explicitly destroyed — it cannot be silently lost or duplicated.

let vault = signer.storage.borrow<
auth(FungibleToken.Withdraw) &FlowToken.Vault>
(from: /storage/flowTokenVault)!

let payment <- vault.withdraw(amount: 10.0)
receiver.deposit(from: <- payment)
// payment: must be deposited, cannot be duplicated
Watch The Intro

BUILT FOR CONSUMER APPS & DEFI