Skip to content

Commit

Permalink
get funABI just before making the tx
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 authored and LianaHus committed Jan 30, 2020
1 parent 16bd102 commit 5d8258e
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/app/ui/universal-dapp-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,17 @@ UniversalDAppUI.prototype.renderInstanceFromABI = function (contractABI, address
setLLIError("'Fallback' function is not defined")
}
}
if (!receive && !fallback) setLLIError("Both 'receive' and 'fallback' functions are not defined")

if (!receive && !fallback) setLLIError(`Both 'receive' and 'fallback' functions are not defined`)

// we have to put the right function ABI:
// if receive is defined and that there is no calldata => receive function is called
// if fallback is defined => fallback function is called
if (receive && !calldata) args.funABI = receive
else if (fallback) args.funABI = fallback

if (!args.funABI) setLLIError(`Please define at least a 'Fallback' with/without sending calldata or a 'Receive' without sending calldata`)

if (!error) self.runTransaction(false, args, null, calldata, null)
}

Expand Down

0 comments on commit 5d8258e

Please sign in to comment.