Skip to content

Commit

Permalink
feat: test solc v0.8.28
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgar2017 committed Oct 10, 2024
1 parent 21b0bf0 commit e15b8b9
Show file tree
Hide file tree
Showing 24 changed files with 571 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
contract C {
uint128 transient x;
uint128 y;

constructor() {
x = 100;
y = x;
}

function f() external view returns (uint128) {
return y;
}
}

// ====
// EVMVersion: >=cancun
// ----
// f() -> 100
14 changes: 14 additions & 0 deletions solidity/ethereum/getters/transient_value_types.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
contract C {
int8 public transient x;

function f() public returns(int8) {
x = -1;
return this.x();
}
}
// ====
// EVMVersion: >=cancun
// ----
// x() -> 0
// f() -> -1
// x() -> 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
contract C {
int8 public transient x;

function f() public returns(int8) {
x = -1;
return this.h();
}
function g() public {
x = x - 1;
}
function h() public returns(int8) {
this.g();
return this.x();
}
}
// ====
// EVMVersion: >=cancun
// ----
// x() -> 0
// f() -> -2
// h() -> -1
// x() -> 0
92 changes: 92 additions & 0 deletions solidity/ethereum/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2192,6 +2192,10 @@ entries:
modes:
- Y+
version: '>=0.4.12'
transient_state_variable_initialization.sol:
hash: '0x702b8ca960d8a816c995de79c5d8134c'
enabled: true
version: '>=0.8.28'
constructor_inheritance_init_order.sol:
hash: '0x732e47de4aeaedcef778c08b21b2b210'
enabled: true
Expand Down Expand Up @@ -3733,6 +3737,14 @@ entries:
- E
- I
version: '>=0.7.0'
transient_value_types.sol:
hash: '0xb1e434bbc71f843cd4d678eaf26be538'
enabled: true
version: '>=0.8.28'
transient_value_types_multi_frame_call.sol:
hash: '0xb5bdfeb2071e62c3505275035131f306'
enabled: true
version: '>=0.8.28'
value_types.sol:
hash: '0xba12d166de3a7cf7e09fb51f7bb45240'
enabled: true
Expand Down Expand Up @@ -3922,6 +3934,14 @@ entries:
hash: '0xd7e21a5b8052338d07f212197e327a3b'
enabled: true
version: '>=0.4.12'
transient_storage_state_variable.sol:
hash: '0xf343442238f0126ff68e34b9428e86ed'
enabled: true
version: '>=0.8.28'
transient_storage_state_variable_abstract_contract.sol:
hash: '0x48bd4cb65538a1f033d0ffff71046daf'
enabled: true
version: '>=0.8.28'
value_for_constructor.sol:
hash: '0xfc70977e16cd72eb8121fffb33ce2abd'
enabled: true
Expand Down Expand Up @@ -4111,6 +4131,10 @@ entries:
hash: '0x04cc5fce661ac43a24ff58258ddbdc00'
enabled: true
version: '>=0.4.12'
inline_assembly_transient_storage_access_inside_function.sol:
hash: '0x9a81fdaadd4790381c2ce5f0efdf6ae7'
enabled: true
version: '>=0.8.28'
inline_assembly_write_to_stack.sol:
hash: '0xfef6d721eb252e69d0f9b2d50938ba14'
enabled: true
Expand Down Expand Up @@ -5024,6 +5048,10 @@ entries:
- E
- I
version: '>=0.4.14'
transient_state_variable_value_type.sol:
hash: '0x5c021cca1a4512a8730f227c6b36d1e2'
enabled: true
version: '>=0.8.28'
multiSource:
enabled: true
entries:
Expand Down Expand Up @@ -5094,6 +5122,10 @@ entries:
hash: '0x1b5e6e137084de716e0d9d8446564dc7'
enabled: true
version: '>=0.4.12'
compound_assign_transient_storage.sol:
hash: '0xbd0c4b63b99f5d44ffb9a89f531f6192'
enabled: true
version: '>=0.8.28'
shifts:
enabled: true
entries:
Expand Down Expand Up @@ -5270,6 +5302,10 @@ entries:
hash: '0x4e8524a65fb68db9368603447805c15a'
enabled: true
version: '>=0.4.21'
transient_storage_variable_increment_decrement.sol:
hash: '0x5d0aa44215d67a5009bec972dd3e44e6'
enabled: true
version: '>=0.8.28'
userDefined:
enabled: true
entries:
Expand Down Expand Up @@ -6794,6 +6830,14 @@ entries:
hash: '0x03f114444079f9008d577cb44bca08f1'
enabled: true
version: '>=0.4.12'
delete_transient_state_variable.sol:
hash: '0x807c0ba2ce1f5c24a5353d93a1f957e5'
enabled: true
version: '>=0.8.28'
delete_transient_state_variable_non_zero_offset.sol:
hash: '0xc9979162f04813bc1e517a39fc4a3600'
enabled: true
version: '>=0.8.28'
mapping_local_assignment.sol:
hash: '0x6e2c8c62d5b866f8b2058c2fac97b584'
enabled: true
Expand Down Expand Up @@ -6830,6 +6874,46 @@ entries:
hash: '0xae0630569bf5603ed696749ab21c00bc'
enabled: true
version: '>=0.4.21'
transient_function_type_state_variable.sol:
hash: '0x85b3b01bd9a867454ff3b3a0210afccf'
enabled: true
version: '>=0.8.28'
transient_state_address_variable_members.sol:
hash: '0xbb703fd9fdd2d7edd8f291abc690d643'
enabled: true
version: '>=0.8.28'
transient_state_enum_variable.sol:
hash: '0x901a1be1942a9f1cd22fa6be99fc8808'
enabled: true
version: '>=0.8.28'
transient_state_variable.sol:
hash: '0xe0e4957bc6b30a1aa0711c069d89626f'
enabled: true
version: '>=0.8.28'
transient_state_variable_cleanup_assignment.sol:
hash: '0xe6873be855417289eed3758ee10c1623'
enabled: true
version: '>=0.8.28'
transient_state_variable_cleanup_tstore.sol:
hash: '0x07a01321e9066c7d538ef425f4a35f23'
enabled: true
version: '>=0.8.28'
transient_state_variable_slot_inline_assembly.sol:
hash: '0x7ba508b71048e6d2cb26d03422fcac1c'
enabled: true
version: '>=0.8.28'
transient_state_variable_slots_and_offsets.sol:
hash: '0x3efe44053d16de0f8abd9bfc12e8adb0'
enabled: true
version: '>=0.8.28'
transient_state_variable_tuple_assignment.sol:
hash: '0x10686230bd53840bc3593c731b0f6e23'
enabled: true
version: '>=0.8.28'
transient_state_variable_udvt.sol:
hash: '0x239da4e075afd9b12c2c717e51d5b274'
enabled: true
version: '>=0.8.28'
various:
enabled: true
entries:
Expand Down Expand Up @@ -6935,6 +7019,10 @@ entries:
hash: '0xfc575b0ea2e377c487c4baf0f21f8cb9'
enabled: true
version: '>=0.4.12'
different_call_type_transient.sol:
hash: '0x53e563a335d8bb3a02b8a021dabe6af5'
enabled: true
version: '>=0.8.28'
empty_name_return_parameter.sol:
hash: '0x5f095962f4ae9a08b908384aa3be701d'
enabled: true
Expand Down Expand Up @@ -7120,6 +7208,10 @@ entries:
hash: '0x4051de6e556f6a42d4486dadce1e24bd'
enabled: true
version: '>=0.5.0'
transient_storage_reentrancy_lock.sol:
hash: '0x7974f3e336b300ecde5071cf652e2109'
enabled: true
version: '>=0.8.28'
tuples.sol:
hash: '0xbd8afa8671e0a31c4726453fde7251ca'
enabled: true
Expand Down
22 changes: 22 additions & 0 deletions solidity/ethereum/inheritance/transient_storage_state_variable.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
contract A {
uint24 transient x;
int24 y;
}

