diff --git a/src/utils/presets/utils.js b/src/utils/presets/utils.js index f88b7ef..e9b0a72 100644 --- a/src/utils/presets/utils.js +++ b/src/utils/presets/utils.js @@ -76,7 +76,7 @@ export const prepareTransfer = (tokenAddress, receiverAddress, rawAmount) => [ export const prepareInflationProposal = async (ethPNTAddress, receiverAddress, rawAmount) => { return _.flattenDeep([ - prepareWithdrawInflation(ethPNTAddress, receiverAddress), + prepareWithdrawInflation(ethPNTAddress, rawAmount), prepareTransfer(ethPNTAddress, receiverAddress, rawAmount) ]) } diff --git a/src/utils/presets/withdrawInflationToRecipient.js b/src/utils/presets/withdrawInflationToRecipient.js index 146abce..d52149c 100644 --- a/src/utils/presets/withdrawInflationToRecipient.js +++ b/src/utils/presets/withdrawInflationToRecipient.js @@ -16,11 +16,11 @@ const withdrawInflationToRecipient = ({ presetParams, setPresetParams }) => ({ fontSize: 15 }, placeholder: 'Receiver address ...', - value: presetParams[1] || '', + value: presetParams[0] || '', onChange: (_e) => setPresetParams({ ...presetParams, - 1: _e.target.value + 0: _e.target.value }) } }, @@ -34,11 +34,11 @@ const withdrawInflationToRecipient = ({ presetParams, setPresetParams }) => ({ fontSize: 15 }, placeholder: 'Amount ...', - value: presetParams[2] || '', + value: presetParams[1] || '', onChange: (_e) => setPresetParams({ ...presetParams, - 2: _e.target.value + 1: _e.target.value }) } } @@ -49,6 +49,8 @@ const withdrawInflationToRecipient = ({ presetParams, setPresetParams }) => ({ const inflationData = prepareInflationData(params[1]) + console.log(params) + if (!ethers.utils.isAddress(params[0])) throw new Error('Inserted destination address is not valid') return prepareInflationProposal(inflationData.ethPNTAddress, params[0], inflationData.rawAmount)