Skip to content

Latest commit

 

History

History
29 lines (17 loc) · 611 Bytes

File metadata and controls

29 lines (17 loc) · 611 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.

Note: Constants do only support literals at this point

Example:

const TEN: u256 = 10

contract Foo:

  pub fn bar() -> u256:
    return TEN * 5