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

🔍 click to expand

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

🔍 click to expand

Operation Categories

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

Host Functions

Available Host Functions

🔍 click to expand

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

🔍 click to expand

Invocation

🔍 click to expand

Upgrade/Rollback

🔍 click to expand

Native Token System

Supported Standards

🔍 click to expand

Token Architecture

🔍 click to expand

Fungible Tokens (ERC20-like)

Token Creation

🔍 click to expand

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

🔍 click to expand

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

🔍 click to expand

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

🔍 click to expand

Security Features

Contract Execution Security

🔍 click to expand

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

🔍 click to expand

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