Limitations of Orbs Contracts

Orbs contracts are written in the Go programming language.

To enhance the security and enable multiple virtual chains in the Orbs blockchain, the smart contracts are limited in regards of the Go language. Specifically, which features and packages of the language are allowed to execute inside the Orbs Virtual Machine.

Package Whitelist

All packages in Go are not allowed with the exception of specific packages expressed in the whitelist below:

// Orbs Contract SDK
// Text
// Time
// Binary
// Encoding
// Utils

Trying to include any package not in that list will result failed compilation of the smart contract.

Time functions blacklist

While we enable the use of the time package for time manipulation, it contains several functions which would result inconsistent and non-deterministic results in contracts, and thus they are blacklisted, these functions are:


Using any of these functions will result failed compilation of the smart contract.

If you want the current time ('Now'), it is possible to use the contract SDK function env.GetBlockTimestamp()

Blacklisted Features

Aside from a whitelist of the allowed packages, Orbs will not allow the usage of the following Go language features:

  • Channels

  • Goroutines (the go statement)

  • The 'arrow' unary expression (<-)

Using any of the above will result in a failed compilation of the smart contract.