From ac2414562b02d6c82e1bb2afe031b6b038f5475b Mon Sep 17 00:00:00 2001 From: Agustin Aguilar Date: Fri, 7 Dec 2018 21:52:24 +0100 Subject: [PATCH 1/3] Wrong input size - noThrowCall ERC165 Input should be 36 bytes (4 signature bytes + 32 bytes parameter) Solidity 5 validates the length of msg.data, reverting on the 32 bytes input, all contracts using the broken 'doesContractImplementInterface' will not be able to read an ERC165 implementation targetting Solidity 5. A legacy-compatible strategy should be defined to make all the "ERC165 readers" sending a 32 bytes sized data compatible with ERC165 contracts compiled targeting this new version of the compiler. A possible solution could be to add a keyword on Solidity to disable the validation of the calldata length. --- EIPS/eip-165.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EIPS/eip-165.md b/EIPS/eip-165.md index fe22150fab376..64e4d0b95f4bc 100644 --- a/EIPS/eip-165.md +++ b/EIPS/eip-165.md @@ -150,7 +150,7 @@ contract ERC165Query { 30000, // 30k gas _contract, // To addr x, // Inputs are stored at location x - 0x20, // Inputs are 32 bytes long + 0x24, // Inputs are 36 bytes long x, // Store output over input (saves space) 0x20) // Outputs are 32 bytes long From 47962c90287c51816e1b9d00dd5c7f5a6ec03567 Mon Sep 17 00:00:00 2001 From: Agustin Aguilar Date: Wed, 23 Jan 2019 21:15:08 +0100 Subject: [PATCH 2/3] Add version history section to EIP165 --- EIPS/eip-165.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/EIPS/eip-165.md b/EIPS/eip-165.md index 64e4d0b95f4bc..e692f0d6629b2 100644 --- a/EIPS/eip-165.md +++ b/EIPS/eip-165.md @@ -224,6 +224,11 @@ contract Homer is ERC165, Simpson { With three or more supported interfaces (including ERC165 itself as a required supported interface), the mapping approach (in every case) costs less gas than the pure approach (at worst case). +## Version history +* EIP 1640, finalized 2019-01-23 -- This corrects the noThrowCall test case to use 36 bytes rather than the previous 32 bytes. The previous code was an error that still silently worked in Solidity 0.4.x but which was broken by new behavior introduced in Solidity 0.5.0. This change was discussed at [#1640](https://github.com/ethereum/EIPs/pull/1640). + +* EIP 165, finalized 2018-04-20 -- Original published version. + ## Copyright Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From 1eca39167ea7e32dd0b30615c13dec58b711c385 Mon Sep 17 00:00:00 2001 From: Agustin Aguilar Date: Mon, 8 Apr 2019 05:08:36 +0200 Subject: [PATCH 3/3] EIP 1640 -> PR 1640 --- EIPS/eip-165.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EIPS/eip-165.md b/EIPS/eip-165.md index e692f0d6629b2..c5c78c2b59ae0 100644 --- a/EIPS/eip-165.md +++ b/EIPS/eip-165.md @@ -225,7 +225,7 @@ contract Homer is ERC165, Simpson { With three or more supported interfaces (including ERC165 itself as a required supported interface), the mapping approach (in every case) costs less gas than the pure approach (at worst case). ## Version history -* EIP 1640, finalized 2019-01-23 -- This corrects the noThrowCall test case to use 36 bytes rather than the previous 32 bytes. The previous code was an error that still silently worked in Solidity 0.4.x but which was broken by new behavior introduced in Solidity 0.5.0. This change was discussed at [#1640](https://github.com/ethereum/EIPs/pull/1640). +* PR 1640, finalized 2019-01-23 -- This corrects the noThrowCall test case to use 36 bytes rather than the previous 32 bytes. The previous code was an error that still silently worked in Solidity 0.4.x but which was broken by new behavior introduced in Solidity 0.5.0. This change was discussed at [#1640](https://github.com/ethereum/EIPs/pull/1640). * EIP 165, finalized 2018-04-20 -- Original published version.