SolidScript ships as a TypeScript package you can import directly in contract source files and in build tooling. When you author contracts, you pull in types, decorators, and runtime globals. When you drive the compiler programmatically — for example in a custom build script or a CI pipeline — you use the compiler pipeline exports to parse, validate, optimise, and emit Solidity without touching the CLI.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.
Compiler pipeline exports
Use these exports when you need to integrate SolidScript into an existing Node.js build process or call the compiler from application code.| Export | Description |
|---|---|
parseContractFiles | Parse TypeScript contract files into the SolidScript intermediate representation (IR) |
validateProgram | Run the native static validation rules against the parsed program |
optimizeProgram | Apply optimiser passes to the parsed program in place |
emitProgram | Emit Solidity source from the parsed program and return one result object per file |
compileSolidity | Compile the emitted Solidity to ABI and bytecode artifacts |
Contract types
SolidScript exports branded primitive types that map directly to EVM value types. Use them in function signatures and storage fields to catch unit errors at compile time.| Export | Meaning |
|---|---|
Address | Branded EVM address string |
CheckedAddress | Address returned by validate(addr), guaranteed to be non-zero and checksum-valid |
Bytes32 | Branded 32-byte value |
Bytes | Branded arbitrary-length byte string |
Runtime globals
msg and block expose the transaction and block context that Solidity contracts depend on. Import them and reference their properties inside any contract method.
Decorators and helpers
SolidScript decorators map one-to-one to Solidity modifiers, access patterns, and code generation targets. Apply them to class fields or methods inside a contract class.| Export | Purpose |
|---|---|
storage | Mark class fields as contract state variables |
view | Mark methods as read-only (no state writes allowed) |
pure | Mark methods as state-independent (no state reads or writes) |
payable | Allow an entrypoint to receive Ether |
onlyOwner | Add owner-gated access control to a method |
nonReentrant | Add reentrancy protection to a method |
whenNotPaused | Add a pause guard to a method |
assembly | Inline a Yul body inside a method |
invariant | Generate invariant tests for the decorated condition |
unsafe | Document and explicitly allow an unsafe pattern |
allowTxOrigin | Targeted override permitting tx.origin use |
allowSelfdestruct | Targeted override permitting selfdestruct |
allowZeroAddress | Targeted override permitting zero-address behaviour |
allowLowLevelCall | Targeted override permitting low-level calls |
throws | Declare custom errors on a method |
require | Assert a precondition; reverts with the given message if it fails |
revert | Revert execution unconditionally |
emit | Emit a contract event |
pullPayment | Queue a pull payment for later withdrawal |
Crypto and ABI helpers
SolidScript re-exports the cryptographic primitives and ABI utilities you need for hashing, signature recovery, and calldata encoding.ecrecover accepts a digest and a signature and returns the signer’s Address. sha256 follows the same call signature as keccak256.
Standards
SolidScript ships base implementations of the most common token standards. Import and extend them instead of writing the interface from scratch.ERC20 provides totalSupply, balanceOf, transfer, allowance, approve, transferFrom, _mint, and _burn. ERC721 provides ownerOf and balanceOf.
Use the package’s generated
dist/index.d.ts as the authoritative source for exact type signatures when integrating the compiler pipeline programmatically.