From 3417f75ea1b6ef5fe878dfa02934c6d8aba63918 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 17 Jun 2019 14:45:31 +0200 Subject: [PATCH 1/3] default with default abi if compiled with yul --- remix-solidity/src/compiler/compiler.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/remix-solidity/src/compiler/compiler.js b/remix-solidity/src/compiler/compiler.js index 7876480383..b0815ea1f5 100644 --- a/remix-solidity/src/compiler/compiler.js +++ b/remix-solidity/src/compiler/compiler.js @@ -373,6 +373,14 @@ function Compiler (handleImportCall) { function updateInterface (data) { txHelper.visitContracts(data.contracts, (contract) => { + if (!contract.object.abi) contract.object.abi = [] + if (language === 'Yul' && contract.object.abi.length === 0) { + contract.object.abi.push({ + 'payablepayable': true, + 'stateMutability': 'payable', + 'type': 'fallback' + }) + } data.contracts[contract.file][contract.name].abi = solcABI.update(truncateVersion(currentVersion), contract.object.abi) }) return data From f47a624fc8316cd27d8cd7068a1c875e539e6348 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 17 Jun 2019 15:00:10 +0200 Subject: [PATCH 2/3] comment --- remix-solidity/src/compiler/compiler.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/remix-solidity/src/compiler/compiler.js b/remix-solidity/src/compiler/compiler.js index b0815ea1f5..794e80f2de 100644 --- a/remix-solidity/src/compiler/compiler.js +++ b/remix-solidity/src/compiler/compiler.js @@ -370,11 +370,13 @@ function Compiler (handleImportCall) { } return version } - + function updateInterface (data) { txHelper.visitContracts(data.contracts, (contract) => { if (!contract.object.abi) contract.object.abi = [] if (language === 'Yul' && contract.object.abi.length === 0) { + // yul compiler does not return any abi, + // we default to accept the fallback function (which expect raw data as argument). contract.object.abi.push({ 'payablepayable': true, 'stateMutability': 'payable', From a407d0fdcd4dec6f1d3d3c053ba9ed2c209dbeea Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 17 Jun 2019 15:00:48 +0200 Subject: [PATCH 3/3] typo --- remix-solidity/src/compiler/compiler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remix-solidity/src/compiler/compiler.js b/remix-solidity/src/compiler/compiler.js index 794e80f2de..ba083f64ef 100644 --- a/remix-solidity/src/compiler/compiler.js +++ b/remix-solidity/src/compiler/compiler.js @@ -378,7 +378,7 @@ function Compiler (handleImportCall) { // yul compiler does not return any abi, // we default to accept the fallback function (which expect raw data as argument). contract.object.abi.push({ - 'payablepayable': true, + 'payable': true, 'stateMutability': 'payable', 'type': 'fallback' })