Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 583 Bytes

File metadata and controls

28 lines (19 loc) · 583 Bytes

const statement

Syntax
ConstStatement :
   const IDENTIFIER: Type = Expression\

A const statement introduces a named constant value. Constants are either directly inlined wherever they are used or loaded from the contract code depending on their type.

Example:

const TEN: u256 = 10
const HUNDO: u256 = TEN * TEN

contract Foo {
  pub fn bar() -> u256 {
    return HUNDO
  }
}