Skip to content
Draft
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
10 changes: 0 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,6 @@ APP_SOURCE_PATH += src
APP_SOURCE_FILES += $(filter-out ./ethereum-plugin-sdk/src/main.c, $(wildcard ./ethereum-plugin-sdk/src/*.c))
INCLUDES_PATH += ./ethereum-plugin-sdk/src

ifeq ($(TARGET_NAME),$(filter $(TARGET_NAME),TARGET_STAX TARGET_FLEX TARGET_APEX_M TARGET_APEX_P))
NETWORK_ICONS_FILE = $(GEN_SRC_DIR)/net_icons.gen.c
NETWORK_ICONS_DIR = $(shell dirname "$(NETWORK_ICONS_FILE)")

$(NETWORK_ICONS_FILE):
python3 tools/gen_networks.py "$(NETWORK_ICONS_DIR)"

APP_SOURCE_FILES += $(NETWORK_ICONS_FILE)
endif

# Application icons following guidelines:
# https://developers.ledger.com/docs/embedded-app/design-requirements/#device-icon
ICON_NANOX = icons/nanox_app_chain_$(CHAIN_ID).gif
Expand Down
Binary file removed glyphs/chain_100_48px.gif
Binary file not shown.
Binary file removed glyphs/chain_100_64px.gif
Binary file not shown.
Binary file removed glyphs/chain_10200_48px.gif
Binary file not shown.
1 change: 0 additions & 1 deletion glyphs/chain_10200_64px.gif

This file was deleted.

Binary file removed glyphs/chain_1030_48px.gif
Binary file not shown.
Binary file removed glyphs/chain_1030_64px.gif
Binary file not shown.
Binary file removed glyphs/chain_10507_48px.gif
Binary file not shown.
Binary file removed glyphs/chain_10507_64px.gif
Binary file not shown.
Binary file removed glyphs/chain_106_48px.gif
Binary file not shown.
Binary file removed glyphs/chain_106_64px.gif
Binary file not shown.
Binary file removed glyphs/chain_1088_48px.gif
Binary file not shown.
Binary file removed glyphs/chain_1088_64px.gif
Binary file not shown.
Binary file removed glyphs/chain_10_48px.gif
Binary file not shown.
Binary file removed glyphs/chain_10_64px.gif
Binary file not shown.
Binary file removed glyphs/chain_1101_48px.gif
Binary file not shown.
1 change: 0 additions & 1 deletion glyphs/chain_1101_64px.gif

This file was deleted.

Binary file removed glyphs/chain_11155111_48px.gif
Binary file not shown.
1 change: 0 additions & 1 deletion glyphs/chain_11155111_64px.gif

This file was deleted.

Binary file removed glyphs/chain_11155420_48px.gif
Binary file not shown.
1 change: 0 additions & 1 deletion glyphs/chain_11155420_64px.gif

This file was deleted.

Binary file removed glyphs/chain_1116_48px.gif
Binary file not shown.
Binary file removed glyphs/chain_1116_64px.gif
Binary file not shown.
Binary file removed glyphs/chain_11297108109_48px.gif
Binary file not shown.
Binary file removed glyphs/chain_11297108109_64px.gif
Binary file not shown.
Binary file removed glyphs/chain_1135_48px.gif
Binary file not shown.
Binary file removed glyphs/chain_1135_64px.gif
Binary file not shown.
Binary file removed glyphs/chain_137_48px.gif
Binary file not shown.
Binary file removed glyphs/chain_137_64px.gif
Binary file not shown.
Binary file removed glyphs/chain_138_48px.gif
Binary file not shown.
Binary file removed glyphs/chain_138_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_14_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_14_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_153153_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_153153_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_1666600001_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_1666600001_64px.gif

This file was deleted.

Binary file removed glyphs/chain_168587773_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_168587773_64px.gif

This file was deleted.

Binary file removed glyphs/chain_16_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_16_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_17000_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_17000_64px.gif

This file was deleted.

Binary file removed glyphs/chain_1818_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_1818_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_1868_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_1868_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_1907_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_1907_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_1923_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_1923_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_1924_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_1924_64px.gif

This file was deleted.

Binary file removed glyphs/chain_1946_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_1946_64px.gif

This file was deleted.

Binary file removed glyphs/chain_196_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_196_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_199_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_199_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_200810_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_200810_64px.gif

This file was deleted.

Binary file removed glyphs/chain_200901_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_200901_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_20531811_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_20531811_64px.gif

This file was deleted.

Binary file removed glyphs/chain_2222_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_2222_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_245022926_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_245022926_64px.gif

This file was deleted.

Binary file removed glyphs/chain_245022934_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_245022934_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_24_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_24_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_250_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_250_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_25_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_25_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_288_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_288_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_300_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_300_64px.gif

This file was deleted.

Binary file removed glyphs/chain_321_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_321_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_324_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_324_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_369_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_369_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_3776_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_3776_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_39797_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_39797_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_3_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_3_64px.gif

This file was deleted.

Binary file removed glyphs/chain_401697_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_401697_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_40_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_40_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_4201_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_4201_64px.gif

This file was deleted.

Binary file removed glyphs/chain_4202_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_4202_64px.gif

This file was deleted.

Binary file removed glyphs/chain_421614_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_421614_64px.gif

This file was deleted.

Binary file removed glyphs/chain_42161_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_42161_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_42220_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_42220_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_42793_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_42793_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_42_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_42_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_43114_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_43114_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_44787_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_44787_64px.gif

This file was deleted.

Binary file removed glyphs/chain_4690_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_4690_64px.gif

This file was deleted.

Binary file removed glyphs/chain_47763_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_47763_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_4919_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_4919_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_4_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_4_64px.gif

This file was deleted.

Binary file removed glyphs/chain_5000_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_5000_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_5003_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_5003_64px.gif

This file was deleted.

Binary file removed glyphs/chain_5165_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_5165_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_51_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_51_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_5201420_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_5201420_64px.gif

This file was deleted.

Binary file removed glyphs/chain_52014_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_52014_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_534351_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_534351_64px.gif

This file was deleted.

Binary file removed glyphs/chain_534352_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_534352_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_534353_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_534353_64px.gif

This file was deleted.

Binary file removed glyphs/chain_534354_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_534354_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_543210_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_543210_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_56_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_56_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_57_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_57_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_59141_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_59141_64px.gif

This file was deleted.

Binary file removed glyphs/chain_59144_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_59144_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_5_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_5_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_60808_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_60808_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_62320_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_62320_64px.gif

This file was deleted.

Binary file removed glyphs/chain_62621_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_62621_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_66_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_66_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_7000_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_7000_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_7171_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_7171_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_7341_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_7341_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_73799_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_73799_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_80094_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_80094_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_81457_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_81457_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_8217_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_8217_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_82_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_82_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_84532_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_84532_64px.gif

This file was deleted.

Binary file removed glyphs/chain_8453_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_8453_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_9001_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_9001_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_943_48px.gif
Diff not rendered.
1 change: 0 additions & 1 deletion glyphs/chain_943_64px.gif

This file was deleted.

Binary file removed glyphs/chain_994873017_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_994873017_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_999_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_999_64px.gif
Diff not rendered.
Binary file removed glyphs/chain_99_48px.gif
Diff not rendered.
Binary file removed glyphs/chain_99_64px.gif
Diff not rendered.
2 changes: 1 addition & 1 deletion src/features/generic_tx_parser/gtp_param_amount.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ bool format_param_amount(const s_param_amount *param, const char *name) {
if ((ret = value_get(&param->value, &collec))) {
if (get_current_tx_info() == NULL) return false;
chain_id = get_current_tx_info()->chain_id;
ticker = get_displayable_ticker(&chain_id, g_chain_config, true);
ticker = get_displayable_ticker(&chain_id, g_chain_config);
for (int i = 0; i < collec.size; ++i) {
if (!(ret = amountToString(collec.value[i].ptr,
collec.value[i].length,
Expand Down
2 changes: 1 addition & 1 deletion src/features/generic_tx_parser/gtp_param_token.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ bool format_param_token(const s_param_token *param, const char *name) {

buf_shrink_expand(collec.value[i].ptr, collec.value[i].length, addr, sizeof(addr));
if (match_native(addr, param)) {
ticker = get_displayable_ticker(&chain_id, g_chain_config, true);
ticker = get_displayable_ticker(&chain_id, g_chain_config);
} else {
if ((token_info = get_matching_token_info_or_dummy(&chain_id, addr)) == NULL) {
ret = false;
Expand Down
2 changes: 1 addition & 1 deletion src/features/generic_tx_parser/gtp_param_token_amount.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static bool process_token_amount(const s_param_token_amount *param,
if (param->has_token) {
buf_shrink_expand(token->ptr, token->length, addr_buf, sizeof(addr_buf));
if (match_native(addr_buf, param)) {
ticker = get_displayable_ticker(&chain_id, g_chain_config, true);
ticker = get_displayable_ticker(&chain_id, g_chain_config);
decimals = WEI_TO_ETHER;
} else {
if ((token_info = get_matching_token_info_or_dummy(&chain_id, addr_buf)) == NULL) {
Expand Down
2 changes: 1 addition & 1 deletion src/features/generic_tx_parser/tx_ctx.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ static bool process_empty_tx(const s_tx_ctx *tx_ctx) {
return false;
}
}
ticker = get_displayable_ticker(&tx_info->chain_id, g_chain_config, true);
ticker = get_displayable_ticker(&tx_info->chain_id, g_chain_config);
decimals = WEI_TO_ETHER;
if (!amountToString(tx_ctx->amount,
sizeof(tx_ctx->amount),
Expand Down
2 changes: 1 addition & 1 deletion src/features/sign_message_eip712/ui_logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,7 +680,7 @@ static bool handle_fallback_empty_calldata(const s_eip712_calldata_info *calldat
chain_id = eip712_context->chain_id;
}

ticker = get_displayable_ticker(&chain_id, g_chain_config, true);
ticker = get_displayable_ticker(&chain_id, g_chain_config);
decimals = WEI_TO_ETHER;
if (!amountToString(calldata_info->amount,
sizeof(calldata_info->amount),
Expand Down
4 changes: 2 additions & 2 deletions src/features/sign_tx/logic_sign_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ static uint16_t address_to_string(uint8_t *in,
static void raw_fee_to_string(uint256_t *rawFee, char *out_buffer, uint32_t out_buffer_size) {
// Fees are always in the base currency, this is why we need to use the chain_id
uint64_t chain_id = get_tx_chain_id();
const char *ticker = get_displayable_ticker(&chain_id, g_chain_config, true);
const char *ticker = get_displayable_ticker(&chain_id, g_chain_config);
uint8_t fee_len = 0;
uint8_t ticker_len = 0;
char raw_fee_buffer[100] = {0};
Expand Down Expand Up @@ -291,7 +291,7 @@ __attribute__((noinline)) static uint16_t finalize_parsing_helper(const txContex
char displayBuffer[50];
uint8_t decimals = WEI_TO_ETHER;
uint64_t chain_id = get_tx_chain_id();
const char *ticker = get_displayable_ticker(&chain_id, g_chain_config, true);
const char *ticker = get_displayable_ticker(&chain_id, g_chain_config);
ethPluginFinalize_t pluginFinalize;
cx_err_t error = CX_INTERNAL_ERROR;

Expand Down
5 changes: 1 addition & 4 deletions src/nbgl/ui_home.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,6 @@ static void prepare_and_display_home(const char *appname, const char *tagline, u
* This function prepares the app name & tagline depending on how the application was called
*/
static void get_appname_and_tagline(const char **appname, const char **tagline) {
uint64_t mainnet_chain_id;

if (g_caller_app) {
*appname = g_caller_app->name;

Expand All @@ -251,8 +249,7 @@ static void get_appname_and_tagline(const char **appname, const char **tagline)
}
}
} else { // Ethereum app
mainnet_chain_id = ETHEREUM_MAINNET_CHAINID;
*appname = get_network_name_from_chain_id(&mainnet_chain_id);
*appname = APPNAME;
}
}

