Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased (develop)

- added: Warning confirmation when sending a zero amount on EVM chains, since the transaction still spends gas.
- added: Remote enable/disable of gift card providers via the info server's giftCardInfo config, supporting whole-provider disabling for Phaze and Bitrefill and per-brand disabling for Phaze.

## 4.49.0 (staging)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ exports[`AccelerateTxModalComponent should render with loading props 1`] = `
},
]
}
testID="confirmSliderThumb"
>
<Text
adjustsFontSizeToFit={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1705,6 +1705,7 @@ exports[`SendScene2 1 spendTarget 1`] = `
},
]
}
testID="confirmSliderThumb"
>
<Text
adjustsFontSizeToFit={true}
Expand Down Expand Up @@ -3714,6 +3715,7 @@ exports[`SendScene2 1 spendTarget with info tiles 1`] = `
},
]
}
testID="confirmSliderThumb"
>
<Text
adjustsFontSizeToFit={true}
Expand Down Expand Up @@ -5723,6 +5725,7 @@ exports[`SendScene2 2 spendTargets 1`] = `
},
]
}
testID="confirmSliderThumb"
>
<Text
adjustsFontSizeToFit={true}
Expand Down Expand Up @@ -7313,6 +7316,7 @@ exports[`SendScene2 2 spendTargets hide tiles 1`] = `
},
]
}
testID="confirmSliderThumb"
>
<Text
adjustsFontSizeToFit={true}
Expand Down Expand Up @@ -8883,6 +8887,7 @@ exports[`SendScene2 2 spendTargets hide tiles 2`] = `
},
]
}
testID="confirmSliderThumb"
>
<Text
adjustsFontSizeToFit={true}
Expand Down Expand Up @@ -10220,6 +10225,7 @@ exports[`SendScene2 2 spendTargets hide tiles 3`] = `
},
]
}
testID="confirmSliderThumb"
>
<Text
adjustsFontSizeToFit={true}
Expand Down Expand Up @@ -11970,6 +11976,7 @@ exports[`SendScene2 2 spendTargets lock tiles 1`] = `
},
]
}
testID="confirmSliderThumb"
>
<Text
adjustsFontSizeToFit={true}
Expand Down Expand Up @@ -13671,6 +13678,7 @@ exports[`SendScene2 2 spendTargets lock tiles 2`] = `
},
]
}
testID="confirmSliderThumb"
>
<Text
adjustsFontSizeToFit={true}
Expand Down Expand Up @@ -15299,6 +15307,7 @@ exports[`SendScene2 2 spendTargets lock tiles 3`] = `
},
]
}
testID="confirmSliderThumb"
>
<Text
adjustsFontSizeToFit={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2033,6 +2033,7 @@ exports[`SwapConfirmationScene should render with loading props 1`] = `
},
]
}
testID="confirmSliderThumb"
>
<Text
adjustsFontSizeToFit={true}
Expand Down
26 changes: 26 additions & 0 deletions src/components/scenes/SendScene2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1287,6 +1287,32 @@ const SendComponent: React.FC<Props> = props => {
}
}

// EVM chains broadcast zero-amount transactions, which still spend gas.
// Other chains disable the slider for zero amounts (unless allowZeroTx),
// so this confirmation only surfaces for EVM coin and token sends.
if (
isEvmWallet(coreWallet) &&
spendInfo.spendTargets.every(target => zeroString(target.nativeAmount))
) {
const answer = await Airship.show<'continue' | 'cancel' | undefined>(
bridge => (
<ButtonsModal
bridge={bridge}
title={lstrings.send_confirmation_zero_amount_title}
message={lstrings.send_confirmation_zero_amount_message}
buttons={{
continue: { label: lstrings.legacy_address_modal_continue },
cancel: { label: lstrings.string_cancel_cap }
}}
/>
)
)
if (answer !== 'continue') {
resetSlider()
return
}
}

try {
if (beforeTransaction != null) await beforeTransaction()
} catch (e: unknown) {
Expand Down
1 change: 1 addition & 0 deletions src/components/themed/SafeSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export const SafeSlider: React.FC<Props> = props => {

<GestureDetector gesture={gesture}>
<Animated.View
testID="confirmSliderThumb"
style={[
styles.thumb,
sliderDisabled ? styles.disabledThumb : null,
Expand Down
3 changes: 3 additions & 0 deletions src/locales/en_US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,9 @@ const strings = {
send_confirmation_calculating_fee: 'Calculating Fee',
send_confirmation_slide_to_confirm: 'Slide to Confirm',
send_confirmation_balance: 'Balance',
send_confirmation_zero_amount_title: 'Send Zero Amount?',
send_confirmation_zero_amount_message:
"You're about to send a transaction with a zero amount. Network fees (gas) will still be charged. Are you sure you want to continue?",
send_confirmation_algo_recipient_not_activated_s:
'Recipient must first activate %1$s before they can receive funds.',
send_confirmation_eos_error_cpu:
Expand Down
2 changes: 2 additions & 0 deletions src/locales/strings/enUS.json
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@
"send_confirmation_calculating_fee": "Calculating Fee",
"send_confirmation_slide_to_confirm": "Slide to Confirm",
"send_confirmation_balance": "Balance",
"send_confirmation_zero_amount_title": "Send Zero Amount?",
"send_confirmation_zero_amount_message": "You're about to send a transaction with a zero amount. Network fees (gas) will still be charged. Are you sure you want to continue?",
"send_confirmation_algo_recipient_not_activated_s": "Recipient must first activate %1$s before they can receive funds.",
"send_confirmation_eos_error_cpu": "Insufficient CPU available to send EOS transaction. Please wait 1-3 days for CPU to recharge.",
"send_confirmation_eos_error_net": "Insufficient NET available to send EOS transaction. Please wait 1-3 days for NET to recharge.",
Expand Down
Loading