Variables

There are 3 types of variables

Output variable

Output variable is a variable, that references one of the previous call output values.

{ type: "output", id: { nodeId: string, innerIndex: number }

External variable

External variable is a variable, that gets passed in variables array with FCT

{ type: "external", id: number }

Global variable

Global variable is a variable, that is accessible as global variable in function runtime on blockchain.

Global variables that are available are (IDs):

  • blockNumber - Block number

  • blockTimestamp - Block timestamp

  • gasPrice - Price of gas at the runtime

  • minerAddress - Address, which mines the block

  • activatorAddress - Address, who activated the FCT

  • blockHash - Hash of the blockchain

{ type: "global", id: string }

Computed variable

Computed variable is a variable, that can take any other variable and do mathematical equations to them.

{ type: "computed", id: { 
    variable: string | Variable,
    add: string,
    sub: string,
    mul: string,
    div: string,
  }
}

Where can you use variables?

Variables can be used at any value parameter.

Last updated