diff options
author | chriseth <chris@ethereum.org> | 2018-05-15 19:04:49 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-05-15 20:45:54 +0800 |
commit | dac0029d16ffe31fba2e6241f99893ea9a26926e (patch) | |
tree | 1e68ea5ff7ab7b10bf2bf59195676ff7feac8524 /test | |
parent | dce62240525035ec7ce6b5d1b76bfeebe1ae9546 (diff) | |
download | dexon-solidity-dac0029d16ffe31fba2e6241f99893ea9a26926e.tar.gz dexon-solidity-dac0029d16ffe31fba2e6241f99893ea9a26926e.tar.zst dexon-solidity-dac0029d16ffe31fba2e6241f99893ea9a26926e.zip |
ABI encoding functions are pure and should be usable in constants.
Diffstat (limited to 'test')
-rw-r--r-- | test/libsolidity/syntaxTests/constants/abi_encoding_constant.sol | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/constants/abi_encoding_constant.sol b/test/libsolidity/syntaxTests/constants/abi_encoding_constant.sol new file mode 100644 index 00000000..dd6968a0 --- /dev/null +++ b/test/libsolidity/syntaxTests/constants/abi_encoding_constant.sol @@ -0,0 +1,7 @@ +contract C { + bytes32 constant a = keccak256(abi.encode(1, 2)); + bytes32 constant b = keccak256(abi.encodePacked(uint(1), a)); + bytes32 constant c = keccak256(abi.encodeWithSelector(0x12345678, b, 2)); + bytes32 constant d = keccak256(abi.encodeWithSignature("f()", 1, 2)); +} +// ---- |