solidity/test/libsolidity/smtCheckerTests/special/range_check.sol
Rodrigo Q. Saramago feba4de509
Add paris constraints to SMTChecker
Co-authored-by: Daniel <daniel@ekpyron.org>
Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
Co-authored-by: Leo <leo@ethereum.org>
2023-01-31 11:03:04 +01:00

66 lines
2.4 KiB
Solidity

contract C {
constructor() payable {
assert(tx.origin >= address(0));
assert(tx.origin <= address(2**160 - 1));
assert(tx.gasprice >= 0);
assert(tx.gasprice <= 2**256 - 1);
assert(msg.sender >= address(0));
assert(msg.sender <= address(2**160 - 1));
assert(msg.value >= 0);
assert(msg.value <= 2**256 - 1);
assert(block.coinbase >= address(0));
assert(block.coinbase <= address(2**160 - 1));
assert(block.timestamp >= 0);
assert(block.timestamp <= 2**256 - 1);
assert(block.chainid >= 0);
assert(block.chainid <= 2**256 - 1);
assert(block.difficulty >= 0);
assert(block.difficulty <= 2**256 - 1);
assert(block.prevrandao > 2**64);
assert(block.prevrandao <= 2**256 - 1);
assert(block.gaslimit >= 0);
assert(block.gaslimit <= 2**256 - 1);
assert(block.number >= 0);
assert(block.number <= 2**256 - 1);
}
}
contract D {
constructor() payable {
unchecked {
assert(tx.origin >= address(0));
assert(tx.origin <= address(2**160 - 1));
assert(tx.gasprice >= 0);
assert(tx.gasprice <= 2**256 - 1);
assert(msg.sender >= address(0));
assert(msg.sender <= address(2**160 - 1));
assert(msg.value >= 0);
assert(msg.value <= 2**256 - 1);
assert(block.coinbase >= address(0));
assert(block.coinbase <= address(2**160 - 1));
assert(block.timestamp >= 0);
assert(block.timestamp <= 2**256 - 1);
assert(block.chainid >= 0);
assert(block.chainid <= 2**256 - 1);
assert(block.difficulty >= 0);
assert(block.difficulty <= 2**256 - 1);
assert(block.prevrandao > 2**64);
assert(block.prevrandao <= 2**256 - 1);
assert(block.gaslimit >= 0);
assert(block.gaslimit <= 2**256 - 1);
assert(block.number >= 0);
assert(block.number <= 2**256 - 1);
}
}
}
// ====
// SMTEngine: all
// ----
// Warning 8417: (565-581): Since the VM version paris, "difficulty" was replaced by "prevrandao", which now returns a random number based on the beacon chain.
// Warning 8417: (598-614): Since the VM version paris, "difficulty" was replaced by "prevrandao", which now returns a random number based on the beacon chain.
// Warning 8417: (1447-1463): Since the VM version paris, "difficulty" was replaced by "prevrandao", which now returns a random number based on the beacon chain.
// Warning 8417: (1481-1497): Since the VM version paris, "difficulty" was replaced by "prevrandao", which now returns a random number based on the beacon chain.