TypeScript Python Go Rust Java Solidity

Solidity SDK

@l3rs/contracts - npm - Solidity 0.8.24
npm install @l3rs/contracts
EVM Profile A (SS17.2). Uses keccak256 as H() on-chain per SS10.3.

Quick Example

import "@l3rs/contracts/contracts/L3RS1Asset.sol";

L3RS1Asset asset = new L3RS1Asset(issuerPubkey, 100, deployNonce);
asset.activate();
bytes32 txId = asset.transfer(receiver, 1000, transferNonce);
(bool ok,) = asset.checkCompliance(sender, receiver, 1000);

L3RS1Asset Functions

FunctionSSDescription
assetId() view -> bytes322.2Immutable - keccak256(pk || ts || nonce)
currentState() view -> AssetState2.4Lifecycle state enum
transfer(receiver, amount, nonce) -> bytes329.6Nonce-based replay protection
checkCompliance(sender, receiver, amount)4.3Returns (bool allowed, bytes32 rule)
crossChainCertificateId() view -> bytes328.3Current CID

L3RS1Hashing Library

FunctionSSDescription
constructAssetId(pubkey, ts, nonce)2.2keccak256(pk || ts || nonce)
constructCID(id, sh, ch, gh, ts)8.3keccak256(I || SH || CH || GH || t)
constructTxId(sender, receiver, amount, nonce, ts)9.6keccak256(all fields)

State Transition Matrix

FromTriggerTo
ISSUEDACTIVATIONACTIVE
ACTIVEBREACHRESTRICTED
ACTIVEFREEZEFROZEN
RESTRICTEDCLEAREDACTIVE
FROZENRELEASEACTIVE
ACTIVEREDEMPTIONREDEEMED
REDEEMEDFINALIZATIONBURNED (terminal)
ACTIVESUSPENSIONSUSPENDED
SUSPENDEDREINSTATEMENTACTIVE