Merge pull request #1259 from ethereum/addedPayableToABI

added copy of payable and stateMutability to the constructor ABI
pull/5370/head
yann300 5 years ago committed by GitHub
commit 2b1d3b4a53
  1. 4
      remix-lib/src/execution/txHelper.js

@ -56,7 +56,7 @@ module.exports = {
}, },
getConstructorInterface: function (abi) { getConstructorInterface: function (abi) {
var funABI = { 'name': '', 'inputs': [], 'type': 'constructor', 'outputs': [] } var funABI = { 'name': '', 'inputs': [], 'type': 'constructor', 'payable': 'false', 'outputs': [] }
if (typeof abi === 'string') { if (typeof abi === 'string') {
try { try {
abi = JSON.parse(abi) abi = JSON.parse(abi)
@ -69,6 +69,8 @@ module.exports = {
for (var i = 0; i < abi.length; i++) { for (var i = 0; i < abi.length; i++) {
if (abi[i].type === 'constructor') { if (abi[i].type === 'constructor') {
funABI.inputs = abi[i].inputs || [] funABI.inputs = abi[i].inputs || []
funABI.payable = abi[i].payable
funABI.stateMutability = abi[i].stateMutability
break break
} }
} }

Loading…
Cancel
Save