From 1870b71ca7aa613db39a4db81232a30b83a0717c Mon Sep 17 00:00:00 2001 From: kkahina Date: Tue, 13 Aug 2024 11:29:34 +0100 Subject: [PATCH] fix for a+=value --- test/contracts/Non-Secret-Array.zol | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/contracts/Non-Secret-Array.zol b/test/contracts/Non-Secret-Array.zol index c8800d14..7334981b 100644 --- a/test/contracts/Non-Secret-Array.zol +++ b/test/contracts/Non-Secret-Array.zol @@ -4,20 +4,22 @@ contract Assign { secret uint256 private a; secret uint256 private b; uint256 public index; -uint256 public d; uint256 [3] public c; function add( uint256 value) public { +require(index < c.length, "Index out of bounds"); c[index] += value; } function add1( uint256 value) public { +require(index < c.length, "Index out of bounds"); c[index] += value; -known a +=d; +known a +=value; } function add2( uint256 value) public { + require(index < c.length, "Index out of bounds"); c[index] += value; known a += value; }