2023-02-21 11:01:18 +01:00
|
|
|
#include <nbgl_page.h>
|
|
|
|
|
#include "shared_context.h"
|
|
|
|
|
#include "ui_callbacks.h"
|
|
|
|
|
#include "ui_nbgl.h"
|
2024-06-21 18:12:26 +02:00
|
|
|
#include "feature_signTx.h"
|
2023-02-21 11:01:18 +01:00
|
|
|
|
2024-06-21 18:12:26 +02:00
|
|
|
static void ui_warning_contract_data_choice2(bool confirm) {
|
2023-02-21 11:01:18 +01:00
|
|
|
if (confirm) {
|
2024-06-21 18:12:26 +02:00
|
|
|
start_signature_flow();
|
2023-02-21 11:01:18 +01:00
|
|
|
} else {
|
2024-06-21 18:12:26 +02:00
|
|
|
report_finalize_error();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void ui_warning_contract_data_choice1(bool confirm) {
|
|
|
|
|
if (confirm) {
|
|
|
|
|
report_finalize_error();
|
|
|
|
|
} else {
|
|
|
|
|
nbgl_useCaseChoice(
|
|
|
|
|
NULL,
|
|
|
|
|
"The transaction cannot be trusted",
|
|
|
|
|
"Your Ledger cannot decode this transaction. If you sign it, you could be authorizing "
|
|
|
|
|
"malicious actions that can drain your wallet.\n\nLearn more: ledger.com/e8",
|
|
|
|
|
"I accept the risk",
|
|
|
|
|
"Reject transaction",
|
|
|
|
|
ui_warning_contract_data_choice2);
|
2023-02-21 11:01:18 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ui_warning_contract_data(void) {
|
2024-06-21 18:12:26 +02:00
|
|
|
nbgl_useCaseChoice(
|
|
|
|
|
&C_Warning_64px,
|
|
|
|
|
"Security risk detected",
|
|
|
|
|
"It may not be safe to sign this transaction. To continue, you'll need to review the risk.",
|
|
|
|
|
"Back to safety",
|
|
|
|
|
"Review risk",
|
|
|
|
|
ui_warning_contract_data_choice1);
|
2023-02-21 11:01:18 +01:00
|
|
|
}
|