MCPcopy Create free account
hub / github.com/argotorg/solidity / formatArrayOp

Function formatArrayOp

libsolidity/formal/ExpressionFormatter.cpp:101–114  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101std::string formatArrayOp(smtutil::Expression const& _expr, std::vector<std::string> const& _args)
102{
103 if (_expr.name == "select")
104 {
105 auto const& a0 = _args.at(0);
106 static std::set<std::string> const ufs{"keccak256", "sha256", "ripemd160", "ecrecover"};
107 if (ufs.count(a0) || starts_with(a0, "t_function_abi"))
108 return _args.at(0) + "(" + _args.at(1) + ")";
109 return _args.at(0) + "[" + _args.at(1) + "]";
110 }
111 if (_expr.name == "store")
112 return "(" + _args.at(0) + "[" + _args.at(1) + "] := " + _args.at(2) + ")";
113 return formatGenericOp(_expr, _args);
114}
115
116std::string formatUnaryOp(smtutil::Expression const& _expr, std::vector<std::string> const& _args)
117{

Callers 1

toSolidityStrFunction · 0.85

Calls 3

formatGenericOpFunction · 0.85
atMethod · 0.80
countMethod · 0.45

Tested by

no test coverage detected