contract C is A {
uint24 w;
int24 transient z;

function f() public returns (uint24, int24, uint24, int24) {
x += 1;
y += 2;
w += 3;
z += 4;

return (x, y, w, z);
}
}
// ====
// EVMVersion: >=cancun
// ----
// f() -> 1, 2, 3, 4
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
abstract contract A {
uint transient x;
int y;
function f() public virtual returns (uint, int, uint, int);
}

contract C is A {
uint w;
int transient z;

function g() public {
w += 2;
z += 2;
}

function f() public override returns (uint, int, uint, int) {
x += 1;
y += 1;
g();
return (x, y, w, z);
}
}
// ====
// EVMVersion: >=cancun
// ----
// f() -> 1, 1, 2, 2
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
contract C {
uint16 transient x;
uint16 public transient y;
uint256 public transient z;

function f() public returns (uint256) {
uint256 offset;
assembly {
function f() -> o1 {
tstore(z.slot, 7)
o1 := y.offset
}
offset := f()
}
assert(offset == 2);
return z;
}
}
// ====
// EVMVersion: >=cancun
// ----
// f() -> 7
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
contract C {
uint16 transient x;

modifier m(uint16) {
x += 10;
_;
}

function f() public m(x) returns (uint16) {
x *= 10;
return x;
}
}

// ====
// EVMVersion: >=cancun
// ----
// f() -> 100
22 changes: 22 additions & 0 deletions solidity/ethereum/operators/compound_assign_transient_storage.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
contract test {
uint value1;
uint transient value2;
function f(uint x, uint y) public returns (uint w) {
uint value3 = y;
value1 += x;
value3 *= x;
value2 += value3 + value1;
return value2 += 7;
}
}
// ====
// EVMVersion: >=cancun
// ----
// f(uint256,uint256): 0, 6 -> 7
// f(uint256,uint256): 1, 3 -> 11
// f(uint256,uint256): 2, 25 -> 0x3c
// f(uint256,uint256): 3, 69 -> 0xdc
// f(uint256,uint256): 4, 84 -> 353
// f(uint256,uint256): 5, 2 -> 0x20
// f(uint256,uint256): 6, 51 -> 334
// f(uint256,uint256): 7, 48 -> 371
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
contract C {
int transient x;
function f() public returns (int) {
++x;
++x;
--x;
x++;
x--;
return x;
}
}
// ====
// EVMVersion: >=cancun
// ----
// f() -> 1
12 changes: 12 additions & 0 deletions solidity/ethereum/variables/delete_transient_state_variable.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
contract C {
uint transient x;
function f() public returns (uint) {
x = 10;
delete x;
return x;
}
}
// ====
// EVMVersion: >=cancun
// ----
// f() -> 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
contract C {
bytes14 transient x;
uint32 transient y;
uint112 transient z;

function f() public returns (bytes14, uint32, uint112) {
x = 0xffffffffffffffffffffffffffff;
y = 0xffffffff;
z = 0xffffffffffffffffffffffffffff;
delete y;
return (x, y, z);
}
}
// ====
// EVMVersion: >=cancun
// ----
// f() -> 0xffffffffffffffffffffffffffff000000000000000000000000000000000000, 0, 0xffffffffffffffffffffffffffff
Loading

0 comments on commit e15b8b9

Please sign in to comment.