Skip to content

Syscalls and Devpack

The compiler emits Neo syscalls and native contract calls for common Solidity constructs. The devpack exposes the same runtime surface for explicit contracts.

Solidity to Neo Runtime Calls

Solidity ConstructNeo Runtime CallNotes
msg.senderSystem.Runtime.GetCallingScriptHashImmediate caller script hash or transaction signer; some internal/self-offset runtime paths inject a direct-caller override.
address(this)System.Runtime.GetExecutingScriptHashCurrent contract script hash.
block.timestampSystem.Runtime.GetTimeNeo milliseconds normalized to seconds.
block.numberLedger.currentIndexNative contract call through System.Contract.Call.
gasleft()System.Runtime.GasLeftRemaining invocation GAS.
State variable readSystem.Storage.GetKey derived from state variable name.
State variable writeSystem.Storage.PutKey derived from state variable name.
mapping[key] read/writeSystem.Storage.Get / System.Storage.PutKey derived by iterative SHA256 hashing.
emit Event(...)System.Runtime.NotifyEvent name plus serialized arguments.
Runtime.checkWitness(addr)System.Runtime.CheckWitnessAccount witness verification.
address(target).call(...)System.Contract.CallCross-contract invocation.
keccak256(...)CryptoLib.keccak256Native contract call.
sha256(...)CryptoLib.sha256Native contract call.

Devpack Layers

LayerImportUse
Low-level syscallsdevpack/contracts/Syscalls.solTyped wrappers for direct Neo N3 syscall access.
Runtime helpersdevpack/libraries/Runtime.solWitness checks, time, logging, notifications, and execution context.
Storage helpersdevpack/libraries/Storage.solTyped storage accessors, iterator helpers, mapping and array keys.
Native contract helpersdevpack/libraries/Neo.sol and related wrappersGAS, NEO, Ledger, Policy, Oracle, CryptoLib, and ContractManagement calls.
Standardsdevpack/standards/*.solNEP token and lifecycle standard implementations.

When to Use Devpack Calls

Use normal Solidity syntax for common constructs such as state variables, events, and typed contract calls. Use devpack wrappers when your contract needs Neo-specific functionality, direct native contract access, or explicit witness and storage utilities.

More Detail

MIT Licensed