[SMTChecker] Report values for block, msg and tx variables in counterexamples

This commit is contained in:
Leo Alt 2021-09-16 19:18:26 +02:00
parent ecfcca1a27
commit 4c2b661eaa
105 changed files with 390 additions and 250 deletions

View File

@ -5,10 +5,11 @@ Language Features:
Compiler Features:
* SMTChecker: Output values for ``block.*``, ``msg.*`` and ``tx.*`` variables that are present in the called functions.
Bugfixes:
* SMTChecker: Fix internal error in magic type access (``block``, ``msg``, ``tx``).
* SMTChecker: Fix internal error in magic type access (``block``, ``msg``, ``tx``).

View File

@ -1892,7 +1892,10 @@ optional<string> CHC::generateCounterexample(CHCSolverInterface::CexGraph const&
if (!pred->isConstructorSummary())
for (unsigned v: callGraph[node])
_dfs(node, v, depth + 1, _dfs);
calls.push_front(string(depth * 4, ' ') + pred->formatSummaryCall(nodeArgs(node), m_charStreamProvider));
bool appendTxVars = pred->isConstructorSummary() || pred->isFunctionSummary() || pred->isExternalCallUntrusted();
calls.push_front(string(depth * 4, ' ') + pred->formatSummaryCall(nodeArgs(node), m_charStreamProvider, appendTxVars));
if (pred->isInternalCall())
calls.front() += " -- internal call";
else if (pred->isExternalCallTrusted())

View File

@ -200,7 +200,8 @@ bool Predicate::isInterface() const
string Predicate::formatSummaryCall(
vector<smtutil::Expression> const& _args,
langutil::CharStreamProvider const& _charStreamProvider
langutil::CharStreamProvider const& _charStreamProvider,
bool _appendTxVars
) const
{
solAssert(isSummary(), "");
@ -214,19 +215,67 @@ string Predicate::formatSummaryCall(
}
/// The signature of a function summary predicate is: summary(error, this, abiFunctions, cryptoFunctions, txData, preBlockChainState, preStateVars, preInputVars, postBlockchainState, postStateVars, postInputVars, outputVars).
/// Here we are interested in preInputVars to format the function call,
/// and in txData to retrieve `msg.value`.
/// Here we are interested in preInputVars to format the function call.
string value;
if (auto v = readTxVars(_args.at(4)).at("msg.value"))
string txModel;
if (_appendTxVars)
{
bigint x(*v);
if (x > 0)
value = "{ value: " + *v + " }";
set<string> txVars;
if (isFunctionSummary())
{
solAssert(programFunction(), "");
if (programFunction()->isPayable())
txVars.insert("msg.value");
}
else if (isConstructorSummary())
{
FunctionDefinition const* fun = programFunction();
if (fun && fun->isPayable())
txVars.insert("msg.value");
}
struct TxVarsVisitor: public ASTConstVisitor
{
bool visit(MemberAccess const& _memberAccess)
{
Expression const* memberExpr = SMTEncoder::innermostTuple(_memberAccess.expression());
Type const* exprType = memberExpr->annotation().type;
solAssert(exprType, "");
if (exprType->category() == Type::Category::Magic)
if (auto const* identifier = dynamic_cast<Identifier const*>(memberExpr))
{
ASTString const& name = identifier->name();
if (name == "block" || name == "msg" || name == "tx")
txVars.insert(name + "." + _memberAccess.memberName());
}
return true;
}
set<string> txVars;
} txVarsVisitor;
if (auto fun = programFunction())
{
fun->accept(txVarsVisitor);
txVars += txVarsVisitor.txVars;
}
// Here we are interested in txData from the summary predicate.
auto txValues = readTxVars(_args.at(4));
vector<string> values;
for (auto const& _var: txVars)
if (auto v = txValues.at(_var))
values.push_back(_var + ": " + *v);
if (!values.empty())
txModel = "{ " + boost::algorithm::join(values, ", ") + " }";
}
if (auto contract = programContract())
return contract->name() + ".constructor()" + value;
return contract->name() + ".constructor()" + txModel;
auto stateVars = stateVariables();
solAssert(stateVars.has_value(), "");
@ -262,7 +311,7 @@ string Predicate::formatSummaryCall(
solAssert(fun->annotation().contract, "");
prefix = fun->annotation().contract->name() + ".";
}
return prefix + fName + "(" + boost::algorithm::join(functionArgs, ", ") + ")" + value;
return prefix + fName + "(" + boost::algorithm::join(functionArgs, ", ") + ")" + txModel;
}
vector<optional<string>> Predicate::summaryStateValues(vector<smtutil::Expression> const& _args) const
@ -384,7 +433,27 @@ optional<string> Predicate::expressionToString(smtutil::Expression const& _expr,
{
solAssert(_expr.sort->kind == Kind::Int, "");
solAssert(_expr.arguments.empty(), "");
// TODO assert that _expr.name is a number.
if (
_type->category() == Type::Category::Address ||
_type->category() == Type::Category::FixedBytes
)
{
try
{
if (_expr.name == "0")
return "0x0";
// For some reason the code below returns "0x" for "0".
return toHex(toCompactBigEndian(bigint(_expr.name)), HexPrefix::Add, HexCase::Lower);
}
catch (out_of_range const&)
{
}
catch (invalid_argument const&)
{
}
}
return _expr.name;
}
if (smt::isBool(*_type))
@ -526,9 +595,9 @@ map<string, optional<string>> Predicate::readTxVars(smtutil::Expression const& _
{"block.number", TypeProvider::uint256()},
{"block.timestamp", TypeProvider::uint256()},
{"blockhash", TypeProvider::array(DataLocation::Memory, TypeProvider::uint256())},
{"msg.data", TypeProvider::bytesMemory()},
{"msg.data", TypeProvider::array(DataLocation::CallData)},
{"msg.sender", TypeProvider::address()},
{"msg.sig", TypeProvider::uint256()},
{"msg.sig", TypeProvider::fixedBytes(4)},
{"msg.value", TypeProvider::uint256()},
{"tx.gasprice", TypeProvider::uint256()},
{"tx.origin", TypeProvider::address()}

View File

@ -149,7 +149,8 @@ public:
/// with _args.
std::string formatSummaryCall(
std::vector<smtutil::Expression> const& _args,
langutil::CharStreamProvider const& _charStreamProvider
langutil::CharStreamProvider const& _charStreamProvider,
bool _appendTxVars = false
) const;
/// @returns the values of the state variables from _args at the point

View File

@ -1,13 +1,13 @@
Warning: CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 0)
test.f(0x0, 0)
--> model_checker_targets_all_all_engines/input.sol:7:3:
|
7 | --x;
@ -16,13 +16,13 @@ test.f(0, 0)
Warning: CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 1
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 2)
test.f(0x0, 2)
--> model_checker_targets_all_all_engines/input.sol:8:3:
|
8 | x + type(uint).max;
@ -31,13 +31,13 @@ test.f(0, 2)
Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_all_all_engines/input.sol:9:3:
|
9 | 2 / x;
@ -46,13 +46,13 @@ test.f(0, 1)
Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_all_all_engines/input.sol:11:3:
|
11 | assert(x > 0);
@ -61,13 +61,13 @@ test.f(0, 1)
Warning: CHC: Empty array "pop" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_all_all_engines/input.sol:12:3:
|
12 | arr.pop();
@ -76,13 +76,13 @@ test.f(0, 1)
Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_all_all_engines/input.sol:13:3:
|
13 | arr[x];

View File

@ -1,13 +1,13 @@
Warning: CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 0)
test.f(0x0, 0)
--> model_checker_targets_all_chc/input.sol:7:3:
|
7 | --x;
@ -16,13 +16,13 @@ test.f(0, 0)
Warning: CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 1
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 2)
test.f(0x0, 2)
--> model_checker_targets_all_chc/input.sol:8:3:
|
8 | x + type(uint).max;
@ -31,13 +31,13 @@ test.f(0, 2)
Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_all_chc/input.sol:9:3:
|
9 | 2 / x;
@ -46,13 +46,13 @@ test.f(0, 1)
Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_all_chc/input.sol:11:3:
|
11 | assert(x > 0);
@ -61,13 +61,13 @@ test.f(0, 1)
Warning: CHC: Empty array "pop" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_all_chc/input.sol:12:3:
|
12 | arr.pop();
@ -76,13 +76,13 @@ test.f(0, 1)
Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_all_chc/input.sol:13:3:
|
13 | arr[x];

