aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/ast
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-05-08 04:34:31 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-06-25 23:01:45 +0800
commit0e66a1ddde9ad3cf3c05e43afc808431e63ac588 (patch)
treede6248a707ba432ffdecdf7259e6f20274399f5b /libsolidity/ast
parent312f422e100e63cb1980a2e09bc39a95f192aa09 (diff)
downloaddexon-solidity-0e66a1ddde9ad3cf3c05e43afc808431e63ac588.tar.gz
dexon-solidity-0e66a1ddde9ad3cf3c05e43afc808431e63ac588.tar.zst
dexon-solidity-0e66a1ddde9ad3cf3c05e43afc808431e63ac588.zip
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.
Diffstat (limited to 'libsolidity/ast')
-rw-r--r--libsolidity/ast/Types.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h
index b2f34dee..d3561fb9 100644
--- a/libsolidity/ast/Types.h
+++ b/libsolidity/ast/Types.h
@@ -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;