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
| Function | SS | Description |
|---|
assetId() view -> bytes32 | 2.2 | Immutable - keccak256(pk || ts || nonce) |
currentState() view -> AssetState | 2.4 | Lifecycle state enum |
transfer(receiver, amount, nonce) -> bytes32 | 9.6 | Nonce-based replay protection |
checkCompliance(sender, receiver, amount) | 4.3 | Returns (bool allowed, bytes32 rule) |
crossChainCertificateId() view -> bytes32 | 8.3 | Current CID |
L3RS1Hashing Library
| Function | SS | Description |
|---|
constructAssetId(pubkey, ts, nonce) | 2.2 | keccak256(pk || ts || nonce) |
constructCID(id, sh, ch, gh, ts) | 8.3 | keccak256(I || SH || CH || GH || t) |
constructTxId(sender, receiver, amount, nonce, ts) | 9.6 | keccak256(all fields) |
State Transition Matrix
| From | Trigger | To |
| ISSUED | ACTIVATION | ACTIVE |
| ACTIVE | BREACH | RESTRICTED |
| ACTIVE | FREEZE | FROZEN |
| RESTRICTED | CLEARED | ACTIVE |
| FROZEN | RELEASE | ACTIVE |
| ACTIVE | REDEMPTION | REDEEMED |
| REDEEMED | FINALIZATION | BURNED (terminal) |
| ACTIVE | SUSPENSION | SUSPENDED |
| SUSPENDED | REINSTATEMENT | ACTIVE |