Skip to main content

ULedgerNET Smart Contracts & Tokens

Overview

ULedgerNET provides a comprehensive smart contract platform based on WebAssembly (WASM) and a native token system supporting fungible tokens, non-fungible tokens (NFTs), and multi-tokens.

WASM Runtime

Architecture

WASM Runtime Features

ULedgerNET uses a high-performance WASM runtime for contract execution:

FeatureDescription
RuntimeProduction-grade WASM engine
Memory ModelLinear memory with growth
ExecutionJIT compilation
IsolationSandboxed execution

Gas Metering

Gas System Overview

Operation Categories

CategoryDescription
Base OperationsWASM instructions, function calls
MemoryAllocation, growth, access
StorageRead, write, delete
Host FunctionsExternal calls to runtime

Host Functions

Available Host Functions

Host Function Details

FunctionParametersReturnsDescription
get_storagekey: stringvalueRetrieve stored value
set_storagekey: string, value-Store value
delete_storagekey: string-Remove stored value
has_keykey: stringboolCheck key existence
get_caller-addressTransaction sender
get_owner-addressContract owner
get_block_height-uint64Current block height
emit_eventname, data-Emit contract event

Contract Lifecycle

Deployment

Invocation

Upgrade/Rollback

Native Token System

Supported Standards

Token Architecture

Fungible Tokens (ERC20-like)

Token Creation

Token Operations

OperationDescriptionPayload Fields
CREATEDeploy new tokenname, symbol, decimals, initialSupply
TRANSFERSend tokenstokenAddress, to, amount
APPROVEAllow spendingtokenAddress, spender, amount
MINTCreate new tokenstokenAddress, to, amount
BURNDestroy tokenstokenAddress, amount

Non-Fungible Tokens (ERC721-like)

NFT Structure

NFT Operations

OperationDescriptionPayload Fields
CREATEDeploy NFT collectionname, symbol
MINTCreate new NFTtokenAddress, to, tokenId, uri
TRANSFERTransfer NFTtokenAddress, from, to, tokenId
APPROVEApprove transfertokenAddress, to, tokenId
SET_APPROVAL_FOR_ALLApprove operatortokenAddress, operator, approved
BURNDestroy NFTtokenAddress, tokenId

Multi-Tokens (ERC1155-like)

Multi-Token Features

Multi-Token Operations

OperationDescription
CREATEDeploy multi-token contract
MINTMint single token type
MINT_BATCHMint multiple token types
TRANSFERTransfer single token type
TRANSFER_BATCHTransfer multiple token types
CONVERTConvert between fungible/non-fungible

Transaction Types

Transaction Type Enumeration

Security Features

Contract Execution Security

Security Manager Features

FeatureDescription
Operation ValidationPre-execution security checks
Call Stack TrackingPrevent deep recursion
Circuit BreakerHalt on repeated failures
Resource LimitsMemory and computation bounds

State Management

Atomic Execution

State Storage

Storage TypeKey FormatDescription
Contract Statecontract:{address}:{key}Arbitrary key-value storage
Token Balancestoken:{address}:balance:{owner}Fungible token balances
NFT Ownershipnft:{address}:owner:{tokenId}NFT owner mapping
Approvals{type}:{address}:approval:{...}Approval mappings

Next: Security Considerations