Completely remove old Starkware internal "plugin"
This commit is contained in:
@@ -37,32 +37,6 @@ void ui_sign_712_v0(void) {
|
||||
ux_flow_init(0, ux_sign_712_v0_flow, NULL);
|
||||
}
|
||||
|
||||
#ifdef HAVE_STARKWARE
|
||||
void ui_display_stark_public(void) {
|
||||
ux_flow_init(0, ux_display_stark_public_flow, NULL);
|
||||
}
|
||||
void ui_stark_limit_order(void) {
|
||||
ux_flow_init(0, ux_stark_limit_order_flow, NULL);
|
||||
}
|
||||
|
||||
void ui_stark_unsafe_sign(void) {
|
||||
ux_flow_init(0, ux_stark_unsafe_sign_flow, NULL);
|
||||
}
|
||||
|
||||
void ui_stark_transfer(bool selfTransfer, bool conditional) {
|
||||
if (selfTransfer) {
|
||||
ux_flow_init(
|
||||
0,
|
||||
(conditional ? ux_stark_self_transfer_conditional_flow : ux_stark_self_transfer_flow),
|
||||
NULL);
|
||||
} else {
|
||||
ux_flow_init(0,
|
||||
(conditional ? ux_stark_transfer_conditional_flow : ux_stark_transfer_flow),
|
||||
NULL);
|
||||
}
|
||||
}
|
||||
#endif // HAVE_STARKWARE
|
||||
|
||||
void ui_confirm_selector(void) {
|
||||
ux_flow_init(0, ux_confirm_selector_flow, NULL);
|
||||
}
|
||||
|
||||
@@ -30,34 +30,4 @@ extern const ux_flow_step_t* const ux_display_privacy_shared_secret_flow[];
|
||||
|
||||
extern const ux_flow_step_t* ux_approval_tx_flow[15];
|
||||
|
||||
#ifdef HAVE_STARKWARE
|
||||
|
||||
extern const ux_flow_step_t* const ux_display_stark_public_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_stark_limit_order_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_stark_transfer_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_stark_self_transfer_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_stark_transfer_conditional_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_stark_self_transfer_conditional_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_approval_starkware_register_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_approval_starkware_deposit_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_approval_starkware_withdraw_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_approval_starkware_verify_vault_id_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_approval_starkware_escape_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_approval_starkware_verify_escape_flow[];
|
||||
|
||||
extern const ux_flow_step_t* const ux_stark_unsafe_sign_flow[];
|
||||
|
||||
#endif
|
||||
|
||||
#endif // _UI_FLOW_H_
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
#ifdef HAVE_STARKWARE
|
||||
|
||||
#include "shared_context.h"
|
||||
#include "ui_callbacks.h"
|
||||
|
||||
// clang-format off
|
||||
UX_STEP_NOCB(
|
||||
ux_display_stark_public_flow_1_step,
|
||||
pnn,
|
||||
{
|
||||
&C_icon_eye,
|
||||
"Verify",
|
||||
"Stark key",
|
||||
});
|
||||
UX_STEP_NOCB(
|
||||
ux_display_stark_public_flow_2_step,
|
||||
bnnn_paging,
|
||||
{
|
||||
.title = "Stark Key",
|
||||
.text = strings.tmp.tmp,
|
||||
});
|
||||
UX_STEP_CB(
|
||||
ux_display_stark_public_flow_3_step,
|
||||
pb,
|
||||
io_seproxyhal_touch_stark_pubkey_ok(NULL),
|
||||
{
|
||||
&C_icon_validate_14,
|
||||
"Approve",
|
||||
});
|
||||
UX_STEP_CB(
|
||||
ux_display_stark_public_flow_4_step,
|
||||
pb,
|
||||
io_seproxyhal_touch_address_cancel(NULL),
|
||||
{
|
||||
&C_icon_crossmark,
|
||||
"Reject",
|
||||
});
|
||||
// clang-format on
|
||||
|
||||
UX_FLOW(ux_display_stark_public_flow,
|
||||
&ux_display_stark_public_flow_1_step,
|
||||
&ux_display_stark_public_flow_2_step,
|
||||
&ux_display_stark_public_flow_3_step,
|
||||
&ux_display_stark_public_flow_4_step);
|
||||
|
||||
#endif
|
||||
@@ -1,234 +0,0 @@
|
||||
#ifdef HAVE_STARKWARE
|
||||
|
||||
#include "shared_context.h"
|
||||
#include "ui_callbacks.h"
|
||||
#include "starkDisplayUtils.h"
|
||||
#include "apdu_constants.h"
|
||||
|
||||
// clang-format off
|
||||
UX_STEP_NOCB(ux_stark_limit_order_1_step,
|
||||
pnn,
|
||||
{
|
||||
&C_icon_eye,
|
||||
"Review",
|
||||
"transaction",
|
||||
});
|
||||
|
||||
UX_STEP_NOCB(ux_stark_limit_order_2_step,
|
||||
bnnn_paging,
|
||||
{
|
||||
.title = "Limit",
|
||||
.text = "Order"
|
||||
});
|
||||
|
||||
UX_STEP_NOCB(ux_stark_limit_order_3_step,
|
||||
bnnn_paging,
|
||||
{
|
||||
.title = "Trading",
|
||||
.text = "Pair"
|
||||
});
|
||||
|
||||
UX_STEP_NOCB(ux_stark_limit_order_4_step,
|
||||
bnnn_paging,
|
||||
{
|
||||
.title = "Sell",
|
||||
.text = strings.common.fullAmount
|
||||
});
|
||||
|
||||
UX_STEP_NOCB(ux_stark_limit_order_5_step,
|
||||
bnnn_paging,
|
||||
{
|
||||
.title = "Buy",
|
||||
.text = strings.common.maxFee
|
||||
});
|
||||
|
||||
UX_STEP_NOCB(ux_stark_limit_order_6_step,
|
||||
bnnn_paging,
|
||||
{
|
||||
.title = "Token Account",
|
||||
.text = strings.common.fullAddress
|
||||
});
|
||||
|
||||
UX_STEP_CB(
|
||||
ux_stark_limit_order_7_step,
|
||||
pbb,
|
||||
io_seproxyhal_touch_stark_ok(NULL),
|
||||
{
|
||||
&C_icon_validate_14,
|
||||
"Accept",
|
||||
"and send",
|
||||
});
|
||||
UX_STEP_CB(
|
||||
ux_stark_limit_order_8_step,
|
||||
pb,
|
||||
io_seproxyhal_touch_tx_cancel(NULL),
|
||||
{
|
||||
&C_icon_crossmark,
|
||||
"Reject",
|
||||
});
|
||||
// clang-format on
|
||||
|
||||
UX_FLOW(ux_stark_limit_order_flow,
|
||||
&ux_stark_limit_order_1_step,
|
||||
&ux_stark_limit_order_2_step,
|
||||
&ux_stark_limit_order_3_step,
|
||||
&ux_stark_limit_order_4_step,
|
||||
&ux_stark_limit_order_5_step,
|
||||
&ux_stark_limit_order_6_step,
|
||||
&ux_stark_limit_order_7_step,
|
||||
&ux_stark_limit_order_8_step);
|
||||
|
||||
static void stark_format_address(void) {
|
||||
if (!getEthDisplayableAddress(dataContext.starkContext.conditionAddress,
|
||||
strings.tmp.tmp,
|
||||
sizeof(strings.tmp.tmp),
|
||||
&global_sha3,
|
||||
chainConfig->chainId)) {
|
||||
THROW(APDU_RESPONSE_ERROR_NO_INFO);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// clang-format off
|
||||
UX_STEP_NOCB(ux_stark_transfer_1_step,
|
||||
pnn,
|
||||
{
|
||||
&C_icon_eye,
|
||||
"Review",
|
||||
"transaction",
|
||||
});
|
||||
|
||||
UX_STEP_NOCB(ux_stark_transfer_2_step,
|
||||
bnnn_paging,
|
||||
{
|
||||
.title = "Transfer",
|
||||
.text = " "
|
||||
});
|
||||
|
||||
UX_STEP_NOCB(ux_stark_self_transfer_2_step,
|
||||
bnnn_paging,
|
||||
{
|
||||
.title = "Self",
|
||||
.text = "Transfer"
|
||||
});
|
||||
|
||||
UX_STEP_NOCB(ux_stark_conditional_transfer_2_step,
|
||||
bnnn_paging,
|
||||
{
|
||||
.title = "Conditional",
|
||||
.text = "Transfer"
|
||||
});
|
||||
|
||||
UX_STEP_NOCB(ux_stark_self_conditional_transfer_2_step,
|
||||
bnnn_paging,
|
||||
{
|
||||
.title = "Conditional",
|
||||
.text = "Self Transfer"
|
||||
});
|
||||
|
||||
UX_STEP_NOCB(ux_stark_transfer_3_step,
|
||||
bnnn_paging,
|
||||
{
|
||||
.title = "Amount",
|
||||
.text = tmpContent.tmp
|
||||
});
|
||||
|
||||
UX_STEP_NOCB(ux_stark_transfer_4_step,
|
||||
bnnn_paging,
|
||||
{
|
||||
.title = "Master Account",
|
||||
.text = strings.tmp.tmp
|
||||
});
|
||||
|
||||
UX_STEP_NOCB(ux_stark_transfer_5_step,
|
||||
bnnn_paging,
|
||||
{
|
||||
.title = "Token Account",
|
||||
.text = strings.tmp.tmp2
|
||||
});
|
||||
|
||||
UX_STEP_CB(
|
||||
ux_stark_transfer_6_step,
|
||||
pbb,
|
||||
io_seproxyhal_touch_stark_ok(NULL),
|
||||
{
|
||||
&C_icon_validate_14,
|
||||
"Accept",
|
||||
"and send",
|
||||
});
|
||||
UX_STEP_CB(
|
||||
ux_stark_transfer_7_step,
|
||||
pb,
|
||||
io_seproxyhal_touch_tx_cancel(NULL),
|
||||
{
|
||||
&C_icon_crossmark,
|
||||
"Reject",
|
||||
});
|
||||
|
||||
UX_STEP_NOCB_INIT(
|
||||
ux_stark_conditional_transfer_4_step,
|
||||
bnnn_paging,
|
||||
stark_sign_display_master_account(),
|
||||
{
|
||||
.title = "Master Account",
|
||||
.text = strings.tmp.tmp
|
||||
});
|
||||
|
||||
UX_STEP_NOCB_INIT(
|
||||
ux_stark_conditional_transfer_8_step,
|
||||
bnnn_paging,
|
||||
stark_format_address(),
|
||||
{
|
||||
.title = "Cond. Address",
|
||||
.text = strings.tmp.tmp
|
||||
});
|
||||
|
||||
UX_STEP_NOCB_INIT(
|
||||
ux_stark_conditional_transfer_9_step,
|
||||
bnnn_paging,
|
||||
stark_sign_display_condition_fact(),
|
||||
{
|
||||
.title = "Cond. Fact",
|
||||
.text = strings.tmp.tmp
|
||||
});
|
||||
// clang-format on
|
||||
|
||||
UX_FLOW(ux_stark_transfer_flow,
|
||||
&ux_stark_transfer_1_step,
|
||||
&ux_stark_transfer_2_step,
|
||||
&ux_stark_transfer_3_step,
|
||||
&ux_stark_transfer_4_step,
|
||||
&ux_stark_transfer_5_step,
|
||||
&ux_stark_transfer_6_step,
|
||||
&ux_stark_transfer_7_step);
|
||||
|
||||
UX_FLOW(ux_stark_self_transfer_flow,
|
||||
&ux_stark_transfer_1_step,
|
||||
&ux_stark_self_transfer_2_step,
|
||||
&ux_stark_transfer_3_step,
|
||||
&ux_stark_transfer_5_step,
|
||||
&ux_stark_transfer_6_step,
|
||||
&ux_stark_transfer_7_step);
|
||||
|
||||
UX_FLOW(ux_stark_transfer_conditional_flow,
|
||||
&ux_stark_transfer_1_step,
|
||||
&ux_stark_conditional_transfer_2_step,
|
||||
&ux_stark_transfer_3_step,
|
||||
&ux_stark_conditional_transfer_4_step,
|
||||
&ux_stark_transfer_5_step,
|
||||
&ux_stark_conditional_transfer_8_step,
|
||||
&ux_stark_conditional_transfer_9_step,
|
||||
&ux_stark_transfer_6_step,
|
||||
&ux_stark_transfer_7_step);
|
||||
|
||||
UX_FLOW(ux_stark_self_transfer_conditional_flow,
|
||||
&ux_stark_transfer_1_step,
|
||||
&ux_stark_self_conditional_transfer_2_step,
|
||||
&ux_stark_transfer_3_step,
|
||||
&ux_stark_transfer_5_step,
|
||||
&ux_stark_conditional_transfer_8_step,
|
||||
&ux_stark_conditional_transfer_9_step,
|
||||
&ux_stark_transfer_6_step,
|
||||
&ux_stark_transfer_7_step);
|
||||
|
||||
#endif
|
||||
@@ -1,70 +0,0 @@
|
||||
#ifdef HAVE_STARKWARE
|
||||
|
||||
#include "shared_context.h"
|
||||
#include "ui_callbacks.h"
|
||||
|
||||
unsigned int io_seproxyhal_touch_stark_unsafe_sign_ok(const bagl_element_t *e);
|
||||
|
||||
void stark_unsafe_sign_display_account() {
|
||||
snprintf(strings.tmp.tmp, sizeof(strings.tmp.tmp), "0x%.*H", 32, dataContext.starkContext.w1);
|
||||
}
|
||||
|
||||
void stark_unsafe_sign_display_hash() {
|
||||
snprintf(strings.tmp.tmp, sizeof(strings.tmp.tmp), "0x%.*H", 32, dataContext.starkContext.w2);
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
UX_STEP_NOCB(ux_stark_unsafe_sign_1_step,
|
||||
pnn,
|
||||
{
|
||||
&C_icon_warning,
|
||||
"StarkNet",
|
||||
"Blind Sign",
|
||||
});
|
||||
|
||||
UX_STEP_NOCB_INIT(
|
||||
ux_stark_unsafe_sign_2_step,
|
||||
bnnn_paging,
|
||||
stark_unsafe_sign_display_account(),
|
||||
{
|
||||
.title = "From Account",
|
||||
.text = strings.tmp.tmp
|
||||
});
|
||||
|
||||
UX_STEP_NOCB_INIT(
|
||||
ux_stark_unsafe_sign_3_step,
|
||||
bnnn_paging,
|
||||
stark_unsafe_sign_display_hash(),
|
||||
{
|
||||
.title = "Tx Hash",
|
||||
.text = strings.tmp.tmp
|
||||
});
|
||||
|
||||
|
||||
UX_STEP_CB(
|
||||
ux_stark_unsafe_sign_4_step,
|
||||
pbb,
|
||||
io_seproxyhal_touch_stark_unsafe_sign_ok(NULL),
|
||||
{
|
||||
&C_icon_validate_14,
|
||||
"Accept",
|
||||
"and send",
|
||||
});
|
||||
UX_STEP_CB(
|
||||
ux_stark_unsafe_sign_5_step,
|
||||
pb,
|
||||
io_seproxyhal_touch_tx_cancel(NULL),
|
||||
{
|
||||
&C_icon_crossmark,
|
||||
"Reject",
|
||||
});
|
||||
// clang-format on
|
||||
|
||||
UX_FLOW(ux_stark_unsafe_sign_flow,
|
||||
&ux_stark_unsafe_sign_1_step,
|
||||
&ux_stark_unsafe_sign_2_step,
|
||||
&ux_stark_unsafe_sign_3_step,
|
||||
&ux_stark_unsafe_sign_4_step,
|
||||
&ux_stark_unsafe_sign_5_step);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user