View File

@ -1,13 +1,13 @@
Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_assert_chc/input.sol:11:3:
|
11 | assert(x > 0);

View File

@ -1,13 +1,13 @@
Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_default_all_engines/input.sol:9:3:
|
9 | 2 / x;
@ -16,13 +16,13 @@ test.f(0, 1)
Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_default_all_engines/input.sol:11:3:
|
11 | assert(x > 0);
@ -31,13 +31,13 @@ test.f(0, 1)
Warning: CHC: Empty array "pop" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_default_all_engines/input.sol:12:3:
|
12 | arr.pop();
@ -46,13 +46,13 @@ test.f(0, 1)
Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_default_all_engines/input.sol:13:3:
|
13 | arr[x];

View File

@ -1,13 +1,13 @@
Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_default_chc/input.sol:9:3:
|
9 | 2 / x;
@ -16,13 +16,13 @@ test.f(0, 1)
Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_default_chc/input.sol:11:3:
|
11 | assert(x > 0);
@ -31,13 +31,13 @@ test.f(0, 1)
Warning: CHC: Empty array "pop" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_default_chc/input.sol:12:3:
|
12 | arr.pop();
@ -46,13 +46,13 @@ test.f(0, 1)
Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_default_chc/input.sol:13:3:
|
13 | arr[x];

View File

@ -1,13 +1,13 @@
Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_div_by_zero_chc/input.sol:9:3:
|
9 | 2 / x;

View File

@ -1,13 +1,13 @@
Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_out_of_bounds_chc/input.sol:13:3:
|
13 | arr[x];

View File

@ -1,13 +1,13 @@
Warning: CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 1
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 2)
test.f(0x0, 2)
--> model_checker_targets_overflow_chc/input.sol:8:3:
|
8 | x + type(uint).max;

View File

@ -1,13 +1,13 @@
Warning: CHC: Empty array "pop" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_pop_empty_chc/input.sol:12:3:
|
12 | arr.pop();

View File

@ -1,13 +1,13 @@
Warning: CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 0)
test.f(0x0, 0)
--> model_checker_targets_underflow_chc/input.sol:7:3:
|
7 | --x;

View File

@ -1,13 +1,13 @@
Warning: CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 0)
test.f(0x0, 0)
--> model_checker_targets_underflow_overflow_assert_chc/input.sol:7:3:
|
7 | --x;
@ -16,13 +16,13 @@ test.f(0, 0)
Warning: CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 1
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 2)
test.f(0x0, 2)
--> model_checker_targets_underflow_overflow_assert_chc/input.sol:8:3:
|
8 | x + type(uint).max;
@ -31,13 +31,13 @@ test.f(0, 2)
Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> model_checker_targets_underflow_overflow_assert_chc/input.sol:11:3:
|
11 | assert(x > 0);

View File

@ -1,13 +1,13 @@
Warning: CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 0)
test.f(0x0, 0)
--> model_checker_targets_underflow_overflow_chc/input.sol:7:3:
|
7 | --x;
@ -16,13 +16,13 @@ test.f(0, 0)
Warning: CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 1
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 2)
test.f(0x0, 2)
--> model_checker_targets_underflow_overflow_chc/input.sol:8:3:
|
8 | x + type(uint).max;

View File

