aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/smtCheckerTests/special/many.sol
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-10-24 20:34:17 +0800
committerGitHub <noreply@github.com>2018-10-24 20:34:17 +0800
commit01566c2e1af5b7f655fd593e5e1019e103d739a0 (patch)
treeaaa2f597e4d4cb2a48e3bd5197c9222646953979 /test/libsolidity/smtCheckerTests/special/many.sol
parent8d01db7c2d74cbf245b995e6d13e563aff5cef65 (diff)
parente2cf5f6ed94c571c7478b9a313f8e4fceee2aec3 (diff)
downloaddexon-solidity-01566c2e1af5b7f655fd593e5e1019e103d739a0.tar.gz
dexon-solidity-01566c2e1af5b7f655fd593e5e1019e103d739a0.tar.zst
dexon-solidity-01566c2e1af5b7f655fd593e5e1019e103d739a0.zip
Merge pull request #5272 from ethereum/smt_special_vars
[SMTChecker] Support msg.*, tx.*, block.*, gasleft and blockhash
Diffstat (limited to 'test/libsolidity/smtCheckerTests/special/many.sol')
-rw-r--r--test/libsolidity/smtCheckerTests/special/many.sol25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/libsolidity/smtCheckerTests/special/many.sol b/test/libsolidity/smtCheckerTests/special/many.sol
new file mode 100644
index 00000000..40e5d987
--- /dev/null
+++ b/test/libsolidity/smtCheckerTests/special/many.sol
@@ -0,0 +1,25 @@
+pragma experimental SMTChecker;
+
+contract C
+{
+ function f() public payable {
+ assert(msg.sender == block.coinbase);
+ assert(block.difficulty == block.gaslimit);
+ assert(block.number == block.timestamp);
+ assert(tx.gasprice == msg.value);
+ assert(tx.origin == msg.sender);
+ uint x = block.number;
+ assert(x + 2 > block.number);
+ assert(now > 10);
+ assert(gasleft() > 100);
+ }
+}
+// ----
+// Warning: (79-115): Assertion violation happens here
+// Warning: (119-161): Assertion violation happens here
+// Warning: (165-204): Assertion violation happens here
+// Warning: (208-240): Assertion violation happens here
+// Warning: (244-275): Assertion violation happens here
+// Warning: (311-316): Overflow (resulting value larger than 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) happens here
+// Warning: (336-352): Assertion violation happens here
+// Warning: (356-379): Assertion violation happens here