mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge commit 'a7d481fb9' into develop_060
This commit is contained in:
@@ -36,7 +36,6 @@ function zeppelin_test
|
||||
truffle_setup https://github.com/erak/openzeppelin-contracts.git master_060
|
||||
run_install install_fn
|
||||
|
||||
|
||||
truffle_run_test compile_fn test_fn
|
||||
}
|
||||
|
||||
|
||||
@@ -193,6 +193,8 @@ BOOST_AUTO_TEST_CASE(valid_opcodes_functional)
|
||||
"4300",
|
||||
"4400",
|
||||
"4500",
|
||||
"4600",
|
||||
"4700",
|
||||
"60005000",
|
||||
"60005100",
|
||||
"600060005200",
|
||||
@@ -420,6 +422,8 @@ BOOST_AUTO_TEST_CASE(valid_opcodes_asm)
|
||||
"4300",
|
||||
"4400",
|
||||
"4500",
|
||||
"4600",
|
||||
"4700",
|
||||
"60005000",
|
||||
"60005100",
|
||||
"600060005200",
|
||||
@@ -559,6 +563,8 @@ BOOST_AUTO_TEST_CASE(valid_opcodes_asm)
|
||||
"(asm NUMBER)",
|
||||
"(asm DIFFICULTY)",
|
||||
"(asm GASLIMIT)",
|
||||
"(asm CHAINID)",
|
||||
"(asm SELFBALANCE)",
|
||||
"(asm 0 POP)",
|
||||
"(asm 0 MLOAD)",
|
||||
"(asm 0 0 MSTORE)",
|
||||
|
||||
@@ -53,6 +53,5 @@ contract MyConc{
|
||||
// ----
|
||||
// Warning: (773-792): This declaration shadows an existing declaration.
|
||||
// Warning: (1009-1086): Function state mutability can be restricted to view
|
||||
// Warning: (874-879): Underflow (resulting value less than 0) happens here.
|
||||
// Warning: (874-879): Overflow (resulting value larger than 2**256 - 1) happens here.
|
||||
// Warning: (985-1002): Underflow (resulting value less than 0) happens here.
|
||||
// Warning: (985-1002): Overflow (resulting value larger than 2**256 - 1) happens here.
|
||||
|
||||
@@ -137,4 +137,3 @@ contract PropagateThroughReturnValue {
|
||||
// Warning: (748-755): Assertion checker does not yet support this expression.
|
||||
// Warning: (748-751): Assertion checker does not yet implement type struct Reference.St storage pointer
|
||||
// Warning: (748-770): Assertion checker does not yet implement such assignments.
|
||||
// Warning: (849-905): Assertion checker does not yet support constructors.
|
||||
|
||||
@@ -13,5 +13,3 @@ contract B is A {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (56-90): Assertion checker does not yet support constructors.
|
||||
// Warning: (113-151): Assertion checker does not yet support constructors.
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C { constructor(uint) public {} }
|
||||
contract A is C { constructor() C(2) public {} }
|
||||
contract C {
|
||||
uint a;
|
||||
constructor(uint x) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract A is C {
|
||||
constructor() C(2) public {
|
||||
assert(a == 2);
|
||||
assert(a == 3);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (45-72): Assertion checker does not yet support constructors.
|
||||
// Warning: (93-121): Assertion checker does not yet support constructors.
|
||||
// Warning: (166-180): Assertion violation happens here
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C { constructor(uint) public {} }
|
||||
contract A is C { constructor() C(2) public {} }
|
||||
contract B is C { constructor() C(3) public {} }
|
||||
contract J is C { constructor() C(3) public {} }
|
||||
contract C { uint a; constructor(uint x) public { a = x; } }
|
||||
contract A is C { constructor() C(2) public { assert(a == 2); } }
|
||||
contract B is C { constructor() C(3) public { assert(a == 3); } }
|
||||
contract J is C { constructor() C(3) public { assert(a == 4); } }
|
||||
// ----
|
||||
// Warning: (45-72): Assertion checker does not yet support constructors.
|
||||
// Warning: (93-121): Assertion checker does not yet support constructors.
|
||||
// Warning: (142-170): Assertion checker does not yet support constructors.
|
||||
// Warning: (191-219): Assertion checker does not yet support constructors.
|
||||
// Warning: (271-285): Assertion violation happens here
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
uint a;
|
||||
constructor(uint x) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract B is C {
|
||||
constructor(uint x) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract A is B {
|
||||
constructor(uint x) B(x) C(x + 2) public {
|
||||
assert(a == x);
|
||||
assert(a == x + 1);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (244-262): Assertion violation happens here
|
||||
@@ -0,0 +1,23 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
uint a;
|
||||
constructor(uint x) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract B is C {
|
||||
constructor(uint x) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract A is B {
|
||||
constructor(uint x) C(x + 2) B(x + 1) public {
|
||||
assert(a == x + 1);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (212-217): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
// Warning: (203-208): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
// Warning: (242-247): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
@@ -0,0 +1,29 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
uint a;
|
||||
constructor(uint x) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract B1 is C {
|
||||
constructor(uint x) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract B2 is C {
|
||||
constructor(uint x) C(x + 2) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract A is B2, B1 {
|
||||
constructor(uint x) B2(x) B1(x) public {
|
||||
assert(a == x);
|
||||
assert(a == x + 1);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (205-210): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
// Warning: (321-339): Assertion violation happens here
|
||||
@@ -0,0 +1,29 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
uint a;
|
||||
constructor(uint x) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract B1 is C {
|
||||
constructor(uint x) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract B2 is C {
|
||||
constructor(uint x) C(x + 2) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract A is B2, B1 {
|
||||
constructor(uint x) B1(x) B2(x) public {
|
||||
assert(a == x);
|
||||
assert(a == x + 1);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (205-210): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
// Warning: (321-339): Assertion violation happens here
|
||||
@@ -0,0 +1,34 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
uint a;
|
||||
constructor(uint x) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract B1 is C {
|
||||
uint b1;
|
||||
constructor(uint x) public {
|
||||
b1 = x + a;
|
||||
}
|
||||
}
|
||||
|
||||
contract B2 is C {
|
||||
uint b2;
|
||||
constructor(uint x) C(x + 2) public {
|
||||
b2 = x + a;
|
||||
}
|
||||
}
|
||||
|
||||
contract A is B2, B1 {
|
||||
constructor(uint x) B2(x) B1(x) public {
|
||||
assert(b1 == b2);
|
||||
assert(b1 != b2);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (165-170): Underflow (resulting value less than 0) happens here
|
||||
// Warning: (165-170): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
// Warning: (230-235): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
// Warning: (253-258): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
// Warning: (353-369): Assertion violation happens here
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
uint a;
|
||||
constructor() public {
|
||||
a = 2;
|
||||
}
|
||||
}
|
||||
|
||||
contract B is C {
|
||||
}
|
||||
|
||||
contract B2 is C {
|
||||
}
|
||||
|
||||
contract A is B, B2 {
|
||||
constructor(uint x) public {
|
||||
assert(a == 2);
|
||||
assert(a == 3);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (171-177): Unused function parameter. Remove or comment out the variable name to silence this warning.
|
||||
// Warning: (208-222): Assertion violation happens here
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
uint a;
|
||||
constructor() public {
|
||||
a = 2;
|
||||
}
|
||||
}
|
||||
|
||||
contract B is C {
|
||||
}
|
||||
|
||||
contract B2 is C {
|
||||
constructor() public {
|
||||
assert(a == 2);
|
||||
}
|
||||
}
|
||||
|
||||
contract A is B, B2 {
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract F {
|
||||
uint a;
|
||||
constructor() public {
|
||||
a = 2;
|
||||
}
|
||||
}
|
||||
|
||||
contract E is F {}
|
||||
contract D is E {}
|
||||
contract C is D {}
|
||||
contract B is C {}
|
||||
|
||||
contract A is B {
|
||||
constructor(uint x) public {
|
||||
assert(a == 2);
|
||||
assert(a == 3);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (201-207): Unused function parameter. Remove or comment out the variable name to silence this warning.
|
||||
// Warning: (238-252): Assertion violation happens here
|
||||
@@ -0,0 +1,20 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
uint a;
|
||||
constructor() public {
|
||||
a = 2;
|
||||
}
|
||||
}
|
||||
|
||||
contract B is C {
|
||||
}
|
||||
|
||||
contract A is B {
|
||||
constructor(uint x) B() public {
|
||||
assert(a == 2);
|
||||
assert(a == 3);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (145-151): Unused function parameter. Remove or comment out the variable name to silence this warning.
|
||||
// Warning: (186-200): Assertion violation happens here
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
uint a;
|
||||
constructor() public {
|
||||
a = 2;
|
||||
}
|
||||
}
|
||||
|
||||
contract B is C {
|
||||
}
|
||||
|
||||
contract A is B {
|
||||
constructor(uint x) public {
|
||||
assert(a == 3);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (145-151): Unused function parameter. Remove or comment out the variable name to silence this warning.
|
||||
// Warning: (164-178): Assertion violation happens here
|
||||
@@ -0,0 +1,30 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract F {
|
||||
uint a;
|
||||
constructor() public {
|
||||
a = 2;
|
||||
}
|
||||
}
|
||||
|
||||
contract E is F {}
|
||||
contract D is E {
|
||||
constructor() public {
|
||||
a = 3;
|
||||
}
|
||||
}
|
||||
contract C is D {}
|
||||
contract B is C {
|
||||
constructor() public {
|
||||
a = 4;
|
||||
}
|
||||
}
|
||||
|
||||
contract A is B {
|
||||
constructor(uint x) public {
|
||||
assert(a == 4);
|
||||
assert(a == 5);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (275-281): Unused function parameter. Remove or comment out the variable name to silence this warning.
|
||||
// Warning: (312-326): Assertion violation happens here
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract F {
|
||||
uint a;
|
||||
constructor() public {
|
||||
a = 2;
|
||||
}
|
||||
}
|
||||
|
||||
contract E is F {}
|
||||
contract D is E {
|
||||
constructor() public {
|
||||
a = 3;
|
||||
}
|
||||
}
|
||||
contract C is D {}
|
||||
contract B is C {
|
||||
constructor() public {
|
||||
assert(a == 3);
|
||||
a = 4;
|
||||
}
|
||||
}
|
||||
|
||||
contract A is B {
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract F {
|
||||
uint a;
|
||||
constructor() public {
|
||||
uint f = 2;
|
||||
a = f;
|
||||
}
|
||||
}
|
||||
|
||||
contract E is F {}
|
||||
contract D is E {
|
||||
constructor() public {
|
||||
uint d = 3;
|
||||
a = d;
|
||||
}
|
||||
}
|
||||
contract C is D {}
|
||||
contract B is C {
|
||||
constructor() public {
|
||||
uint b = 4;
|
||||
a = b;
|
||||
}
|
||||
}
|
||||
|
||||
contract A is B {
|
||||
constructor(uint x) public {
|
||||
uint a1 = 4;
|
||||
uint a2 = 5;
|
||||
assert(a == a1);
|
||||
assert(a == a2);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (317-323): Unused function parameter. Remove or comment out the variable name to silence this warning.
|
||||
// Warning: (385-400): Assertion violation happens here
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract F {
|
||||
uint a;
|
||||
constructor(uint x) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract E is F {}
|
||||
contract D is E {
|
||||
constructor() public {
|
||||
a = 3;
|
||||
}
|
||||
}
|
||||
contract C is D {}
|
||||
contract B is C {
|
||||
constructor(uint x) F(x + 1) public {
|
||||
}
|
||||
}
|
||||
|
||||
contract A is B {
|
||||
constructor(uint x) B(x) public {
|
||||
assert(a == 3);
|
||||
assert(a == 4);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (234-239): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
// Warning: (329-343): Assertion violation happens here
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract F {
|
||||
uint a;
|
||||
constructor(uint x) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract E is F {}
|
||||
contract D is E {
|
||||
constructor() public {
|
||||
a = 3;
|
||||
}
|
||||
}
|
||||
contract C is D {}
|
||||
contract B is C {
|
||||
constructor() F(1) public {
|
||||
assert(a == 3);
|
||||
assert(a == 2);
|
||||
}
|
||||
}
|
||||
|
||||
contract A is B {
|
||||
}
|
||||
// ----
|
||||
// Warning: (260-274): Assertion violation happens here
|
||||
// Warning: (260-274): Assertion violation happens here
|
||||
@@ -0,0 +1,17 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
uint a;
|
||||
modifier n { _; a = 7; }
|
||||
constructor(uint x) n public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract A is C {
|
||||
modifier m { a = 5; _; }
|
||||
constructor() C(2) public {
|
||||
assert(a == 4);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (202-216): Assertion violation happens here
|
||||
@@ -0,0 +1,16 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
uint a;
|
||||
constructor(uint x) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract A is C {
|
||||
constructor() C(2) public {
|
||||
assert(a == 0);
|
||||
assert(C.a == 0);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (148-162): Assertion violation happens here
|
||||
@@ -0,0 +1,16 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract C {
|
||||
uint x;
|
||||
|
||||
constructor() public {
|
||||
assert(x == 0);
|
||||
x = 10;
|
||||
}
|
||||
|
||||
function f(uint y) public view {
|
||||
assert(y == x);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (148-162): Assertion violation happens here
|
||||
@@ -0,0 +1,16 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract C {
|
||||
uint x = 5;
|
||||
|
||||
constructor() public {
|
||||
assert(x == 5);
|
||||
x = 10;
|
||||
}
|
||||
|
||||
function f(uint y) public view {
|
||||
assert(y == x);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (152-166): Assertion violation happens here
|
||||
@@ -0,0 +1,18 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract B {
|
||||
uint x = 5;
|
||||
}
|
||||
|
||||
contract C is B {
|
||||
constructor() public {
|
||||
assert(x == 5);
|
||||
x = 10;
|
||||
}
|
||||
|
||||
function f(uint y) public view {
|
||||
assert(y == x);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (172-186): Assertion violation happens here
|
||||
@@ -0,0 +1,17 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract C {
|
||||
uint x = 5;
|
||||
|
||||
constructor(uint a, uint b) public {
|
||||
assert(x == 5);
|
||||
x = a + b;
|
||||
}
|
||||
|
||||
function f(uint y) public view {
|
||||
assert(y == x);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (169-183): Assertion violation happens here
|
||||
// Warning: (122-127): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
@@ -0,0 +1,13 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
function f() public pure {}
|
||||
constructor() public {
|
||||
C c = this;
|
||||
c.f(); // this does not warn now, but should warn in the future
|
||||
this.f();
|
||||
(this).f();
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (204-208): "this" used in constructor. Note that external functions of a contract cannot be called while it is being constructed.
|
||||
// Warning: (223-227): "this" used in constructor. Note that external functions of a contract cannot be called while it is being constructed.
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract F {
|
||||
uint a;
|
||||
constructor(uint x) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract E is F {}
|
||||
contract D is E {
|
||||
constructor() public {
|
||||
a = 3;
|
||||
}
|
||||
}
|
||||
contract C is D {}
|
||||
contract B is C {
|
||||
constructor(uint x) F(x + 1) public {
|
||||
}
|
||||
}
|
||||
|
||||
contract A is B {
|
||||
constructor(uint x) B(x) public {
|
||||
assert(a == 3);
|
||||
assert(a == 4);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (234-239): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
// Warning: (329-343): Assertion violation happens here
|
||||
@@ -0,0 +1,11 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract C {
|
||||
uint x = 2;
|
||||
constructor () public {
|
||||
assert(x == 2);
|
||||
assert(x == 3);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (104-118): Assertion violation happens here
|
||||
@@ -0,0 +1,14 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract C {
|
||||
uint x = 2;
|
||||
}
|
||||
|
||||
contract D is C {
|
||||
constructor() public {
|
||||
assert(x == 2);
|
||||
assert(x == 3);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (124-138): Assertion violation happens here
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract A {
|
||||
uint x = 1;
|
||||
}
|
||||
|
||||
contract B is A {
|
||||
constructor() public { x = 2; }
|
||||
}
|
||||
|
||||
contract C is B {
|
||||
constructor() public { x = 3; }
|
||||
}
|
||||
|
||||
contract D is C {
|
||||
constructor() public {
|
||||
assert(x == 3);
|
||||
assert(x == 2);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (232-246): Assertion violation happens here
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract A {
|
||||
uint x = 1;
|
||||
}
|
||||
|
||||
contract B is A {
|
||||
constructor() public { x = 2; }
|
||||
}
|
||||
|
||||
contract C is B {
|
||||
}
|
||||
|
||||
contract D is C {
|
||||
constructor() public {
|
||||
assert(x == 2);
|
||||
assert(x == 3);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (199-213): Assertion violation happens here
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
uint a;
|
||||
constructor(uint x) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract B is C {
|
||||
uint b;
|
||||
constructor(uint x) public {
|
||||
b = a + x;
|
||||
}
|
||||
}
|
||||
|
||||
contract A is B {
|
||||
constructor(uint x) B(x) C(x + 2) public {
|
||||
assert(a == x + 2);
|
||||
assert(b == x + x + 2);
|
||||
assert(a == x + 5);
|
||||
}
|
||||
}
|
||||
|
||||
// ----
|
||||
// Warning: (162-167): Underflow (resulting value less than 0) happens here
|
||||
// Warning: (162-167): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
// Warning: (287-305): Assertion violation happens here
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
uint a;
|
||||
constructor(uint x) public {
|
||||
a = x;
|
||||
}
|
||||
}
|
||||
|
||||
contract B is C {
|
||||
uint b;
|
||||
constructor(uint x) public {
|
||||
b = x + 10;
|
||||
}
|
||||
}
|
||||
|
||||
contract A is B {
|
||||
constructor(uint x) B(x) C(x + 2) public {
|
||||
assert(a == x + 2);
|
||||
assert(b == x + 10);
|
||||
assert(b == x + 5);
|
||||
}
|
||||
}
|
||||
|
||||
// ----
|
||||
// Warning: (162-168): Overflow (resulting value larger than 2**256 - 1) happens here
|
||||
// Warning: (285-303): Assertion violation happens here
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract A {
|
||||
uint x = 2;
|
||||
}
|
||||
|
||||
contract B is A {
|
||||
}
|
||||
|
||||
contract C is A {
|
||||
}
|
||||
|
||||
contract D is B, C {
|
||||
constructor() public {
|
||||
assert(x == 2);
|
||||
assert(x == 3);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (169-183): Assertion violation happens here
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract A {
|
||||
uint x = 1;
|
||||
}
|
||||
|
||||
contract B is A {
|
||||
constructor() public { x = 2; }
|
||||
}
|
||||
|
||||
contract C is A {
|
||||
constructor() public { x = 3; }
|
||||
}
|
||||
|
||||
contract D is B, C {
|
||||
constructor() public {
|
||||
assert(x == 3);
|
||||
assert(x == 4);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (235-249): Assertion violation happens here
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract C {
|
||||
uint x = f(2);
|
||||
constructor () public {
|
||||
assert(x == 2);
|
||||
}
|
||||
|
||||
function f(uint y) internal view returns (uint) {
|
||||
assert(y > 0);
|
||||
assert(x == 0);
|
||||
return y;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (162-175): Assertion violation happens here
|
||||
// Warning: (179-193): Assertion violation happens here
|
||||
@@ -15,7 +15,7 @@ contract A {
|
||||
// 2 warnings, B.f and A.g
|
||||
contract B is A {
|
||||
function f() public view override {
|
||||
assert(x == 0);
|
||||
assert(x == 1);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
|
||||
@@ -17,7 +17,7 @@ contract B is A {
|
||||
uint y;
|
||||
|
||||
function f() public view override {
|
||||
assert(x == 0);
|
||||
assert(x == 1);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
|
||||
@@ -17,10 +17,10 @@ contract B is A {
|
||||
uint y;
|
||||
|
||||
function f() public view virtual override {
|
||||
assert(x == 0);
|
||||
assert(x == 1);
|
||||
}
|
||||
function h() public view {
|
||||
assert(x == 2);
|
||||
assert(x == 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,10 +29,10 @@ contract C is B {
|
||||
uint z;
|
||||
|
||||
function f() public view override {
|
||||
assert(x == 0);
|
||||
assert(x == 1);
|
||||
}
|
||||
function i() public view {
|
||||
assert(x == 0);
|
||||
assert(x == 1);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract A {
|
||||
uint x;
|
||||
constructor (uint y) public { assert(x == 0); x = y; }
|
||||
}
|
||||
|
||||
contract B is A {
|
||||
constructor () A(2) public { assert(x == 2); }
|
||||
}
|
||||
|
||||
contract C is B {
|
||||
function f() public view {
|
||||
assert(x == 2);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract A {
|
||||
uint x;
|
||||
function h() public view {
|
||||
assert(x == 0);
|
||||
}
|
||||
}
|
||||
|
||||
contract B is A {
|
||||
function g() public view {
|
||||
assert(x == 0);
|
||||
}
|
||||
}
|
||||
|
||||
contract C is B {
|
||||
function f() public view {
|
||||
assert(x == 0);
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,15 @@ pragma experimental "ABIEncoderV2";
|
||||
|
||||
contract C {
|
||||
struct S { uint x; uint[] b; }
|
||||
function f() public pure returns (S memory, bytes memory) {
|
||||
return abi.decode("abc", (S, bytes));
|
||||
function f() public pure returns (S memory, bytes memory, uint[][2] memory) {
|
||||
return abi.decode("abc", (S, bytes, uint[][2]));
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (151-159): Assertion checker does not yet support the type of this variable.
|
||||
// Warning: (188-191): Assertion checker does not yet implement type abi
|
||||
// Warning: (207-208): Assertion checker does not yet implement type type(struct C.S storage pointer)
|
||||
// Warning: (188-217): Assertion checker does not yet implement this type of function call.
|
||||
// Warning: (206-209): Assertion checker does not yet implement type abi
|
||||
// Warning: (225-226): Assertion checker does not yet implement type type(struct C.S storage pointer)
|
||||
// Warning: (235-241): Assertion checker does not yet implement type type(uint256[] memory)
|
||||
// Warning: (235-241): Assertion checker does not yet implement this expression.
|
||||
// Warning: (235-244): Assertion checker does not yet implement type type(uint256[] memory[2] memory)
|
||||
// Warning: (206-246): Assertion checker does not yet implement this type of function call.
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
pragma experimental SMTChecker;
|
||||
library L {
|
||||
struct Nested { uint y; }
|
||||
function c(function(Nested memory) external returns (uint)[] storage) external pure {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
struct Nested { uint y; }
|
||||
// ensure that we consider array of function pointers as reference type
|
||||
function b(function(Nested memory) external returns (uint)[] storage) internal pure {}
|
||||
function c(function(Nested memory) external returns (uint)[] memory) public pure {}
|
||||
function d(function(Nested memory) external returns (uint)[] calldata) external pure {}
|
||||
}
|
||||
// ----
|
||||
@@ -0,0 +1,14 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract C {
|
||||
function(uint) external returns (uint)[] public x;
|
||||
function(uint) internal returns (uint)[10] y;
|
||||
function f() view public {
|
||||
function(uint) returns (uint)[10] memory a;
|
||||
function(uint) returns (uint)[10] storage b = y;
|
||||
function(uint) external returns (uint)[] memory c;
|
||||
c = new function(uint) external returns (uint)[](200);
|
||||
a; b;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (361-410): Assertion checker does not yet implement this type of function call.
|
||||
@@ -0,0 +1,7 @@
|
||||
pragma experimental SMTChecker;
|
||||
contract test {
|
||||
mapping (address => function() internal returns (uint)) a;
|
||||
mapping (address => function() external) b;
|
||||
mapping (address => function() external[]) c;
|
||||
function() external[] d;
|
||||
}
|
||||
Reference in New Issue
Block a user