Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.solidscipt.zoracle.xyz/llms.txt

Use this file to discover all available pages before exploring further.

SolidScript keeps the contract-authoring type system intentionally small. Every TypeScript type you use in a contract class maps to a concrete Solidity type in the compiled output, so you never need to think in two type systems at once. Understanding the mapping lets you choose the right type for storage layout, gas efficiency, and correctness before compilation.
ChainLockBridge.ts
import { Address, Bytes32, storage, view, block, keccak256, abi } from "solidscript";

export class ChainLockBridge {
  @storage validators: Map<Address, bigint> = new Map();
  @storage processedMessages: Map<Bytes32, boolean> = new Map();

  @view
  computeMessageId(srcChainId: bigint, dstChainId: bigint, nonce: bigint, recipient: Address, amount: bigint): Bytes32 {
    return keccak256(abi.encode(srcChainId, dstChainId, nonce, recipient, amount));
  }
}
bigint is the canonical numeric type for on-chain integers. Address is a branded address string that prevents accidental string assignment. Solidity mappings are written as TypeScript Map<K, V>.
TypeScriptContract meaning
bigintuint256-style integer
numberNumeric value, mapped to integer output
booleanbool
stringSolidity string storage or memory value
Addressaddress
CheckedAddressAddress that passed validate(addr)
Bytes32bytes32
Bytesbytes
Map<K, V>Solidity mapping
Array<T>Solidity array
voidNo return value
The following values have no Solidity equivalent and are not supported in contract classes:
  • null
  • undefined

EVM globals

Built-in globals mirror the EVM execution context. Import msg and block from solidscript to access them:
import { msg, block } from "solidscript";

msg.sender;
msg.value;
msg.data;

block.timestamp;
block.number;
block.coinbase;
block.chainid;

Address validation

Use CheckedAddress and validate when you accept external addresses before sending value. The type system then enforces that only validated addresses reach transfer calls:
import { Address, CheckedAddress, validate } from "solidscript";

const recipient: CheckedAddress = validate(input as Address);
payable(recipient).transfer(amount);