diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-09-13 23:30:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-13 23:30:54 +0800 |
commit | e7daed68c1977683546ac3e72d4f84ff538f6711 (patch) | |
tree | bb2595e6cc12d420c22bc0373bcb5a7f81c3b0bb /libsolidity/codegen/ABIFunctions.cpp | |
parent | 5aa5fa78f32c89fcf8f635db026d18a6ba8ef132 (diff) | |
parent | ae35a58124852eda9a5e6bf67f9976198d2f9c0f (diff) | |
download | dexon-solidity-e7daed68c1977683546ac3e72d4f84ff538f6711.tar dexon-solidity-e7daed68c1977683546ac3e72d4f84ff538f6711.tar.gz dexon-solidity-e7daed68c1977683546ac3e72d4f84ff538f6711.tar.bz2 dexon-solidity-e7daed68c1977683546ac3e72d4f84ff538f6711.tar.lz dexon-solidity-e7daed68c1977683546ac3e72d4f84ff538f6711.tar.xz dexon-solidity-e7daed68c1977683546ac3e72d4f84ff538f6711.tar.zst dexon-solidity-e7daed68c1977683546ac3e72d4f84ff538f6711.zip |
Merge pull request #4911 from ethereum/addressPayable
Payable and non-payable address type.
Diffstat (limited to 'libsolidity/codegen/ABIFunctions.cpp')
-rw-r--r-- | libsolidity/codegen/ABIFunctions.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libsolidity/codegen/ABIFunctions.cpp b/libsolidity/codegen/ABIFunctions.cpp index 5e5fe84a..6c27533c 100644 --- a/libsolidity/codegen/ABIFunctions.cpp +++ b/libsolidity/codegen/ABIFunctions.cpp @@ -242,8 +242,14 @@ string ABIFunctions::cleanupFunction(Type const& _type, bool _revertOnFailure) break; } case Type::Category::Contract: - templ("body", "cleaned := " + cleanupFunction(AddressType()) + "(value)"); + { + AddressType addressType(dynamic_cast<ContractType const&>(_type).isPayable() ? + StateMutability::Payable : + StateMutability::NonPayable + ); + templ("body", "cleaned := " + cleanupFunction(addressType) + "(value)"); break; + } case Type::Category::Enum: { size_t members = dynamic_cast<EnumType const&>(_type).numberOfMembers(); |