Expand Down
19 changes: 4 additions & 15 deletions src/nbgl/ui_icons.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
#include "plugins.h"
#include "network.h"
#include "network_info.h"
#ifdef SCREEN_SIZE_WALLET
#include "net_icons.gen.h"
#endif

/**
* Retrieve the app icon, using the caller app icon if requested
Expand Down Expand Up @@ -78,7 +75,8 @@ const nbgl_icon_details_t *get_tx_icon(bool fromPlugin) {
/**
* Get the network icon from a given chain ID
*
* Loops onto the generated \ref g_network_icons array until a chain ID matches.
* Searches the dynamically loaded networks, then falls back to the app's own
* icon when the requested chain is the application's native chain.
*
* @param[in] chain_id network's chain ID
* @return the network icon if found, \ref NULL otherwise
Expand All @@ -90,19 +88,10 @@ const nbgl_icon_details_t *get_network_icon_from_chain_id(const uint64_t *chain_
PRINTF("[NETWORK_ICONS] - Found dynamic '%s'\n", net_info->name);
return PIC(&net_info->icon);
}
#ifdef SCREEN_SIZE_WALLET
for (size_t i = 0; i < ARRAYLEN(g_network_icons); ++i) {
if ((uint64_t) PIC(g_network_icons[i].chain_id) == *chain_id) {
PRINTF("[NETWORK_ICONS] - Fallback on hardcoded list.\n");
return PIC(g_network_icons[i].icon);
}
}
#else
// Nano devices don't have the array of icons, fallback on the app's icon
if (*chain_id == ETHEREUM_MAINNET_CHAINID) {
// Fallback on the app's own icon for its native chain
if (*chain_id == g_chain_config->chain_id) {
return &ICONGLYPH;
}
#endif
return NULL;
}

Expand Down
Loading
Loading