This commit is contained in:
Alexandre Paillier
2022-06-15 13:32:50 +02:00
parent d1eb4ccc92
commit 785cfdc2ea
6 changed files with 16 additions and 1 deletions

View File

@@ -0,0 +1,3 @@
APP_LOAD_PARAMS += --path "44'/60'"
DEFINES += CHAINID_UPCASE=\"CUBE\" CHAINID_COINNAME=\"CUBE\" CHAIN_KIND=CHAIN_KIND_CUBE CHAIN_ID=1818
APPNAME = "Cube"

View File

@@ -64,7 +64,8 @@ typedef enum chain_kind_e {
CHAIN_KIND_BTTC,
CHAIN_KIND_KARDIACHAIN,
CHAIN_KIND_WETHIO,
CHAIN_KIND_OKC
CHAIN_KIND_OKC,
CHAIN_KIND_CUBE
} chain_kind_t;
typedef struct chain_config_s {

View File

@@ -287,6 +287,9 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) {
case CHAIN_KIND_OKC:
numTokens = NUM_TOKENS_OKC;
break;
case CHAIN_KIND_CUBE:
numTokens = NUM_TOKENS_CUBE;
break;
}
for (i = 0; i < numTokens; i++) {
switch (chainConfig->kind) {
@@ -416,6 +419,9 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) {
case CHAIN_KIND_OKC:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_OKC[i]);
break;
case CHAIN_KIND_CUBE:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_CUBE[i]);
break;
}
if (memcmp(currentToken->address, tmpContent.txContent.destination, ADDRESS_LENGTH) == 0) {
return currentToken;

View File

@@ -206,4 +206,6 @@ const tokenDefinition_t const TOKENS_WETHIO[NUM_TOKENS_WETHIO] = {};
const tokenDefinition_t const TOKENS_OKC[NUM_TOKENS_OKC] = {};
const tokenDefinition_t const TOKENS_CUBE[NUM_TOKENS_CUBE] = {};
#endif

View File

@@ -107,6 +107,7 @@ static const uint8_t LEDGER_SIGNATURE_PUBLIC_KEY[] = {
#define NUM_TOKENS_KARDIACHAIN 0
#define NUM_TOKENS_WETHIO 0
#define NUM_TOKENS_OKC 0
#define NUM_TOKENS_CUBE 0
extern tokenDefinition_t const TOKENS_AKROMA[NUM_TOKENS_AKROMA];
extern tokenDefinition_t const TOKENS_ELLAISM[NUM_TOKENS_ELLAISM];
@@ -149,6 +150,7 @@ extern tokenDefinition_t const TOKENS_MOONBEAM[NUM_TOKENS_MOONBEAM];
extern tokenDefinition_t const TOKENS_BTTC[NUM_TOKENS_BTTC];
extern tokenDefinition_t const TOKENS_KARDIACHAIN[NUM_TOKENS_KARDIACHAIN];
extern tokenDefinition_t const TOKENS_WETHIO[NUM_TOKENS_WETHIO];
extern tokenDefinition_t const TOKENS_CUBE[NUM_TOKENS_CUBE];
#endif /* HAVE_TOKENS_LIST */

View File

@@ -25,6 +25,7 @@ const network_info_t NETWORK_MAPPING[] = {
{.chain_id = 44787, .name = "Celo Alfajores", .ticker = "aCELO "},
{.chain_id = 62320, .name = "Celo Baklava", .ticker = "bCELO "},
{.chain_id = 11297108109, .name = "Palm Network", .ticker = "PALM "}};
{.chain_id = 1818, .name = "Cube", .ticker = "CUBE "},
uint64_t get_chain_id(void) {
uint64_t chain_id = 0;