@ -1,13 +1,13 @@
{"errors":[{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:12:7:
|
12 | \t\t\t\t\t\tassert(x > 0);
@ -16,10 +16,10 @@ test.f(0, 1)
","message":"CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":258,"file":"A","start":245},"type":"Warning"}],"sources":{"A":{"id":0}}}
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":258,"file":"A","start":245},"type":"Warning"}],"sources":{"A":{"id":0}}}

View File

@ -126,13 +126,13 @@
"}},"errors":[{"component":"general","errorCode":"4281","formattedMessage":"Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:10:7:
|
10 | \t\t\t\t\t\t2 / x;
@ -141,22 +141,22 @@ test.f(0, 1)
","message":"CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":216,"file":"A","start":211},"type":"Warning"},{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here.
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":216,"file":"A","start":211},"type":"Warning"},{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:12:7:
|
12 | \t\t\t\t\t\tassert(x > 0);
@ -165,22 +165,22 @@ test.f(0, 1)
","message":"CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":258,"file":"A","start":245},"type":"Warning"},{"component":"general","errorCode":"2529","formattedMessage":"Warning: CHC: Empty array \"pop\" happens here.
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":258,"file":"A","start":245},"type":"Warning"},{"component":"general","errorCode":"2529","formattedMessage":"Warning: CHC: Empty array \"pop\" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:13:7:
|
13 | \t\t\t\t\t\tarr.pop();
@ -189,22 +189,22 @@ test.f(0, 1)
","message":"CHC: Empty array \"pop\" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":275,"file":"A","start":266},"type":"Warning"},{"component":"general","errorCode":"6368","formattedMessage":"Warning: CHC: Out of bounds access happens here.
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":275,"file":"A","start":266},"type":"Warning"},{"component":"general","errorCode":"6368","formattedMessage":"Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:14:7:
|
14 | \t\t\t\t\t\tarr[x];
@ -213,13 +213,13 @@ test.f(0, 1)
","message":"CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":289,"file":"A","start":283},"type":"Warning"},{"component":"general","errorCode":"6838","formattedMessage":"Warning: BMC: Condition is always true.
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":289,"file":"A","start":283},"type":"Warning"},{"component":"general","errorCode":"6838","formattedMessage":"Warning: BMC: Condition is always true.
--> A:7:15:
|
7 | \t\t\t\t\t\trequire(x >= 0);

View File

@ -1,13 +1,13 @@
{"errors":[{"component":"general","errorCode":"4281","formattedMessage":"Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:10:7:
|
10 | \t\t\t\t\t\t2 / x;
@ -16,22 +16,22 @@ test.f(0, 1)
","message":"CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":216,"file":"A","start":211},"type":"Warning"},{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here.
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":216,"file":"A","start":211},"type":"Warning"},{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:12:7:
|
12 | \t\t\t\t\t\tassert(x > 0);
@ -40,22 +40,22 @@ test.f(0, 1)
","message":"CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":258,"file":"A","start":245},"type":"Warning"},{"component":"general","errorCode":"2529","formattedMessage":"Warning: CHC: Empty array \"pop\" happens here.
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":258,"file":"A","start":245},"type":"Warning"},{"component":"general","errorCode":"2529","formattedMessage":"Warning: CHC: Empty array \"pop\" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:13:7:
|
13 | \t\t\t\t\t\tarr.pop();
@ -64,22 +64,22 @@ test.f(0, 1)
","message":"CHC: Empty array \"pop\" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":275,"file":"A","start":266},"type":"Warning"},{"component":"general","errorCode":"6368","formattedMessage":"Warning: CHC: Out of bounds access happens here.
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":275,"file":"A","start":266},"type":"Warning"},{"component":"general","errorCode":"6368","formattedMessage":"Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:14:7:
|
14 | \t\t\t\t\t\tarr[x];
@ -88,10 +88,10 @@ test.f(0, 1)
","message":"CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":289,"file":"A","start":283},"type":"Warning"}],"sources":{"A":{"id":0}}}
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":289,"file":"A","start":283},"type":"Warning"}],"sources":{"A":{"id":0}}}

View File

@ -1,13 +1,13 @@
{"errors":[{"component":"general","errorCode":"4281","formattedMessage":"Warning: CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:10:7:
|
10 | \t\t\t\t\t\t2 / x;
@ -16,10 +16,10 @@ test.f(0, 1)
","message":"CHC: Division by zero happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":216,"file":"A","start":211},"type":"Warning"}],"sources":{"A":{"id":0}}}
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":216,"file":"A","start":211},"type":"Warning"}],"sources":{"A":{"id":0}}}

View File

@ -1,13 +1,13 @@
{"errors":[{"component":"general","errorCode":"6368","formattedMessage":"Warning: CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:14:7:
|
14 | \t\t\t\t\t\tarr[x];
@ -16,10 +16,10 @@ test.f(0, 1)
","message":"CHC: Out of bounds access happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":289,"file":"A","start":283},"type":"Warning"}],"sources":{"A":{"id":0}}}
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":289,"file":"A","start":283},"type":"Warning"}],"sources":{"A":{"id":0}}}

View File

@ -1,13 +1,13 @@
{"errors":[{"component":"general","errorCode":"4984","formattedMessage":"Warning: CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 1
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 2)
test.f(0x0, 2)
--> A:9:7:
|
9 | \t\t\t\t\t\tx + type(uint).max;
@ -16,10 +16,10 @@ test.f(0, 2)
","message":"CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 1
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 2)","severity":"warning","sourceLocation":{"end":203,"file":"A","start":185},"type":"Warning"}],"sources":{"A":{"id":0}}}
test.f(0x0, 2)","severity":"warning","sourceLocation":{"end":203,"file":"A","start":185},"type":"Warning"}],"sources":{"A":{"id":0}}}

View File

@ -1,13 +1,13 @@
{"errors":[{"component":"general","errorCode":"2529","formattedMessage":"Warning: CHC: Empty array \"pop\" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:13:7:
|
13 | \t\t\t\t\t\tarr.pop();
@ -16,10 +16,10 @@ test.f(0, 1)
","message":"CHC: Empty array \"pop\" happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":275,"file":"A","start":266},"type":"Warning"}],"sources":{"A":{"id":0}}}
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":275,"file":"A","start":266},"type":"Warning"}],"sources":{"A":{"id":0}}}

View File

@ -1,13 +1,13 @@
{"errors":[{"component":"general","errorCode":"3944","formattedMessage":"Warning: CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 0)
test.f(0x0, 0)
--> A:8:7:
|
8 | \t\t\t\t\t\t--x;
@ -16,10 +16,10 @@ test.f(0, 0)
","message":"CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 0)","severity":"warning","sourceLocation":{"end":177,"file":"A","start":174},"type":"Warning"}],"sources":{"A":{"id":0}}}
test.f(0x0, 0)","severity":"warning","sourceLocation":{"end":177,"file":"A","start":174},"type":"Warning"}],"sources":{"A":{"id":0}}}

View File

@ -1,13 +1,13 @@
{"errors":[{"component":"general","errorCode":"3944","formattedMessage":"Warning: CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 0)
test.f(0x0, 0)
--> A:8:7:
|
8 | \t\t\t\t\t\t--x;
@ -16,22 +16,22 @@ test.f(0, 0)
","message":"CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 0)","severity":"warning","sourceLocation":{"end":177,"file":"A","start":174},"type":"Warning"},{"component":"general","errorCode":"4984","formattedMessage":"Warning: CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
test.f(0x0, 0)","severity":"warning","sourceLocation":{"end":177,"file":"A","start":174},"type":"Warning"},{"component":"general","errorCode":"4984","formattedMessage":"Warning: CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 1
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 2)
test.f(0x0, 2)
--> A:9:7:
|
9 | \t\t\t\t\t\tx + type(uint).max;
@ -40,22 +40,22 @@ test.f(0, 2)
","message":"CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 1
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 2)","severity":"warning","sourceLocation":{"end":203,"file":"A","start":185},"type":"Warning"},{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here.
test.f(0x0, 2)","severity":"warning","sourceLocation":{"end":203,"file":"A","start":185},"type":"Warning"},{"component":"general","errorCode":"6328","formattedMessage":"Warning: CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)
test.f(0x0, 1)
--> A:12:7:
|
12 | \t\t\t\t\t\tassert(x > 0);
@ -64,10 +64,10 @@ test.f(0, 1)
","message":"CHC: Assertion violation happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 1)","severity":"warning","sourceLocation":{"end":258,"file":"A","start":245},"type":"Warning"}],"sources":{"A":{"id":0}}}
test.f(0x0, 1)","severity":"warning","sourceLocation":{"end":258,"file":"A","start":245},"type":"Warning"}],"sources":{"A":{"id":0}}}

View File

@ -1,13 +1,13 @@
{"errors":[{"component":"general","errorCode":"3944","formattedMessage":"Warning: CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 0)
test.f(0x0, 0)
--> A:8:7:
|
8 | \t\t\t\t\t\t--x;
@ -16,22 +16,22 @@ test.f(0, 0)
","message":"CHC: Underflow (resulting value less than 0) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 0
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 0)","severity":"warning","sourceLocation":{"end":177,"file":"A","start":174},"type":"Warning"},{"component":"general","errorCode":"4984","formattedMessage":"Warning: CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
test.f(0x0, 0)","severity":"warning","sourceLocation":{"end":177,"file":"A","start":174},"type":"Warning"},{"component":"general","errorCode":"4984","formattedMessage":"Warning: CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 1
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 2)
test.f(0x0, 2)
--> A:9:7:
|
9 | \t\t\t\t\t\tx + type(uint).max;
@ -40,10 +40,10 @@ test.f(0, 2)
","message":"CHC: Overflow (resulting value larger than 2**256 - 1) happens here.
Counterexample:
arr = []
a = 0
a = 0x0
x = 1
Transaction trace:
test.constructor()
State: arr = []
test.f(0, 2)","severity":"warning","sourceLocation":{"end":203,"file":"A","start":185},"type":"Warning"}],"sources":{"A":{"id":0}}}
test.f(0x0, 2)","severity":"warning","sourceLocation":{"end":203,"file":"A","start":185},"type":"Warning"}],"sources":{"A":{"id":0}}}

View File

@ -15,4 +15,4 @@ contract C {
// SMTEngine: all
// ----
// Warning 6328: (139-161): CHC: Assertion violation happens here.
// Warning 6328: (263-290): CHC: Assertion violation happens here.\nCounterexample:\ndata = [1]\n\nTransaction trace:\nC.constructor()\nState: data = []\nC.g()
// Warning 6328: (263-290): CHC: Assertion violation happens here.\nCounterexample:\ndata = [0x01]\n\nTransaction trace:\nC.constructor()\nState: data = []\nC.g()

View File

@ -7,5 +7,5 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (40-74): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()
// Warning 6328: (93-126): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()
// Warning 6328: (40-74): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor(){ msg.value: 0 }
// Warning 6328: (93-126): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor(){ msg.value: 0 }

View File

@ -10,4 +10,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (153-188): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor(){ value: 101 }\nC.f()
// Warning 6328: (153-188): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor(){ msg.value: 101 }\nC.f()

View File

@ -15,5 +15,5 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 4984: (266-272): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.\nCounterexample:\nx = 115792089237316195423570985008687907853269984665640564039457584007913129639926, once = true\n\nTransaction trace:\nC.constructor(){ value: 28100 }\nState: x = 115792089237316195423570985008687907853269984665640564039457584007913129639926, once = false\nC.f(){ value: 8 }
// Warning 6328: (235-273): CHC: Assertion violation happens here.\nCounterexample:\nx = 0, once = true\n\nTransaction trace:\nC.constructor()\nState: x = 0, once = false\nC.f(){ value: 8 }
// Warning 4984: (266-272): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.\nCounterexample:\nx = 115792089237316195423570985008687907853269984665640564039457584007913129639926, once = true\n\nTransaction trace:\nC.constructor(){ msg.value: 28100 }\nState: x = 115792089237316195423570985008687907853269984665640564039457584007913129639926, once = false\nC.f(){ msg.value: 8 }
// Warning 6328: (235-273): CHC: Assertion violation happens here.\nCounterexample:\nx = 0, once = true\n\nTransaction trace:\nC.constructor(){ msg.value: 0 }\nState: x = 0, once = false\nC.f(){ msg.value: 8 }

View File

@ -6,4 +6,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (40-82): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()
// Warning 6328: (40-82): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor(){ msg.value: 0 }

View File

@ -15,7 +15,7 @@ contract C {
// Warning 4984: (82-85): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
// Warning 4984: (154-160): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
// Warning 4984: (212-218): CHC: Overflow (resulting value larger than 2**256 - 1) might happen here.
// Warning 6328: (180-219): CHC: Assertion violation happens here.\nCounterexample:\nc = 1\n\nTransaction trace:\nC.constructor()\nState: c = 0\nC.f(){ value: 11 }\nState: c = 1\nC.inv()
// Warning 6328: (180-219): CHC: Assertion violation happens here.\nCounterexample:\nc = 1\n\nTransaction trace:\nC.constructor()\nState: c = 0\nC.f(){ msg.value: 11 }\nState: c = 1\nC.inv()
// Warning 2661: (82-85): BMC: Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 2661: (154-160): BMC: Overflow (resulting value larger than 2**256 - 1) happens here.
// Warning 2661: (212-218): BMC: Overflow (resulting value larger than 2**256 - 1) happens here.

View File

@ -21,6 +21,6 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (173-208): CHC: Assertion violation happens here.\nCounterexample:\nonce = true\n\nTransaction trace:\nC.constructor()\nState: once = false\nC.f(){ value: 10 }
// Warning 6328: (321-356): CHC: Assertion violation happens here.\nCounterexample:\nonce = true\n\nTransaction trace:\nC.constructor()\nState: once = false\nC.f(){ value: 10 }\n C.g(){ value: 10 } -- internal call
// Warning 6328: (469-504): CHC: Assertion violation happens here.\nCounterexample:\nonce = true\n\nTransaction trace:\nC.constructor()\nState: once = false\nC.f(){ value: 10 }\n C.g(){ value: 10 } -- internal call\n C.h(){ value: 10 } -- internal call
// Warning 6328: (173-208): CHC: Assertion violation happens here.\nCounterexample:\nonce = true\n\nTransaction trace:\nC.constructor()\nState: once = false\nC.f(){ msg.value: 10 }
// Warning 6328: (321-356): CHC: Assertion violation happens here.\nCounterexample:\nonce = true\n\nTransaction trace:\nC.constructor()\nState: once = false\nC.f(){ msg.value: 10 }\n C.g() -- internal call
// Warning 6328: (469-504): CHC: Assertion violation happens here.\nCounterexample:\nonce = true\n\nTransaction trace:\nC.constructor()\nState: once = false\nC.f(){ msg.value: 10 }\n C.g() -- internal call\n C.h() -- internal call

View File

@ -23,4 +23,4 @@ contract C {
// SMTEngine: all
// ----
// Warning 9302: (212-228): Return value of low-level calls not used.
// Warning 6328: (232-246): CHC: Assertion violation happens here.\nCounterexample:\nx = 1, lock = false\n_a = 0\ny = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0, lock = false\nC.f(0)\n _a.call("aaaaa") -- untrusted external call, synthesized as:\n C.set(1) -- reentrant call
// Warning 6328: (232-246): CHC: Assertion violation happens here.\nCounterexample:\nx = 1, lock = false\n_a = 0x0\ny = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0, lock = false\nC.f(0x0)\n _a.call("aaaaa") -- untrusted external call, synthesized as:\n C.set(1) -- reentrant call

View File

@ -11,5 +11,5 @@ contract C {
// ----
// Warning 9302: (96-116): Return value of low-level calls not used.
// Warning 6328: (120-156): CHC: Assertion violation might happen here.
// Warning 6328: (175-210): CHC: Assertion violation happens here.\nCounterexample:\n\ni = 0\n\nTransaction trace:\nC.constructor()\nC.g(0)\n i.call{value: 0}("") -- untrusted external call
// Warning 6328: (175-210): CHC: Assertion violation happens here.\nCounterexample:\n\ni = 0x0\n\nTransaction trace:\nC.constructor()\nC.g(0x0)\n i.call{value: 0}("") -- untrusted external call
// Warning 4661: (120-156): BMC: Assertion violation happens here.

View File

@ -16,4 +16,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (206-220): CHC: Assertion violation happens here.\nCounterexample:\nlocked = false\ntarget = 0\n\nTransaction trace:\nC.constructor()\nState: locked = true\nC.call(0)\n D(target).e() -- untrusted external call, synthesized as:\n C.broken() -- reentrant call
// Warning 6328: (206-220): CHC: Assertion violation happens here.\nCounterexample:\nlocked = false\ntarget = 0x0\n\nTransaction trace:\nC.constructor()\nState: locked = true\nC.call(0x0)\n D(target).e() -- untrusted external call, synthesized as:\n C.broken() -- reentrant call

View File

@ -13,4 +13,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (117-131): CHC: Assertion violation happens here.\nCounterexample:\nlocked = false\ntarget = 0\n\nTransaction trace:\nC.constructor()\nState: locked = true\nC.call(0)\n D(target).e() -- untrusted external call, synthesized as:\n C.call(0) -- reentrant call
// Warning 6328: (117-131): CHC: Assertion violation happens here.\nCounterexample:\nlocked = false\ntarget = 0x0\n\nTransaction trace:\nC.constructor()\nState: locked = true\nC.call(0x0)\n D(target).e() -- untrusted external call, synthesized as:\n C.call(0x0) -- reentrant call

View File

@ -38,4 +38,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (968-983): CHC: Assertion violation happens here.\nCounterexample:\n\nw = 56\nz = 1\nt = 44048180624707321370159228589897778088919435935156254407473833945046349512704\n\nTransaction trace:\nC.constructor()\nC.p()\n C.f() -- internal call\n C.g() -- internal call\n C.h() -- internal call\n C.i() -- internal call
// Warning 6328: (968-983): CHC: Assertion violation happens here.\nCounterexample:\n\nw = 56\nz = 1\nt = 0x61626300ff5f5f00000000000000000000000000000000000000000000000000\n\nTransaction trace:\nC.constructor()\nC.p()\n C.f() -- internal call\n C.g() -- internal call\n C.h() -- internal call\n C.i() -- internal call

View File

@ -18,5 +18,5 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (b.sol:208-222): CHC: Assertion violation happens here.\nCounterexample:\n\na = 7\nb = 3\n\nTransaction trace:\nC.constructor()\nC.p()\n C.f() -- internal call\n a.sol:f(2) -- internal call\n a.sol:f([97, 98, 99]) -- internal call
// Warning 6328: (b.sol:274-288): CHC: Assertion violation happens here.\nCounterexample:\n\na = 7\nb = 3\n\nTransaction trace:\nC.constructor()\nC.p()\n C.f() -- internal call\n a.sol:f(2) -- internal call\n a.sol:f([97, 98, 99]) -- internal call
// Warning 6328: (b.sol:208-222): CHC: Assertion violation happens here.\nCounterexample:\n\na = 7\nb = 3\n\nTransaction trace:\nC.constructor()\nC.p()\n C.f() -- internal call\n a.sol:f(2) -- internal call\n a.sol:f([0x61, 0x62, 0x63]) -- internal call
// Warning 6328: (b.sol:274-288): CHC: Assertion violation happens here.\nCounterexample:\n\na = 7\nb = 3\n\nTransaction trace:\nC.constructor()\nC.p()\n C.f() -- internal call\n a.sol:f(2) -- internal call\n a.sol:f([0x61, 0x62, 0x63]) -- internal call

View File

@ -15,4 +15,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (229-243): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 2\ny = 3\n\nTransaction trace:\nC.constructor()\nC.g()\n f(2) -- internal call\n f([97, 98, 99]) -- internal call
// Warning 6328: (229-243): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 2\ny = 3\n\nTransaction trace:\nC.constructor()\nC.g()\n f(2) -- internal call\n f([0x61, 0x62, 0x63]) -- internal call

View File

@ -43,4 +43,4 @@ contract Homer is ERC165, Simpson {
// ====
// SMTEngine: all
// ----
// Warning 6328: (1340-1395): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nHomer.constructor()\nHomer.check()\n Homer.supportsInterface(1941353618) -- internal call\n Homer.supportsInterface(33540519) -- internal call\n Homer.supportsInterface(2342435274) -- internal call
// Warning 6328: (1340-1395): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nHomer.constructor()\nHomer.check()\n Homer.supportsInterface(0x73b6b492) -- internal call\n Homer.supportsInterface(0x01ffc9a7) -- internal call\n Homer.supportsInterface(0x8b9eb9ca) -- internal call

View File

@ -9,4 +9,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (92-126): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (92-126): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f(){ msg.sig: 0x26121ff0 }

View File

@ -14,5 +14,5 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (171-197): CHC: Assertion violation happens here.\nCounterexample:\nx = 0, y = 0\na = 0\nb = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0, y = 0\nC.f()
// Warning 6328: (249-275): CHC: Assertion violation happens here.\nCounterexample:\nx = 0, y = 0\na = 0\nb = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0, y = 0\nC.f()
// Warning 6328: (171-197): CHC: Assertion violation happens here.\nCounterexample:\nx = 0x0, y = 0x0\na = 0x0\nb = 0x0\n\nTransaction trace:\nC.constructor()\nState: x = 0x0, y = 0x0\nC.f()
// Warning 6328: (249-275): CHC: Assertion violation happens here.\nCounterexample:\nx = 0x0, y = 0x0\na = 0x0\nb = 0x0\n\nTransaction trace:\nC.constructor()\nState: x = 0x0, y = 0x0\nC.f()

View File

@ -14,5 +14,5 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (159-175): CHC: Assertion violation happens here.\nCounterexample:\nx = 0, y = 0\na = 0\nb = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0, y = 0\nC.f()
// Warning 6328: (227-245): CHC: Assertion violation happens here.\nCounterexample:\nx = 0, y = 0\na = 0\nb = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0, y = 0\nC.f()
// Warning 6328: (159-175): CHC: Assertion violation happens here.\nCounterexample:\nx = 0x0, y = 0x0\na = 0x0\nb = 0x0\n\nTransaction trace:\nC.constructor()\nState: x = 0x0, y = 0x0\nC.f()
// Warning 6328: (227-245): CHC: Assertion violation happens here.\nCounterexample:\nx = 0x0, y = 0x0\na = 0x0\nb = 0x0\n\nTransaction trace:\nC.constructor()\nState: x = 0x0, y = 0x0\nC.f()

View File

@ -24,4 +24,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (261-283): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.g2(){ value: 35 }\n C.i(){ value: 35 } -- internal call
// Warning 6328: (261-283): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.g2(){ msg.value: 35 }\n C.i() -- internal call

View File

@ -20,4 +20,4 @@ contract Der is Base {
// ====
// SMTEngine: all
// ----
// Warning 6328: (der:173-186): CHC: Assertion violation happens here.\nCounterexample:\nx = 3, a = 0\ny = 0\n\nTransaction trace:\nDer.constructor()\nState: x = 0, a = 0\nDer.g(0)\n Base.f() -- internal call
// Warning 6328: (der:173-186): CHC: Assertion violation happens here.\nCounterexample:\nx = 3, a = 0x0\ny = 0\n\nTransaction trace:\nDer.constructor()\nState: x = 0, a = 0x0\nDer.g(0)\n Base.f() -- internal call

View File

@ -20,4 +20,4 @@ contract ERC20 {
// ====
// SMTEngine: all
// ----
// Warning 3944: (ERC20.sol:121-126): CHC: Underflow (resulting value less than 0) happens here.\nCounterexample:\n\namount = 1\n\nTransaction trace:\nERC20.constructor()\nERC20.transferFrom(1)\n ERC20.sol:sub(0, 1) -- internal call
// Warning 3944: (ERC20.sol:121-126): CHC: Underflow (resulting value less than 0) happens here.\nCounterexample:\n\namount = 1\n\nTransaction trace:\nERC20.constructor()\nERC20.transferFrom(1){ msg.sender: 0x52f6 }\n ERC20.sol:sub(0, 1) -- internal call

View File

@ -25,4 +25,4 @@ contract ERC20 {
// ====
// SMTEngine: all
// ----
// Warning 3944: (ERC20.sol:157-162): CHC: Underflow (resulting value less than 0) happens here.\nCounterexample:\n\namount = 1\n\nTransaction trace:\nERC20.constructor()\nERC20.transferFrom(1)\n SafeMath.sub(0, 1) -- internal call
// Warning 3944: (ERC20.sol:157-162): CHC: Underflow (resulting value less than 0) happens here.\nCounterexample:\n\namount = 1\n\nTransaction trace:\nERC20.constructor()\nERC20.transferFrom(1){ msg.sender: 0x52f6 }\n SafeMath.sub(0, 1) -- internal call

View File

@ -21,6 +21,6 @@ contract B is A {
// ====
// SMTEngine: all
// ----
// Warning 6328: (87-101): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nA.constructor()\nState: x = 0\nA.receive(){ value: 2 }
// Warning 6328: (87-101): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nA.constructor()\nState: x = 0\nA.receive(){ msg.value: 2 }
// Warning 6328: (136-150): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\n\nTransaction trace:\nA.constructor()\nState: x = 0\nA.g()
// Warning 6328: (255-269): CHC: Assertion violation happens here.\nCounterexample:\ny = 0, x = 0\n\nTransaction trace:\nB.constructor()\nState: y = 0, x = 0\nB.fallback()

View File

@ -20,4 +20,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (254-267): CHC: Assertion violation happens here.\nCounterexample:\nx = 0, owner = 0\ny = 1\n\nTransaction trace:\nC.constructor()\nState: x = 0, owner = 0\nC.g(1)\n C.f() -- internal call
// Warning 6328: (254-267): CHC: Assertion violation happens here.\nCounterexample:\nx = 0, owner = 0x0\ny = 1\n\nTransaction trace:\nC.constructor()\nState: x = 0, owner = 0x0\nC.g(1)\n C.f() -- internal call

View File

@ -34,4 +34,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (540-554): CHC: Assertion violation happens here.\nCounterexample:\nx = 1, owner = 0\ny = 1\n\nTransaction trace:\nC.constructor()\nState: x = 0, owner = 0\nC.g(1)
// Warning 6328: (540-554): CHC: Assertion violation happens here.\nCounterexample:\nx = 1, owner = 0x0\ny = 1\n\nTransaction trace:\nC.constructor()\nState: x = 0, owner = 0x0\nC.g(1){ msg.sender: 0x0 }

View File

@ -9,4 +9,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (100-123): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 65535\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (100-123): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0xffff\n\nTransaction trace:\nC.constructor()\nC.f()

View File

@ -9,4 +9,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (150-175): CHC: Assertion violation happens here.\nCounterexample:\n\n = 0\nb = 255\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (150-175): CHC: Assertion violation happens here.\nCounterexample:\n\n = 0x0\nb = 0xff\n\nTransaction trace:\nC.constructor()\nC.f()

View File

@ -34,5 +34,5 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6368: (468-472): CHC: Out of bounds access happens here.\nCounterexample:\n\nx = [18, 52, 0]\n\nTransaction trace:\nC.constructor()\nC.h()
// Warning 6368: (490-494): CHC: Out of bounds access happens here.\nCounterexample:\n\nx = [18, 52, 0]\n\nTransaction trace:\nC.constructor()\nC.h()
// Warning 6368: (468-472): CHC: Out of bounds access happens here.\nCounterexample:\n\nx = [0x12, 0x34, 0x0]\n\nTransaction trace:\nC.constructor()\nC.h()
// Warning 6368: (490-494): CHC: Out of bounds access happens here.\nCounterexample:\n\nx = [0x12, 0x34, 0x0]\n\nTransaction trace:\nC.constructor()\nC.h()

View File

@ -13,4 +13,4 @@ contract C {
// SMTEngine: all
// ----
// Warning 6321: (51-57): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
// Warning 6328: (177-191): CHC: Assertion violation happens here.\nCounterexample:\n\n = 0\na = 0\nb = 240\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (177-191): CHC: Assertion violation happens here.\nCounterexample:\n\n = 0x0\na = 0x0\nb = 0xf0\n\nTransaction trace:\nC.constructor()\nC.f()

View File

@ -13,4 +13,4 @@ contract C {
// SMTEngine: all
// ----
// Warning 6321: (51-57): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
// Warning 6328: (177-191): CHC: Assertion violation happens here.\nCounterexample:\n\n = 0\na = 255\nb = 255\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (177-191): CHC: Assertion violation happens here.\nCounterexample:\n\n = 0x0\na = 0xff\nb = 0xff\n\nTransaction trace:\nC.constructor()\nC.f()

View File

@ -14,4 +14,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (147-165): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 6579559\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (147-165): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 0x646567\n\nTransaction trace:\nC.constructor()\nC.f()

View File

@ -17,5 +17,5 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (229-276): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 43595849750559157961410616371195012376776328331498503227444818324475146035296\nz = 43595849750559157961410616371195012376776328331498503227444818324475146035296\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (394-437): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 44959890247538927454655645290332771782915717053340361485195502024921998844258\nz = 44959890247538927454655645290332771782915717053340361485195502024921998844258\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (229-276): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 0x6062606464666060606260646466606060626064646660606062606464666060\nz = 0x6062606464666060606260646466606060626064646660606062606464666060\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (394-437): CHC: Assertion violation happens here.\nCounterexample:\n\ny = 0x63666566676e616263666566676e616263666566676e616263666566676e6162\nz = 0x63666566676e616263666566676e616263666566676e616263666566676e6162\n\nTransaction trace:\nC.constructor()\nC.f()

View File

@ -13,4 +13,4 @@ contract C {
// SMTEngine: all
// ----
// Warning 6321: (51-57): Unnamed return variable can remain unassigned. Add an explicit return with value to all non-reverting code paths or name the variable.
// Warning 6328: (178-195): CHC: Assertion violation happens here.\nCounterexample:\n\n = 0\na = 255\nb = 240\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (178-195): CHC: Assertion violation happens here.\nCounterexample:\n\n = 0x0\na = 0xff\nb = 0xf0\n\nTransaction trace:\nC.constructor()\nC.f()

View File

@ -9,4 +9,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (152-173): CHC: Assertion violation happens here.\nCounterexample:\n\nx = [0, 17, 34, 51]\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (152-173): CHC: Assertion violation happens here.\nCounterexample:\n\nx = [0x0, 0x11, 0x22, 0x33]\n\nTransaction trace:\nC.constructor()\nC.f()

View File

@ -6,4 +6,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6368: (83-87): CHC: Out of bounds access happens here.\nCounterexample:\n\nx = 0\ny = 4\n = 0\n\nTransaction trace:\nC.constructor()\nC.r(0, 4)
// Warning 6368: (83-87): CHC: Out of bounds access happens here.\nCounterexample:\n\nx = 0x0\ny = 4\n = 0x0\n\nTransaction trace:\nC.constructor()\nC.r(0x0, 4)

View File

@ -13,4 +13,4 @@ contract C {
// Warning 2072: (82-86): Unused local variable.
// Warning 2072: (140-150): Unused local variable.
// Warning 2072: (152-156): Unused local variable.
// Warning 6328: (220-236): CHC: Assertion violation happens here.\nCounterexample:\n\na1 = 2437\nb1 = 10\nc1 = 9\na2 = 2437\nb2 = 10\nc2 = 9\n\nTransaction trace:\nC.constructor()\nC.f(data)
// Warning 6328: (220-236): CHC: Assertion violation happens here.\nCounterexample:\n\na1 = 2437\nb1 = 0x0a\nc1 = 9\na2 = 2437\nb2 = 0x0a\nc2 = 9\n\nTransaction trace:\nC.constructor()\nC.f(data)

View File

@ -25,8 +25,11 @@ contract C {
assert(gas == block.gaslimit); // should hold with CHC
assert(number == block.number); // should hold with CHC
assert(timestamp == block.timestamp); // should hold with CHC
assert(coin == address(this)); // should fail
}
}
// ====
// SMTEngine: chc
// ----
// Warning 6328: (770-799): CHC: Assertion violation happens here.\nCounterexample:\ncoin = 0x0, dif = 0, gas = 0, number = 0, timestamp = 0\n\nTransaction trace:\nC.constructor()\nState: coin = 0x0, dif = 0, gas = 0, number = 0, timestamp = 0\nC.f(){ block.coinbase: 0x0, block.difficulty: 0, block.gaslimit: 0, block.number: 0, block.timestamp: 0 }\n C.g() -- internal call

View File

@ -7,6 +7,7 @@ contract C {
// ====
// SMTEngine: all
// SMTIgnoreOS: macos
// SMTIgnoreCex: yes
// ----
// Warning 6328: (46-71): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f(){ value: 11 }
// Warning 6328: (75-113): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (46-71): CHC: Assertion violation happens here.
// Warning 6328: (75-113): CHC: Assertion violation happens here.

View File

@ -25,6 +25,6 @@ contract C
// ====
// SMTEngine: all
// ----
// Warning 6328: (43-72): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (370-399): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f()\n C.fi() -- internal call\n C.gi() -- internal call
// Warning 6328: (510-539): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.h()
// Warning 6328: (43-72): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f(){ msg.sig: 0x26121ff0 }
// Warning 6328: (370-399): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f(){ msg.sig: 0x26121ff0 }\n C.fi() -- internal call\n C.gi() -- internal call
// Warning 6328: (510-539): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.h(){ msg.sig: 0xb8c9d365 }

View File

@ -6,5 +6,5 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 4984: (55-68): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f(){ value: 115792089237316195423570985008687907853269984665640564039457584007913129639931 }
// Warning 4984: (55-80): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f(){ value: 57896044618658097711785492504343953926634992332820282019728792003956564819966 }
// Warning 4984: (55-68): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f(){ msg.value: 115792089237316195423570985008687907853269984665640564039457584007913129639931 }
// Warning 4984: (55-80): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f(){ msg.value: 57896044618658097711785492504343953926634992332820282019728792003956564819966 }

View File

@ -6,4 +6,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (46-67): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (46-67): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nC.constructor()\nC.f(){ msg.value: 0 }

View File

@ -13,4 +13,4 @@ contract B {
// ====
// SMTEngine: all
// ----
// Warning 6328: (154-176): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nB.constructor(){ value: 39 }
// Warning 6328: (154-176): CHC: Assertion violation happens here.\nCounterexample:\n\n\nTransaction trace:\nB.constructor(){ msg.value: 39 }

View File

@ -14,4 +14,4 @@ contract C is A {
// ====
// SMTEngine: all
// ----
// Warning 6328: (68-82): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nA.constructor(){ value: 1 }
// Warning 6328: (68-82): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nA.constructor(){ msg.value: 1 }

View File

@ -14,5 +14,5 @@ contract C is A {
// ====
// SMTEngine: all
// ----
// Warning 6328: (60-74): CHC: Assertion violation happens here.\nCounterexample:\nv = 0, x = 1\n\nTransaction trace:\nC.constructor(){ value: 1 }
// Warning 6328: (240-254): CHC: Assertion violation happens here.\nCounterexample:\nv = 1, x = 1\n\nTransaction trace:\nC.constructor(){ value: 1 }
// Warning 6328: (60-74): CHC: Assertion violation happens here.\nCounterexample:\nv = 0, x = 1\n\nTransaction trace:\nC.constructor(){ msg.value: 1 }
// Warning 6328: (240-254): CHC: Assertion violation happens here.\nCounterexample:\nv = 1, x = 1\n\nTransaction trace:\nC.constructor(){ msg.value: 1 }

View File

@ -19,4 +19,4 @@ contract C is A, B {
// ====
// SMTEngine: all
// ----
// Warning 6328: (60-74): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nC.constructor(){ value: 1 }
// Warning 6328: (60-74): CHC: Assertion violation happens here.\nCounterexample:\nx = 1\n\nTransaction trace:\nC.constructor(){ msg.value: 1 }

View File

@ -21,8 +21,11 @@ contract C {
assert(sender == msg.sender); // should hold with CHC
assert(sig == msg.sig); // should hold with CHC
assert(value == msg.value); // should hold with CHC
assert(msg.value == 10); // should fail
}
}
// ====
// SMTEngine: chc
// ----
// Warning 6328: (621-644): CHC: Assertion violation happens here.\nCounterexample:\ndata = [0x26, 0x12, 0x1f, 0xf0], sender = 0x0, sig = 0x26121ff0, value = 0\n\nTransaction trace:\nC.constructor()\nState: data = [], sender = 0x0, sig = 0x0, value = 0\nC.f(){ msg.data: [0x26, 0x12, 0x1f, 0xf0], msg.sender: 0x0, msg.sig: 0x26121ff0, msg.value: 0 }\n C.g() -- internal call

View File

@ -0,0 +1,24 @@
contract C {
struct S {
uint value;
address origin;
uint number;
}
function f() public payable {
S memory msg = S(42, address(0), 666);
S memory tx = S(42, address(0), 666);
S memory block = S(42, address(0), 666);
assert(msg.value == 42); // should hold
assert(msg.value == 41); // should fail
assert(tx.origin == address(0)); // should hold
assert(block.number == 666); // should hold
}
}
// ====
// SMTEngine: all
// SMTIgnoreCex: yes
// ----
// Warning 2319: (108-120): This declaration shadows a builtin symbol.
// Warning 2319: (149-160): This declaration shadows a builtin symbol.
// Warning 2319: (189-203): This declaration shadows a builtin symbol.
// Warning 6328: (274-297): CHC: Assertion violation happens here.

View File

@ -9,4 +9,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 4984: (107-126): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.\nCounterexample:\nx = 115792089237316195423570985008687907853269984665640564039457584007913129639935\n\nTransaction trace:\nC.constructor()
// Warning 4984: (107-126): CHC: Overflow (resulting value larger than 2**256 - 1) happens here.\nCounterexample:\nx = 115792089237316195423570985008687907853269984665640564039457584007913129639935\n\nTransaction trace:\nC.constructor(){ block.timestamp: 115792089237316195423570985008687907853269984665640564039457584007913129639935 }

View File

@ -13,8 +13,11 @@ contract C {
assert(gas == tx.gasprice); // should hold with CHC
assert(origin == tx.origin); // should hold with CHC
assert(tx.origin == address(this)); // should fail
}
}
// ====
// SMTEngine: chc
// ----
// Warning 6328: (343-377): CHC: Assertion violation happens here.\nCounterexample:\ngas = 0, origin = 0x0\n\nTransaction trace:\nC.constructor()\nState: gas = 0, origin = 0x0\nC.f(){ tx.gasprice: 0, tx.origin: 0x0 }\n C.g() -- internal call

View File

@ -0,0 +1,16 @@
interface I {
function f() external;
}
contract C {
function g(I _i) public payable {
uint x = address(this).balance;
_i.f();
assert(x == address(this).balance); // should fail
}
}
// ====
// SMTEngine: all
// SMTIgnoreOS: macos
// ----
// Warning 6328: (135-169): CHC: Assertion violation happens here.\nCounterexample:\n\n_i = 0\nx = 841\n\nTransaction trace:\nC.constructor()\nC.g(0){ msg.value: 38 }\n _i.f() -- untrusted external call, synthesized as:\n C.g(0){ msg.value: 0 } -- reentrant call\n _i.f() -- untrusted external call

View File

@ -0,0 +1,16 @@
interface I {
function f() external payable;
}
contract C {
function g(I _i) public payable {
uint x = address(this).balance;
_i.f{ value: 100 }();
assert(x == address(this).balance); // should fail
}
}
// ====
// SMTEngine: all
// SMTIgnoreOS: macos
// ----
// Warning 6328: (157-191): CHC: Assertion violation happens here.\nCounterexample:\n\n_i = 0\nx = 2537\n\nTransaction trace:\nC.constructor()\nC.g(0){ msg.value: 38 }\n _i.f{ value: 100 }() -- untrusted external call

View File

@ -22,4 +22,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (454-468): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\na = 0\nb = 1\nc = 0\nd = 0\ne = 305419896\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.g()
// Warning 6328: (454-468): CHC: Assertion violation happens here.\nCounterexample:\nx = 0x0\na = 0x0\nb = 0x01\nc = 0x0\nd = 0x0\ne = 0x12345678\n\nTransaction trace:\nC.constructor()\nState: x = 0x0\nC.g()

View File

@ -16,7 +16,7 @@ contract C {
}
}
// ----
// Warning 6328: (225-256): CHC: Assertion violation happens here.\nCounterexample:\n\nc = 283686952306183\nd = 0\ne = 0\ng = 0\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (352-399): CHC: Assertion violation happens here.\nCounterexample:\n\nc = 283686952306183\nd = 5233100606242806050944357496980485\ne = 0\ng = 0\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (526-589): CHC: Assertion violation happens here.\nCounterexample:\n\nc = 283686952306183\nd = 5233100606242806050944357496980485\ne = 96533667595335344310996525432040024692804347064549891\ng = 0\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (732-811): CHC: Assertion violation happens here.\nCounterexample:\n\nc = 283686952306183\nd = 5233100606242806050944357496980485\ne = 96533667595335344310996525432040024692804347064549891\ng = 1780731860627700044956966451854862080991451332659079878538166652776284161\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (225-256): CHC: Assertion violation happens here.\nCounterexample:\n\nc = 0x01020304050607\nd = 0x0\ne = 0x0\ng = 0x0\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (352-399): CHC: Assertion violation happens here.\nCounterexample:\n\nc = 0x01020304050607\nd = 0x010203040506070809000102030405\ne = 0x0\ng = 0x0\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (526-589): CHC: Assertion violation happens here.\nCounterexample:\n\nc = 0x01020304050607\nd = 0x010203040506070809000102030405\ne = 0x0102030405060708090001020304050607080900010203\ng = 0x0\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (732-811): CHC: Assertion violation happens here.\nCounterexample:\n\nc = 0x01020304050607\nd = 0x010203040506070809000102030405\ne = 0x0102030405060708090001020304050607080900010203\ng = 0x01020304050607080900010203040506070809000102030405060708090001\n\nTransaction trace:\nC.constructor()\nC.f()

View File

@ -12,4 +12,4 @@ contract C
// ====
// SMTEngine: all
// ----
// Warning 6328: (240-254): CHC: Assertion violation happens here.\nCounterexample:\n\na = 4660\nb = 305397760\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (240-254): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0x1234\nb = 0x12340000\n\nTransaction trace:\nC.constructor()\nC.f()

View File

@ -13,4 +13,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (153-174): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 2\nb = 0\n\nTransaction trace:\nC.constructor()\nC.f()\n C.g(0) -- internal call
// Warning 6328: (153-174): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 2\nb = 0x0\n\nTransaction trace:\nC.constructor()\nC.f()\n C.g(0x0) -- internal call

View File

@ -9,4 +9,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (173-207): CHC: Assertion violation happens here.\nCounterexample:\n\nb = [255, 255]\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (173-207): CHC: Assertion violation happens here.\nCounterexample:\n\nb = [0xff, 0xff]\n\nTransaction trace:\nC.constructor()\nC.f()

View File

@ -9,4 +9,4 @@ contract B {
// ====
// SMTEngine: all
// ----
// Warning 6328: (120-142): CHC: Assertion violation happens here.\nCounterexample:\n\na = 13564890559296822\n\nTransaction trace:\nB.constructor()\nB.f()
// Warning 6328: (120-142): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0x30313233343536\n\nTransaction trace:\nB.constructor()\nB.f()

View File

@ -13,4 +13,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (410-429): CHC: Assertion violation happens here.\nCounterexample:\n\nv1 = 44048180597813453602326562734351324025098966208897425494240603688123167145984\nv2 = 6579558\n\nTransaction trace:\nC.constructor()\nC.a()\n C.f2() -- internal call\n C.h() -- internal call
// Warning 6328: (410-429): CHC: Assertion violation happens here.\nCounterexample:\n\nv1 = 0x6162630000000000000000000000000000000000000000000000000000000000\nv2 = 0x646566\n\nTransaction trace:\nC.constructor()\nC.a()\n C.f2() -- internal call\n C.h() -- internal call

View File

@ -11,4 +11,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (132-160): CHC: Assertion violation happens here.\nCounterexample:\nx = [97, 98, 99, 97]\n\nTransaction trace:\nC.constructor()\nState: x = []\nC.s()
// Warning 6328: (132-160): CHC: Assertion violation happens here.\nCounterexample:\nx = [0x61, 0x62, 0x63, 0x61]\n\nTransaction trace:\nC.constructor()\nState: x = []\nC.s()

View File

@ -11,5 +11,5 @@ contract C
// ====
// SMTEngine: all
// ----
// Warning 6328: (162-186): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0\nx = 100\n\nTransaction trace:\nC.constructor()\nC.f(0)
// Warning 6328: (162-186): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0x0\nx = 100\n\nTransaction trace:\nC.constructor()\nC.f(0x0)
// Warning 1236: (98-113): BMC: Insufficient funds happens here.

View File

@ -11,6 +11,6 @@ contract C
// ====
// SMTEngine: all
// ----
// Warning 6328: (180-204): CHC: Assertion violation happens here.\nCounterexample:\n\na = 8855\nb = 8855\n\nTransaction trace:\nC.constructor()\nC.f(8855, 8855)
// Warning 6328: (180-204): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0x2297\nb = 0x2297\n\nTransaction trace:\nC.constructor()\nC.f(0x2297, 0x2297)
// Warning 1236: (101-116): BMC: Insufficient funds happens here.
// Warning 1236: (120-136): BMC: Insufficient funds happens here.

View File

@ -12,4 +12,4 @@ contract C
// ====
// SMTEngine: all
// ----
// Warning 6328: (83-97): CHC: Assertion violation happens here.\nCounterexample:\nx = 0\ny = 0\n\nTransaction trace:\nC.constructor()\nState: x = 0\nC.f(0)\n C.g() -- internal call
// Warning 6328: (83-97): CHC: Assertion violation happens here.\nCounterexample:\nx = 0x0\ny = 0x0\n\nTransaction trace:\nC.constructor()\nState: x = 0x0\nC.f(0x0)\n C.g() -- internal call

View File

@ -12,4 +12,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (231-252): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 450552876409790643671482431940419874915447411150352389258589821042463539455\nz = 0\no = 255\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (231-252): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0xff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff00ff\nz = 0x0\no = 0xff\n\nTransaction trace:\nC.constructor()\nC.f()

View File

@ -11,6 +11,6 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (87-104): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 16909060\nb = 2\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (138-155): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 16909060\nb = 2\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (168-185): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 16909060\nb = 2\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (87-104): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0x01020304\nb = 0x02\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (138-155): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0x01020304\nb = 0x02\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (168-185): CHC: Assertion violation happens here.\nCounterexample:\n\nx = 0x01020304\nb = 0x02\n\nTransaction trace:\nC.constructor()\nC.f()

View File

@ -8,5 +8,5 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6368: (99-103): CHC: Out of bounds access happens here.\nCounterexample:\n\ni = 4\nx = 16909060\n\nTransaction trace:\nC.constructor()\nC.f(4)
// Warning 6328: (92-112): CHC: Assertion violation happens here.\nCounterexample:\n\ni = 4\nx = 16909060\n\nTransaction trace:\nC.constructor()\nC.f(4)
// Warning 6368: (99-103): CHC: Out of bounds access happens here.\nCounterexample:\n\ni = 4\nx = 0x01020304\n\nTransaction trace:\nC.constructor()\nC.f(4)
// Warning 6328: (92-112): CHC: Assertion violation happens here.\nCounterexample:\n\ni = 4\nx = 0x01020304\n\nTransaction trace:\nC.constructor()\nC.f(4)

View File

@ -8,4 +8,4 @@ contract C
// ====
// SMTEngine: all
// ----
// Warning 6328: (92-111): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0\nx = 0\n\nTransaction trace:\nC.constructor()\nC.f(0, 0)
// Warning 6328: (92-111): CHC: Assertion violation happens here.\nCounterexample:\n\na = 0x0\nx = 0\n\nTransaction trace:\nC.constructor()\nC.f(0x0, 0)

View File

@ -8,5 +8,5 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (102-122): CHC: Assertion violation happens here.\nCounterexample:\n\na = [9, 9]\n\nTransaction trace:\nC.constructor()\nC.f([9, 9])
// Warning 6328: (141-161): CHC: Assertion violation happens here.\nCounterexample:\n\na = [9, 9]\n\nTransaction trace:\nC.constructor()\nC.f([9, 9])
// Warning 6328: (102-122): CHC: Assertion violation happens here.\nCounterexample:\n\na = [0x09, 0x09]\n\nTransaction trace:\nC.constructor()\nC.f([0x09, 0x09])
// Warning 6328: (141-161): CHC: Assertion violation happens here.\nCounterexample:\n\na = [0x09, 0x09]\n\nTransaction trace:\nC.constructor()\nC.f([0x09, 0x09])

View File

@ -8,5 +8,5 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (113-133): CHC: Assertion violation happens here.\nCounterexample:\n\na = [0, 0]\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (152-172): CHC: Assertion violation happens here.\nCounterexample:\n\na = [0, 0]\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (113-133): CHC: Assertion violation happens here.\nCounterexample:\n\na = [0x0, 0x0]\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (152-172): CHC: Assertion violation happens here.\nCounterexample:\n\na = [0x0, 0x0]\n\nTransaction trace:\nC.constructor()\nC.f()

View File

@ -9,5 +9,5 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (106-126): CHC: Assertion violation happens here.\nCounterexample:\n\na = [0, 0]\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (145-165): CHC: Assertion violation happens here.\nCounterexample:\n\na = [0, 0]\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (106-126): CHC: Assertion violation happens here.\nCounterexample:\n\na = [0x0, 0x0]\n\nTransaction trace:\nC.constructor()\nC.f()
// Warning 6328: (145-165): CHC: Assertion violation happens here.\nCounterexample:\n\na = [0x0, 0x0]\n\nTransaction trace:\nC.constructor()\nC.f()

View File

@ -20,4 +20,4 @@ contract C
// ====
// SMTEngine: all
// ----
// Warning 6328: (330-389): CHC: Assertion violation happens here.\nCounterexample:\na = 512, b = false, c = 0\nx = 1\n\nTransaction trace:\nC.constructor()\nState: a = 0, b = false, c = 0\nC.f(1)
// Warning 6328: (330-389): CHC: Assertion violation happens here.\nCounterexample:\na = 0x0200, b = false, c = 0\nx = 1\n\nTransaction trace:\nC.constructor()\nState: a = 0x0, b = false, c = 0\nC.f(1)

View File

@ -10,4 +10,4 @@ contract C
// ====
// SMTEngine: all
// ----
// Warning 6328: (91-104): CHC: Assertion violation happens here.\nCounterexample:\na = 0, b = false, c = 0\n\nTransaction trace:\nC.constructor()\nState: a = 0, b = false, c = 0\nC.f()
// Warning 6328: (91-104): CHC: Assertion violation happens here.\nCounterexample:\na = 0x0, b = false, c = 0\n\nTransaction trace:\nC.constructor()\nState: a = 0x0, b = false, c = 0\nC.f()

View File

@ -10,4 +10,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (142-157): CHC: Assertion violation happens here.\nCounterexample:\n\n_x = 52647538817385212172903286807934654968315727694643370704309751478220717293568\ny = 52647538817385212172903286807934654968315727694643370704309751478220717293568\nz = 154717211199090701642289212291190620160\n\nTransaction trace:\nC.constructor()\nC.f(52647538817385212172903286807934654968315727694643370704309751478220717293568)
// Warning 6328: (142-157): CHC: Assertion violation happens here.\nCounterexample:\n\n_x = 0x7465737400000000000000000000000000000000000000000000000000000000\ny = 0x7465737400000000000000000000000000000000000000000000000000000000\nz = 0x746573747a0000000000000000000000\n\nTransaction trace:\nC.constructor()\nC.f(0x7465737400000000000000000000000000000000000000000000000000000000)

View File

@ -9,4 +9,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (143-158): CHC: Assertion violation happens here.\nCounterexample:\n\n_x = 52647538817385212172903286807934654968315727694643370704309751478220717293568\ny = 52647538817385212172903286807934654968315727694643370704309751478220717293568\nz = 154717211199090701642289212291190620160\n\nTransaction trace:\nC.constructor()\nC.f(52647538817385212172903286807934654968315727694643370704309751478220717293568)
// Warning 6328: (143-158): CHC: Assertion violation happens here.\nCounterexample:\n\n_x = 0x7465737400000000000000000000000000000000000000000000000000000000\ny = 0x7465737400000000000000000000000000000000000000000000000000000000\nz = 0x746573747a0000000000000000000000\n\nTransaction trace:\nC.constructor()\nC.f(0x7465737400000000000000000000000000000000000000000000000000000000)

View File

@ -11,4 +11,4 @@ contract C {
// ====
// SMTEngine: all
// ----
// Warning 6328: (153-168): CHC: Assertion violation happens here.\nCounterexample:\n\n_x = 52647538817385212172903286807934654968315727694643370704309751478220717293568\ny = 52647538817385212172903286807934654968315727694643370704309751478220717293568\nz = 154717211199090701642289212291190620160\n\nTransaction trace:\nC.constructor()\nC.f(52647538817385212172903286807934654968315727694643370704309751478220717293568)
// Warning 6328: (153-168): CHC: Assertion violation happens here.\nCounterexample:\n\n_x = 0x7465737400000000000000000000000000000000000000000000000000000000\ny = 0x7465737400000000000000000000000000000000000000000000000000000000\nz = 0x746573747a0000000000000000000000\n\nTransaction trace:\nC.constructor()\nC.f(0x7465737400000000000000000000000000000000000000000000000000000000)

Some files were not shown because too many files have changed in this diff Show More