Skip to content

Commit cf4640b

Browse files
Merge pull request #227 from tjulien-ledger/shyft-support
Shyft support
2 parents 24f4ecd + 8055a65 commit cf4640b

File tree

7 files changed

+19
-4
lines changed

7 files changed

+19
-4
lines changed

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ APP_LOAD_PARAMS += --path "1517992542'/1101353413'"
3030

3131
APPVERSION_M=1
3232
APPVERSION_N=9
33-
APPVERSION_P=14
33+
APPVERSION_P=16
3434
APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)
3535
APP_LOAD_FLAGS= --appFlags 0x240 --dep Ethereum:$(APPVERSION)
3636

@@ -234,9 +234,13 @@ else ifeq ($(CHAIN),polygon)
234234
APP_LOAD_PARAMS += --path "44'/60'"
235235
DEFINES += CHAINID_UPCASE=\"POLYGON\" CHAINID_COINNAME=\"MATIC\" CHAIN_KIND=CHAIN_KIND_POLYGON CHAIN_ID=137
236236
APPNAME = "Polygon"
237+
else ifeq ($(CHAIN),shyft)
238+
APP_LOAD_PARAMS += --path "44'/60'"
239+
DEFINES += CHAINID_UPCASE=\"SHYFT\" CHAINID_COINNAME=\"SHFT\" CHAIN_KIND=CHAIN_KIND_SHYFT CHAIN_ID=7341
240+
APPNAME = "Shyft"
237241
else
238242
ifeq ($(filter clean,$(MAKECMDGOALS)),)
239-
$(error Unsupported CHAIN - use ethereum, ropsten, goerli, moonriver, ethereum_classic, expanse, poa, artis_sigma1, artis_tau1, rsk, rsk_testnet, ubiq, wanchain, kusd, musicoin, pirl, akroma, atheios, callisto, ethersocial, ellaism, ether1, ethergem, gochain, mix, reosc, hpb, tomochain, tobalaba, dexon, volta, ewc, webchain, thundercore, bsc, songbird, polygon)
243+
$(error Unsupported CHAIN - use ethereum, ropsten, goerli, moonriver, ethereum_classic, expanse, poa, artis_sigma1, artis_tau1, rsk, rsk_testnet, ubiq, wanchain, kusd, musicoin, pirl, akroma, atheios, callisto, ethersocial, ellaism, ether1, ethergem, gochain, mix, reosc, hpb, tomochain, tobalaba, dexon, volta, ewc, webchain, thundercore, bsc, songbird, polygon, shyft)
240244
endif
241245
endif
242246

@@ -407,4 +411,4 @@ include $(BOLOS_SDK)/Makefile.rules
407411
dep/%.d: %.c Makefile
408412

409413
listvariants:
410-
@echo VARIANTS CHAIN ethereum ropsten goerli moonriver ethereum_classic expanse poa rsk rsk_testnet ubiq wanchain pirl akroma atheios callisto ethersocial ether1 gochain musicoin ethergem mix ellaism reosc hpb tomochain dexon volta ewc thundercore bsc songbird polygon
414+
@echo VARIANTS CHAIN ethereum ropsten goerli moonriver ethereum_classic expanse poa rsk rsk_testnet ubiq wanchain pirl akroma atheios callisto ethersocial ether1 gochain musicoin ethergem mix ellaism reosc hpb tomochain dexon volta ewc thundercore bsc songbird polygon shyft

icons/nanos_app_shyft.gif

73 Bytes
Loading

icons/nanox_app_shyft.gif

76 Bytes
Loading

src/chainConfig.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ typedef enum chain_kind_e {
5757
CHAIN_KIND_FLARE,
5858
CHAIN_KIND_BSC,
5959
CHAIN_KIND_SONGBIRD,
60-
CHAIN_KIND_POLYGON
60+
CHAIN_KIND_POLYGON,
61+
CHAIN_KIND_SHYFT
6162
} chain_kind_t;
6263

6364
typedef struct chain_config_s {

src/main.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ tokenDefinition_t *getKnownToken(uint8_t *contractAddress) {
266266
case CHAIN_KIND_POLYGON:
267267
numTokens = NUM_TOKENS_POLYGON;
268268
break;
269+
case CHAIN_KIND_SHYFT:
270+
numTokens = NUM_TOKENS_SHYFT;
271+
break;
269272
}
270273
for (i = 0; i < numTokens; i++) {
271274
switch (chainConfig->kind) {
@@ -374,6 +377,9 @@ tokenDefinition_t *getKnownToken(uint8_t *contractAddress) {
374377
case CHAIN_KIND_POLYGON:
375378
currentToken = (tokenDefinition_t *) PIC(&TOKENS_POLYGON[i]);
376379
break;
380+
case CHAIN_KIND_SHYFT:
381+
currentToken = (tokenDefinition_t *) PIC(&TOKENS_SHYFT[i]);
382+
break;
377383
}
378384
if (memcmp(currentToken->address, tmpContent.txContent.destination, ADDRESS_LENGTH) == 0) {
379385
return currentToken;

src/tokens.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,6 @@ const tokenDefinition_t const TOKENS_MOONRIVER[NUM_TOKENS_MOONRIVER] = {};
192192

193193
const tokenDefinition_t const TOKENS_POLYGON[NUM_TOKENS_POLYGON] = {};
194194

195+
const tokenDefinition_t const TOKENS_SHYFT[NUM_TOKENS_SHYFT] = {};
196+
195197
#endif

src/tokens.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ static const uint8_t LEDGER_SIGNATURE_PUBLIC_KEY[] = {
101101
#define NUM_TOKENS_SONGBIRD 0
102102
#define NUM_TOKENS_MOONRIVER 0
103103
#define NUM_TOKENS_POLYGON 0
104+
#define NUM_TOKENS_SHYFT 0
104105

105106
extern tokenDefinition_t const TOKENS_AKROMA[NUM_TOKENS_AKROMA];
106107
extern tokenDefinition_t const TOKENS_ELLAISM[NUM_TOKENS_ELLAISM];
@@ -137,6 +138,7 @@ extern tokenDefinition_t const TOKENS_BSC[NUM_TOKENS_BSC];
137138
extern tokenDefinition_t const TOKENS_SONGBIRD[NUM_TOKENS_SONGBIRD];
138139
extern tokenDefinition_t const TOKENS_MOONRIVER[NUM_TOKENS_MOONRIVER];
139140
extern tokenDefinition_t const TOKENS_POLYGON[NUM_TOKENS_POLYGON];
141+
extern tokenDefinition_t const TOKENS_SHYFT[NUM_TOKENS_SHYFT];
140142

141143
#endif /* HAVE_TOKENS_LIST */
142144

0 commit comments

Comments
 (0)