mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Single bytes argument.
In 0.5.0 mode, only accept a single bytes argument for ``.call``, ``keccak256`` and others and do not pad when encoding.
This commit is contained in:
committed by
Alex Beregszaszi
parent
312f422e10
commit
0e66a1ddde
@@ -1058,18 +1058,20 @@ public:
|
||||
ASTPointer<ASTString> documentation() const;
|
||||
|
||||
/// true iff arguments are to be padded to multiples of 32 bytes for external calls
|
||||
/// TODO should this be true in general for bareCall*?
|
||||
bool padArguments() const { return !(m_kind == Kind::SHA3 || m_kind == Kind::SHA256 || m_kind == Kind::RIPEMD160 || m_kind == Kind::ABIEncodePacked); }
|
||||
bool takesArbitraryParameters() const { return m_arbitraryParameters; }
|
||||
/// true iff the function takes a single bytes parameter and it is passed on without padding.
|
||||
/// @todo until 0.5.0, this is just a "recommendation".
|
||||
bool takesSinglePackedBytesParameter() const
|
||||
{
|
||||
// @todo add the call kinds here with 0.5.0 and perhaps also log0.
|
||||
switch (m_kind)
|
||||
{
|
||||
case FunctionType::Kind::SHA3:
|
||||
case FunctionType::Kind::SHA256:
|
||||
case FunctionType::Kind::RIPEMD160:
|
||||
case FunctionType::Kind::BareCall:
|
||||
case FunctionType::Kind::BareCallCode:
|
||||
case FunctionType::Kind::BareDelegateCall:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user