diff --git a/Makefile b/Makefile index d93f8e0..7b1d929 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ APP_LOAD_PARAMS += --appFlags 0x800 --path "44'/60'" --path "45'" --path "44'/1' APP_LOAD_PARAMS += $(COMMON_LOAD_PARAMS) APPVERSION_M = 1 -APPVERSION_N = 4 +APPVERSION_N = 5 APPVERSION_P = 0 APPVERSION = $(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P) diff --git a/README.md b/README.md index 3f5d823..2f24fb0 100644 --- a/README.md +++ b/README.md @@ -44,10 +44,13 @@ On these smart contracts, the functions covered by this plugin are: |StableMultiMintERC721 |stableMintSign | 0x11413601|
uint256 amount
| |StableMultiMintERC721 |stableMint | 0x804b936f|
uint256 amount
| |StableMultiMintERC721 |mintSign | 0xf39247a9|
uint256 amount
| -|StableMultiMintERC721 |mint (v2) | 0xa0712d68|
uint256 amount
| +|StableMultiMintERC721 |mint | 0xa0712d68|
uint256 amount
| |MultiMint1155 | mintSign (v2) | 0x657bb113|
uint256 tokenId
uint256 amount
address pass
| |AuctionCore |bid | 0x454a2ab3|
uint256 auctionId
| |AuctionCore |finalizeAuction| 0xe8083863|
uint256 auctionId
| +|MultiMint1155 | mint (v2) | 0x08dc9f42|
uint256 tokenId
uint256 amount
| + +> **Note:** Only the third `mint` function is labelled as v2 because the first two share the same selector and behave identically. ## Build diff --git a/src/contract.c b/src/contract.c index 9f97c23..37cd2f7 100644 --- a/src/contract.c +++ b/src/contract.c @@ -1,6 +1,6 @@ #include "ledger_nft_plugin.h" -// Function: mint +// Function: mint (MultiMintContractNFT, StableMultiMintERC721) // Selector: 0xa0712d68 static const uint8_t MINT_SELECTOR[SELECTOR_SIZE] = {0xa0, 0x71, 0x2d, 0x68}; @@ -32,6 +32,10 @@ static const uint8_t BID_SELECTOR[SELECTOR_SIZE] = {0x45, 0x4a, 0x2a, 0xb3}; // Selector: 0xe8083863 static const uint8_t FINALIZE_AUCTION_SELECTOR[SELECTOR_SIZE] = {0xe8, 0x08, 0x38, 0x63}; +// Function: mint (MultiMint1155) +// Selector: 0x08dc9f42 +static const uint8_t MINT_V2_SELECTOR[SELECTOR_SIZE] = {0x08, 0xdc, 0x9f, 0x42}; + // Plugin uses 0x00000 as a dummy address to reprecent ETH. const uint8_t NULL_ETH_ADDRESS[ADDRESS_LENGTH] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -47,6 +51,7 @@ const uint8_t *const LEDGER_NFT_SELECTORS[NUM_SELECTORS] = { MINT_SIGN_V2_SELECTOR, BID_SELECTOR, FINALIZE_AUCTION_SELECTOR, + MINT_V2_SELECTOR, }; static const uint8_t MULTI_MINT_CONTRACT_NFT_ADDRESS[ADDRESS_LENGTH] = { diff --git a/src/handle_finalize.c b/src/handle_finalize.c index d279228..a16b086 100644 --- a/src/handle_finalize.c +++ b/src/handle_finalize.c @@ -16,6 +16,9 @@ void handle_finalize(void *parameters) { case BID: msg->numScreens = 2; break; + case MINT_V2: + msg->numScreens = 3; + break; case MINT_SIGN_V2: msg->numScreens = 4; break; diff --git a/src/handle_init_contract.c b/src/handle_init_contract.c index d1af8d2..71fdd25 100644 --- a/src/handle_init_contract.c +++ b/src/handle_init_contract.c @@ -46,6 +46,9 @@ void handle_init_contract(void *parameters) { case FINALIZE_AUCTION: context->next_param = AUCTION_ID; break; + case MINT_V2: + context->next_param = TOKEN_ID; + break; default: PRINTF("Missing selectorIndex: %d\n", context->selectorIndex); msg->result = ETH_PLUGIN_RESULT_ERROR; diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index 219d961..d18b658 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -81,6 +81,26 @@ void handle_auction(ethPluginProvideParameter_t *msg, context_t *context) { } } +void handle_mint_v2(ethPluginProvideParameter_t *msg, context_t *context) { + switch (context->next_param) { + case TOKEN_ID: + // Using context->token_id to store the auctionId + handle_token_id(msg, context); + context->next_param = AMOUNT; + break; + case AMOUNT: + handle_amount(msg, context); + context->next_param = NONE; + break; + case NONE: + break; + default: + PRINTF("Param not supported\n"); + msg->result = ETH_PLUGIN_RESULT_ERROR; + break; + } +} + void handle_provide_parameter(void *parameters) { ethPluginProvideParameter_t *msg = (ethPluginProvideParameter_t *) parameters; context_t *context = (context_t *) msg->pluginContext; @@ -115,6 +135,9 @@ void handle_provide_parameter(void *parameters) { case FINALIZE_AUCTION: handle_auction(msg, context); break; + case MINT_V2: + handle_mint_v2(msg, context); + break; default: PRINTF("Selector Index not supported: %d\n", context->selectorIndex); msg->result = ETH_PLUGIN_RESULT_ERROR; diff --git a/src/handle_query_contract_id.c b/src/handle_query_contract_id.c index a4c8037..dac5d33 100644 --- a/src/handle_query_contract_id.c +++ b/src/handle_query_contract_id.c @@ -44,6 +44,9 @@ void handle_query_contract_id(void *parameters) { case FINALIZE_AUCTION: strlcpy(msg->version, "Finalize Auction", msg->versionLength); break; + case MINT_V2: + strlcpy(msg->version, "MultiMint1155 - Mint", msg->versionLength); + break; default: PRINTF("Selector index: %d not supported\n", context->selectorIndex); msg->result = ETH_PLUGIN_RESULT_ERROR; diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 7d68ce3..1542c10 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -96,6 +96,18 @@ static screens_t get_screen(const ethQueryContractUI_t *msg, return ERROR; } break; + case MINT_V2: + switch (index) { + case 0: + return TOKEN_ID_SCREEN; + case 1: + return AMOUNT_SCREEN; + case 2: + return PAYABLE_AMOUNT_SCREEN; + default: + return ERROR; + } + break; default: PRINTF("Selector index: %d not supported\n", context->selectorIndex); return ERROR; diff --git a/src/ledger_nft_plugin.h b/src/ledger_nft_plugin.h index 369b7dd..9624a8f 100644 --- a/src/ledger_nft_plugin.h +++ b/src/ledger_nft_plugin.h @@ -4,7 +4,7 @@ #include "eth_internals.h" #include "eth_plugin_interface.h" -#define NUM_SELECTORS 8 +#define NUM_SELECTORS 9 #define NUM_CONTRACTS 4 #define PLUGIN_NAME "Ledger NFT" #define TOKEN_FOUND 1 << 1 @@ -25,6 +25,7 @@ typedef enum { MINT_SIGN_V2, BID, FINALIZE_AUCTION, + MINT_V2, } selector_t; // Enumeration used to parse the smart contract data. diff --git a/tests/networks/ethereum_goerli/ledgerNFT/b2c.json b/tests/networks/ethereum_goerli/ledgerNFT/b2c.json index 835fbae..7ec1eb6 100644 --- a/tests/networks/ethereum_goerli/ledgerNFT/b2c.json +++ b/tests/networks/ethereum_goerli/ledgerNFT/b2c.json @@ -51,6 +51,11 @@ "erc20OfInterest": [], "method": "mintSign", "plugin": "LedgerNFT" + }, + "0x08dc9f42": { + "erc20OfInterest": [], + "method": "mint", + "plugin": "LedgerNFT" } } }, diff --git a/tests/snapshots/ethereum_goerli_nanos_mint/00000.png b/tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00000.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanos_mint/00000.png rename to tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00000.png diff --git a/tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00001.png b/tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00001.png new file mode 100644 index 0000000..2f677bd Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00001.png differ diff --git a/tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00002.png b/tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00002.png new file mode 100644 index 0000000..db278b3 Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00002.png differ diff --git a/tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00003.png b/tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00003.png new file mode 100644 index 0000000..1a73e40 Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00003.png differ diff --git a/tests/snapshots/ethereum_goerli_nanos_mint/00004.png b/tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00004.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanos_mint/00004.png rename to tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00004.png diff --git a/tests/snapshots/ethereum_goerli_nanos_mint/00005.png b/tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00005.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanos_mint/00005.png rename to tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00005.png diff --git a/tests/snapshots/ethereum_goerli_nanos_mint/00006.png b/tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00006.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanos_mint/00006.png rename to tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00006.png diff --git a/tests/snapshots/ethereum_goerli_nanos_mint/00007.png b/tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00007.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanos_mint/00007.png rename to tests/snapshots/ethereum_goerli_nanos_mint_mm1155/00007.png diff --git a/tests/snapshots/ethereum_goerli_nanos_mint_v2/00000.png b/tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00000.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanos_mint_v2/00000.png rename to tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00000.png diff --git a/tests/snapshots/ethereum_goerli_nanos_mint/00001.png b/tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00001.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanos_mint/00001.png rename to tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00001.png diff --git a/tests/snapshots/ethereum_goerli_nanos_mint/00002.png b/tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00002.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanos_mint/00002.png rename to tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00002.png diff --git a/tests/snapshots/ethereum_goerli_nanos_mint/00003.png b/tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00003.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanos_mint/00003.png rename to tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00003.png diff --git a/tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00004.png b/tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00004.png new file mode 100644 index 0000000..1ce6d61 Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00004.png differ diff --git a/tests/snapshots/ethereum_goerli_nanos_mint_v2/00005.png b/tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00005.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanos_mint_v2/00005.png rename to tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00005.png diff --git a/tests/snapshots/ethereum_goerli_nanos_mint_v2/00006.png b/tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00006.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanos_mint_v2/00006.png rename to tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00006.png diff --git a/tests/snapshots/ethereum_goerli_nanos_mint_v2/00007.png b/tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00007.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanos_mint_v2/00007.png rename to tests/snapshots/ethereum_goerli_nanos_mint_mmnft/00007.png diff --git a/tests/snapshots/ethereum_goerli_nanos_mint_smm721/00000.png b/tests/snapshots/ethereum_goerli_nanos_mint_smm721/00000.png new file mode 100644 index 0000000..8d84cc7 Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanos_mint_smm721/00000.png differ diff --git a/tests/snapshots/ethereum_goerli_nanos_mint_v2/00001.png b/tests/snapshots/ethereum_goerli_nanos_mint_smm721/00001.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanos_mint_v2/00001.png rename to tests/snapshots/ethereum_goerli_nanos_mint_smm721/00001.png diff --git a/tests/snapshots/ethereum_goerli_nanos_mint_v2/00002.png b/tests/snapshots/ethereum_goerli_nanos_mint_smm721/00002.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanos_mint_v2/00002.png rename to tests/snapshots/ethereum_goerli_nanos_mint_smm721/00002.png diff --git a/tests/snapshots/ethereum_goerli_nanos_mint_v2/00003.png b/tests/snapshots/ethereum_goerli_nanos_mint_smm721/00003.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanos_mint_v2/00003.png rename to tests/snapshots/ethereum_goerli_nanos_mint_smm721/00003.png diff --git a/tests/snapshots/ethereum_goerli_nanos_mint_v2/00004.png b/tests/snapshots/ethereum_goerli_nanos_mint_smm721/00004.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanos_mint_v2/00004.png rename to tests/snapshots/ethereum_goerli_nanos_mint_smm721/00004.png diff --git a/tests/snapshots/ethereum_goerli_nanos_mint_smm721/00005.png b/tests/snapshots/ethereum_goerli_nanos_mint_smm721/00005.png new file mode 100644 index 0000000..eeec632 Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanos_mint_smm721/00005.png differ diff --git a/tests/snapshots/ethereum_goerli_nanos_mint_smm721/00006.png b/tests/snapshots/ethereum_goerli_nanos_mint_smm721/00006.png new file mode 100644 index 0000000..1c9156c Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanos_mint_smm721/00006.png differ diff --git a/tests/snapshots/ethereum_goerli_nanos_mint_smm721/00007.png b/tests/snapshots/ethereum_goerli_nanos_mint_smm721/00007.png new file mode 100644 index 0000000..ce795f3 Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanos_mint_smm721/00007.png differ diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint/00000.png b/tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00000.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanosp_mint/00000.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00000.png diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00001.png b/tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00001.png new file mode 100644 index 0000000..847df7a Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00001.png differ diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00002.png b/tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00002.png new file mode 100644 index 0000000..d14c411 Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00002.png differ diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00003.png b/tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00003.png new file mode 100644 index 0000000..6b8ceef Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00003.png differ diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint/00003.png b/tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00004.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanosp_mint/00003.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00004.png diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint/00004.png b/tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00005.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanosp_mint/00004.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00005.png diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint/00005.png b/tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00006.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanosp_mint/00005.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00006.png diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint/00006.png b/tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00007.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanosp_mint/00006.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_mm1155/00007.png diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint_v2/00000.png b/tests/snapshots/ethereum_goerli_nanosp_mint_mmnft/00000.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanosp_mint_v2/00000.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_mmnft/00000.png diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint/00001.png b/tests/snapshots/ethereum_goerli_nanosp_mint_mmnft/00001.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanosp_mint/00001.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_mmnft/00001.png diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint/00002.png b/tests/snapshots/ethereum_goerli_nanosp_mint_mmnft/00002.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanosp_mint/00002.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_mmnft/00002.png diff --git a/tests/snapshots/ethereum_goerli_nanox_mint/00003.png b/tests/snapshots/ethereum_goerli_nanosp_mint_mmnft/00003.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanox_mint/00003.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_mmnft/00003.png diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint_v2/00004.png b/tests/snapshots/ethereum_goerli_nanosp_mint_mmnft/00004.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanosp_mint_v2/00004.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_mmnft/00004.png diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint_v2/00005.png b/tests/snapshots/ethereum_goerli_nanosp_mint_mmnft/00005.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanosp_mint_v2/00005.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_mmnft/00005.png diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint_v2/00006.png b/tests/snapshots/ethereum_goerli_nanosp_mint_mmnft/00006.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanosp_mint_v2/00006.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_mmnft/00006.png diff --git a/tests/snapshots/ethereum_goerli_nanox_mint/00000.png b/tests/snapshots/ethereum_goerli_nanosp_mint_smm721/00000.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanox_mint/00000.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_smm721/00000.png diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint_v2/00001.png b/tests/snapshots/ethereum_goerli_nanosp_mint_smm721/00001.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanosp_mint_v2/00001.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_smm721/00001.png diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint_v2/00002.png b/tests/snapshots/ethereum_goerli_nanosp_mint_smm721/00002.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanosp_mint_v2/00002.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_smm721/00002.png diff --git a/tests/snapshots/ethereum_goerli_nanosp_mint_v2/00003.png b/tests/snapshots/ethereum_goerli_nanosp_mint_smm721/00003.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanosp_mint_v2/00003.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_smm721/00003.png diff --git a/tests/snapshots/ethereum_goerli_nanox_mint/00004.png b/tests/snapshots/ethereum_goerli_nanosp_mint_smm721/00004.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanox_mint/00004.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_smm721/00004.png diff --git a/tests/snapshots/ethereum_goerli_nanox_mint/00005.png b/tests/snapshots/ethereum_goerli_nanosp_mint_smm721/00005.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanox_mint/00005.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_smm721/00005.png diff --git a/tests/snapshots/ethereum_goerli_nanox_mint/00006.png b/tests/snapshots/ethereum_goerli_nanosp_mint_smm721/00006.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanox_mint/00006.png rename to tests/snapshots/ethereum_goerli_nanosp_mint_smm721/00006.png diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_v2/00000.png b/tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00000.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanox_mint_v2/00000.png rename to tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00000.png diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00001.png b/tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00001.png new file mode 100644 index 0000000..847df7a Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00001.png differ diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00002.png b/tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00002.png new file mode 100644 index 0000000..d14c411 Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00002.png differ diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00003.png b/tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00003.png new file mode 100644 index 0000000..6b8ceef Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00003.png differ diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00004.png b/tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00004.png new file mode 100644 index 0000000..e7c81bf Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00004.png differ diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_v2/00004.png b/tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00005.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanox_mint_v2/00004.png rename to tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00005.png diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_v2/00005.png b/tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00006.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanox_mint_v2/00005.png rename to tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00006.png diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_v2/00006.png b/tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00007.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanox_mint_v2/00006.png rename to tests/snapshots/ethereum_goerli_nanox_mint_mm1155/00007.png diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00000.png b/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00000.png differ diff --git a/tests/snapshots/ethereum_goerli_nanox_mint/00001.png b/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00001.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanox_mint/00001.png rename to tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00001.png diff --git a/tests/snapshots/ethereum_goerli_nanox_mint/00002.png b/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00002.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanox_mint/00002.png rename to tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00002.png diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00003.png b/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00003.png new file mode 100644 index 0000000..e7c81bf Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00003.png differ diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00004.png b/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00004.png new file mode 100644 index 0000000..89bfa0b Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00004.png differ diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00005.png b/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00005.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00005.png differ diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00006.png b/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00006.png new file mode 100644 index 0000000..a58590b Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanox_mint_mmnft/00006.png differ diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_smm721/00000.png b/tests/snapshots/ethereum_goerli_nanox_mint_smm721/00000.png new file mode 100644 index 0000000..487ea10 Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanox_mint_smm721/00000.png differ diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_v2/00001.png b/tests/snapshots/ethereum_goerli_nanox_mint_smm721/00001.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanox_mint_v2/00001.png rename to tests/snapshots/ethereum_goerli_nanox_mint_smm721/00001.png diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_v2/00002.png b/tests/snapshots/ethereum_goerli_nanox_mint_smm721/00002.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanox_mint_v2/00002.png rename to tests/snapshots/ethereum_goerli_nanox_mint_smm721/00002.png diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_v2/00003.png b/tests/snapshots/ethereum_goerli_nanox_mint_smm721/00003.png similarity index 100% rename from tests/snapshots/ethereum_goerli_nanox_mint_v2/00003.png rename to tests/snapshots/ethereum_goerli_nanox_mint_smm721/00003.png diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_smm721/00004.png b/tests/snapshots/ethereum_goerli_nanox_mint_smm721/00004.png new file mode 100644 index 0000000..89bfa0b Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanox_mint_smm721/00004.png differ diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_smm721/00005.png b/tests/snapshots/ethereum_goerli_nanox_mint_smm721/00005.png new file mode 100644 index 0000000..570ce28 Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanox_mint_smm721/00005.png differ diff --git a/tests/snapshots/ethereum_goerli_nanox_mint_smm721/00006.png b/tests/snapshots/ethereum_goerli_nanox_mint_smm721/00006.png new file mode 100644 index 0000000..a58590b Binary files /dev/null and b/tests/snapshots/ethereum_goerli_nanox_mint_smm721/00006.png differ diff --git a/tests/src/mintMM1155.test.js b/tests/src/mintMM1155.test.js new file mode 100644 index 0000000..4e737dd --- /dev/null +++ b/tests/src/mintMM1155.test.js @@ -0,0 +1,47 @@ +import { processTest, populateTransaction } from "./test.fixture"; + +const contractName = "MultiMintContractNFT"; + +const testLabel = "MintMM1155"; // <= Name of the test +const testDirSuffix = "mint_mm1155"; // <= directory to compare device snapshots to +const signedPlugin = false; +const testNetwork = "ethereum_goerli"; + +const contractAddr = "0x12b180053db389b6200e6f646949e6ab7b385d40"; +const chainID = 1; + +// Selector: 0x08dc9f42 +// [0] 0000000000000000000000000000000000000000000000000000000000000015 tokenId +// [1] 0000000000000000000000000000000000000000000000000000000000000002 amount +// [2] 0000000000000000000000000000000000000000000000000000000000000060 offset to data +// [3] 0000000000000000000000000000000000000000000000000000000000000008 data length +// [4] 746573745f6e6674000000000000000000000000000000000000000000000000 data + +const inputData = "0x08dc9f420000000000000000000000000000000000000000000000000000000000000015000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000008746573745f6e6674000000000000000000000000000000000000000000000000"; +const value = "12.0"; + +// Create serializedTx and remove the "0x" prefix +const serializedTx = populateTransaction(contractAddr, inputData, chainID, value); + +const devices = [ + { + name: "nanos", + label: "Nano S", + steps: 6, // <= Define the number of steps for this test case and this device + }, + { + name: "nanox", + label: "Nano X", + steps: 6, // <= Define the number of steps for this test case and this device + }, + { + name: "nanosp", + label: "Nano S+", + steps: 6, // <= Define the number of steps for this test case and this device + }, + +]; + +devices.forEach((device) => { + processTest(device, contractName, testLabel, testDirSuffix, "", signedPlugin, serializedTx, testNetwork); +}); \ No newline at end of file diff --git a/tests/src/mint.test.js b/tests/src/mintMMNFT.test.js similarity index 89% rename from tests/src/mint.test.js rename to tests/src/mintMMNFT.test.js index 9eb44bd..3a43165 100644 --- a/tests/src/mint.test.js +++ b/tests/src/mintMMNFT.test.js @@ -2,8 +2,8 @@ import { processTest, populateTransaction } from "./test.fixture"; const contractName = "MultiMintContractNFT"; -const testLabel = "Mint"; // <= Name of the test -const testDirSuffix = "mint"; // <= directory to compare device snapshots to +const testLabel = "MintMMNFT"; // <= Name of the test +const testDirSuffix = "mint_mmnft"; // <= directory to compare device snapshots to const signedPlugin = false; const testNetwork = "ethereum_goerli"; diff --git a/tests/src/mintV2.test.js b/tests/src/mintSMM721.test.js similarity index 89% rename from tests/src/mintV2.test.js rename to tests/src/mintSMM721.test.js index cc904ed..eb578ff 100644 --- a/tests/src/mintV2.test.js +++ b/tests/src/mintSMM721.test.js @@ -2,8 +2,8 @@ import { processTest, populateTransaction } from "./test.fixture"; const contractName = "StableMultiMintERC721"; -const testLabel = "mintV2"; // <= Name of the test -const testDirSuffix = "mint_v2"; // <= directory to compare device snapshots to +const testLabel = "mintSMM721"; // <= Name of the test +const testDirSuffix = "mint_smm721"; // <= directory to compare device snapshots to const signedPlugin = false; const testNetwork = "ethereum_goerli";