Skip to content

Non-literal global constants #427

Description

@hosseinzoda

There are a few cases where we need to define a constant that its value is dependent on another constant.

const SCRIPT_INPUT0_SIZE = 32;
const SCRIPT_INPUTS_SIZE = 1 + SCRIPT_INPUT0_SIZE; // OP_PUSHDATA1 SCRIPT_INPUT0
...
    require(tx.inputs[0].lockingBytecode.split(SCRIPTINPUTS_SIZE)[0] +
                 A_NEW_BYTECODE == tx.outputs[0].lockingBytecode);
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions