mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #10010 from ethereum/develop
Merge develop into breaking.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract C {
|
||||
uint t;
|
||||
constructor() {
|
||||
t = address(this).balance;
|
||||
}
|
||||
function f(address payable a, uint x) public {
|
||||
require(address(this).balance >= x);
|
||||
a.transfer(x);
|
||||
}
|
||||
function inv() public view {
|
||||
// If only looking at `f`, it looks like this.balance always decreases.
|
||||
// However, the edge case of a contract `selfdestruct` sending its remaining balance
|
||||
// to this contract should make the claim false (since there's no fallback/receive here).
|
||||
assert(address(this).balance == t);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 6328: (496-530): CHC: Assertion violation happens here.
|
||||
@@ -0,0 +1,12 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract C {
|
||||
address t;
|
||||
constructor() {
|
||||
t = address(this);
|
||||
}
|
||||
function inv() public view {
|
||||
assert(address(this) == t);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
abstract contract D {
|
||||
function d() external virtual;
|
||||
}
|
||||
|
||||
contract C {
|
||||
address t;
|
||||
constructor() {
|
||||
t = address(this);
|
||||
}
|
||||
function f(D d) public {
|
||||
address a = address(this);
|
||||
d.d();
|
||||
assert(address(this) == t);
|
||||
assert(a == t);
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract C {
|
||||
address t;
|
||||
constructor() {
|
||||
t = address(this);
|
||||
}
|
||||
function f() public view {
|
||||
g(address(this));
|
||||
}
|
||||
function g(address a) internal view {
|
||||
assert(a == t);
|
||||
assert(a == address(this));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
pragma experimental SMTChecker;
|
||||
|
||||
contract C {
|
||||
function f(address payable a) public {
|
||||
require(address(this).balance > 1000);
|
||||
a.transfer(666);
|
||||
assert(address(this).balance > 100);
|
||||
// Fails.
|
||||
assert(address(this).balance > 500);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 6328: (199-234): CHC: Assertion violation happens here.
|
||||
@@ -17,4 +17,3 @@ contract C
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 4661: (297-321): BMC: Assertion violation happens here.
|
||||
|
||||
@@ -15,3 +15,4 @@ contract C
|
||||
}
|
||||
// ----
|
||||
// Warning 2661: (176-181): BMC: Overflow (resulting value larger than 2**256 - 1) happens here.
|
||||
// Warning 4661: (296-309): BMC: Assertion violation happens here.
|
||||
|
||||
@@ -11,6 +11,7 @@ contract C {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning 2519: (128-159): This declaration shadows an existing declaration.
|
||||
// Warning 6328: (207-227): CHC: Assertion violation happens here.
|
||||
// Warning 6328: (231-245): CHC: Assertion violation happens here.
|
||||
// Warning 5729: (214-218): Assertion checker does not yet implement this type of function call.
|
||||
|
||||
-3
@@ -23,8 +23,6 @@ contract C {
|
||||
assert(s1[2].a[2] == s2.a[2]);
|
||||
s1[0].ts[3].y = 5;
|
||||
assert(s1[0].ts[3].y == s2.ts[3].y);
|
||||
s1[1].ts[4].a[5] = 6;
|
||||
assert(s1[1].ts[4].a[5] == s2.ts[4].a[5]);
|
||||
}
|
||||
}
|
||||
// ----
|
||||
@@ -32,4 +30,3 @@ contract C {
|
||||
// Warning 6328: (327-354): CHC: Assertion violation happens here.
|
||||
// Warning 6328: (376-405): CHC: Assertion violation happens here.
|
||||
// Warning 6328: (430-465): CHC: Assertion violation happens here.
|
||||
// Warning 6328: (493-534): CHC: Assertion violation happens here.
|
||||
|
||||
Reference in New Issue
Block a user