Skip to content

Fix a -= b + c #454

@lydiagarms

Description

@lydiagarms

Overview

Starlight will replace A -= B, with A = A - B. However if B is unbracketed b +c then this will give A = A - b +c. This logic is not consistent with solidity.

Tasks

Describe which contracts are affected

// SPDX-License-Identifier: CC0

pragma solidity ^0.8.0;

contract Assign {

secret uint256 private a;
secret uint256 private b;
uint256 private b;

function add(secret uint256 value1, secret uint256 value2) public {
known a += value1;
known b += value2;
}

function remove(secret uint256 value) public {
a -= b + value;

}
}

Describe the bug that should be fixed
The logic should be fixed in orchestration and also the circuits.

Definition of done

When is this task complete?
The above contract should work successfully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions