From 8c063339d98913892c26987f302cd674b4d91699 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Mon, 16 Oct 2023 11:48:45 +0200 Subject: [PATCH 01/33] Updated to use the latest plugin SDK --- ethereum-plugin-sdk | 2 +- src/handle_finalize.c | 3 +- src/handle_init_contract.c | 4 +- src/handle_provide_parameter.c | 3 +- src/handle_provide_token.c | 5 ++ src/handle_query_contract_id.c | 3 +- src/handle_query_contract_ui.c | 103 +++++++++++++----------- src/kiln_plugin.h | 6 -- src/main.c | 139 --------------------------------- 9 files changed, 68 insertions(+), 200 deletions(-) create mode 100644 src/handle_provide_token.c delete mode 100644 src/main.c diff --git a/ethereum-plugin-sdk b/ethereum-plugin-sdk index b9777e7..1fe4085 160000 --- a/ethereum-plugin-sdk +++ b/ethereum-plugin-sdk @@ -1 +1 @@ -Subproject commit b9777e7a81a9c33b3f8997ffa23396fa2b3f861d +Subproject commit 1fe4085d04a88f4238103a4ed3db1484fdb69c63 diff --git a/src/handle_finalize.c b/src/handle_finalize.c index 7cb8bcb..81572ad 100644 --- a/src/handle_finalize.c +++ b/src/handle_finalize.c @@ -1,7 +1,6 @@ #include "kiln_plugin.h" -void handle_finalize(void *parameters) { - ethPluginFinalize_t *msg = (ethPluginFinalize_t *) parameters; +void handle_finalize(ethPluginFinalize_t *msg) { context_t *context = (context_t *) msg->pluginContext; msg->uiType = ETH_UI_TYPE_GENERIC; diff --git a/src/handle_init_contract.c b/src/handle_init_contract.c index 4dd1bcf..5ddf9ac 100644 --- a/src/handle_init_contract.c +++ b/src/handle_init_contract.c @@ -10,9 +10,7 @@ static int find_selector(uint32_t selector, const uint32_t *selectors, size_t n, return -1; } -void handle_init_contract(void *parameters) { - ethPluginInitContract_t *msg = (ethPluginInitContract_t *) parameters; - +void handle_init_contract(ethPluginInitContract_t *msg) { if (msg->interfaceVersion != ETH_PLUGIN_INTERFACE_VERSION_LATEST) { msg->result = ETH_PLUGIN_RESULT_UNAVAILABLE; return; diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index e0c6adb..9032bf3 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -1,7 +1,6 @@ #include "kiln_plugin.h" -void handle_provide_parameter(void *parameters) { - ethPluginProvideParameter_t *msg = (ethPluginProvideParameter_t *) parameters; +void handle_provide_parameter(ethPluginProvideParameter_t *msg) { context_t *context = (context_t *) msg->pluginContext; PRINTF("plugin provide parameter: offset %d\nBytes: %.*H\n", diff --git a/src/handle_provide_token.c b/src/handle_provide_token.c new file mode 100644 index 0000000..8f94498 --- /dev/null +++ b/src/handle_provide_token.c @@ -0,0 +1,5 @@ +#include "kiln_plugin.h" + +void handle_provide_token(ethPluginProvideInfo_t *msg) { + msg->result = ETH_PLUGIN_RESULT_OK; +} diff --git a/src/handle_query_contract_id.c b/src/handle_query_contract_id.c index b760091..1401122 100644 --- a/src/handle_query_contract_id.c +++ b/src/handle_query_contract_id.c @@ -1,7 +1,6 @@ #include "kiln_plugin.h" -void handle_query_contract_id(void *parameters) { - ethQueryContractID_t *msg = (ethQueryContractID_t *) parameters; +void handle_query_contract_id(ethQueryContractID_t *msg) { const context_t *context = (const context_t *) msg->pluginContext; strlcpy(msg->name, PLUGIN_NAME, msg->nameLength); diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 8fff009..62fe33e 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -1,6 +1,7 @@ +#include #include "kiln_plugin.h" -static void withdraw_rewards_ui(ethQueryContractUI_t *msg, context_t *context) { +static bool withdraw_rewards_ui(ethQueryContractUI_t *msg, context_t *context) { strlcpy(msg->title, "Rewards", msg->titleLength); switch (context->selectorIndex) { @@ -20,23 +21,25 @@ static void withdraw_rewards_ui(ethQueryContractUI_t *msg, context_t *context) { strlcpy(msg->msg, "?", msg->msgLength); break; } + return true; } -static void withdraw_ui(ethQueryContractUI_t *msg, context_t *context) { +static bool withdraw_ui(ethQueryContractUI_t *msg, context_t *context) { + bool ret = false; + switch (msg->screenIndex) { case 0: - withdraw_rewards_ui(msg, context); - msg->result = ETH_PLUGIN_RESULT_OK; + ret = withdraw_rewards_ui(msg, context); break; default: PRINTF("Received an invalid screenIndex\n"); - msg->result = ETH_PLUGIN_RESULT_ERROR; break; } + return ret; } -static void batch_withdraw_rewards_ui(ethQueryContractUI_t *msg, context_t *context) { +static bool batch_withdraw_rewards_ui(ethQueryContractUI_t *msg, context_t *context) { strlcpy(msg->title, "Rewards", msg->titleLength); switch (context->selectorIndex) { @@ -56,157 +59,167 @@ static void batch_withdraw_rewards_ui(ethQueryContractUI_t *msg, context_t *cont strlcpy(msg->msg, "?", msg->msgLength); break; } + return true; } -static void batch_withdraw_ui(ethQueryContractUI_t *msg, context_t *context) { +static bool batch_withdraw_ui(ethQueryContractUI_t *msg, context_t *context) { + bool ret = false; + switch (msg->screenIndex) { case 0: - batch_withdraw_rewards_ui(msg, context); - msg->result = ETH_PLUGIN_RESULT_OK; + ret = batch_withdraw_rewards_ui(msg, context); break; default: PRINTF("Received an invalid screenIndex\n"); - msg->result = ETH_PLUGIN_RESULT_ERROR; break; } + return ret; } -static void request_exits_ui(ethQueryContractUI_t *msg) { +static bool request_exits_ui(ethQueryContractUI_t *msg) { strlcpy(msg->title, "Request", msg->titleLength); strlcpy(msg->msg, "Validators Exit", msg->msgLength); + return true; } -static void request_exit_ui(ethQueryContractUI_t *msg) { +static bool request_exit_ui(ethQueryContractUI_t *msg) { + bool ret = false; + switch (msg->screenIndex) { case 0: - request_exits_ui(msg); - msg->result = ETH_PLUGIN_RESULT_OK; + ret = request_exits_ui(msg); break; default: PRINTF("Received an invalid screenIndex\n"); - msg->result = ETH_PLUGIN_RESULT_ERROR; break; } + return ret; } -static void stake_ui(ethQueryContractUI_t *msg) { +static bool stake_ui(ethQueryContractUI_t *msg) { + bool ret = false; + switch (msg->screenIndex) { case 0: strlcpy(msg->title, "Stake", msg->titleLength); const uint8_t *eth_amount = msg->pluginSharedRO->txContent->value.value; uint8_t eth_amount_size = msg->pluginSharedRO->txContent->value.length; - amountToString(eth_amount, - eth_amount_size, - WEI_TO_ETHER, - "ETH", - msg->msg, - msg->msgLength); - - msg->result = ETH_PLUGIN_RESULT_OK; + ret = amountToString(eth_amount, + eth_amount_size, + WEI_TO_ETHER, + "ETH", + msg->msg, + msg->msgLength); break; default: PRINTF("Received an invalid screenIndex\n"); - msg->result = ETH_PLUGIN_RESULT_ERROR; break; } + return ret; } -static void request_exit_ui_v2(ethQueryContractUI_t *msg) { +static bool request_exit_ui_v2(ethQueryContractUI_t *msg) { + bool ret = false; + switch (msg->screenIndex) { case 0: strlcpy(msg->title, "Request", msg->titleLength); strlcpy(msg->msg, "Position Exit", msg->msgLength); - msg->result = ETH_PLUGIN_RESULT_OK; + ret = true; break; default: PRINTF("Received an invalid screenIndex\n"); - msg->result = ETH_PLUGIN_RESULT_ERROR; break; } + return ret; } -static void multiclaim_ui_v2(ethQueryContractUI_t *msg) { +static bool multiclaim_ui_v2(ethQueryContractUI_t *msg) { + bool ret = false; + switch (msg->screenIndex) { case 0: strlcpy(msg->title, "Withdraw", msg->titleLength); strlcpy(msg->msg, "Exited Positions", msg->msgLength); - msg->result = ETH_PLUGIN_RESULT_OK; + ret = true; break; default: PRINTF("Received an invalid screenIndex\n"); - msg->result = ETH_PLUGIN_RESULT_ERROR; break; } + return ret; } -static void claim_ui_v2(ethQueryContractUI_t *msg) { +static bool claim_ui_v2(ethQueryContractUI_t *msg) { + bool ret = false; + switch (msg->screenIndex) { case 0: strlcpy(msg->title, "Withdraw", msg->titleLength); strlcpy(msg->msg, "Exited Position", msg->msgLength); - msg->result = ETH_PLUGIN_RESULT_OK; + ret = true; break; default: PRINTF("Received an invalid screenIndex\n"); - msg->result = ETH_PLUGIN_RESULT_ERROR; break; } + return ret; } -void handle_query_contract_ui(void *parameters) { - ethQueryContractUI_t *msg = (ethQueryContractUI_t *) parameters; +void handle_query_contract_ui(ethQueryContractUI_t *msg) { context_t *context = (context_t *) msg->pluginContext; + bool ret = false; memset(msg->title, 0, msg->titleLength); memset(msg->msg, 0, msg->msgLength); switch (context->selectorIndex) { case KILN_V1_DEPOSIT: - stake_ui(msg); + ret = stake_ui(msg); break; case KILN_V1_WITHDRAW: case KILN_V1_WITHDRAW_EL: case KILN_V1_WITHDRAW_CL: - withdraw_ui(msg, context); + ret = withdraw_ui(msg, context); break; case KILN_V1_BATCH_WITHDRAW: case KILN_V1_BATCH_WITHDRAW_EL: case KILN_V1_BATCH_WITHDRAW_CL: - batch_withdraw_ui(msg, context); + ret = batch_withdraw_ui(msg, context); break; case KILN_V1_REQUEST_EXIT: - request_exit_ui(msg); + ret = request_exit_ui(msg); break; case KILN_V2_STAKE: - stake_ui(msg); + ret = stake_ui(msg); break; case KILN_V2_REQUEST_EXIT: - request_exit_ui_v2(msg); + ret = request_exit_ui_v2(msg); break; case KILN_V2_MULTICLAIM: - multiclaim_ui_v2(msg); + ret = multiclaim_ui_v2(msg); break; case KILN_V2_CLAIM: - claim_ui_v2(msg); + ret = claim_ui_v2(msg); break; default: PRINTF("Selector Index not supported: %d\n", context->selectorIndex); - msg->result = ETH_PLUGIN_RESULT_ERROR; break; } + msg->result = ret ? ETH_PLUGIN_RESULT_OK : ETH_PLUGIN_RESULT_ERROR; } diff --git a/src/kiln_plugin.h b/src/kiln_plugin.h index 1e56b89..1c9acb8 100644 --- a/src/kiln_plugin.h +++ b/src/kiln_plugin.h @@ -66,9 +66,3 @@ typedef struct context_t { } context_t; _Static_assert(sizeof(context_t) <= 5 * 32, "Structure of parameters too big."); - -void handle_provide_parameter(void *parameters); -void handle_query_contract_ui(void *parameters); -void handle_init_contract(void *parameters); -void handle_finalize(void *parameters); -void handle_query_contract_id(void *parameters); diff --git a/src/main.c b/src/main.c deleted file mode 100644 index 6362e71..0000000 --- a/src/main.c +++ /dev/null @@ -1,139 +0,0 @@ -/******************************************************************************* - * Ethereum 2 Deposit Application - * (c) 2020 Ledger - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - ********************************************************************************/ - -#include -#include -#include - -#include "os.h" -#include "cx.h" -#include "glyphs.h" - -#include "kiln_plugin.h" - -// Function to dispatch calls from the ethereum app. -void dispatch_plugin_calls(int message, void *parameters) { - switch (message) { - case ETH_PLUGIN_INIT_CONTRACT: - handle_init_contract(parameters); - break; - case ETH_PLUGIN_PROVIDE_PARAMETER: - handle_provide_parameter(parameters); - break; - case ETH_PLUGIN_FINALIZE: - handle_finalize(parameters); - break; - case ETH_PLUGIN_QUERY_CONTRACT_ID: - handle_query_contract_id(parameters); - break; - case ETH_PLUGIN_QUERY_CONTRACT_UI: - handle_query_contract_ui(parameters); - break; - default: - PRINTF("Unhandled message %d\n", message); - break; - } -} - -void handle_query_ui_exception(unsigned int *args) { - switch (args[0]) { - case ETH_PLUGIN_QUERY_CONTRACT_UI: - ((ethQueryContractUI_t *) args[1])->result = ETH_PLUGIN_RESULT_ERROR; - break; - default: - break; - } -} - -// Calls the ethereum app. -void call_app_ethereum() { - unsigned int libcall_params[5]; - - libcall_params[0] = (unsigned int) "Ethereum"; - libcall_params[1] = 0x100; - libcall_params[2] = RUN_APPLICATION; - libcall_params[3] = (unsigned int) NULL; -#ifdef HAVE_NBGL - caller_app_t capp; - const char name[] = APPNAME; - nbgl_icon_details_t icon_details; - uint8_t bitmap[sizeof(ICONBITMAP)]; - - memcpy(&icon_details, &ICONGLYPH, sizeof(ICONGLYPH)); - memcpy(&bitmap, &ICONBITMAP, sizeof(bitmap)); - icon_details.bitmap = (const uint8_t *) bitmap; - capp.name = name; - capp.icon = &icon_details; - libcall_params[4] = (unsigned int) &capp; -#else - libcall_params[4] = (unsigned int) NULL; -#endif - os_lib_call((unsigned int *) &libcall_params); -} - -// Weird low-level black magic. No need to edit this. -__attribute__((section(".boot"))) int main(int arg0) { - // Exit critical section - __asm volatile("cpsie i"); - - // Ensure exception will work as planned - os_boot(); - - // Try catch block. Please read the docs for more information on how to use those! - BEGIN_TRY { - TRY { - // Low-level black magic. - check_api_level(CX_COMPAT_APILEVEL); - - // Check if we are called from the dashboard. - if (!arg0) { - // Called from dashboard, launch Ethereum app - call_app_ethereum(); - return 0; - } else { - // Not called from dashboard: called from the ethereum app! - const unsigned int *args = (const unsigned int *) arg0; - - // If `ETH_PLUGIN_CHECK_PRESENCE` is set, this means the caller is just trying to - // know whether this app exists or not. We can skip `dispatch_plugin_calls`. - if (args[0] != ETH_PLUGIN_CHECK_PRESENCE) { - dispatch_plugin_calls(args[0], (void *) args[1]); - } - } - } - CATCH_OTHER(e) { - switch (e) { - // These exceptions are only generated on handle_query_contract_ui() - case 0x6502: - case EXCEPTION_OVERFLOW: - handle_query_ui_exception((unsigned int *) arg0); - break; - default: - break; - } - PRINTF("Exception 0x%x caught\n", e); - } - FINALLY { - // Call `os_lib_end`, go back to the ethereum app. - os_lib_end(); - } - } - END_TRY; - - // Will not get reached. - return 0; -} From 0cfd3ab0b309b57040258a8e00e70139f5f8c3f1 Mon Sep 17 00:00:00 2001 From: Sarah Gliner <105934250+sgliner-ledger@users.noreply.github.com> Date: Wed, 29 Nov 2023 11:46:03 +0100 Subject: [PATCH 02/33] [auto]: add PR template --- .github/PULL_REQUEST_TEMPLATE.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..98b720f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +# Checklist + +- [ ] App update process has been followed +- [ ] Target branch is `develop` +- [ ] Application version has been bumped + + From a482b13c815f841c746c93521a22886740e71221 Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Tue, 30 Jan 2024 15:28:33 +0100 Subject: [PATCH 03/33] feat: add liquid restaking selectors --- src/contract.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/contract.c b/src/contract.c index f26a80c..7df2e1c 100644 --- a/src/contract.c +++ b/src/contract.c @@ -1,6 +1,6 @@ #include "kiln_plugin.h" -// V1 - Solo Staking +// ONCHAIN V1 - Solo Staking // --- cast sig "deposit()" static const uint32_t KILN_V1_DEPOSIT_SELECTOR = 0xd0e30db0; // --- cast sig "withdraw(bytes)" @@ -18,7 +18,7 @@ static const uint32_t KILN_V1_BATCH_WITHDRAW_CL_SELECTOR = 0x0ffab6c2; // --- cast sig "requestValidatorsExit(bytes)" static const uint32_t KILN_V1_REQUEST_EXIT_SELECTOR = 0xb6b06dec; -// V2 - Pooled Staking +// ONCHAIN V2 - Pooled Staking // --- cast sig "stake()" static const uint32_t KILN_V2_STAKE_SELECTOR = 0x3a4b66f1; // --- cast sig "requestExit(uint256)" @@ -28,6 +28,21 @@ static const uint32_t KILN_V2_MULTICLAIM_SELECTOR = 0xb7ba18c7; // --- cast sig "claim(uint256[],uint32[],uint16)" static const uint32_t KILN_V2_CLAIM_SELECTOR = 0xadcf1163; +// RESTAKING - Liquid Restaking +// --- cast sig "approve(address,uint256)" +static const uint32_t KILN_LR_ERC20_APPROVE_SELECTOR = 0x095ea7b3; +// --- cast sig "depositIntoStrategy(address,address,uint256)" +static const uint32_t KILN_LR_DEPOSIT_INTO_STRATEGY_SELECTOR = 0xe7a050aa; +// --- cast sig "queueWithdrawal(uint256[],address[],uint256[],address,bool)" +static const uint32_t KILN_LR_QUEUE_WITHDRAWAL_SELECTOR = 0xf123991e; +// --- cast sig "queueWithdrawals((address[],uint256[],address)[])" +static const uint32_t KILN_LR_QUEUE_WITHDRAWALS_SELECTOR = 0x0dd8dd02; +// --- cast sig "completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]),address[],uint256,bool)" +static const uint32_t KILN_LR_COMPLETE_QUEUED_WITHDRAWAL_SELECTOR = 0x60d7faed; +// --- cast sig "completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[],address[][],uint256[],bool[])" +static const uint32_t KILN_LR_COMPLETE_QUEUED_WITHDRAWALS_SELECTOR = 0x33404396; + + const uint32_t KILN_SELECTORS[NUM_SELECTORS] = { // V1 KILN_V1_DEPOSIT_SELECTOR, @@ -43,4 +58,11 @@ const uint32_t KILN_SELECTORS[NUM_SELECTORS] = { KILN_V2_REQUEST_EXIT_SELECTOR, KILN_V2_MULTICLAIM_SELECTOR, KILN_V2_CLAIM_SELECTOR, + // LR + KILN_LR_ERC20_APPROVE_SELECTOR, + KILN_LR_DEPOSIT_INTO_STRATEGY_SELECTOR, + KILN_LR_QUEUE_WITHDRAWAL_SELECTOR, + KILN_LR_QUEUE_WITHDRAWALS_SELECTOR, + KILN_LR_COMPLETE_QUEUED_WITHDRAWAL_SELECTOR, + KILN_LR_COMPLETE_QUEUED_WITHDRAWALS_SELECTOR }; From 5169434860fc0cf9da4eb8cf091a14574c2c7a83 Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Wed, 31 Jan 2024 10:44:55 +0100 Subject: [PATCH 04/33] feat: add Liquid Restaking selectors handling --- src/handle_finalize.c | 6 ++++++ src/handle_init_contract.c | 8 ++++++++ src/handle_provide_parameter.c | 9 +++++++++ src/handle_query_contract_id.c | 24 ++++++++++++++++++++++++ src/handle_query_contract_ui.c | 21 +++++++++++++++++++++ src/kiln_plugin.h | 10 +++++++++- 6 files changed, 77 insertions(+), 1 deletion(-) diff --git a/src/handle_finalize.c b/src/handle_finalize.c index 81572ad..954be99 100644 --- a/src/handle_finalize.c +++ b/src/handle_finalize.c @@ -18,6 +18,12 @@ void handle_finalize(ethPluginFinalize_t *msg) { case KILN_V2_REQUEST_EXIT: case KILN_V2_MULTICLAIM: case KILN_V2_CLAIM: + case KILN_LR_ERC20_APPROVE: + case KILN_LR_DEPOSIT_INTO_STRATEGY: + case KILN_LR_QUEUE_WITHDRAWAL: + case KILN_LR_QUEUE_WITHDRAWALS: + case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: + case KILN_LR_COMPLETE_QUEUED_WITHDRAWALS: msg->numScreens = 1; msg->result = ETH_PLUGIN_RESULT_OK; break; diff --git a/src/handle_init_contract.c b/src/handle_init_contract.c index 5ddf9ac..d98b93f 100644 --- a/src/handle_init_contract.c +++ b/src/handle_init_contract.c @@ -58,6 +58,14 @@ void handle_init_contract(ethPluginInitContract_t *msg) { case KILN_V2_CLAIM: break; + case KILN_LR_ERC20_APPROVE: + case KILN_LR_DEPOSIT_INTO_STRATEGY: + case KILN_LR_QUEUE_WITHDRAWAL: + case KILN_LR_QUEUE_WITHDRAWALS: + case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: + case KILN_LR_COMPLETE_QUEUED_WITHDRAWALS: + 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 9032bf3..a073fc3 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -37,6 +37,15 @@ void handle_provide_parameter(ethPluginProvideParameter_t *msg) { msg->result = ETH_PLUGIN_RESULT_OK; break; + case KILN_LR_ERC20_APPROVE: + case KILN_LR_DEPOSIT_INTO_STRATEGY: + case KILN_LR_QUEUE_WITHDRAWAL: + case KILN_LR_QUEUE_WITHDRAWALS: + case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: + case KILN_LR_COMPLETE_QUEUED_WITHDRAWALS: + msg->result = ETH_PLUGIN_RESULT_OK; + 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 1401122..ee62e7d 100644 --- a/src/handle_query_contract_id.c +++ b/src/handle_query_contract_id.c @@ -44,6 +44,30 @@ void handle_query_contract_id(ethQueryContractID_t *msg) { strlcpy(msg->version, "Claim", msg->versionLength); break; + case KILN_LR_ERC20_APPROVE: + strlcpy(msg->version, "ERC20 Approve", msg->versionLength); + break; + + case KILN_LR_DEPOSIT_INTO_STRATEGY: + strlcpy(msg->version, "Deposit In Strategy", msg->versionLength); + break; + + case KILN_LR_QUEUE_WITHDRAWAL: + strlcpy(msg->version, "Queue Withdrawal", msg->versionLength); + break; + + case KILN_LR_QUEUE_WITHDRAWALS: + strlcpy(msg->version, "Queue Withdrawals", msg->versionLength); + break; + + case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: + strlcpy(msg->version, "Complete Queued Withdrawal", msg->versionLength); + break; + + case KILN_LR_COMPLETE_QUEUED_WITHDRAWALS: + strlcpy(msg->version, "Complete Queued Withdrawals", msg->versionLength); + break; + default: PRINTF("Selector Index not supported: %d\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 62fe33e..068dfe9 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -173,6 +173,23 @@ static bool claim_ui_v2(ethQueryContractUI_t *msg) { return ret; } +static bool erc20_approve_lr(ethQueryContractUI_t *msg) { + bool ret = false; + + switch (msg->screenIndex) { + case 0: + strlcpy(msg->title, "Approve", msg->titleLength); + strlcpy(msg->msg, "LR Token", msg->msgLength); + ret = true; + break; + + default: + PRINTF("Received an invalid screenIndex\n"); + break; + } + return ret; +} + void handle_query_contract_ui(ethQueryContractUI_t *msg) { context_t *context = (context_t *) msg->pluginContext; bool ret = false; @@ -217,6 +234,10 @@ void handle_query_contract_ui(ethQueryContractUI_t *msg) { ret = claim_ui_v2(msg); break; + case KILN_LR_ERC20_APPROVE: + ret = erc20_approve_lr(msg); + break; + default: PRINTF("Selector Index not supported: %d\n", context->selectorIndex); break; diff --git a/src/kiln_plugin.h b/src/kiln_plugin.h index 1c9acb8..dd39a27 100644 --- a/src/kiln_plugin.h +++ b/src/kiln_plugin.h @@ -25,7 +25,15 @@ // --- 9. requestExit(shares_count) // --- 10. multiClaim(exit_queues, ticket_ids, cask_ids) // --- 11. claim(uint256[],uint32[],uint16) -#define NUM_SELECTORS 12 +// +// LR selectors +// --- 12. approve(address,uint256) +// --- 13. depositIntoStrategy(address,address,uint256) +// --- 14. queueWithdrawal(uint256[],address[],uint256[],address,bool) +// --- 15. queueWithdrawals((address[],uint256[],address)[]) +// --- 16. completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]),address[],uint256,bool) +// --- 17. completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[],address[][],uint256[],bool[]) +#define NUM_SELECTORS 18 // Selectors available (see mapping above). typedef enum { From 974863238e19117eb5e73c068d0d5a4748873830 Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Fri, 2 Feb 2024 01:14:42 +0100 Subject: [PATCH 05/33] feat: lookup + depositIntoStrategy --- src/contract.c | 52 ++++++- src/handle_finalize.c | 10 +- src/handle_init_contract.c | 8 +- src/handle_provide_parameter.c | 130 +++++++++++++++++- src/handle_query_contract_id.c | 4 - src/handle_query_contract_ui.c | 21 ++- src/kiln_plugin.h | 49 +++++-- ...646372cc42e1a627fce94aa7a7033e7cf075a.json | 25 ++++ tests/cal/b2c.json | 10 ++ tests/src/approve.test.js | 63 +++++++++ 10 files changed, 342 insertions(+), 30 deletions(-) create mode 100644 tests/cal/abis/0x858646372cc42e1a627fce94aa7a7033e7cf075a.json create mode 100644 tests/src/approve.test.js diff --git a/src/contract.c b/src/contract.c index 7df2e1c..ec8cab7 100644 --- a/src/contract.c +++ b/src/contract.c @@ -37,10 +37,9 @@ static const uint32_t KILN_LR_DEPOSIT_INTO_STRATEGY_SELECTOR = 0xe7a050aa; static const uint32_t KILN_LR_QUEUE_WITHDRAWAL_SELECTOR = 0xf123991e; // --- cast sig "queueWithdrawals((address[],uint256[],address)[])" static const uint32_t KILN_LR_QUEUE_WITHDRAWALS_SELECTOR = 0x0dd8dd02; -// --- cast sig "completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]),address[],uint256,bool)" -static const uint32_t KILN_LR_COMPLETE_QUEUED_WITHDRAWAL_SELECTOR = 0x60d7faed; -// --- cast sig "completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[],address[][],uint256[],bool[])" -static const uint32_t KILN_LR_COMPLETE_QUEUED_WITHDRAWALS_SELECTOR = 0x33404396; +// --- cast sig "completeQueuedWithdrawal((address[],uint256[],address,(address,uint96),uint32,address),address[],uint256,bool)" +static const uint32_t KILN_LR_COMPLETE_QUEUED_WITHDRAWAL_SELECTOR = 0xf3be65d3; + const uint32_t KILN_SELECTORS[NUM_SELECTORS] = { @@ -64,5 +63,48 @@ const uint32_t KILN_SELECTORS[NUM_SELECTORS] = { KILN_LR_QUEUE_WITHDRAWAL_SELECTOR, KILN_LR_QUEUE_WITHDRAWALS_SELECTOR, KILN_LR_COMPLETE_QUEUED_WITHDRAWAL_SELECTOR, - KILN_LR_COMPLETE_QUEUED_WITHDRAWALS_SELECTOR }; + + + +const char lr_strategy_addresses[LR_STRATEGIES_COUNT][ADDRESS_STR_LEN] = { + "0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc", // cbETH + "0x93c4b944D05dfe6df7645A86cd2206016c51564D", // stETH + "0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2", // rETH + "0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d", // ETHx + "0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff", // ankrETH + "0xa4C637e0F704745D182e4D38cAb7E7485321d059", // OETH + "0x57ba429517c3473B6d34CA9aCd56c0e735b94c02", // osETH + "0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6", // swETH + "0x7CA911E83dabf90C90dD3De5411a10F1A6112184", // wBETH + "0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6", // sfrxETH + "0x298aFB19A105D59E74658C4C334Ff360BadE6dd2" // mETH +}; + +const char lr_erc20_addresses[LR_STRATEGIES_COUNT][ADDRESS_STR_LEN] = { + "0xBe9895146f7AF43049ca1c1AE358B0541Ea49704", // cbETH + "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84", // stETH + "0xae78736Cd615f374D3085123A210448E74Fc6393", // rETH + "0xA35b1B31Ce002FBF2058D22F30f95D405200A15b", // ETHx + "0xE95A203B1a91a908F9B9CE46459d101078c2c3cb", // ankrETH + "0x856c4Efb76C1D1AE02e20CEB03A2A6a08b0b8dC3", // OETH + "0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38", // osETH + "0xf951E335afb289353dc249e82926178EaC7DEd78", // swETH + "0xa2E3356610840701BDf5611a53974510Ae27E2e1", // wBETH + "0xac3E018457B222d93114458476f3E3416Abbe38F", // sfrxETH + "0xd5F7838F5C461fefF7FE49ea5ebaF7728bB0ADfa", // mETH +}; + +const char lr_tickers[LR_STRATEGIES_COUNT][MAX_TICKER_LEN] = { + "cbETH", + "stETH", + "rETH", + "ETHx", + "ankrETH", + "OETH", + "osETH", + "swETH", + "wBETH", + "sfrxETH", + "mETH" +}; \ No newline at end of file diff --git a/src/handle_finalize.c b/src/handle_finalize.c index 954be99..a48c855 100644 --- a/src/handle_finalize.c +++ b/src/handle_finalize.c @@ -18,12 +18,20 @@ void handle_finalize(ethPluginFinalize_t *msg) { case KILN_V2_REQUEST_EXIT: case KILN_V2_MULTICLAIM: case KILN_V2_CLAIM: + msg->numScreens = 1; + msg->result = ETH_PLUGIN_RESULT_OK; + break; case KILN_LR_ERC20_APPROVE: + msg->numScreens = 2; + msg->result = ETH_PLUGIN_RESULT_OK; + break; case KILN_LR_DEPOSIT_INTO_STRATEGY: + msg->numScreens = 2; + msg->result = ETH_PLUGIN_RESULT_OK; + break; case KILN_LR_QUEUE_WITHDRAWAL: case KILN_LR_QUEUE_WITHDRAWALS: case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: - case KILN_LR_COMPLETE_QUEUED_WITHDRAWALS: msg->numScreens = 1; msg->result = ETH_PLUGIN_RESULT_OK; break; diff --git a/src/handle_init_contract.c b/src/handle_init_contract.c index d98b93f..1dbcbeb 100644 --- a/src/handle_init_contract.c +++ b/src/handle_init_contract.c @@ -41,7 +41,6 @@ void handle_init_contract(ethPluginInitContract_t *msg) { case KILN_V1_WITHDRAW: case KILN_V1_WITHDRAW_EL: case KILN_V1_WITHDRAW_CL: - context->next_param = WITHDRAW_VALIDATION_OFFSET; break; case KILN_V1_BATCH_WITHDRAW: @@ -59,11 +58,16 @@ void handle_init_contract(ethPluginInitContract_t *msg) { break; case KILN_LR_ERC20_APPROVE: + context->next_param = LR_ERC20_APPROVE_SPENDER; + break; case KILN_LR_DEPOSIT_INTO_STRATEGY: + context->next_param = LR_DEPOSIT_INTO_STRATEGY_STRATEGY; + break; case KILN_LR_QUEUE_WITHDRAWAL: + break; case KILN_LR_QUEUE_WITHDRAWALS: + break; case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: - case KILN_LR_COMPLETE_QUEUED_WITHDRAWALS: break; default: diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index a073fc3..deafc50 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -1,5 +1,131 @@ #include "kiln_plugin.h" +/* + * Compare two addresses + * + * @param a: first address + * @param b: second address + * + * @return true if the addresses are the same +*/ +bool compare_addresses(const char *a, const char *b) { + for (size_t i = 0; i < ADDRESS_STR_LEN; i += 1) { + if (tolower((unsigned char)a[i]) != tolower((unsigned char)b[i])) { + return false; + } + } + return true; +} + +/* + * If address is a known erc20, update lr display context with its name + * otherwise set it to "UNKNOWN" + * + * @param address: address to check + * @param context: context to update + * + * @note impacts the following context storage: + * `context->lr_erc20_name`: name of the erc20 +*/ +void find_lr_known_erc20(const char *address, context_t *context) { + for (size_t i = 0; i < LR_STRATEGIES_COUNT; i++) { + if (compare_addresses(address, &lr_erc20_addresses[i])) { + strncpy(context->lr_erc20_name, &lr_tickers[i], MAX_TICKER_LEN); + return; + } + } + // if unknown erc20, indicate it + strncpy(context->lr_erc20_name, "UNKNOWN", MAX_TICKER_LEN); +} + +/* + * If address is a known strategy, update lr display context with its name + * otherwise set it to "UNKNOWN" + * + * @param address: address to check + * @param context: context to update + * + * @note impacts the following context storage: + * `context->lr_strategy_name`: name of the strategy +*/ +void find_lr_known_strategy(const char *address, context_t *context) { + for (size_t i = 0; i < LR_STRATEGIES_COUNT; i++) { + if (compare_addresses(address, &lr_strategy_addresses[i])) { + strncpy(context->lr_strategy_name, &lr_tickers[i], MAX_TICKER_LEN); + return; + } + } + // if unknown strategy, indicate it + strncpy(context->lr_strategy_name, "UNKNOWN", MAX_TICKER_LEN); +} + +/* + * Handle the parameters for the depositIntoStrategy(strategy,erc20,amount) + * selector + * + * @param msg: message containing the parameter + * @param context: context to update + * + * @note impacts the following context storage: + * `context->lr_strategy_address`: address of the strategy + * `context->lr_strategy_name`: name of the strategy + * `context->lr_erc20_address`: address of the erc20 + * `context->lr_erc20_name`: name of the erc20 + * `context->lr_erc20_amount`: amount of the erc20 +*/ +void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t *context) { + uint8_t buffer[ADDRESS_LENGTH]; + + switch (context->next_param) { + case LR_DEPOSIT_INTO_STRATEGY_STRATEGY: + copy_address( + buffer, + msg->parameter, + sizeof(buffer) + ); + getEthDisplayableAddress( + buffer, + context->lr_strategy_address, + sizeof(context->lr_strategy_address), + msg->pluginSharedRW->sha3, + 0 + ); + find_lr_known_strategy(context->lr_strategy_address, context); + + context->next_param = LR_DEPOSIT_INTO_STRATEGY_TOKEN; + break; + case LR_DEPOSIT_INTO_STRATEGY_TOKEN: + copy_address( + buffer, + msg->parameter, + sizeof(buffer) + ); + getEthDisplayableAddress( + buffer, + context->lr_erc20_address, + sizeof(context->lr_erc20_address), + msg->pluginSharedRW->sha3, + 0 + ); + find_lr_known_erc20(context->lr_erc20_address, context); + + context->next_param = LR_DEPOSIT_INTO_STRATEGY_AMOUNT; + break; + case LR_DEPOSIT_INTO_STRATEGY_AMOUNT: + copy_parameter( + context->lr_erc20_amount, + msg->parameter, + sizeof(context->lr_erc20_amount) + ); + context->next_param = LR_DEPOSIT_INTO_STRATEGY_UNEXPECTED_PARAMETER; + break; + default: + PRINTF("Param not supported: %d\n", context->next_param); + msg->result = ETH_PLUGIN_RESULT_ERROR; + break; + } +} + void handle_provide_parameter(ethPluginProvideParameter_t *msg) { context_t *context = (context_t *) msg->pluginContext; @@ -37,12 +163,12 @@ void handle_provide_parameter(ethPluginProvideParameter_t *msg) { msg->result = ETH_PLUGIN_RESULT_OK; break; - case KILN_LR_ERC20_APPROVE: case KILN_LR_DEPOSIT_INTO_STRATEGY: + handle_lr_deposit_into_strategy(msg, context); + break; case KILN_LR_QUEUE_WITHDRAWAL: case KILN_LR_QUEUE_WITHDRAWALS: case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: - case KILN_LR_COMPLETE_QUEUED_WITHDRAWALS: msg->result = ETH_PLUGIN_RESULT_OK; break; diff --git a/src/handle_query_contract_id.c b/src/handle_query_contract_id.c index ee62e7d..19a2488 100644 --- a/src/handle_query_contract_id.c +++ b/src/handle_query_contract_id.c @@ -64,10 +64,6 @@ void handle_query_contract_id(ethQueryContractID_t *msg) { strlcpy(msg->version, "Complete Queued Withdrawal", msg->versionLength); break; - case KILN_LR_COMPLETE_QUEUED_WITHDRAWALS: - strlcpy(msg->version, "Complete Queued Withdrawals", msg->versionLength); - break; - default: PRINTF("Selector Index not supported: %d\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 068dfe9..0b0ab25 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -173,16 +173,25 @@ static bool claim_ui_v2(ethQueryContractUI_t *msg) { return ret; } -static bool erc20_approve_lr(ethQueryContractUI_t *msg) { +static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *context) { bool ret = false; switch (msg->screenIndex) { case 0: - strlcpy(msg->title, "Approve", msg->titleLength); - strlcpy(msg->msg, "LR Token", msg->msgLength); + strlcpy(msg->title, "Strategy", msg->titleLength); + strlcpy(msg->msg, context->lr_strategy_name, MAX_TICKER_LEN); + ret = true; + break; + case 1: + strlcpy(msg->title, "Amount", msg->titleLength); + amountToString(context->lr_erc20_amount, + sizeof(context->lr_erc20_amount), + 2, + context->lr_erc20_name, + msg->msg, + msg->msgLength); ret = true; break; - default: PRINTF("Received an invalid screenIndex\n"); break; @@ -234,8 +243,8 @@ void handle_query_contract_ui(ethQueryContractUI_t *msg) { ret = claim_ui_v2(msg); break; - case KILN_LR_ERC20_APPROVE: - ret = erc20_approve_lr(msg); + case KILN_LR_DEPOSIT_INTO_STRATEGY: + ret = deposit_into_stragey_ui_lr(msg, context); break; default: diff --git a/src/kiln_plugin.h b/src/kiln_plugin.h index dd39a27..15a8e23 100644 --- a/src/kiln_plugin.h +++ b/src/kiln_plugin.h @@ -1,6 +1,7 @@ #pragma once #include +#include #include "eth_internals.h" #include "eth_plugin_interface.h" @@ -32,8 +33,7 @@ // --- 14. queueWithdrawal(uint256[],address[],uint256[],address,bool) // --- 15. queueWithdrawals((address[],uint256[],address)[]) // --- 16. completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]),address[],uint256,bool) -// --- 17. completeQueuedWithdrawals((address,address,address,uint256,uint32,address[],uint256[])[],address[][],uint256[],bool[]) -#define NUM_SELECTORS 18 +#define NUM_SELECTORS 17 // Selectors available (see mapping above). typedef enum { @@ -49,27 +49,56 @@ typedef enum { KILN_V2_REQUEST_EXIT, KILN_V2_MULTICLAIM, KILN_V2_CLAIM, + KILN_LR_ERC20_APPROVE, + KILN_LR_DEPOSIT_INTO_STRATEGY, + KILN_LR_QUEUE_WITHDRAWAL, + KILN_LR_QUEUE_WITHDRAWALS, + KILN_LR_COMPLETE_QUEUED_WITHDRAWAL, } selector_t; +extern const uint32_t KILN_SELECTORS[NUM_SELECTORS]; + +// ADDRESS_STR_LEN is 0x + addr + \0 +#define ADDRESS_STR_LEN 43 + // Parameters for deposit selector. typedef enum { DEPOSIT_UNEXPECTED_PARAMETER, } deposit_parameters; -// Parameters for withdraw selectors (applies to withdraw, withdrawEL, withdrawCL) +// Parameters for LR approve selector. typedef enum { - WITHDRAW_VALIDATION_OFFSET = 0, - WITHDRAW_VALIDATION_LENGTH = 1, - WITHDRAW_VALIDATION_KEY_PART_1 = 2, // BLS keys are 48 bytes, thus they are - WITHDRAW_VALIDATION_KEY_PART_2 = 3, // taking 2x32 bytes parameters. - WITHDRAW_UNEXPECTED_PARAMETER, -} withdraw_parameters; + LR_ERC20_APPROVE_SPENDER = 0, + LR_ERC20_APPROVE_AMOUNT, + LR_ERC20_APPROVE_UNEXPECTED_PARAMETER, +} lr_approve_parameters; -extern const uint32_t KILN_SELECTORS[NUM_SELECTORS]; +// Parameters for LR deposit into strategy selector. +typedef enum { + LR_DEPOSIT_INTO_STRATEGY_STRATEGY = 0, + LR_DEPOSIT_INTO_STRATEGY_TOKEN, + LR_DEPOSIT_INTO_STRATEGY_AMOUNT, + LR_DEPOSIT_INTO_STRATEGY_UNEXPECTED_PARAMETER, +} lr_deposit_into_strategy_parameters; + +#define LR_STRATEGIES_COUNT 11 + +extern const char lr_strategy_addresses[LR_STRATEGIES_COUNT][ADDRESS_STR_LEN]; +extern const char lr_erc20_addresses[LR_STRATEGIES_COUNT][ADDRESS_STR_LEN]; +extern const char lr_tickers[LR_STRATEGIES_COUNT][MAX_TICKER_LEN]; typedef struct context_t { uint8_t next_param; + // parameters for LR functions + char lr_strategy_address[ADDRESS_STR_LEN]; + char lr_strategy_name[MAX_TICKER_LEN]; + + char lr_erc20_address[ADDRESS_STR_LEN]; + char lr_erc20_name[MAX_TICKER_LEN]; + uint8_t lr_erc20_amount[INT256_LENGTH]; + + selector_t selectorIndex; } context_t; diff --git a/tests/cal/abis/0x858646372cc42e1a627fce94aa7a7033e7cf075a.json b/tests/cal/abis/0x858646372cc42e1a627fce94aa7a7033e7cf075a.json new file mode 100644 index 0000000..510f70b --- /dev/null +++ b/tests/cal/abis/0x858646372cc42e1a627fce94aa7a7033e7cf075a.json @@ -0,0 +1,25 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "strategy", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "depositIntoStrategy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/tests/cal/b2c.json b/tests/cal/b2c.json index 632e9ce..256dc9c 100644 --- a/tests/cal/b2c.json +++ b/tests/cal/b2c.json @@ -70,6 +70,16 @@ "plugin": "Kiln" } } + }, + { + "address": "0x858646372cc42e1a627fce94aa7a7033e7cf075a", + "contractName": "EigenLayerStrategyManager", + "selectors": { + "0xe7a050aa": { + "method": "depositIntoStrategy", + "plugin": "Kiln" + } + } } ], "name": "Kiln" diff --git a/tests/src/approve.test.js b/tests/src/approve.test.js new file mode 100644 index 0000000..46890ea --- /dev/null +++ b/tests/src/approve.test.js @@ -0,0 +1,63 @@ +import 'core-js/stable'; +import 'regenerator-runtime/runtime'; +import { + waitForAppScreen, + kilnJSON, + zemu, + genericTx, + nano_models, + SPECULOS_ADDRESS, + txFromEtherscan, +} from './test.fixture'; +import { ethers } from 'ethers'; +import { parseEther, parseUnits } from 'ethers/lib/utils'; +import { ledgerService } from '@ledgerhq/hw-app-eth'; + +const contractAddr = '0x858646372cc42e1a627fce94aa7a7033e7cf075a'; + +const pluginName = 'Kiln'; +const abi_path = `../cal/abis/${contractAddr}.json`; +const abi = require(abi_path); + +nano_models.forEach(function (model) { + test( + '[Nano ' + model.letter + '] Deposit Into Strategy ', + zemu(model, async (sim, eth) => { + const contract = new ethers.Contract(contractAddr, abi); + + const { data } = await contract.populateTransaction.depositIntoStrategy( + '0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2', + '0xae78736Cd615f374D3085123A210448E74Fc6393', + 42 + ); + + let unsignedTx = genericTx; + + unsignedTx.to = contractAddr; + unsignedTx.data = data; + unsignedTx.value = parseEther('0'); + + const serializedTx = ethers.utils + .serializeTransaction(unsignedTx) + .slice(2); + const resolution = await ledgerService.resolveTransaction( + serializedTx, + eth.loadConfig, + { + externalPlugins: true, + } + ); + const tx = eth.signTransaction("44'/60'/0'/0", serializedTx, resolution); + const right_clicks = 6; + + await waitForAppScreen(sim); + await sim.navigateAndCompareSnapshots( + '.', + model.name + '_depositIntoStrategy', + [right_clicks, 0] + ); + await tx; + }), + 30000 + ); +}); From beac95ead5866ae9004bf90a4e3d3c05b6ea6159 Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Fri, 2 Feb 2024 09:09:29 +0100 Subject: [PATCH 06/33] feat: add LR display buffer support --- src/handle_init_contract.c | 1 + src/handle_provide_parameter.c | 55 ++++++++++++++++++---------------- src/handle_query_contract_ui.c | 19 +++++++----- src/kiln_plugin.h | 15 +++++----- tests/src/approve.test.js | 4 +-- 5 files changed, 52 insertions(+), 42 deletions(-) diff --git a/src/handle_init_contract.c b/src/handle_init_contract.c index 1dbcbeb..729be17 100644 --- a/src/handle_init_contract.c +++ b/src/handle_init_contract.c @@ -61,6 +61,7 @@ void handle_init_contract(ethPluginInitContract_t *msg) { context->next_param = LR_ERC20_APPROVE_SPENDER; break; case KILN_LR_DEPOSIT_INTO_STRATEGY: + context->lr_display_buffer_size = 1; context->next_param = LR_DEPOSIT_INTO_STRATEGY_STRATEGY; break; case KILN_LR_QUEUE_WITHDRAWAL: diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index deafc50..da43628 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -19,44 +19,46 @@ bool compare_addresses(const char *a, const char *b) { /* * If address is a known erc20, update lr display context with its name - * otherwise set it to "UNKNOWN" + * otherwise set it to unkwown (-1) * - * @param address: address to check + * @param address: address to compare + * @param index: index of the erc20 in the context * @param context: context to update * * @note impacts the following context storage: - * `context->lr_erc20_name`: name of the erc20 + * `context->lr_strategy_to_display`: set index of the erc20 in the context */ -void find_lr_known_erc20(const char *address, context_t *context) { +void find_lr_known_erc20(const char *address, size_t index, context_t *context) { for (size_t i = 0; i < LR_STRATEGIES_COUNT; i++) { if (compare_addresses(address, &lr_erc20_addresses[i])) { - strncpy(context->lr_erc20_name, &lr_tickers[i], MAX_TICKER_LEN); + context->lr_erc20_to_display[index] = i; return; } } // if unknown erc20, indicate it - strncpy(context->lr_erc20_name, "UNKNOWN", MAX_TICKER_LEN); + context->lr_erc20_to_display[index] = -1; } /* * If address is a known strategy, update lr display context with its name - * otherwise set it to "UNKNOWN" + * otherwise set it to unkwown (-1) * - * @param address: address to check + * @param address: address to compare + * @param index: index of the strategy in the context * @param context: context to update * - * @note impacts the following context storage: - * `context->lr_strategy_name`: name of the strategy + * @note impacts the following context storage: + * `context->lr_strategy_to_display`: set index of the strategy in the context */ -void find_lr_known_strategy(const char *address, context_t *context) { +void find_lr_known_strategy(const char *address, size_t index, context_t *context) { for (size_t i = 0; i < LR_STRATEGIES_COUNT; i++) { if (compare_addresses(address, &lr_strategy_addresses[i])) { - strncpy(context->lr_strategy_name, &lr_tickers[i], MAX_TICKER_LEN); + context->lr_strategy_to_display[index] = i; return; } } // if unknown strategy, indicate it - strncpy(context->lr_strategy_name, "UNKNOWN", MAX_TICKER_LEN); + context->lr_strategy_to_display[index] = -1; } /* @@ -67,14 +69,15 @@ void find_lr_known_strategy(const char *address, context_t *context) { * @param context: context to update * * @note impacts the following context storage: - * `context->lr_strategy_address`: address of the strategy - * `context->lr_strategy_name`: name of the strategy - * `context->lr_erc20_address`: address of the erc20 - * `context->lr_erc20_name`: name of the erc20 - * `context->lr_erc20_amount`: amount of the erc20 + * `context->next_param`: set to the next parameter to handle + * `context->lr_strategy_to_display`: set index of the strategy in the context + * `context->lr_erc20_to_display`: set index of the erc20 in the context + * `context->lr_erc20_amount_to_display`: set amount of the erc20 in the context + * */ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t *context) { uint8_t buffer[ADDRESS_LENGTH]; + char address_buffer[ADDRESS_STR_LEN]; switch (context->next_param) { case LR_DEPOSIT_INTO_STRATEGY_STRATEGY: @@ -85,12 +88,12 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t ); getEthDisplayableAddress( buffer, - context->lr_strategy_address, - sizeof(context->lr_strategy_address), + address_buffer, + sizeof(address_buffer), msg->pluginSharedRW->sha3, 0 ); - find_lr_known_strategy(context->lr_strategy_address, context); + find_lr_known_strategy(&address_buffer, 0, context); context->next_param = LR_DEPOSIT_INTO_STRATEGY_TOKEN; break; @@ -102,20 +105,20 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t ); getEthDisplayableAddress( buffer, - context->lr_erc20_address, - sizeof(context->lr_erc20_address), + address_buffer, + sizeof(address_buffer), msg->pluginSharedRW->sha3, 0 ); - find_lr_known_erc20(context->lr_erc20_address, context); + find_lr_known_erc20(&address_buffer, 0, context); context->next_param = LR_DEPOSIT_INTO_STRATEGY_AMOUNT; break; case LR_DEPOSIT_INTO_STRATEGY_AMOUNT: copy_parameter( - context->lr_erc20_amount, + context->lr_erc20_amount_to_display[0], msg->parameter, - sizeof(context->lr_erc20_amount) + sizeof(context->lr_erc20_amount_to_display[0]) ); context->next_param = LR_DEPOSIT_INTO_STRATEGY_UNEXPECTED_PARAMETER; break; diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 0b0ab25..6233c3b 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -179,17 +179,22 @@ static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *con switch (msg->screenIndex) { case 0: strlcpy(msg->title, "Strategy", msg->titleLength); - strlcpy(msg->msg, context->lr_strategy_name, MAX_TICKER_LEN); + if (context->lr_strategy_to_display[0] == -1) { + strlcpy(msg->msg, "UNKNOWN", msg->msgLength); + } else { + strlcpy(msg->msg, lr_tickers[context->lr_strategy_to_display[0]], MAX_TICKER_LEN); + } ret = true; break; case 1: strlcpy(msg->title, "Amount", msg->titleLength); - amountToString(context->lr_erc20_amount, - sizeof(context->lr_erc20_amount), - 2, - context->lr_erc20_name, - msg->msg, - msg->msgLength); + amountToString(context->lr_erc20_amount_to_display[0], + sizeof(context->lr_erc20_amount_to_display[0]), + 2, + context->lr_erc20_to_display[0] == -1 ? + "UNKNOWN" : lr_tickers[context->lr_erc20_to_display[0]], + msg->msg, + msg->msgLength); ret = true; break; default: diff --git a/src/kiln_plugin.h b/src/kiln_plugin.h index 15a8e23..a43cc66 100644 --- a/src/kiln_plugin.h +++ b/src/kiln_plugin.h @@ -87,16 +87,17 @@ extern const char lr_strategy_addresses[LR_STRATEGIES_COUNT][ADDRESS_STR_LEN]; extern const char lr_erc20_addresses[LR_STRATEGIES_COUNT][ADDRESS_STR_LEN]; extern const char lr_tickers[LR_STRATEGIES_COUNT][MAX_TICKER_LEN]; +// max number of strategies / erc20 to display +#define MAX_DISPLAY_COUNT 3 + typedef struct context_t { uint8_t next_param; - // parameters for LR functions - char lr_strategy_address[ADDRESS_STR_LEN]; - char lr_strategy_name[MAX_TICKER_LEN]; - - char lr_erc20_address[ADDRESS_STR_LEN]; - char lr_erc20_name[MAX_TICKER_LEN]; - uint8_t lr_erc20_amount[INT256_LENGTH]; + // buffers for LR display + int lr_strategy_to_display[MAX_DISPLAY_COUNT]; + int lr_erc20_to_display[MAX_DISPLAY_COUNT]; + uint8_t lr_erc20_amount_to_display[MAX_DISPLAY_COUNT][INT256_LENGTH]; + size_t lr_display_buffer_size; selector_t selectorIndex; diff --git a/tests/src/approve.test.js b/tests/src/approve.test.js index 46890ea..d4c94c4 100644 --- a/tests/src/approve.test.js +++ b/tests/src/approve.test.js @@ -26,8 +26,8 @@ nano_models.forEach(function (model) { const contract = new ethers.Contract(contractAddr, abi); const { data } = await contract.populateTransaction.depositIntoStrategy( - '0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2', - '0xae78736Cd615f374D3085123A210448E74Fc6393', + '0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6', + '0x1e68238ce926dec62b3fbc99ab06eb1d85ce0270', 42 ); From 6525dcfba70731c33d28b69dd45824df61620690 Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Fri, 2 Feb 2024 10:33:08 +0100 Subject: [PATCH 07/33] fix: depositIntoStrategy tests --- tests/src/approve.test.js | 63 ----------- tests/src/lrDepositIntoStrategy.test.js | 143 ++++++++++++++++++++++++ 2 files changed, 143 insertions(+), 63 deletions(-) delete mode 100644 tests/src/approve.test.js create mode 100644 tests/src/lrDepositIntoStrategy.test.js diff --git a/tests/src/approve.test.js b/tests/src/approve.test.js deleted file mode 100644 index d4c94c4..0000000 --- a/tests/src/approve.test.js +++ /dev/null @@ -1,63 +0,0 @@ -import 'core-js/stable'; -import 'regenerator-runtime/runtime'; -import { - waitForAppScreen, - kilnJSON, - zemu, - genericTx, - nano_models, - SPECULOS_ADDRESS, - txFromEtherscan, -} from './test.fixture'; -import { ethers } from 'ethers'; -import { parseEther, parseUnits } from 'ethers/lib/utils'; -import { ledgerService } from '@ledgerhq/hw-app-eth'; - -const contractAddr = '0x858646372cc42e1a627fce94aa7a7033e7cf075a'; - -const pluginName = 'Kiln'; -const abi_path = `../cal/abis/${contractAddr}.json`; -const abi = require(abi_path); - -nano_models.forEach(function (model) { - test( - '[Nano ' + model.letter + '] Deposit Into Strategy ', - zemu(model, async (sim, eth) => { - const contract = new ethers.Contract(contractAddr, abi); - - const { data } = await contract.populateTransaction.depositIntoStrategy( - '0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6', - '0x1e68238ce926dec62b3fbc99ab06eb1d85ce0270', - 42 - ); - - let unsignedTx = genericTx; - - unsignedTx.to = contractAddr; - unsignedTx.data = data; - unsignedTx.value = parseEther('0'); - - const serializedTx = ethers.utils - .serializeTransaction(unsignedTx) - .slice(2); - const resolution = await ledgerService.resolveTransaction( - serializedTx, - eth.loadConfig, - { - externalPlugins: true, - } - ); - const tx = eth.signTransaction("44'/60'/0'/0", serializedTx, resolution); - const right_clicks = 6; - - await waitForAppScreen(sim); - await sim.navigateAndCompareSnapshots( - '.', - model.name + '_depositIntoStrategy', - [right_clicks, 0] - ); - await tx; - }), - 30000 - ); -}); diff --git a/tests/src/lrDepositIntoStrategy.test.js b/tests/src/lrDepositIntoStrategy.test.js new file mode 100644 index 0000000..9bbff59 --- /dev/null +++ b/tests/src/lrDepositIntoStrategy.test.js @@ -0,0 +1,143 @@ +import 'core-js/stable'; +import 'regenerator-runtime/runtime'; +import { + waitForAppScreen, + kilnJSON, + zemu, + genericTx, + nano_models, + SPECULOS_ADDRESS, + txFromEtherscan, +} from './test.fixture'; +import { ethers } from 'ethers'; +import { parseEther, parseUnits } from 'ethers/lib/utils'; +import { ledgerService } from '@ledgerhq/hw-app-eth'; + +const contractAddr = '0x858646372cc42e1a627fce94aa7a7033e7cf075a'; + +const pluginName = 'Kiln'; +const abi_path = `../cal/abis/${contractAddr}.json`; +const abi = require(abi_path); +const right_clicks = 5; + +nano_models.forEach(function (model) { + test( + '[Nano ' + model.letter + '] Deposit Into Strategy Normal', + zemu(model, async (sim, eth) => { + const contract = new ethers.Contract(contractAddr, abi); + + const { data } = await contract.populateTransaction.depositIntoStrategy( + '0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d', // ETHx strat + '0xA35b1B31Ce002FBF2058D22F30f95D405200A15b', // ETHx erc20 + 42 + ); + + let unsignedTx = genericTx; + + unsignedTx.to = contractAddr; + unsignedTx.data = data; + unsignedTx.value = parseEther('0'); + + const serializedTx = ethers.utils + .serializeTransaction(unsignedTx) + .slice(2); + const resolution = await ledgerService.resolveTransaction( + serializedTx, + eth.loadConfig, + { + externalPlugins: true, + } + ); + const tx = eth.signTransaction("44'/60'/0'/0", serializedTx, resolution); + + await waitForAppScreen(sim); + await sim.navigateAndCompareSnapshots( + '.', + model.name + '_lrDepositIntoStrategyNormal', + [right_clicks, 0] + ); + await tx; + }), + 30000 + ); + + test( + '[Nano ' + model.letter + '] Deposit Into Strategy Unknown strategy', + zemu(model, async (sim, eth) => { + const contract = new ethers.Contract(contractAddr, abi); + + const { data } = await contract.populateTransaction.depositIntoStrategy( + '0x1e68238ce926dec62b3fbc99ab06eb1d85ce0270', // unknown strat + '0xac3E018457B222d93114458476f3E3416Abbe38F', // sfrxETH erc20 + 42 + ); + + let unsignedTx = genericTx; + + unsignedTx.to = contractAddr; + unsignedTx.data = data; + unsignedTx.value = parseEther('0'); + + const serializedTx = ethers.utils + .serializeTransaction(unsignedTx) + .slice(2); + const resolution = await ledgerService.resolveTransaction( + serializedTx, + eth.loadConfig, + { + externalPlugins: true, + } + ); + const tx = eth.signTransaction("44'/60'/0'/0", serializedTx, resolution); + + await waitForAppScreen(sim); + await sim.navigateAndCompareSnapshots( + '.', + model.name + '_lrDepositIntoStrategyUnknownStrategy', + [right_clicks, 0] + ); + await tx; + }), + 30000 + ); + + test( + '[Nano ' + model.letter + '] Deposit Into Strategy Unknown erc20', + zemu(model, async (sim, eth) => { + const contract = new ethers.Contract(contractAddr, abi); + + const { data } = await contract.populateTransaction.depositIntoStrategy( + '0x298aFB19A105D59E74658C4C334Ff360BadE6dd2', // mETH strategy + '0x1e68238ce926dec62b3fbc99ab06eb1d85ce0270', // sfrxETH erc20 + 42 + ); + + let unsignedTx = genericTx; + + unsignedTx.to = contractAddr; + unsignedTx.data = data; + unsignedTx.value = parseEther('0'); + + const serializedTx = ethers.utils + .serializeTransaction(unsignedTx) + .slice(2); + const resolution = await ledgerService.resolveTransaction( + serializedTx, + eth.loadConfig, + { + externalPlugins: true, + } + ); + const tx = eth.signTransaction("44'/60'/0'/0", serializedTx, resolution); + + await waitForAppScreen(sim); + await sim.navigateAndCompareSnapshots( + '.', + model.name + '_lrDepositIntoStrategyUnknownERC20', + [right_clicks, 0] + ); + await tx; + }), + 30000 + ); +}); From 001dbe0723e256822d369197bf16c61bb1609d7b Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Fri, 2 Feb 2024 11:17:18 +0100 Subject: [PATCH 08/33] feat: queue withdrawal placeholder --- src/contract.c | 6 -- src/handle_finalize.c | 7 +- src/handle_init_contract.c | 4 +- src/handle_provide_parameter.c | 26 +++++++ src/handle_query_contract_id.c | 4 -- src/handle_query_contract_ui.c | 22 ++++++ src/kiln_plugin.h | 29 ++++---- ...646372cc42e1a627fce94aa7a7033e7cf075a.json | 33 +++++++++ tests/cal/b2c.json | 4 ++ tests/src/lrQueueWithdrawal.test.js | 68 +++++++++++++++++++ 10 files changed, 172 insertions(+), 31 deletions(-) create mode 100644 tests/src/lrQueueWithdrawal.test.js diff --git a/src/contract.c b/src/contract.c index ec8cab7..d55a2be 100644 --- a/src/contract.c +++ b/src/contract.c @@ -29,14 +29,10 @@ static const uint32_t KILN_V2_MULTICLAIM_SELECTOR = 0xb7ba18c7; static const uint32_t KILN_V2_CLAIM_SELECTOR = 0xadcf1163; // RESTAKING - Liquid Restaking -// --- cast sig "approve(address,uint256)" -static const uint32_t KILN_LR_ERC20_APPROVE_SELECTOR = 0x095ea7b3; // --- cast sig "depositIntoStrategy(address,address,uint256)" static const uint32_t KILN_LR_DEPOSIT_INTO_STRATEGY_SELECTOR = 0xe7a050aa; // --- cast sig "queueWithdrawal(uint256[],address[],uint256[],address,bool)" static const uint32_t KILN_LR_QUEUE_WITHDRAWAL_SELECTOR = 0xf123991e; -// --- cast sig "queueWithdrawals((address[],uint256[],address)[])" -static const uint32_t KILN_LR_QUEUE_WITHDRAWALS_SELECTOR = 0x0dd8dd02; // --- cast sig "completeQueuedWithdrawal((address[],uint256[],address,(address,uint96),uint32,address),address[],uint256,bool)" static const uint32_t KILN_LR_COMPLETE_QUEUED_WITHDRAWAL_SELECTOR = 0xf3be65d3; @@ -58,10 +54,8 @@ const uint32_t KILN_SELECTORS[NUM_SELECTORS] = { KILN_V2_MULTICLAIM_SELECTOR, KILN_V2_CLAIM_SELECTOR, // LR - KILN_LR_ERC20_APPROVE_SELECTOR, KILN_LR_DEPOSIT_INTO_STRATEGY_SELECTOR, KILN_LR_QUEUE_WITHDRAWAL_SELECTOR, - KILN_LR_QUEUE_WITHDRAWALS_SELECTOR, KILN_LR_COMPLETE_QUEUED_WITHDRAWAL_SELECTOR, }; diff --git a/src/handle_finalize.c b/src/handle_finalize.c index a48c855..78c42cc 100644 --- a/src/handle_finalize.c +++ b/src/handle_finalize.c @@ -21,15 +21,14 @@ void handle_finalize(ethPluginFinalize_t *msg) { msg->numScreens = 1; msg->result = ETH_PLUGIN_RESULT_OK; break; - case KILN_LR_ERC20_APPROVE: - msg->numScreens = 2; - msg->result = ETH_PLUGIN_RESULT_OK; - break; case KILN_LR_DEPOSIT_INTO_STRATEGY: msg->numScreens = 2; msg->result = ETH_PLUGIN_RESULT_OK; break; case KILN_LR_QUEUE_WITHDRAWAL: + msg->numScreens = 1; + msg->result = ETH_PLUGIN_RESULT_OK; + break; case KILN_LR_QUEUE_WITHDRAWALS: case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: msg->numScreens = 1; diff --git a/src/handle_init_contract.c b/src/handle_init_contract.c index 729be17..0504e87 100644 --- a/src/handle_init_contract.c +++ b/src/handle_init_contract.c @@ -57,14 +57,12 @@ void handle_init_contract(ethPluginInitContract_t *msg) { case KILN_V2_CLAIM: break; - case KILN_LR_ERC20_APPROVE: - context->next_param = LR_ERC20_APPROVE_SPENDER; - break; case KILN_LR_DEPOSIT_INTO_STRATEGY: context->lr_display_buffer_size = 1; context->next_param = LR_DEPOSIT_INTO_STRATEGY_STRATEGY; break; case KILN_LR_QUEUE_WITHDRAWAL: + context->next_param = LR_QUEUE_WITHDRAWAL_STRATEGY_INDEXES_OFFSET; break; case KILN_LR_QUEUE_WITHDRAWALS: break; diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index da43628..00e42dc 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -129,6 +129,30 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t } } +void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *context) { + switch (context->next_param) { + case LR_QUEUE_WITHDRAWAL_STRATEGY_INDEXES_OFFSET: + context->next_param = LR_QUEUE_WITHDRAWAL_STRATEGIES_OFFSET; + break; + case LR_QUEUE_WITHDRAWAL_STRATEGIES_OFFSET: + context->next_param = LR_QUEUE_WITHDRAWAL_SHARES_OFFSET; + break; + case LR_QUEUE_WITHDRAWAL_SHARES_OFFSET: + context->next_param = LR_QUEUE_WITHDRAWAL_WITHDRAWER; + break; + case LR_QUEUE_WITHDRAWAL_WITHDRAWER: + context->next_param = LR_QUEUE_WITHDRAWAL_UNDELEGATEIFPOSSIBLE; + break; + case LR_QUEUE_WITHDRAWAL_UNDELEGATEIFPOSSIBLE: + context->next_param = LR_QUEUE_WITHDRAWAL_UNEXPECTED_PARAMETER; + break; + default: + PRINTF("Param not supported: %d\n", context->next_param); + //msg->result = ETH_PLUGIN_RESULT_ERROR; + break; + } +} + void handle_provide_parameter(ethPluginProvideParameter_t *msg) { context_t *context = (context_t *) msg->pluginContext; @@ -170,6 +194,8 @@ void handle_provide_parameter(ethPluginProvideParameter_t *msg) { handle_lr_deposit_into_strategy(msg, context); break; case KILN_LR_QUEUE_WITHDRAWAL: + handle_lr_queue_withdrawal(msg, context); + break; case KILN_LR_QUEUE_WITHDRAWALS: case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: msg->result = ETH_PLUGIN_RESULT_OK; diff --git a/src/handle_query_contract_id.c b/src/handle_query_contract_id.c index 19a2488..37c9256 100644 --- a/src/handle_query_contract_id.c +++ b/src/handle_query_contract_id.c @@ -44,10 +44,6 @@ void handle_query_contract_id(ethQueryContractID_t *msg) { strlcpy(msg->version, "Claim", msg->versionLength); break; - case KILN_LR_ERC20_APPROVE: - strlcpy(msg->version, "ERC20 Approve", msg->versionLength); - break; - case KILN_LR_DEPOSIT_INTO_STRATEGY: strlcpy(msg->version, "Deposit In Strategy", msg->versionLength); break; diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 6233c3b..2a4f504 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -204,6 +204,24 @@ static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *con return ret; } +bool queue_withdrawal_ui_lr(ethQueryContractUI_t *msg, context_t *context) { + // TODO: display strategies + bool ret = false; + + switch (msg->screenIndex) { + case 0: + strlcpy(msg->title, "Liquid Restaking", msg->titleLength); + strlcpy(msg->msg, "Queue Withdrawal", msg->msgLength); + ret = true; + break; + + default: + PRINTF("Received an invalid screenIndex\n"); + break; + } + return ret; +} + void handle_query_contract_ui(ethQueryContractUI_t *msg) { context_t *context = (context_t *) msg->pluginContext; bool ret = false; @@ -252,6 +270,10 @@ void handle_query_contract_ui(ethQueryContractUI_t *msg) { ret = deposit_into_stragey_ui_lr(msg, context); break; + case KILN_LR_QUEUE_WITHDRAWAL: + ret = queue_withdrawal_ui_lr(msg, context); + break; + default: PRINTF("Selector Index not supported: %d\n", context->selectorIndex); break; diff --git a/src/kiln_plugin.h b/src/kiln_plugin.h index a43cc66..8c838f2 100644 --- a/src/kiln_plugin.h +++ b/src/kiln_plugin.h @@ -28,12 +28,11 @@ // --- 11. claim(uint256[],uint32[],uint16) // // LR selectors -// --- 12. approve(address,uint256) -// --- 13. depositIntoStrategy(address,address,uint256) -// --- 14. queueWithdrawal(uint256[],address[],uint256[],address,bool) -// --- 15. queueWithdrawals((address[],uint256[],address)[]) -// --- 16. completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]),address[],uint256,bool) -#define NUM_SELECTORS 17 +// --- 12. depositIntoStrategy(address,address,uint256) +// --- 13. queueWithdrawal(uint256[],address[],uint256[],address,bool) +// --- 14. queueWithdrawals((address[],uint256[],address)[]) +// --- 15. completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]),address[],uint256,bool) +#define NUM_SELECTORS 16 // Selectors available (see mapping above). typedef enum { @@ -49,7 +48,6 @@ typedef enum { KILN_V2_REQUEST_EXIT, KILN_V2_MULTICLAIM, KILN_V2_CLAIM, - KILN_LR_ERC20_APPROVE, KILN_LR_DEPOSIT_INTO_STRATEGY, KILN_LR_QUEUE_WITHDRAWAL, KILN_LR_QUEUE_WITHDRAWALS, @@ -66,13 +64,6 @@ typedef enum { DEPOSIT_UNEXPECTED_PARAMETER, } deposit_parameters; -// Parameters for LR approve selector. -typedef enum { - LR_ERC20_APPROVE_SPENDER = 0, - LR_ERC20_APPROVE_AMOUNT, - LR_ERC20_APPROVE_UNEXPECTED_PARAMETER, -} lr_approve_parameters; - // Parameters for LR deposit into strategy selector. typedef enum { LR_DEPOSIT_INTO_STRATEGY_STRATEGY = 0, @@ -81,6 +72,16 @@ typedef enum { LR_DEPOSIT_INTO_STRATEGY_UNEXPECTED_PARAMETER, } lr_deposit_into_strategy_parameters; +// Parameters for LR queue withdrawal selector. +typedef enum { + LR_QUEUE_WITHDRAWAL_STRATEGY_INDEXES_OFFSET = 0, + LR_QUEUE_WITHDRAWAL_STRATEGIES_OFFSET, + LR_QUEUE_WITHDRAWAL_SHARES_OFFSET, + LR_QUEUE_WITHDRAWAL_WITHDRAWER, + LR_QUEUE_WITHDRAWAL_UNDELEGATEIFPOSSIBLE, + LR_QUEUE_WITHDRAWAL_UNEXPECTED_PARAMETER +} lr_queue_withdrawal_parameters; + #define LR_STRATEGIES_COUNT 11 extern const char lr_strategy_addresses[LR_STRATEGIES_COUNT][ADDRESS_STR_LEN]; diff --git a/tests/cal/abis/0x858646372cc42e1a627fce94aa7a7033e7cf075a.json b/tests/cal/abis/0x858646372cc42e1a627fce94aa7a7033e7cf075a.json index 510f70b..7914d5e 100644 --- a/tests/cal/abis/0x858646372cc42e1a627fce94aa7a7033e7cf075a.json +++ b/tests/cal/abis/0x858646372cc42e1a627fce94aa7a7033e7cf075a.json @@ -21,5 +21,38 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256[]", + "name": "strategyIndexes", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "strategies", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "shares", + "type": "uint256[]" + }, + { + "internalType": "address", + "name": "withdrawer", + "type": "address" + }, + { + "internalType": "bool", + "name": "undelegateIfPossible", + "type": "bool" + } + ], + "name": "queueWithdrawal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" } ] \ No newline at end of file diff --git a/tests/cal/b2c.json b/tests/cal/b2c.json index 256dc9c..362449d 100644 --- a/tests/cal/b2c.json +++ b/tests/cal/b2c.json @@ -78,6 +78,10 @@ "0xe7a050aa": { "method": "depositIntoStrategy", "plugin": "Kiln" + }, + "0xf123991e": { + "method": "queueWithdrawal", + "plugin": "Kiln" } } } diff --git a/tests/src/lrQueueWithdrawal.test.js b/tests/src/lrQueueWithdrawal.test.js new file mode 100644 index 0000000..f1e120c --- /dev/null +++ b/tests/src/lrQueueWithdrawal.test.js @@ -0,0 +1,68 @@ +import 'core-js/stable'; +import 'regenerator-runtime/runtime'; +import { + waitForAppScreen, + kilnJSON, + zemu, + genericTx, + nano_models, + SPECULOS_ADDRESS, + txFromEtherscan, +} from './test.fixture'; +import { ethers } from 'ethers'; +import { parseEther, parseUnits } from 'ethers/lib/utils'; +import { ledgerService } from '@ledgerhq/hw-app-eth'; + +const contractAddr = '0x858646372CC42E1A627fcE94aa7A7033e7CF075A'; + +const pluginName = 'Kiln'; +const abi_path = `../cal/abis/${contractAddr}.json`; +const abi = require(abi_path); + +nano_models.forEach(function (model) { + test( + '[Nano ' + model.letter + '] Stake Eth', + zemu(model, async (sim, eth) => { + const contract = new ethers.Contract(contractAddr, abi); + + const { data } = await contract.populateTransaction.queueWithdrawal( + [1, 2], + [ + '0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc', // cbETH strat + '0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff', // ankrETH strat + ], + [42, 54], + '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', // withdrawer + true // undelegateIfPossible + ); + + let unsignedTx = genericTx; + + unsignedTx.to = contractAddr; + unsignedTx.data = data; + unsignedTx.value = parseEther('0'); + + const serializedTx = ethers.utils + .serializeTransaction(unsignedTx) + .slice(2); + const resolution = await ledgerService.resolveTransaction( + serializedTx, + eth.loadConfig, + { + externalPlugins: true, + } + ); + const tx = eth.signTransaction("44'/60'/0'/0", serializedTx, resolution); + const right_clicks = 4; + + await waitForAppScreen(sim); + await sim.navigateAndCompareSnapshots( + '.', + model.name + '_lrQueueWithdrawal', + [right_clicks, 0] + ); + await tx; + }), + 30000 + ); +}); From fc7314944d9784c16f946e7ad486fee7751052a8 Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Fri, 2 Feb 2024 14:28:12 +0100 Subject: [PATCH 09/33] feat: complete queue withdrawal placeholder --- src/handle_finalize.c | 1 - src/handle_init_contract.c | 3 +- src/handle_provide_parameter.c | 25 +++++- src/handle_query_contract_id.c | 6 +- src/handle_query_contract_ui.c | 26 +++++- src/kiln_plugin.h | 15 +++- ...646372cc42e1a627fce94aa7a7033e7cf075a.json | 72 +++++++++++++++ tests/cal/b2c.json | 4 + tests/src/lrCompleteQueuedWithdrawal.test.js | 88 +++++++++++++++++++ tests/src/lrDepositIntoStrategy.test.js | 2 +- tests/src/lrQueueWithdrawal.test.js | 2 +- 11 files changed, 227 insertions(+), 17 deletions(-) create mode 100644 tests/src/lrCompleteQueuedWithdrawal.test.js diff --git a/src/handle_finalize.c b/src/handle_finalize.c index 78c42cc..159a9eb 100644 --- a/src/handle_finalize.c +++ b/src/handle_finalize.c @@ -29,7 +29,6 @@ void handle_finalize(ethPluginFinalize_t *msg) { msg->numScreens = 1; msg->result = ETH_PLUGIN_RESULT_OK; break; - case KILN_LR_QUEUE_WITHDRAWALS: case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: msg->numScreens = 1; msg->result = ETH_PLUGIN_RESULT_OK; diff --git a/src/handle_init_contract.c b/src/handle_init_contract.c index 0504e87..147f8f5 100644 --- a/src/handle_init_contract.c +++ b/src/handle_init_contract.c @@ -64,9 +64,8 @@ void handle_init_contract(ethPluginInitContract_t *msg) { case KILN_LR_QUEUE_WITHDRAWAL: context->next_param = LR_QUEUE_WITHDRAWAL_STRATEGY_INDEXES_OFFSET; break; - case KILN_LR_QUEUE_WITHDRAWALS: - break; case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: + context->next_param = LR_COMPLETE_QUEUED_WITHDRAWAL_QUEUEDWITHDRAWAL_OFFSET; break; default: diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index 00e42dc..239a209 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -153,6 +153,27 @@ void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *con } } +void handle_lr_complete_queued_withdrawal(ethPluginProvideParameter_t *msg, context_t *context) { + switch (context->next_param) { + case LR_COMPLETE_QUEUED_WITHDRAWAL_QUEUEDWITHDRAWAL_OFFSET: + context->next_param = LR_COMPLETE_QUEUED_WITHDRAWAL_TOKENS_OFFSET; + break; + case LR_COMPLETE_QUEUED_WITHDRAWAL_TOKENS_OFFSET: + context->next_param = LR_COMPLETE_QUEUED_WITHDRAWAL_MIDDLEWARETIMEINDEX; + break; + case LR_COMPLETE_QUEUED_WITHDRAWAL_MIDDLEWARETIMEINDEX: + context->next_param = LR_COMPLETE_QUEUED_WITHDRAWAL_RECEIVEASTOKENS; + break; + case LR_COMPLETE_QUEUED_WITHDRAWAL_RECEIVEASTOKENS: + context->next_param = LR_COMPLETE_QUEUED_WITHDRAWAL_UNEXPECTED_PARAMETER; + break; + default: + PRINTF("Param not supported: %d\n", context->next_param); + //msg->result = ETH_PLUGIN_RESULT_ERROR; + break; + } +} + void handle_provide_parameter(ethPluginProvideParameter_t *msg) { context_t *context = (context_t *) msg->pluginContext; @@ -192,12 +213,14 @@ void handle_provide_parameter(ethPluginProvideParameter_t *msg) { case KILN_LR_DEPOSIT_INTO_STRATEGY: handle_lr_deposit_into_strategy(msg, context); + msg->result = ETH_PLUGIN_RESULT_OK; break; case KILN_LR_QUEUE_WITHDRAWAL: handle_lr_queue_withdrawal(msg, context); + msg->result = ETH_PLUGIN_RESULT_OK; break; - case KILN_LR_QUEUE_WITHDRAWALS: case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: + handle_lr_complete_queued_withdrawal(msg, context); msg->result = ETH_PLUGIN_RESULT_OK; break; diff --git a/src/handle_query_contract_id.c b/src/handle_query_contract_id.c index 37c9256..7708cc0 100644 --- a/src/handle_query_contract_id.c +++ b/src/handle_query_contract_id.c @@ -52,12 +52,8 @@ void handle_query_contract_id(ethQueryContractID_t *msg) { strlcpy(msg->version, "Queue Withdrawal", msg->versionLength); break; - case KILN_LR_QUEUE_WITHDRAWALS: - strlcpy(msg->version, "Queue Withdrawals", msg->versionLength); - break; - case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: - strlcpy(msg->version, "Complete Queued Withdrawal", msg->versionLength); + strlcpy(msg->version, "Queued Withdrawal", msg->versionLength); break; default: diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 2a4f504..4e3e8e4 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -204,7 +204,7 @@ static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *con return ret; } -bool queue_withdrawal_ui_lr(ethQueryContractUI_t *msg, context_t *context) { +static bool queue_withdrawal_ui_lr(ethQueryContractUI_t *msg, context_t *context) { // TODO: display strategies bool ret = false; @@ -222,6 +222,24 @@ bool queue_withdrawal_ui_lr(ethQueryContractUI_t *msg, context_t *context) { return ret; } +static bool complete_queued_withdrawal_ui_lr(ethQueryContractUI_t *msg, context_t *context) { + // TODO: display strategies + bool ret = false; + + switch (msg->screenIndex) { + case 0: + strlcpy(msg->title, "Liquid Restaking", msg->titleLength); + strlcpy(msg->msg, "Complete Withdrawal", msg->msgLength); + ret = true; + break; + + default: + PRINTF("Received an invalid screenIndex\n"); + break; + } + return ret; +} + void handle_query_contract_ui(ethQueryContractUI_t *msg) { context_t *context = (context_t *) msg->pluginContext; bool ret = false; @@ -272,7 +290,11 @@ void handle_query_contract_ui(ethQueryContractUI_t *msg) { case KILN_LR_QUEUE_WITHDRAWAL: ret = queue_withdrawal_ui_lr(msg, context); - break; + break; + + case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: + ret = complete_queued_withdrawal_ui_lr(msg, context); + break; default: PRINTF("Selector Index not supported: %d\n", context->selectorIndex); diff --git a/src/kiln_plugin.h b/src/kiln_plugin.h index 8c838f2..f14e360 100644 --- a/src/kiln_plugin.h +++ b/src/kiln_plugin.h @@ -30,9 +30,8 @@ // LR selectors // --- 12. depositIntoStrategy(address,address,uint256) // --- 13. queueWithdrawal(uint256[],address[],uint256[],address,bool) -// --- 14. queueWithdrawals((address[],uint256[],address)[]) -// --- 15. completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]),address[],uint256,bool) -#define NUM_SELECTORS 16 +// --- 14. completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]),address[],uint256,bool) +#define NUM_SELECTORS 15 // Selectors available (see mapping above). typedef enum { @@ -50,7 +49,6 @@ typedef enum { KILN_V2_CLAIM, KILN_LR_DEPOSIT_INTO_STRATEGY, KILN_LR_QUEUE_WITHDRAWAL, - KILN_LR_QUEUE_WITHDRAWALS, KILN_LR_COMPLETE_QUEUED_WITHDRAWAL, } selector_t; @@ -82,6 +80,15 @@ typedef enum { LR_QUEUE_WITHDRAWAL_UNEXPECTED_PARAMETER } lr_queue_withdrawal_parameters; +// Parameters for LR complete queued withdrawal selector. +typedef enum { + LR_COMPLETE_QUEUED_WITHDRAWAL_QUEUEDWITHDRAWAL_OFFSET = 0, + LR_COMPLETE_QUEUED_WITHDRAWAL_TOKENS_OFFSET, + LR_COMPLETE_QUEUED_WITHDRAWAL_MIDDLEWARETIMEINDEX, + LR_COMPLETE_QUEUED_WITHDRAWAL_RECEIVEASTOKENS, + LR_COMPLETE_QUEUED_WITHDRAWAL_UNEXPECTED_PARAMETER +} lr_complete_queued_withdrawal_parameters; + #define LR_STRATEGIES_COUNT 11 extern const char lr_strategy_addresses[LR_STRATEGIES_COUNT][ADDRESS_STR_LEN]; diff --git a/tests/cal/abis/0x858646372cc42e1a627fce94aa7a7033e7cf075a.json b/tests/cal/abis/0x858646372cc42e1a627fce94aa7a7033e7cf075a.json index 7914d5e..5c7da95 100644 --- a/tests/cal/abis/0x858646372cc42e1a627fce94aa7a7033e7cf075a.json +++ b/tests/cal/abis/0x858646372cc42e1a627fce94aa7a7033e7cf075a.json @@ -54,5 +54,77 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" + }, + { + "inputs": [ + { + "internalType": "struct QueuedWithdrawal", + "name": "queuedWithdrawal", + "type": "tuple", + "components": [ + { + "internalType": "address[]", + "name": "strategies", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "shares", + "type": "uint256[]" + }, + { + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "internalType": "struct WithdrawerAndNonce", + "name": "withdrawerAndNonce", + "type": "tuple", + "components": [ + { + "internalType": "address", + "name": "withdrawer", + "type": "address" + }, + { + "internalType": "uint96", + "name": "nonce", + "type": "uint96" + } + ] + }, + { + "internalType": "uint32", + "name": "withdrawalStartBlock", + "type": "uint32" + }, + { + "internalType": "address", + "name": "delegatedAddress", + "type": "address" + } + ] + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "middlewareTimesIndex", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "receiveAsTokens", + "type": "bool" + } + ], + "name": "completeQueuedWithdrawal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" } ] \ No newline at end of file diff --git a/tests/cal/b2c.json b/tests/cal/b2c.json index 362449d..8f9d8d8 100644 --- a/tests/cal/b2c.json +++ b/tests/cal/b2c.json @@ -82,6 +82,10 @@ "0xf123991e": { "method": "queueWithdrawal", "plugin": "Kiln" + }, + "0xf3be65d3": { + "method": "completeQueuedWithdrawal", + "plugin": "Kiln" } } } diff --git a/tests/src/lrCompleteQueuedWithdrawal.test.js b/tests/src/lrCompleteQueuedWithdrawal.test.js new file mode 100644 index 0000000..74945e8 --- /dev/null +++ b/tests/src/lrCompleteQueuedWithdrawal.test.js @@ -0,0 +1,88 @@ +import 'core-js/stable'; +import 'regenerator-runtime/runtime'; +import { + waitForAppScreen, + kilnJSON, + zemu, + genericTx, + nano_models, + SPECULOS_ADDRESS, + txFromEtherscan, +} from './test.fixture'; +import { ethers } from 'ethers'; +import { parseEther, parseUnits } from 'ethers/lib/utils'; +import { ledgerService } from '@ledgerhq/hw-app-eth'; + +const contractAddr = '0x858646372CC42E1A627fcE94aa7A7033e7CF075A'; // strategy manager + +const pluginName = 'Kiln'; +const abi_path = `../cal/abis/${contractAddr}.json`; +const abi = require(abi_path); + +nano_models.forEach(function (model) { + test( + '[Nano ' + model.letter + '] Stake Eth', + zemu(model, async (sim, eth) => { + const contract = new ethers.Contract(contractAddr, abi); + + const queuedWithdrawal = { + strategies: [ + '0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff', // ankrETH strat + '0xa4C637e0F704745D182e4D38cAb7E7485321d059', // OETH strat + ], + shares: [1000, 2000], + depositor: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', + withdrawerAndNonce: { + withdrawer: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', + nonce: 1, + }, + withdrawalStartBlock: 12345678, + delegatedAddress: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045', // Placeholder delegated address + }; + const tokens = [ + '0xE95A203B1a91a908F9B9CE46459d101078c2c3cb', // ankrETH erc20 + '0x856c4Efb76C1D1AE02e20CEB03A2A6a08b0b8dC3', // OETH erc20 + ]; // Placeholder token addresses + const middlewareTimesIndex = 0; // Placeholder middleware times index + const receiveAsTokens = true; // Placeholder boolean + + // Generate the transaction data 0xf044c946 + const { data } = + await contract.populateTransaction.completeQueuedWithdrawal( + queuedWithdrawal, + tokens, + middlewareTimesIndex, + receiveAsTokens + ); + + let unsignedTx = genericTx; + console.log(unsignedTx); + + unsignedTx.to = contractAddr; + unsignedTx.data = data; + unsignedTx.value = parseEther('0'); + + const serializedTx = ethers.utils + .serializeTransaction(unsignedTx) + .slice(2); + const resolution = await ledgerService.resolveTransaction( + serializedTx, + eth.loadConfig, + { + externalPlugins: true, + } + ); + const tx = eth.signTransaction("44'/60'/0'/0", serializedTx, resolution); + const right_clicks = 4; + + await waitForAppScreen(sim); + await sim.navigateAndCompareSnapshots( + '.', + model.name + '_lrCompleteQueuedWithdrawal', + [right_clicks, 0] + ); + await tx; + }), + 30000 + ); +}); diff --git a/tests/src/lrDepositIntoStrategy.test.js b/tests/src/lrDepositIntoStrategy.test.js index 9bbff59..432cef7 100644 --- a/tests/src/lrDepositIntoStrategy.test.js +++ b/tests/src/lrDepositIntoStrategy.test.js @@ -13,7 +13,7 @@ import { ethers } from 'ethers'; import { parseEther, parseUnits } from 'ethers/lib/utils'; import { ledgerService } from '@ledgerhq/hw-app-eth'; -const contractAddr = '0x858646372cc42e1a627fce94aa7a7033e7cf075a'; +const contractAddr = '0x858646372cc42e1a627fce94aa7a7033e7cf075a'; // strategy manager const pluginName = 'Kiln'; const abi_path = `../cal/abis/${contractAddr}.json`; diff --git a/tests/src/lrQueueWithdrawal.test.js b/tests/src/lrQueueWithdrawal.test.js index f1e120c..fc68691 100644 --- a/tests/src/lrQueueWithdrawal.test.js +++ b/tests/src/lrQueueWithdrawal.test.js @@ -13,7 +13,7 @@ import { ethers } from 'ethers'; import { parseEther, parseUnits } from 'ethers/lib/utils'; import { ledgerService } from '@ledgerhq/hw-app-eth'; -const contractAddr = '0x858646372CC42E1A627fcE94aa7A7033e7CF075A'; +const contractAddr = '0x858646372CC42E1A627fcE94aa7A7033e7CF075A'; // strategy manager const pluginName = 'Kiln'; const abi_path = `../cal/abis/${contractAddr}.json`; From e4cfaf9de8b7d1815be7cdfd681deaa301cd3ee8 Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Fri, 2 Feb 2024 14:42:09 +0100 Subject: [PATCH 10/33] fix: linting --- .clang-format | 1 - src/contract.c | 75 +++++++++--------- src/handle_provide_parameter.c | 140 +++++++++++++++------------------ src/handle_query_contract_id.c | 2 +- src/handle_query_contract_ui.c | 13 +-- src/kiln_plugin.h | 8 +- 6 files changed, 110 insertions(+), 129 deletions(-) diff --git a/.clang-format b/.clang-format index b4abfa0..c76e9fc 100644 --- a/.clang-format +++ b/.clang-format @@ -12,7 +12,6 @@ SortIncludes: false SpaceAfterCStyleCast: true AllowShortCaseLabelsOnASingleLine: false AllowAllArgumentsOnNextLine: false -AllowAllParametersOfDeclarationOnNextLine: false AllowShortBlocksOnASingleLine: Never AllowShortFunctionsOnASingleLine: None BinPackArguments: false diff --git a/src/contract.c b/src/contract.c index d55a2be..213e8c2 100644 --- a/src/contract.c +++ b/src/contract.c @@ -33,11 +33,10 @@ static const uint32_t KILN_V2_CLAIM_SELECTOR = 0xadcf1163; static const uint32_t KILN_LR_DEPOSIT_INTO_STRATEGY_SELECTOR = 0xe7a050aa; // --- cast sig "queueWithdrawal(uint256[],address[],uint256[],address,bool)" static const uint32_t KILN_LR_QUEUE_WITHDRAWAL_SELECTOR = 0xf123991e; -// --- cast sig "completeQueuedWithdrawal((address[],uint256[],address,(address,uint96),uint32,address),address[],uint256,bool)" +// --- cast sig +// "completeQueuedWithdrawal((address[],uint256[],address,(address,uint96),uint32,address),address[],uint256,bool)" static const uint32_t KILN_LR_COMPLETE_QUEUED_WITHDRAWAL_SELECTOR = 0xf3be65d3; - - const uint32_t KILN_SELECTORS[NUM_SELECTORS] = { // V1 KILN_V1_DEPOSIT_SELECTOR, @@ -59,46 +58,42 @@ const uint32_t KILN_SELECTORS[NUM_SELECTORS] = { KILN_LR_COMPLETE_QUEUED_WITHDRAWAL_SELECTOR, }; - - const char lr_strategy_addresses[LR_STRATEGIES_COUNT][ADDRESS_STR_LEN] = { - "0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc", // cbETH - "0x93c4b944D05dfe6df7645A86cd2206016c51564D", // stETH - "0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2", // rETH - "0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d", // ETHx - "0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff", // ankrETH - "0xa4C637e0F704745D182e4D38cAb7E7485321d059", // OETH - "0x57ba429517c3473B6d34CA9aCd56c0e735b94c02", // osETH - "0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6", // swETH - "0x7CA911E83dabf90C90dD3De5411a10F1A6112184", // wBETH - "0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6", // sfrxETH - "0x298aFB19A105D59E74658C4C334Ff360BadE6dd2" // mETH + "0x54945180dB7943c0ed0FEE7EdaB2Bd24620256bc", // cbETH + "0x93c4b944D05dfe6df7645A86cd2206016c51564D", // stETH + "0x1BeE69b7dFFfA4E2d53C2a2Df135C388AD25dCD2", // rETH + "0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d", // ETHx + "0x13760F50a9d7377e4F20CB8CF9e4c26586c658ff", // ankrETH + "0xa4C637e0F704745D182e4D38cAb7E7485321d059", // OETH + "0x57ba429517c3473B6d34CA9aCd56c0e735b94c02", // osETH + "0x0Fe4F44beE93503346A3Ac9EE5A26b130a5796d6", // swETH + "0x7CA911E83dabf90C90dD3De5411a10F1A6112184", // wBETH + "0x8CA7A5d6f3acd3A7A8bC468a8CD0FB14B6BD28b6", // sfrxETH + "0x298aFB19A105D59E74658C4C334Ff360BadE6dd2" // mETH }; const char lr_erc20_addresses[LR_STRATEGIES_COUNT][ADDRESS_STR_LEN] = { - "0xBe9895146f7AF43049ca1c1AE358B0541Ea49704", // cbETH - "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84", // stETH - "0xae78736Cd615f374D3085123A210448E74Fc6393", // rETH - "0xA35b1B31Ce002FBF2058D22F30f95D405200A15b", // ETHx - "0xE95A203B1a91a908F9B9CE46459d101078c2c3cb", // ankrETH - "0x856c4Efb76C1D1AE02e20CEB03A2A6a08b0b8dC3", // OETH - "0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38", // osETH - "0xf951E335afb289353dc249e82926178EaC7DEd78", // swETH - "0xa2E3356610840701BDf5611a53974510Ae27E2e1", // wBETH - "0xac3E018457B222d93114458476f3E3416Abbe38F", // sfrxETH - "0xd5F7838F5C461fefF7FE49ea5ebaF7728bB0ADfa", // mETH + "0xBe9895146f7AF43049ca1c1AE358B0541Ea49704", // cbETH + "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84", // stETH + "0xae78736Cd615f374D3085123A210448E74Fc6393", // rETH + "0xA35b1B31Ce002FBF2058D22F30f95D405200A15b", // ETHx + "0xE95A203B1a91a908F9B9CE46459d101078c2c3cb", // ankrETH + "0x856c4Efb76C1D1AE02e20CEB03A2A6a08b0b8dC3", // OETH + "0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38", // osETH + "0xf951E335afb289353dc249e82926178EaC7DEd78", // swETH + "0xa2E3356610840701BDf5611a53974510Ae27E2e1", // wBETH + "0xac3E018457B222d93114458476f3E3416Abbe38F", // sfrxETH + "0xd5F7838F5C461fefF7FE49ea5ebaF7728bB0ADfa", // mETH }; -const char lr_tickers[LR_STRATEGIES_COUNT][MAX_TICKER_LEN] = { - "cbETH", - "stETH", - "rETH", - "ETHx", - "ankrETH", - "OETH", - "osETH", - "swETH", - "wBETH", - "sfrxETH", - "mETH" -}; \ No newline at end of file +const char lr_tickers[LR_STRATEGIES_COUNT][MAX_TICKER_LEN] = {"cbETH", + "stETH", + "rETH", + "ETHx", + "ankrETH", + "OETH", + "osETH", + "swETH", + "wBETH", + "sfrxETH", + "mETH"}; \ No newline at end of file diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index 239a209..e6a716b 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -1,16 +1,16 @@ #include "kiln_plugin.h" -/* - * Compare two addresses - * - * @param a: first address - * @param b: second address - * - * @return true if the addresses are the same -*/ +/* + * Compare two addresses + * + * @param a: first address + * @param b: second address + * + * @return true if the addresses are the same + */ bool compare_addresses(const char *a, const char *b) { for (size_t i = 0; i < ADDRESS_STR_LEN; i += 1) { - if (tolower((unsigned char)a[i]) != tolower((unsigned char)b[i])) { + if (tolower((unsigned char) a[i]) != tolower((unsigned char) b[i])) { return false; } } @@ -18,21 +18,21 @@ bool compare_addresses(const char *a, const char *b) { } /* - * If address is a known erc20, update lr display context with its name - * otherwise set it to unkwown (-1) - * - * @param address: address to compare - * @param index: index of the erc20 in the context - * @param context: context to update - * - * @note impacts the following context storage: - * `context->lr_strategy_to_display`: set index of the erc20 in the context -*/ + * If address is a known erc20, update lr display context with its name + * otherwise set it to unkwown (-1) + * + * @param address: address to compare + * @param index: index of the erc20 in the context + * @param context: context to update + * + * @note impacts the following context storage: + * `context->lr_strategy_to_display`: set index of the erc20 in the context + */ void find_lr_known_erc20(const char *address, size_t index, context_t *context) { for (size_t i = 0; i < LR_STRATEGIES_COUNT; i++) { if (compare_addresses(address, &lr_erc20_addresses[i])) { context->lr_erc20_to_display[index] = i; - return; + return; } } // if unknown erc20, indicate it @@ -40,21 +40,21 @@ void find_lr_known_erc20(const char *address, size_t index, context_t *context) } /* - * If address is a known strategy, update lr display context with its name - * otherwise set it to unkwown (-1) - * - * @param address: address to compare - * @param index: index of the strategy in the context - * @param context: context to update - * - * @note impacts the following context storage: - * `context->lr_strategy_to_display`: set index of the strategy in the context -*/ + * If address is a known strategy, update lr display context with its name + * otherwise set it to unkwown (-1) + * + * @param address: address to compare + * @param index: index of the strategy in the context + * @param context: context to update + * + * @note impacts the following context storage: + * `context->lr_strategy_to_display`: set index of the strategy in the context + */ void find_lr_known_strategy(const char *address, size_t index, context_t *context) { for (size_t i = 0; i < LR_STRATEGIES_COUNT; i++) { if (compare_addresses(address, &lr_strategy_addresses[i])) { context->lr_strategy_to_display[index] = i; - return; + return; } } // if unknown strategy, indicate it @@ -62,64 +62,50 @@ void find_lr_known_strategy(const char *address, size_t index, context_t *contex } /* - * Handle the parameters for the depositIntoStrategy(strategy,erc20,amount) - * selector - * - * @param msg: message containing the parameter - * @param context: context to update - * - * @note impacts the following context storage: - * `context->next_param`: set to the next parameter to handle - * `context->lr_strategy_to_display`: set index of the strategy in the context - * `context->lr_erc20_to_display`: set index of the erc20 in the context - * `context->lr_erc20_amount_to_display`: set amount of the erc20 in the context - * -*/ + * Handle the parameters for the depositIntoStrategy(strategy,erc20,amount) + * selector + * + * @param msg: message containing the parameter + * @param context: context to update + * + * @note impacts the following context storage: + * `context->next_param`: set to the next parameter to handle + * `context->lr_strategy_to_display`: set index of the strategy in the context + * `context->lr_erc20_to_display`: set index of the erc20 in the context + * `context->lr_erc20_amount_to_display`: set amount of the erc20 in the context + * + */ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t *context) { uint8_t buffer[ADDRESS_LENGTH]; char address_buffer[ADDRESS_STR_LEN]; - + switch (context->next_param) { case LR_DEPOSIT_INTO_STRATEGY_STRATEGY: - copy_address( - buffer, - msg->parameter, - sizeof(buffer) - ); - getEthDisplayableAddress( - buffer, - address_buffer, - sizeof(address_buffer), - msg->pluginSharedRW->sha3, - 0 - ); + copy_address(buffer, msg->parameter, sizeof(buffer)); + getEthDisplayableAddress(buffer, + address_buffer, + sizeof(address_buffer), + msg->pluginSharedRW->sha3, + 0); find_lr_known_strategy(&address_buffer, 0, context); context->next_param = LR_DEPOSIT_INTO_STRATEGY_TOKEN; break; case LR_DEPOSIT_INTO_STRATEGY_TOKEN: - copy_address( - buffer, - msg->parameter, - sizeof(buffer) - ); - getEthDisplayableAddress( - buffer, - address_buffer, - sizeof(address_buffer), - msg->pluginSharedRW->sha3, - 0 - ); + copy_address(buffer, msg->parameter, sizeof(buffer)); + getEthDisplayableAddress(buffer, + address_buffer, + sizeof(address_buffer), + msg->pluginSharedRW->sha3, + 0); find_lr_known_erc20(&address_buffer, 0, context); context->next_param = LR_DEPOSIT_INTO_STRATEGY_AMOUNT; break; case LR_DEPOSIT_INTO_STRATEGY_AMOUNT: - copy_parameter( - context->lr_erc20_amount_to_display[0], - msg->parameter, - sizeof(context->lr_erc20_amount_to_display[0]) - ); + copy_parameter(context->lr_erc20_amount_to_display[0], + msg->parameter, + sizeof(context->lr_erc20_amount_to_display[0])); context->next_param = LR_DEPOSIT_INTO_STRATEGY_UNEXPECTED_PARAMETER; break; default: @@ -148,7 +134,7 @@ void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *con break; default: PRINTF("Param not supported: %d\n", context->next_param); - //msg->result = ETH_PLUGIN_RESULT_ERROR; + // msg->result = ETH_PLUGIN_RESULT_ERROR; break; } } @@ -169,7 +155,7 @@ void handle_lr_complete_queued_withdrawal(ethPluginProvideParameter_t *msg, cont break; default: PRINTF("Param not supported: %d\n", context->next_param); - //msg->result = ETH_PLUGIN_RESULT_ERROR; + // msg->result = ETH_PLUGIN_RESULT_ERROR; break; } } @@ -220,7 +206,7 @@ void handle_provide_parameter(ethPluginProvideParameter_t *msg) { msg->result = ETH_PLUGIN_RESULT_OK; break; case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: - handle_lr_complete_queued_withdrawal(msg, context); + handle_lr_complete_queued_withdrawal(msg, context); msg->result = ETH_PLUGIN_RESULT_OK; break; diff --git a/src/handle_query_contract_id.c b/src/handle_query_contract_id.c index 7708cc0..b9c0180 100644 --- a/src/handle_query_contract_id.c +++ b/src/handle_query_contract_id.c @@ -47,7 +47,7 @@ void handle_query_contract_id(ethQueryContractID_t *msg) { case KILN_LR_DEPOSIT_INTO_STRATEGY: strlcpy(msg->version, "Deposit In Strategy", msg->versionLength); break; - + case KILN_LR_QUEUE_WITHDRAWAL: strlcpy(msg->version, "Queue Withdrawal", msg->versionLength); break; diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 4e3e8e4..1a28680 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -189,12 +189,13 @@ static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *con case 1: strlcpy(msg->title, "Amount", msg->titleLength); amountToString(context->lr_erc20_amount_to_display[0], - sizeof(context->lr_erc20_amount_to_display[0]), - 2, - context->lr_erc20_to_display[0] == -1 ? - "UNKNOWN" : lr_tickers[context->lr_erc20_to_display[0]], - msg->msg, - msg->msgLength); + sizeof(context->lr_erc20_amount_to_display[0]), + 2, + context->lr_erc20_to_display[0] == -1 + ? "UNKNOWN" + : lr_tickers[context->lr_erc20_to_display[0]], + msg->msg, + msg->msgLength); ret = true; break; default: diff --git a/src/kiln_plugin.h b/src/kiln_plugin.h index f14e360..86788cc 100644 --- a/src/kiln_plugin.h +++ b/src/kiln_plugin.h @@ -1,7 +1,6 @@ #pragma once #include -#include #include "eth_internals.h" #include "eth_plugin_interface.h" @@ -30,7 +29,9 @@ // LR selectors // --- 12. depositIntoStrategy(address,address,uint256) // --- 13. queueWithdrawal(uint256[],address[],uint256[],address,bool) -// --- 14. completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]),address[],uint256,bool) +// --- 14. +// completeQueuedWithdrawal((address,address,address,uint256,uint32,address[],uint256[]),address[],uint256,bool) +// #define NUM_SELECTORS 15 // Selectors available (see mapping above). @@ -87,7 +88,7 @@ typedef enum { LR_COMPLETE_QUEUED_WITHDRAWAL_MIDDLEWARETIMEINDEX, LR_COMPLETE_QUEUED_WITHDRAWAL_RECEIVEASTOKENS, LR_COMPLETE_QUEUED_WITHDRAWAL_UNEXPECTED_PARAMETER -} lr_complete_queued_withdrawal_parameters; +} lr_complete_queued_withdrawal_parameters; #define LR_STRATEGIES_COUNT 11 @@ -107,7 +108,6 @@ typedef struct context_t { uint8_t lr_erc20_amount_to_display[MAX_DISPLAY_COUNT][INT256_LENGTH]; size_t lr_display_buffer_size; - selector_t selectorIndex; } context_t; From a10fe60aa046506add699bff9db7e8b5fdc189cf Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Fri, 2 Feb 2024 14:56:53 +0100 Subject: [PATCH 11/33] fix: add missing ledger app config --- ledger_app.toml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 ledger_app.toml diff --git a/ledger_app.toml b/ledger_app.toml new file mode 100644 index 0000000..4646fae --- /dev/null +++ b/ledger_app.toml @@ -0,0 +1,7 @@ +[app] +build_directory = "./" +sdk = "C" +devices = ["nanos", "nanox", "nanos+"] + +[tests] +pytest_directory = "./tests/" \ No newline at end of file From fecd889b56dd8bb29d7271d3b2977631e8a3318f Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Fri, 2 Feb 2024 15:11:46 +0100 Subject: [PATCH 12/33] fix: warnings --- src/handle_provide_parameter.c | 11 +++++++---- src/handle_query_contract_ui.c | 8 ++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index e6a716b..2f62dbc 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -1,4 +1,5 @@ #include "kiln_plugin.h" +#include /* * Compare two addresses @@ -30,7 +31,7 @@ bool compare_addresses(const char *a, const char *b) { */ void find_lr_known_erc20(const char *address, size_t index, context_t *context) { for (size_t i = 0; i < LR_STRATEGIES_COUNT; i++) { - if (compare_addresses(address, &lr_erc20_addresses[i])) { + if (compare_addresses(address, lr_erc20_addresses[i])) { context->lr_erc20_to_display[index] = i; return; } @@ -52,7 +53,7 @@ void find_lr_known_erc20(const char *address, size_t index, context_t *context) */ void find_lr_known_strategy(const char *address, size_t index, context_t *context) { for (size_t i = 0; i < LR_STRATEGIES_COUNT; i++) { - if (compare_addresses(address, &lr_strategy_addresses[i])) { + if (compare_addresses(address, lr_strategy_addresses[i])) { context->lr_strategy_to_display[index] = i; return; } @@ -87,7 +88,7 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t sizeof(address_buffer), msg->pluginSharedRW->sha3, 0); - find_lr_known_strategy(&address_buffer, 0, context); + find_lr_known_strategy(address_buffer, 0, context); context->next_param = LR_DEPOSIT_INTO_STRATEGY_TOKEN; break; @@ -98,7 +99,7 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t sizeof(address_buffer), msg->pluginSharedRW->sha3, 0); - find_lr_known_erc20(&address_buffer, 0, context); + find_lr_known_erc20(address_buffer, 0, context); context->next_param = LR_DEPOSIT_INTO_STRATEGY_AMOUNT; break; @@ -137,6 +138,7 @@ void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *con // msg->result = ETH_PLUGIN_RESULT_ERROR; break; } + msg->result = ETH_PLUGIN_RESULT_OK; } void handle_lr_complete_queued_withdrawal(ethPluginProvideParameter_t *msg, context_t *context) { @@ -158,6 +160,7 @@ void handle_lr_complete_queued_withdrawal(ethPluginProvideParameter_t *msg, cont // msg->result = ETH_PLUGIN_RESULT_ERROR; break; } + msg->result = ETH_PLUGIN_RESULT_OK; } void handle_provide_parameter(ethPluginProvideParameter_t *msg) { diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 1a28680..4c1a8ec 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -205,7 +205,7 @@ static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *con return ret; } -static bool queue_withdrawal_ui_lr(ethQueryContractUI_t *msg, context_t *context) { +static bool queue_withdrawal_ui_lr(ethQueryContractUI_t *msg) { // TODO: display strategies bool ret = false; @@ -223,7 +223,7 @@ static bool queue_withdrawal_ui_lr(ethQueryContractUI_t *msg, context_t *context return ret; } -static bool complete_queued_withdrawal_ui_lr(ethQueryContractUI_t *msg, context_t *context) { +static bool complete_queued_withdrawal_ui_lr(ethQueryContractUI_t *msg) { // TODO: display strategies bool ret = false; @@ -290,11 +290,11 @@ void handle_query_contract_ui(ethQueryContractUI_t *msg) { break; case KILN_LR_QUEUE_WITHDRAWAL: - ret = queue_withdrawal_ui_lr(msg, context); + ret = queue_withdrawal_ui_lr(msg); break; case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: - ret = complete_queued_withdrawal_ui_lr(msg, context); + ret = complete_queued_withdrawal_ui_lr(msg); break; default: From 643b577824be4c07376ca700302b2092fa4c399a Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Fri, 2 Feb 2024 16:34:17 +0100 Subject: [PATCH 13/33] feat: decimals and screens --- README.md | 42 ++++++++++++++---- src/handle_query_contract_ui.c | 2 +- src/kiln_plugin.h | 3 ++ .../00000.png | Bin 0 -> 374 bytes .../00001.png | Bin 0 -> 364 bytes .../00002.png | Bin 0 -> 491 bytes .../00003.png | Bin 0 -> 358 bytes .../00004.png | Bin 0 -> 414 bytes .../00005.png | Bin 0 -> 349 bytes .../00000.png | Bin 0 -> 374 bytes .../00001.png | Bin 0 -> 393 bytes .../00002.png | Bin 0 -> 337 bytes .../00003.png | Bin 0 -> 355 bytes .../00004.png | Bin 0 -> 358 bytes .../00005.png | Bin 0 -> 414 bytes .../00006.png | Bin 0 -> 349 bytes .../00000.png | Bin 0 -> 374 bytes .../00001.png | Bin 0 -> 393 bytes .../00002.png | Bin 0 -> 341 bytes .../00003.png | Bin 0 -> 393 bytes .../00004.png | Bin 0 -> 315 bytes .../00005.png | Bin 0 -> 324 bytes .../00006.png | Bin 0 -> 349 bytes .../00000.png | Bin 0 -> 374 bytes .../00001.png | Bin 0 -> 393 bytes .../00002.png | Bin 0 -> 396 bytes .../00003.png | Bin 0 -> 373 bytes .../00004.png | Bin 0 -> 315 bytes .../00005.png | Bin 0 -> 324 bytes .../00006.png | Bin 0 -> 349 bytes .../nanos_lrQueueWithdrawal/00000.png | Bin 0 -> 374 bytes .../nanos_lrQueueWithdrawal/00001.png | Bin 0 -> 354 bytes .../nanos_lrQueueWithdrawal/00002.png | Bin 0 -> 456 bytes .../nanos_lrQueueWithdrawal/00003.png | Bin 0 -> 358 bytes .../nanos_lrQueueWithdrawal/00004.png | Bin 0 -> 414 bytes .../nanos_lrQueueWithdrawal/00005.png | Bin 0 -> 349 bytes .../00000.png | Bin 0 -> 414 bytes .../00001.png | Bin 0 -> 406 bytes .../00002.png | Bin 0 -> 561 bytes .../00003.png | Bin 0 -> 415 bytes .../00004.png | Bin 0 -> 472 bytes .../00005.png | Bin 0 -> 381 bytes .../00000.png | Bin 0 -> 414 bytes .../00001.png | Bin 0 -> 445 bytes .../00002.png | Bin 0 -> 390 bytes .../00003.png | Bin 0 -> 410 bytes .../00004.png | Bin 0 -> 415 bytes .../00005.png | Bin 0 -> 472 bytes .../00006.png | Bin 0 -> 381 bytes .../00000.png | Bin 0 -> 414 bytes .../00001.png | Bin 0 -> 445 bytes .../00002.png | Bin 0 -> 392 bytes .../00003.png | Bin 0 -> 500 bytes .../00004.png | Bin 0 -> 415 bytes .../00005.png | Bin 0 -> 472 bytes .../00006.png | Bin 0 -> 381 bytes .../00000.png | Bin 0 -> 414 bytes .../00001.png | Bin 0 -> 445 bytes .../00002.png | Bin 0 -> 445 bytes .../00003.png | Bin 0 -> 494 bytes .../00004.png | Bin 0 -> 415 bytes .../00005.png | Bin 0 -> 472 bytes .../00006.png | Bin 0 -> 381 bytes .../nanox_lrQueueWithdrawal/00000.png | Bin 0 -> 414 bytes .../nanox_lrQueueWithdrawal/00001.png | Bin 0 -> 407 bytes .../nanox_lrQueueWithdrawal/00002.png | Bin 0 -> 541 bytes .../nanox_lrQueueWithdrawal/00003.png | Bin 0 -> 415 bytes .../nanox_lrQueueWithdrawal/00004.png | Bin 0 -> 472 bytes .../nanox_lrQueueWithdrawal/00005.png | Bin 0 -> 381 bytes tests/src/lrDepositIntoStrategy.test.js | 2 +- 70 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00000.png create mode 100644 tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00001.png create mode 100644 tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00002.png create mode 100644 tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00003.png create mode 100644 tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00004.png create mode 100644 tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00005.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyNormal/00000.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyNormal/00001.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyNormal/00002.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyNormal/00003.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyNormal/00004.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyNormal/00005.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyNormal/00006.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00000.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00001.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00002.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00003.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00004.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00005.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00006.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00000.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00001.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00002.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00003.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00004.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00005.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00006.png create mode 100644 tests/snapshots/nanos_lrQueueWithdrawal/00000.png create mode 100644 tests/snapshots/nanos_lrQueueWithdrawal/00001.png create mode 100644 tests/snapshots/nanos_lrQueueWithdrawal/00002.png create mode 100644 tests/snapshots/nanos_lrQueueWithdrawal/00003.png create mode 100644 tests/snapshots/nanos_lrQueueWithdrawal/00004.png create mode 100644 tests/snapshots/nanos_lrQueueWithdrawal/00005.png create mode 100644 tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00000.png create mode 100644 tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00001.png create mode 100644 tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00002.png create mode 100644 tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00003.png create mode 100644 tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00004.png create mode 100644 tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00005.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyNormal/00000.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyNormal/00001.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyNormal/00002.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyNormal/00003.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyNormal/00004.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyNormal/00005.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyNormal/00006.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00000.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00001.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00002.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00003.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00004.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00005.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00006.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00000.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00001.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00002.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00003.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00004.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00005.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00006.png create mode 100644 tests/snapshots/nanox_lrQueueWithdrawal/00000.png create mode 100644 tests/snapshots/nanox_lrQueueWithdrawal/00001.png create mode 100644 tests/snapshots/nanox_lrQueueWithdrawal/00002.png create mode 100644 tests/snapshots/nanox_lrQueueWithdrawal/00003.png create mode 100644 tests/snapshots/nanox_lrQueueWithdrawal/00004.png create mode 100644 tests/snapshots/nanox_lrQueueWithdrawal/00005.png diff --git a/README.md b/README.md index c1eed08..69fbf09 100644 --- a/README.md +++ b/README.md @@ -108,22 +108,34 @@ The flow processed in [GitHub Actions](https://github.com/features/actions) is t ![](/tests/snapshots/nanos_requestValidatorsExit/00000.png) ![](/tests/snapshots/nanos_requestValidatorsExit/00001.png) ![](/tests/snapshots/nanos_requestValidatorsExit/00002.png) ![](/tests/snapshots/nanos_requestValidatorsExit/00003.png) ![](/tests/snapshots/nanos_requestValidatorsExit/00004.png) ![](/tests/snapshots/nanos_requestValidatorsExit/00005.png) -## Stake v2 +### Stake v2 ![](/tests/snapshots/nanos_stakeV2/00000.png) ![](/tests/snapshots/nanos_stakeV2/00001.png) ![](/tests/snapshots/nanos_stakeV2/00002.png) ![](/tests/snapshots/nanos_stakeV2/00003.png) ![](/tests/snapshots/nanos_stakeV2/00004.png) ![](/tests/snapshots/nanos_stakeV2/00005.png) -## RequestExit v2 +### RequestExit v2 ![](/tests/snapshots/nanos_requestExitV2/00000.png) ![](/tests/snapshots/nanos_requestExitV2/00001.png) ![](/tests/snapshots/nanos_requestExitV2/00002.png) ![](/tests/snapshots/nanos_requestExitV2/00003.png) ![](/tests/snapshots/nanos_requestExitV2/00004.png) ![](/tests/snapshots/nanos_requestExitV2/00005.png) -## MultiClaim v2 +### MultiClaim v2 ![](/tests/snapshots/nanos_multiClaimV2/00000.png) ![](/tests/snapshots/nanos_multiClaimV2/00001.png) ![](/tests/snapshots/nanos_multiClaimV2/00002.png) ![](/tests/snapshots/nanos_multiClaimV2/00003.png) ![](/tests/snapshots/nanos_multiClaimV2/00004.png) ![](/tests/snapshots/nanos_multiClaimV2/00005.png) -## Claim v2 +### Claim v2 ![](/tests/snapshots/nanos_claimV2/00000.png) ![](/tests/snapshots/nanos_claimV2/00001.png) ![](/tests/snapshots/nanos_claimV2/00002.png) ![](/tests/snapshots/nanos_claimV2/00003.png) ![](/tests/snapshots/nanos_claimV2/00004.png) ![](/tests/snapshots/nanos_claimV2/00005.png) +### LR Deposit Into Strategy + +![](/tests/snapshots/nanos_lrDepositIntoStrategy/00000.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategy/00001.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategy/00002.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategy/00003.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategy/00004.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategy/00005.png) + +### LR Queue Withdraw + +![](/tests/snapshots/nanos_lrQueueWithdraw/00000.png) ![](/tests/snapshots/nanos_lrQueueWithdraw/00001.png) ![](/tests/snapshots/nanos_lrQueueWithdraw/00002.png) ![](/tests/snapshots/nanos_lrQueueWithdraw/00003.png) ![](/tests/snapshots/nanos_lrQueueWithdraw/00004.png) ![](/tests/snapshots/nanos_lrQueueWithdraw/00005.png) + +### LR Complete Queued Withdraw + +![](/tests/snapshots/nanos_lrCompleteQueuedWithdraw/00000.png) ![](/tests/snapshots/nanos_lrCompleteQueuedWithdraw/00001.png) ![](/tests/snapshots/nanos_lrCompleteQueuedWithdraw/00002.png) ![](/tests/snapshots/nanos_lrCompleteQueuedWithdraw/00003.png) ![](/tests/snapshots/nanos_lrCompleteQueuedWithdraw/00004.png) ![](/tests/snapshots/nanos_lrCompleteQueuedWithdraw/00005.png) + ## NANO X ### Deposit @@ -154,22 +166,34 @@ The flow processed in [GitHub Actions](https://github.com/features/actions) is t ![](/tests/snapshots/nanox_batchWithdrawCL/00000.png) ![](/tests/snapshots/nanox_batchWithdrawCL/00001.png) ![](/tests/snapshots/nanox_batchWithdrawCL/00002.png) ![](/tests/snapshots/nanox_batchWithdrawCL/00003.png) ![](/tests/snapshots/nanox_batchWithdrawCL/00004.png) ![](/tests/snapshots/nanox_batchWithdrawCL/00005.png) -## Request Exits +### Request Exits ![](/tests/snapshots/nanox_requestValidatorsExit/00000.png) ![](/tests/snapshots/nanox_requestValidatorsExit/00001.png) ![](/tests/snapshots/nanox_requestValidatorsExit/00002.png) ![](/tests/snapshots/nanox_requestValidatorsExit/00003.png) ![](/tests/snapshots/nanox_requestValidatorsExit/00004.png) ![](/tests/snapshots/nanox_requestValidatorsExit/00005.png) -## Stake V2 +### Stake V2 ![](/tests/snapshots/nanox_stakeV2/00000.png) ![](/tests/snapshots/nanox_stakeV2/00001.png) ![](/tests/snapshots/nanox_stakeV2/00002.png) ![](/tests/snapshots/nanox_stakeV2/00003.png) ![](/tests/snapshots/nanox_stakeV2/00004.png) ![](/tests/snapshots/nanox_stakeV2/00005.png) -## RequestExit V2 +### RequestExit V2 ![](/tests/snapshots/nanox_requestExitV2/00000.png) ![](/tests/snapshots/nanox_requestExitV2/00001.png) ![](/tests/snapshots/nanox_requestExitV2/00002.png) ![](/tests/snapshots/nanox_requestExitV2/00003.png) ![](/tests/snapshots/nanox_requestExitV2/00004.png) ![](/tests/snapshots/nanox_requestExitV2/00005.png) -## MultiClaim V2 +### MultiClaim V2 ![](/tests/snapshots/nanox_multiClaimV2/00000.png) ![](/tests/snapshots/nanox_multiClaimV2/00001.png) ![](/tests/snapshots/nanox_multiClaimV2/00002.png) ![](/tests/snapshots/nanox_multiClaimV2/00003.png) ![](/tests/snapshots/nanox_multiClaimV2/00004.png) ![](/tests/snapshots/nanox_multiClaimV2/00005.png) -## Claim V2 +### Claim V2 ![](/tests/snapshots/nanox_claimV2/00000.png) ![](/tests/snapshots/nanox_claimV2/00001.png) ![](/tests/snapshots/nanox_claimV2/00002.png) ![](/tests/snapshots/nanox_claimV2/00003.png) ![](/tests/snapshots/nanox_claimV2/00004.png) ![](/tests/snapshots/nanox_claimV2/00005.png) + +### LR Deposit Into Strategy + +![](/tests/snapshots/nanox_lrDepositIntoStrategy/00000.png) ![](/tests/snapshots/nanox_lrDepositIntoStrategy/00001.png) ![](/tests/snapshots/nanox_lrDepositIntoStrategy/00002.png) ![](/tests/snapshots/nanox_lrDepositIntoStrategy/00003.png) ![](/tests/snapshots/nanox_lrDepositIntoStrategy/00004.png) ![](/tests/snapshots/nanox_lrDepositIntoStrategy/00005.png) + +### LR Queue Withdraw + +![](/tests/snapshots/nanox_lrQueueWithdraw/00000.png) ![](/tests/snapshots/nanox_lrQueueWithdraw/00001.png) ![](/tests/snapshots/nanox_lrQueueWithdraw/00002.png) ![](/tests/snapshots/nanox_lrQueueWithdraw/00003.png) ![](/tests/snapshots/nanox_lrQueueWithdraw/00004.png) ![](/tests/snapshots/nanox_lrQueueWithdraw/00005.png) + +### LR Complete Queued Withdraw + +![](/tests/snapshots/nanox_lrCompleteQueuedWithdraw/00000.png) ![](/tests/snapshots/nanox_lrCompleteQueuedWithdraw/00001.png) ![](/tests/snapshots/nanox_lrCompleteQueuedWithdraw/00002.png) ![](/tests/snapshots/nanox_lrCompleteQueuedWithdraw/00003.png) ![](/tests/snapshots/nanox_lrCompleteQueuedWithdraw/00004.png) ![](/tests/snapshots/nanox_lrCompleteQueuedWithdraw/00005.png) diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 4c1a8ec..dd38052 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -190,7 +190,7 @@ static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *con strlcpy(msg->title, "Amount", msg->titleLength); amountToString(context->lr_erc20_amount_to_display[0], sizeof(context->lr_erc20_amount_to_display[0]), - 2, + ERC20_DECIMALS, context->lr_erc20_to_display[0] == -1 ? "UNKNOWN" : lr_tickers[context->lr_erc20_to_display[0]], diff --git a/src/kiln_plugin.h b/src/kiln_plugin.h index 86788cc..928724d 100644 --- a/src/kiln_plugin.h +++ b/src/kiln_plugin.h @@ -58,6 +58,9 @@ extern const uint32_t KILN_SELECTORS[NUM_SELECTORS]; // ADDRESS_STR_LEN is 0x + addr + \0 #define ADDRESS_STR_LEN 43 +// All supported ERC20 tokens have 18 decimals on mainnet. +#define ERC20_DECIMALS 18 + // Parameters for deposit selector. typedef enum { DEPOSIT_UNEXPECTED_PARAMETER, diff --git a/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00000.png b/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00000.png new file mode 100644 index 0000000000000000000000000000000000000000..8d84cc70fea8013b7e8b25c0982ce142fa103d5c GIT binary patch literal 374 zcmV-+0g3*JP)K?4J2QqX3 zXn7ePqhBDwvA-|J28LIrjF%tX0z{3v6!_gF&(SYH)S*7TN;1RxW-%}TLH9_+sttDO z-T32w&rL(!1@Vr`jm5G(8dd=Ruu#)JAN?l#rFLU`oQ(r?$33AC7s0}pw!fi~(9k^# zU9aci?pXN=I7A<-f!Mw2untnw9MivqZYw}c5&)gweYhbTnv#2#t$0X2wST7_1F;LR zw?>Da2SkSfG>qWq1mej-6nW@2l+Z=0om5jdB%3o3Qx19_LNUlTqF4R_1Iaj%@^2O= z@;n%h1N>H$2;%-~Dvx1!0LtkT-;cq73rgisOElFtPbcL{d3TfNQvm<~003s>1*i4o Uje8$F8UO$Q07*qoM6N<$g5rpv%m4rY literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00001.png b/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00001.png new file mode 100644 index 0000000000000000000000000000000000000000..0f8045ce987d2e781dd12eb9686979c9169fb554 GIT binary patch literal 364 zcmV-y0h9iTP)(ngBGR26txO zTL=6|FS1{OXp)irY6Mb^>{kXFv;OzVw?F zG%%cU0qoei5>r~snZ-=Z z2xI>u&S11h;VV}0(*GkW*^YJw(dW&d6xE9@loY^u7`yG-i}IDxm@!&2PLyNuSj}}l zzwQ&Ddyw{p#_f&URh#8%cJfPDI$)&4J_0RR91@R9@BHuy|8TN-57$eN3;I0aY~EweTLRfiQ#=*tSidI#N3~T*JSvtU~Ltok1Jnw13E4 h1?hl9B9ZuA`~!q9hkP2~nm+&l002ovPDHLkV1i1+*NgxF literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00003.png b/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00003.png new file mode 100644 index 0000000000000000000000000000000000000000..eeec6324a1f33b9b155d3e979728a086251adb10 GIT binary patch literal 358 zcmV-s0h#`ZP)py!C9JIc{)5O z@z$QeIQ9`eWZ?jWi`t2Mo$*Db2R}Hn&;ifF{eG`PbQ=vzUeGZ$-(viTv&jx{*n>+F z$sJSlS-F{}u|NPAS#vt({Ipt{4zxMEv>x1pQ_2Ty6vG|1u)q#rxT8xbt6SjIvSJcm zATRwh1$m*q09lctz8DFqp}sJPfhIVGH2D>obVJ8hCB^DASqdfRP^^LZu4>Ved?oGf z&gPIV`f^(;vh%m0~_?r8>V7uBj~f|{k#}B z4)Di%0(GQh%XXzDG$sKK-Q2JkKR-`QsiPFD-4d_!i{fwH;J|_aEL%ZYNu#B0FJ7G| z;=_VQWOA9;dQ4Y9)LpKCV=ri`X({49JagUwO3&5UdSK)wEJxPN%9wG}45n;lzK(aC zKtbL$y*-#9uSql`7 zENOEh^0jsFWbV&<+yj5)WEX_aERLO-`${sQhD#B5ZCio#Fr4qHlr^7X|9DL69eFa= z#kf#}$Pcl(QEE=tNl8Pt$o;~Fk*8r@j8mpwSGW8d!1&11FbzPh@^gWj=oh7f%f7G)4s^6#xJL07*qo IM6N<$g02I(Gynhq literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00005.png b/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00005.png new file mode 100644 index 0000000000000000000000000000000000000000..ce795f34e8569e986af689fded3b59c9a8af2961 GIT binary patch literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00000.png b/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00000.png new file mode 100644 index 0000000000000000000000000000000000000000..8d84cc70fea8013b7e8b25c0982ce142fa103d5c GIT binary patch literal 374 zcmV-+0g3*JP)K?4J2QqX3 zXn7ePqhBDwvA-|J28LIrjF%tX0z{3v6!_gF&(SYH)S*7TN;1RxW-%}TLH9_+sttDO z-T32w&rL(!1@Vr`jm5G(8dd=Ruu#)JAN?l#rFLU`oQ(r?$33AC7s0}pw!fi~(9k^# zU9aci?pXN=I7A<-f!Mw2untnw9MivqZYw}c5&)gweYhbTnv#2#t$0X2wST7_1F;LR zw?>Da2SkSfG>qWq1mej-6nW@2l+Z=0om5jdB%3o3Qx19_LNUlTqF4R_1Iaj%@^2O= z@;n%h1N>H$2;%-~Dvx1!0LtkT-;cq73rgisOElFtPbcL{d3TfNQvm<~003s>1*i4o Uje8$F8UO$Q07*qoM6N<$g5rpv%m4rY literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00001.png b/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00001.png new file mode 100644 index 0000000000000000000000000000000000000000..a642dd5317d03b8a3558dcfc9b52f566bb301be7 GIT binary patch literal 393 zcmV;40e1e0P)lf`csy+^CD_aEhJlkd73w^u31CAO2 z{5grdkSUi`RhBS=wW4O#g_u4gpzhhW9jENAs#&eV-~~+usE%NndDJQVcO^8@lx0h+q9ca=@QZrcZ9ha0!M3j4a=Z=&Gc;v6VcA#d}1{p%$%+ z-SHcXSMU09j4%m{bI0000Wp64Ta29fYbvvN9@b>0D^zZC8zB>F15ZkboIG4fUOY4RFRE_2ZrDhQ)U=|y4)Ph9( z3ums&^Mmo9u<{emkb5H3CvyiVUrDSbv|>YewZPIhi9?Vl?KDC>matp_35sze`Xept zk6^S7vww7s9B>pKo%oSX>(W>z7`*}j0000$ZC;o%!63U}-7f$D002ovPDHLkV1m$H Blyd+8 literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00004.png b/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00004.png new file mode 100644 index 0000000000000000000000000000000000000000..eeec6324a1f33b9b155d3e979728a086251adb10 GIT binary patch literal 358 zcmV-s0h#`ZP)py!C9JIc{)5O z@z$QeIQ9`eWZ?jWi`t2Mo$*Db2R}Hn&;ifF{eG`PbQ=vzUeGZ$-(viTv&jx{*n>+F z$sJSlS-F{}u|NPAS#vt({Ipt{4zxMEv>x1pQ_2Ty6vG|1u)q#rxT8xbt6SjIvSJcm zATRwh1$m*q09lctz8DFqp}sJPfhIVGH2D>obVJ8hCB^DASqdfRP^^LZu4>Ved?oGf z&gPIV`f^(;vh%m0~_?r8>V7uBj~f|{k#}B z4)Di%0(GQh%XXzDG$sKK-Q2JkKR-`QsiPFD-4d_!i{fwH;J|_aEL%ZYNu#B0FJ7G| z;=_VQWOA9;dQ4Y9)LpKCV=ri`X({49JagUwO3&5UdSK)wEJxPN%9wG}45n;lzK(aC zKtbL$y*-#9uSql`7 zENOEh^0jsFWbV&<+yj5)WEX_aERLO-`${sQhD#B5ZCio#Fr4qHlr^7X|9DL69eFa= z#kf#}$Pcl(QEE=tNl8Pt$o;~Fk*8r@j8mpwSGW8d!1&11FbzPh@^gWj=oh7f%f7G)4s^6#xJL07*qo IM6N<$g02I(Gynhq literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00006.png b/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00006.png new file mode 100644 index 0000000000000000000000000000000000000000..ce795f34e8569e986af689fded3b59c9a8af2961 GIT binary patch literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00000.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00000.png new file mode 100644 index 0000000000000000000000000000000000000000..8d84cc70fea8013b7e8b25c0982ce142fa103d5c GIT binary patch literal 374 zcmV-+0g3*JP)K?4J2QqX3 zXn7ePqhBDwvA-|J28LIrjF%tX0z{3v6!_gF&(SYH)S*7TN;1RxW-%}TLH9_+sttDO z-T32w&rL(!1@Vr`jm5G(8dd=Ruu#)JAN?l#rFLU`oQ(r?$33AC7s0}pw!fi~(9k^# zU9aci?pXN=I7A<-f!Mw2untnw9MivqZYw}c5&)gweYhbTnv#2#t$0X2wST7_1F;LR zw?>Da2SkSfG>qWq1mej-6nW@2l+Z=0om5jdB%3o3Qx19_LNUlTqF4R_1Iaj%@^2O= z@;n%h1N>H$2;%-~Dvx1!0LtkT-;cq73rgisOElFtPbcL{d3TfNQvm<~003s>1*i4o Uje8$F8UO$Q07*qoM6N<$g5rpv%m4rY literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00001.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00001.png new file mode 100644 index 0000000000000000000000000000000000000000..a642dd5317d03b8a3558dcfc9b52f566bb301be7 GIT binary patch literal 393 zcmV;40e1e0P)lf`csy+^CD_aEhJlkd73w^u31CAO2 z{5grdkSUi`RhBS=wW4O#g_u4gpzhhW9jENAs#&eV-~~+usE%NndDMAqyx$ANsI#PMp%<(j6TK?1s n3J}b&C1~DlnGiw7Dr#A#GyY>m*m*9K z`^CQpvj*wqb=5Vvsk|7zuWvk&LXv))Bu%emI!2US{4- zaM}!ojk$^l<)Rfas#oPN+xoXI$K;=M8gRy!JiQ{qyzP5Ig*fdOc@(PNs~Oj)3gZBa ziU-k@B9Tg6BnPObvFtTV5=3%6-)l3X=@X<00000NkvXXu0mjf@y@W| literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00004.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00004.png new file mode 100644 index 0000000000000000000000000000000000000000..888975aeb8de3d63ba92842a77c85281681b1b5c GIT binary patch literal 315 zcmV-B0mS}^P)waXF|C+`a)iA`9% zH+L@LX>a~Lh)|>!d_1me6SCv&SF@kO2+(r)!`Y99l4`Qw88q;ORmhW5`>=YBSbKz} z%kE;JcXXKdhsD_C>P*0000$#sk|GY=lp#+%5nB N002ovPDHLkV1gw_kca>P literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00005.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00005.png new file mode 100644 index 0000000000000000000000000000000000000000..6e71f370c13ab1d7f3742216e31330aad671b603 GIT binary patch literal 324 zcmV-K0lWT*P)m>boTx}C_;%(OK2R8!L98R2lZwRSI_B#U&EI}2rWS)JPpC9-S-hYJOa+L1T zMyP)lq(SeGBSi)jV501YAqA)~pf=GufQ#@FZ+2({rucJf^h;6$@cO41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00000.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00000.png new file mode 100644 index 0000000000000000000000000000000000000000..8d84cc70fea8013b7e8b25c0982ce142fa103d5c GIT binary patch literal 374 zcmV-+0g3*JP)K?4J2QqX3 zXn7ePqhBDwvA-|J28LIrjF%tX0z{3v6!_gF&(SYH)S*7TN;1RxW-%}TLH9_+sttDO z-T32w&rL(!1@Vr`jm5G(8dd=Ruu#)JAN?l#rFLU`oQ(r?$33AC7s0}pw!fi~(9k^# zU9aci?pXN=I7A<-f!Mw2untnw9MivqZYw}c5&)gweYhbTnv#2#t$0X2wST7_1F;LR zw?>Da2SkSfG>qWq1mej-6nW@2l+Z=0om5jdB%3o3Qx19_LNUlTqF4R_1Iaj%@^2O= z@;n%h1N>H$2;%-~Dvx1!0LtkT-;cq73rgisOElFtPbcL{d3TfNQvm<~003s>1*i4o Uje8$F8UO$Q07*qoM6N<$g5rpv%m4rY literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00001.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00001.png new file mode 100644 index 0000000000000000000000000000000000000000..a642dd5317d03b8a3558dcfc9b52f566bb301be7 GIT binary patch literal 393 zcmV;40e1e0P)lf`csy+^CD_aEhJlkd73w^u31CAO2 z{5grdkSUi`RhBS=wW4O#g_u4gpzhhW9jENAs#&eV-~~+usE%NndDIy8 zr2wrOf7?p|GXu)N7ZZYu<+WNY+lrzvQ~RBl_bNSA7S$N%O4V}LMJUhc0T9t|wAvxr z^%{m-{a^^NA(j-wjM|Q__4DW&2a*6MAzaTgV@QG_fU(NAB3iW+JGQXL@OY1_t)UjJ zjXm%gtF9mN?`wp~WwG|TJHss_%q#Cgo1 z+K5G8H4tr$8xE(F1yNkGY(KVfS|@DEAHN?M_MYAcQn|MhAPOTttCM5rp~aBiPXhlF9@so?J=>BbNs=TKP)$J5k%6TYf6{eGsY9KbF0b>WBB@mh{rPR$zO2@E6*+L z`r+@vsGIcgx~>h#hPP3pPhk?EIUG3p(GWt7=sSZP+zGnSoveeLgxf*X5=GAuM`mh` zh#QMHPXCq03GW8GYOys~mvmy3yS*0F2^ZqIG~c>QQ6hMfo8)K_{litST=C0U85V{} z3Fz#Pi%?OB96cNpHY^F#f_z2bID|<+rY8rvP)5mCm=@I8#Et$A000000DO4^enQ%~ TgP*I=00000NkvXXu0mjfe#EOw literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00004.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00004.png new file mode 100644 index 0000000000000000000000000000000000000000..888975aeb8de3d63ba92842a77c85281681b1b5c GIT binary patch literal 315 zcmV-B0mS}^P)waXF|C+`a)iA`9% zH+L@LX>a~Lh)|>!d_1me6SCv&SF@kO2+(r)!`Y99l4`Qw88q;ORmhW5`>=YBSbKz} z%kE;JcXXKdhsD_C>P*0000$#sk|GY=lp#+%5nB N002ovPDHLkV1gw_kca>P literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00005.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00005.png new file mode 100644 index 0000000000000000000000000000000000000000..6e71f370c13ab1d7f3742216e31330aad671b603 GIT binary patch literal 324 zcmV-K0lWT*P)m>boTx}C_;%(OK2R8!L98R2lZwRSI_B#U&EI}2rWS)JPpC9-S-hYJOa+L1T zMyP)lq(SeGBSi)jV501YAqA)~pf=GufQ#@FZ+2({rucJf^h;6$@cO41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrQueueWithdrawal/00000.png b/tests/snapshots/nanos_lrQueueWithdrawal/00000.png new file mode 100644 index 0000000000000000000000000000000000000000..8d84cc70fea8013b7e8b25c0982ce142fa103d5c GIT binary patch literal 374 zcmV-+0g3*JP)K?4J2QqX3 zXn7ePqhBDwvA-|J28LIrjF%tX0z{3v6!_gF&(SYH)S*7TN;1RxW-%}TLH9_+sttDO z-T32w&rL(!1@Vr`jm5G(8dd=Ruu#)JAN?l#rFLU`oQ(r?$33AC7s0}pw!fi~(9k^# zU9aci?pXN=I7A<-f!Mw2untnw9MivqZYw}c5&)gweYhbTnv#2#t$0X2wST7_1F;LR zw?>Da2SkSfG>qWq1mej-6nW@2l+Z=0om5jdB%3o3Qx19_LNUlTqF4R_1Iaj%@^2O= z@;n%h1N>H$2;%-~Dvx1!0LtkT-;cq73rgisOElFtPbcL{d3TfNQvm<~003s>1*i4o Uje8$F8UO$Q07*qoM6N<$g5rpv%m4rY literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrQueueWithdrawal/00001.png b/tests/snapshots/nanos_lrQueueWithdrawal/00001.png new file mode 100644 index 0000000000000000000000000000000000000000..c5b561b357d2815884c87b57df32e0d1939cef62 GIT binary patch literal 354 zcmV-o0iFJdP)j1=TyX#U@!jAx9O$}TL5Ej(Hn*d=!4eqS` zZ4>Y(y~w@-#Uvy9YGhK4>?;EeEI}2rq|Z5g9=B&Gq!r3Lqt7~YBf?g4%2!d-AQhk< z#+(8$dN~X`KQU#r38X1VIo4dd}mzMPa06xqPfJiQkiX z;qp@>_sjQmo$l8ZtLKp(@9%XXH-cZuMukVy%uu zd?UZcg=4`$zP{BNQirN#&JLIgSnQy&ZXwrZD;Z7;dBX(Y;*d}sz-5iMkV}(12c@75 z^Bgzf1E}WeKI+a!JH}`Sv`)6xQ!$U)H4%6SK7?zJGmO&d<{-@j#$?+~94oi^V zS@bV(`+N2Zy~hqn7H{Lkz}w8uE<_GIajQZ>x}0QT4(d9%^6&ueu!=yAx-@IWBB$&1 z+gg5Mq?j(P)FlB3Ybkd38M^}k)@}tFpy!C9JIc{)5O z@z$QeIQ9`eWZ?jWi`t2Mo$*Db2R}Hn&;ifF{eG`PbQ=vzUeGZ$-(viTv&jx{*n>+F z$sJSlS-F{}u|NPAS#vt({Ipt{4zxMEv>x1pQ_2Ty6vG|1u)q#rxT8xbt6SjIvSJcm zATRwh1$m*q09lctz8DFqp}sJPfhIVGH2D>obVJ8hCB^DASqdfRP^^LZu4>Ved?oGf z&gPIV`f^(;vh%m0~_?r8>V7uBj~f|{k#}B z4)Di%0(GQh%XXzDG$sKK-Q2JkKR-`QsiPFD-4d_!i{fwH;J|_aEL%ZYNu#B0FJ7G| z;=_VQWOA9;dQ4Y9)LpKCV=ri`X({49JagUwO3&5UdSK)wEJxPN%9wG}45n;lzK(aC zKtbL$y*-#9uSql`7 zENOEh^0jsFWbV&<+yj5)WEX_aERLO-`${sQhD#B5ZCio#Fr4qHlr^7X|9DL69eFa= z#kf#}$Pcl(QEE=tNl8Pt$o;~Fk*8r@j8mpwSGW8d!1&11FbzPh@^gWj=oh7f%f7G)4s^6#xJL07*qo IM6N<$g02I(Gynhq literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrQueueWithdrawal/00005.png b/tests/snapshots/nanos_lrQueueWithdrawal/00005.png new file mode 100644 index 0000000000000000000000000000000000000000..ce795f34e8569e986af689fded3b59c9a8af2961 GIT binary patch literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00000.png b/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00000.png new file mode 100644 index 0000000000000000000000000000000000000000..487ea10fcfeb2f3e6b79239459672251d49addd7 GIT binary patch literal 414 zcmV;P0b%}$P)vpO}&+|8}fC)JNq`>?#dJ%s{^>GN_4usXQirk{^@^BA?p!El9&T9q~zMsh2=YdLB`_ONiP zKy6XlUGFZ>Cn7mP3u*Rz8tb@^47*O50){+cK38t%#_dL60rT>_wMO3hPZbx z;()v>@=o^;1~X35U(EHE zR93R@bEwSm<}dO&-Vr+tls4Y1F?+F{qjJN)3a-=j(*EZsT|bz7GW>@5;=)3&h{B~D zdHG8WB_C(Mn(tQ7-Kw7=HM!#1KBw@o@O_64F`4)sJDyiu_VzDtzKGTB9_?w5AC*L3 z7yhlAejsx9(Zy<4me)98^~Zzopr0Nv!L^#A|> literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00002.png b/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00002.png new file mode 100644 index 0000000000000000000000000000000000000000..db2fe5f5db5da85a372d11d5bc94f987a10cc160 GIT binary patch literal 561 zcmV-10?z%3P)O9YsQc5W#(w!DZMMjAUfLx*6t*Z0#VA&~^%$Y82<(}MB zbC4qTTJmoxTU~5bq0RTu=zjKW(kxYV{neRu%ATr7*(}XfXDCe!&HsqXfXw|}><%k4 zrYdek)HS!^%ad7^0V^=FUT*60b|6tn6T+RdIyeA(PGeVU+P|$ByHeBPoDV?yqxEmK zvo+Dqm8)U7DQ6;^GAHB>%9yz^e`Bz#@B!X9r%==a=hpk5&VY|(<|W+8hG*pCR3AM6 z03SjUglmoxFK;6){jSj!*EUE(Xzyl@>c}FPSrQOZib3`1R2N4 z#9%477XSbN000000000000000000000ALxva{vZLBnpD400000NkvXXu0mjfJAwKR literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00003.png b/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00003.png new file mode 100644 index 0000000000000000000000000000000000000000..b2401b220a6db139961dbcfed78507c4de86032a GIT binary patch literal 415 zcmV;Q0bu@#P)Q31IlGw|9L_yRTLLS&ux#tU!)?{o#0wDkZ008EG?1xM#ZH*XXtLJje zn{n*@df&j4{!!jD&jO^BVvJ()hQHH!%W3(Dj6W`QoPO|;n2-Ayk2fOj!k(QvFKVVz zN;#YPAImsuXF2GEUvpr^C8&NT!any~^~irCB9x)jPI1+~25toqi%C6mLnBjXN6GEh z+9gIeu7UFsG@jy9g;A5($*kA<6Bb;8%B3c|@F<8lTYl9}-0rEScN?C9`;0f0RR9100000000000001hX}(@gLwlUg|EK@}002ov JPDHLkV1g7!yiouE literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00004.png b/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00004.png new file mode 100644 index 0000000000000000000000000000000000000000..570ce28d53e82ac396ba25c370110058f3a638f9 GIT binary patch literal 472 zcmV;}0Vn>6P)Nkl`l1;k+@4An6g^M6kcbtxu@7*hfO000000DuchDWw$aQJnB& zJ%BsK3VrpQ1hnYqoNY&PO0WdV>i`7cs)e_@w@x()p@w=B24`klR6(CLpxqtlZO|2 zIWjpO-F~*EHtLqUMt)Wc_@bMv^h#{CUFW0M(vJ1P=5N1GhWcHM(-Xu*&bc@D4_o$^ z7Y|pL)I@*DzttR=&yLH#^{|TW)8Sp0qphw%epiuSUG#WHS~ht|j~;`U4>BXmdi9@& zuz>%00000G5i7^TsbXePb2LB O0000U4`s1;0 z?{f>9Zfbf|_00eLCwPudd#p2Mzfg8-=Z~Y&(Z3(6-dSPln_e}2 z&8bJe=5=w3_V0Wxpw!uqXV@ zTyg#0l&4R7|Ayyoo}1J3WZRs6lez;p_x-s3`O4ERHjEo5Zk@S4@1z`Oka)v{pj(C~ z>TB;CrkB0D2@>;k^>bP0l+XkKqsFS~ literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00000.png b/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00000.png new file mode 100644 index 0000000000000000000000000000000000000000..487ea10fcfeb2f3e6b79239459672251d49addd7 GIT binary patch literal 414 zcmV;P0b%}$P)vpO}&+|8}fC)JNq`>?#dJ%s{^>GN_4usXQirk{^@^BA?p!El9&T9q~zMsh2=YdLB`_ONiP zKy6XlUGFZ>Cn7mP3u*L`a;6^GDE#|x+bzG5DC~iC0Ewk zCaxV1^~(2*mCMnh$JIZh?t^W|Y%eU!{mL5LS^Y|ErM7loL3}*hga}9J5x;KlfIAxj z%7Lj+DIck-E>Q;SM9rpyaa%^f+_h^v&iGDQH|(uiy4auQfyG0$OMcu!Qs9hj#qjs;__4I3x4v=&gzEnm_1`ZhDj6uk9;Z!B4ldAXWOA?-%?khk n0000000000000000BrLIJyAZuoSlBNKfb_qtt63d>b&HNtU-+lq5YzmISJTY> zHi@5?6JVY$S0n5$7Hyq5SYaOm*TYZ|s!K6<{F5fj%7_O(h_yyVFp<~ZKGdzQbJpWWSU*}U@B^m?vc zf%eO;9{YUOKCyLrK}cEapRdt!_qBp--zGTLv`8+0wpyDfvER$lx@aEf`HM64Ce$$0 zY+ibw@v(gUnU?M|b^X^QHvVa|3d-_T=Xc)z!{o_N!@MI8Qc9l+#$LxcP*ry}aH-sOu e0>c9t*gfOdH~qpr!)KB;NZ8ZW&t;ucLK6U-%B4*J literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00003.png b/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00003.png new file mode 100644 index 0000000000000000000000000000000000000000..2a409b85c209be284ea1c1bb9820a3c8367a5a07 GIT binary patch literal 410 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!2~2@x4h6`U|>x2ba4!+nDh2#;G|{+o`#1d z>G_BL_8*D;)+pJg$ha}uWhnN(z1rHpeAPDt{eR^S-@S9}r`_1v`))Od$m;2i9Ww|<@2UTJhNthN zu*Gll_!92FcIpr}ob28E>yLhIzHY`xvAz#huY_uE+A?;>d#0xcrq;SgKUd4+vRZkj zq?TdEf6pADr7~-M|MgbxylC|1z|!BG6>n9|bsv|MtvY;dci1+W-(2Dkdp{WbsW_}4 z{5QELK=|+B8O;7EivHq`X?)w1_5i~O85}UHx9JydIIH0#0220e^>bP0l+XkKwcM~8 literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00004.png b/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00004.png new file mode 100644 index 0000000000000000000000000000000000000000..b2401b220a6db139961dbcfed78507c4de86032a GIT binary patch literal 415 zcmV;Q0bu@#P)Q31IlGw|9L_yRTLLS&ux#tU!)?{o#0wDkZ008EG?1xM#ZH*XXtLJje zn{n*@df&j4{!!jD&jO^BVvJ()hQHH!%W3(Dj6W`QoPO|;n2-Ayk2fOj!k(QvFKVVz zN;#YPAImsuXF2GEUvpr^C8&NT!any~^~irCB9x)jPI1+~25toqi%C6mLnBjXN6GEh z+9gIeu7UFsG@jy9g;A5($*kA<6Bb;8%B3c|@F<8lTYl9}-0rEScN?C9`;0f0RR9100000000000001hX}(@gLwlUg|EK@}002ov JPDHLkV1g7!yiouE literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00005.png b/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00005.png new file mode 100644 index 0000000000000000000000000000000000000000..570ce28d53e82ac396ba25c370110058f3a638f9 GIT binary patch literal 472 zcmV;}0Vn>6P)Nkl`l1;k+@4An6g^M6kcbtxu@7*hfO000000DuchDWw$aQJnB& zJ%BsK3VrpQ1hnYqoNY&PO0WdV>i`7cs)e_@w@x()p@w=B24`klR6(CLpxqtlZO|2 zIWjpO-F~*EHtLqUMt)Wc_@bMv^h#{CUFW0M(vJ1P=5N1GhWcHM(-Xu*&bc@D4_o$^ z7Y|pL)I@*DzttR=&yLH#^{|TW)8Sp0qphw%epiuSUG#WHS~ht|j~;`U4>BXmdi9@& zuz>%00000G5i7^TsbXePb2LB O0000U4`s1;0 z?{f>9Zfbf|_00eLCwPudd#p2Mzfg8-=Z~Y&(Z3(6-dSPln_e}2 z&8bJe=5=w3_V0Wxpw!uqXV@ zTyg#0l&4R7|Ayyoo}1J3WZRs6lez;p_x-s3`O4ERHjEo5Zk@S4@1z`Oka)v{pj(C~ z>TB;CrkB0D2@>;k^>bP0l+XkKqsFS~ literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00000.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00000.png new file mode 100644 index 0000000000000000000000000000000000000000..487ea10fcfeb2f3e6b79239459672251d49addd7 GIT binary patch literal 414 zcmV;P0b%}$P)vpO}&+|8}fC)JNq`>?#dJ%s{^>GN_4usXQirk{^@^BA?p!El9&T9q~zMsh2=YdLB`_ONiP zKy6XlUGFZ>Cn7mP3u*L`a;6^GDE#|x+bzG5DC~iC0Ewk zCaxV1^~(2*mCMnh$JIZh?t^W|Y%eU!{mL5LS^Y|ErM7loL3}*hga}9J5x;KlfIAxj z%7Lj+DIck-E>Q;SM9rpyaa%^f+_h^v&iGDQH|(uiy4auQfyG0$OMcu!Qs9hj#qjs;__4I3x4v=&gzEnm_1`ZhDj6uk9;Z!B4ldAXWOA?-%?khk n0000000000000000BrLIJyAwipyLtC!&-~z1H*xoK&WyUx z{mpY+BN+_~G9QT-ni!Y&uYZ~RFS~g9g;lHK+PW61s#e6>rzpCr|E)L9PCNR}Np#b% z-*HB-;#)8BEB^6x>%Fw3&$xC&WXn#3; z__8Oa3I7%bY!q1hc)$DmdmHPvS#6#^?Nj6h2gBq0D~@i-WIFV?YU?}W$(lEduRZ_f zd*DWj<`w?OWrw{YdRRK9a^BeNmtD8qZsK(t%ZHEuo$uV`sP^l$iIeXaabi-e}trh_Q0001ZEiuLzqxD%B@N0bn zA|hG(+dS~&_n-9%sKgjU2uY?~NaY;R-BQ-7+Nqiq9H0o9#Y{!H4Hg(@uXogSjB zp35NwTlK|*0f}8&w2C{)CkOD7g4R{=ON@I!nVQ?=uF>`t^GtFW7b&Pr%Dbv`pQ7yp zV^ICIJr4i?0N_Pvs}5VXPlM$%tjuTuRoy{@H{fC(AhXM^hW6dy6jRbJwe#EOo}X* z{JNRV#OeBdz==7xrMklIfyN#Tp2ls(0~d0&2NQW8+|&J_ij4ZV(UBVUZw3!6Aq!bD z5g89I{*6F7Rr*C`eDJ7GE>r7lHxCV1O|gUOg#4h0000Q31IlGw|9L_yRTLLS&ux#tU!)?{o#0wDkZ008EG?1xM#ZH*XXtLJje zn{n*@df&j4{!!jD&jO^BVvJ()hQHH!%W3(Dj6W`QoPO|;n2-Ayk2fOj!k(QvFKVVz zN;#YPAImsuXF2GEUvpr^C8&NT!any~^~irCB9x)jPI1+~25toqi%C6mLnBjXN6GEh z+9gIeu7UFsG@jy9g;A5($*kA<6Bb;8%B3c|@F<8lTYl9}-0rEScN?C9`;0f0RR9100000000000001hX}(@gLwlUg|EK@}002ov JPDHLkV1g7!yiouE literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00005.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00005.png new file mode 100644 index 0000000000000000000000000000000000000000..570ce28d53e82ac396ba25c370110058f3a638f9 GIT binary patch literal 472 zcmV;}0Vn>6P)Nkl`l1;k+@4An6g^M6kcbtxu@7*hfO000000DuchDWw$aQJnB& zJ%BsK3VrpQ1hnYqoNY&PO0WdV>i`7cs)e_@w@x()p@w=B24`klR6(CLpxqtlZO|2 zIWjpO-F~*EHtLqUMt)Wc_@bMv^h#{CUFW0M(vJ1P=5N1GhWcHM(-Xu*&bc@D4_o$^ z7Y|pL)I@*DzttR=&yLH#^{|TW)8Sp0qphw%epiuSUG#WHS~ht|j~;`U4>BXmdi9@& zuz>%00000G5i7^TsbXePb2LB O0000U4`s1;0 z?{f>9Zfbf|_00eLCwPudd#p2Mzfg8-=Z~Y&(Z3(6-dSPln_e}2 z&8bJe=5=w3_V0Wxpw!uqXV@ zTyg#0l&4R7|Ayyoo}1J3WZRs6lez;p_x-s3`O4ERHjEo5Zk@S4@1z`Oka)v{pj(C~ z>TB;CrkB0D2@>;k^>bP0l+XkKqsFS~ literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00000.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00000.png new file mode 100644 index 0000000000000000000000000000000000000000..487ea10fcfeb2f3e6b79239459672251d49addd7 GIT binary patch literal 414 zcmV;P0b%}$P)vpO}&+|8}fC)JNq`>?#dJ%s{^>GN_4usXQirk{^@^BA?p!El9&T9q~zMsh2=YdLB`_ONiP zKy6XlUGFZ>Cn7mP3u*L`a;6^GDE#|x+bzG5DC~iC0Ewk zCaxV1^~(2*mCMnh$JIZh?t^W|Y%eU!{mL5LS^Y|ErM7loL3}*hga}9J5x;KlfIAxj z%7Lj+DIck-E>Q;SM9rpyaa%^f+_h^v&iGDQH|(uiy4auQfyG0$OMcu!Qs9hj#qjs;__4I3x4v=&gzEnm_1`ZhDj6uk9;Z!B4ldAXWOA?-%?khk n0000000000000000BrLIJyAQ31IlGw|9pdw@pNh82cde6tGNqJ1{Kqv_T0002k?q%D3N~wH~F&h3S zzbK_tCqO-Op^yI(2 zS&1K^30Zr-myGsX!{~<)-X^_f<)+Se`k+|;a5&YJ0ymnJj7Pw?!L0|!xY>HRh!#ZG zw(O^%iN-NilV>~s1P>44tQ`vV(u(t!xHvUQ_vk5{}SF~@NJ>KrwxqKzytNZ=k_3%Q26Ui4c z6X)EP`dV>ZMw}l!joXSBE@X8M4#NB3k?uz~$V7h|CDcTJGjd>wS;*2skjcSPgckq+ n00000000000000009fW9=_5(OU%?(o00000NkvXXu0mjfk`Kst literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00003.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00003.png new file mode 100644 index 0000000000000000000000000000000000000000..e55377ba07988fbb928fedd38821d687e5dfcb51 GIT binary patch literal 494 zcmVt}Il|^3lUf zl-+YVgkY<_crYMwN(-&HlX&t1UP92m3SPu`29%*$2lpO&u9!!XmvIq-%AkCzOY<(O zZy1B_kDYk{0002Cd|3~m%Y34yTuL^R6U}_a%xd+yoLZju8V|BeXD{(NTx`VTZ%>p& z$)9D~vN|em6ugL+T#)?V59|0a4i`E#J#OX)M+Qs=}bG%9li1Uf<_Y^;>*{&w^M&_dTGJEaP)Zk kMY0FX0{{R30DuF20eXNIR({XdV*mgE07*qoM6N<$g2h7D%K!iX literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00004.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00004.png new file mode 100644 index 0000000000000000000000000000000000000000..b2401b220a6db139961dbcfed78507c4de86032a GIT binary patch literal 415 zcmV;Q0bu@#P)Q31IlGw|9L_yRTLLS&ux#tU!)?{o#0wDkZ008EG?1xM#ZH*XXtLJje zn{n*@df&j4{!!jD&jO^BVvJ()hQHH!%W3(Dj6W`QoPO|;n2-Ayk2fOj!k(QvFKVVz zN;#YPAImsuXF2GEUvpr^C8&NT!any~^~irCB9x)jPI1+~25toqi%C6mLnBjXN6GEh z+9gIeu7UFsG@jy9g;A5($*kA<6Bb;8%B3c|@F<8lTYl9}-0rEScN?C9`;0f0RR9100000000000001hX}(@gLwlUg|EK@}002ov JPDHLkV1g7!yiouE literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00005.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00005.png new file mode 100644 index 0000000000000000000000000000000000000000..570ce28d53e82ac396ba25c370110058f3a638f9 GIT binary patch literal 472 zcmV;}0Vn>6P)Nkl`l1;k+@4An6g^M6kcbtxu@7*hfO000000DuchDWw$aQJnB& zJ%BsK3VrpQ1hnYqoNY&PO0WdV>i`7cs)e_@w@x()p@w=B24`klR6(CLpxqtlZO|2 zIWjpO-F~*EHtLqUMt)Wc_@bMv^h#{CUFW0M(vJ1P=5N1GhWcHM(-Xu*&bc@D4_o$^ z7Y|pL)I@*DzttR=&yLH#^{|TW)8Sp0qphw%epiuSUG#WHS~ht|j~;`U4>BXmdi9@& zuz>%00000G5i7^TsbXePb2LB O0000U4`s1;0 z?{f>9Zfbf|_00eLCwPudd#p2Mzfg8-=Z~Y&(Z3(6-dSPln_e}2 z&8bJe=5=w3_V0Wxpw!uqXV@ zTyg#0l&4R7|Ayyoo}1J3WZRs6lez;p_x-s3`O4ERHjEo5Zk@S4@1z`Oka)v{pj(C~ z>TB;CrkB0D2@>;k^>bP0l+XkKqsFS~ literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrQueueWithdrawal/00000.png b/tests/snapshots/nanox_lrQueueWithdrawal/00000.png new file mode 100644 index 0000000000000000000000000000000000000000..487ea10fcfeb2f3e6b79239459672251d49addd7 GIT binary patch literal 414 zcmV;P0b%}$P)vpO}&+|8}fC)JNq`>?#dJ%s{^>GN_4usXQirk{^@^BA?p!El9&T9q~zMsh2=YdLB`_ONiP zKy6XlUGFZ>Cn7mP3u*>+`L1 zPs>Z0(yuh0v$%8X{3{lww$m{#w^}YFe#%d4Q(vO#@Ip;lDe{^7ET)k8^{(zqH65mD zTWR?+cKuTPB5NeN;O8bOps@$M=iR+~{lfbVry~T5(LSWx97cky0ZB%=l;_c?bEL>xM*?bcD)gc z1^?^!*DaL)UgzMO`Niqj%$uJ~+X9%Tr&zCKI4Ajw(|g`R)&1YEvlr_evd$@?2>?C8vuOYT literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrQueueWithdrawal/00002.png b/tests/snapshots/nanox_lrQueueWithdrawal/00002.png new file mode 100644 index 0000000000000000000000000000000000000000..50fda38a6043742f3ac569162cfdf2680d905c62 GIT binary patch literal 541 zcmV+&0^Q@-F?z)S;*-uA0rxdmo*Zh@eP}Gz0(u004mFd`;-2ltKtGMnf_; zjxD_KT3PPQT7H&{GUuXKE5?{oN+~Ug^q@trikCG3kTaCKRSB;ZEQNBAIn$-BEXhsf zgH*BSl7CCx>SU_}+I+iuk8@^|X07VdU&1`5lvGv9W@)bKp)}$0Kdj1t%5)k_Zm zz=xCmv)h)ks~#CQ;lW{7apuW)>R#Vn(WM#42&1F<(L-oF< zOq7zcP-^(ut*UOsm_v0B8b7*Er9^cY9CqBUF{ARY(b>h~3}`Xv+3h!HZw2CYi-!U* zn4#}*k#W`I=8AWcXOtq;>sU39nciVnXTXR7b^e6jDOdg{Z@ilqyZ%vn-WtJW&eh+V z+C(bd{?>jR%@vzoN@C!pvSKXaVTi$Q31IlGw|9L_yRTLLS&ux#tU!)?{o#0wDkZ008EG?1xM#ZH*XXtLJje zn{n*@df&j4{!!jD&jO^BVvJ()hQHH!%W3(Dj6W`QoPO|;n2-Ayk2fOj!k(QvFKVVz zN;#YPAImsuXF2GEUvpr^C8&NT!any~^~irCB9x)jPI1+~25toqi%C6mLnBjXN6GEh z+9gIeu7UFsG@jy9g;A5($*kA<6Bb;8%B3c|@F<8lTYl9}-0rEScN?C9`;0f0RR9100000000000001hX}(@gLwlUg|EK@}002ov JPDHLkV1g7!yiouE literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrQueueWithdrawal/00004.png b/tests/snapshots/nanox_lrQueueWithdrawal/00004.png new file mode 100644 index 0000000000000000000000000000000000000000..570ce28d53e82ac396ba25c370110058f3a638f9 GIT binary patch literal 472 zcmV;}0Vn>6P)Nkl`l1;k+@4An6g^M6kcbtxu@7*hfO000000DuchDWw$aQJnB& zJ%BsK3VrpQ1hnYqoNY&PO0WdV>i`7cs)e_@w@x()p@w=B24`klR6(CLpxqtlZO|2 zIWjpO-F~*EHtLqUMt)Wc_@bMv^h#{CUFW0M(vJ1P=5N1GhWcHM(-Xu*&bc@D4_o$^ z7Y|pL)I@*DzttR=&yLH#^{|TW)8Sp0qphw%epiuSUG#WHS~ht|j~;`U4>BXmdi9@& zuz>%00000G5i7^TsbXePb2LB O0000U4`s1;0 z?{f>9Zfbf|_00eLCwPudd#p2Mzfg8-=Z~Y&(Z3(6-dSPln_e}2 z&8bJe=5=w3_V0Wxpw!uqXV@ zTyg#0l&4R7|Ayyoo}1J3WZRs6lez;p_x-s3`O4ERHjEo5Zk@S4@1z`Oka)v{pj(C~ z>TB;CrkB0D2@>;k^>bP0l+XkKqsFS~ literal 0 HcmV?d00001 diff --git a/tests/src/lrDepositIntoStrategy.test.js b/tests/src/lrDepositIntoStrategy.test.js index 432cef7..c47a4c0 100644 --- a/tests/src/lrDepositIntoStrategy.test.js +++ b/tests/src/lrDepositIntoStrategy.test.js @@ -29,7 +29,7 @@ nano_models.forEach(function (model) { const { data } = await contract.populateTransaction.depositIntoStrategy( '0x9d7eD45EE2E8FC5482fa2428f15C971e6369011d', // ETHx strat '0xA35b1B31Ce002FBF2058D22F30f95D405200A15b', // ETHx erc20 - 42 + '420000000000000' ); let unsignedTx = genericTx; From 5f41aba91c36eaada338044d6df867a6aae5a1b7 Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Fri, 2 Feb 2024 16:39:21 +0100 Subject: [PATCH 14/33] fix: readme previews --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 69fbf09..1e3ec18 100644 --- a/README.md +++ b/README.md @@ -126,15 +126,15 @@ The flow processed in [GitHub Actions](https://github.com/features/actions) is t ### LR Deposit Into Strategy -![](/tests/snapshots/nanos_lrDepositIntoStrategy/00000.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategy/00001.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategy/00002.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategy/00003.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategy/00004.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategy/00005.png) +![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00000.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00001.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00002.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00003.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00004.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00005.png) -### LR Queue Withdraw +### LR Queue Withdrawal -![](/tests/snapshots/nanos_lrQueueWithdraw/00000.png) ![](/tests/snapshots/nanos_lrQueueWithdraw/00001.png) ![](/tests/snapshots/nanos_lrQueueWithdraw/00002.png) ![](/tests/snapshots/nanos_lrQueueWithdraw/00003.png) ![](/tests/snapshots/nanos_lrQueueWithdraw/00004.png) ![](/tests/snapshots/nanos_lrQueueWithdraw/00005.png) +![](/tests/snapshots/nanos_lrQueueWithdrawal/00000.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00001.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00002.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00003.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00004.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00005.png) -### LR Complete Queued Withdraw +### LR Complete Queued Withdrawal -![](/tests/snapshots/nanos_lrCompleteQueuedWithdraw/00000.png) ![](/tests/snapshots/nanos_lrCompleteQueuedWithdraw/00001.png) ![](/tests/snapshots/nanos_lrCompleteQueuedWithdraw/00002.png) ![](/tests/snapshots/nanos_lrCompleteQueuedWithdraw/00003.png) ![](/tests/snapshots/nanos_lrCompleteQueuedWithdraw/00004.png) ![](/tests/snapshots/nanos_lrCompleteQueuedWithdraw/00005.png) +![](/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00000.png) ![](/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00001.png) ![](/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00002.png) ![](/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00003.png) ![](/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00004.png) ![](/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00005.png) ## NANO X @@ -188,12 +188,12 @@ The flow processed in [GitHub Actions](https://github.com/features/actions) is t ### LR Deposit Into Strategy -![](/tests/snapshots/nanox_lrDepositIntoStrategy/00000.png) ![](/tests/snapshots/nanox_lrDepositIntoStrategy/00001.png) ![](/tests/snapshots/nanox_lrDepositIntoStrategy/00002.png) ![](/tests/snapshots/nanox_lrDepositIntoStrategy/00003.png) ![](/tests/snapshots/nanox_lrDepositIntoStrategy/00004.png) ![](/tests/snapshots/nanox_lrDepositIntoStrategy/00005.png) +![](/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00000.png) ![](/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00001.png) ![](/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00002.png) ![](/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00003.png) ![](/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00004.png) ![](/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00005.png) -### LR Queue Withdraw +### LR Queue Withdrawal -![](/tests/snapshots/nanox_lrQueueWithdraw/00000.png) ![](/tests/snapshots/nanox_lrQueueWithdraw/00001.png) ![](/tests/snapshots/nanox_lrQueueWithdraw/00002.png) ![](/tests/snapshots/nanox_lrQueueWithdraw/00003.png) ![](/tests/snapshots/nanox_lrQueueWithdraw/00004.png) ![](/tests/snapshots/nanox_lrQueueWithdraw/00005.png) +![](/tests/snapshots/nanox_lrQueueWithdrawal/00000.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00001.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00002.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00003.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00004.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00005.png) -### LR Complete Queued Withdraw +### LR Complete Queued Withdrawal -![](/tests/snapshots/nanox_lrCompleteQueuedWithdraw/00000.png) ![](/tests/snapshots/nanox_lrCompleteQueuedWithdraw/00001.png) ![](/tests/snapshots/nanox_lrCompleteQueuedWithdraw/00002.png) ![](/tests/snapshots/nanox_lrCompleteQueuedWithdraw/00003.png) ![](/tests/snapshots/nanox_lrCompleteQueuedWithdraw/00004.png) ![](/tests/snapshots/nanox_lrCompleteQueuedWithdraw/00005.png) +![](/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00000.png) ![](/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00001.png) ![](/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00002.png) ![](/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00003.png) ![](/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00004.png) ![](/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00005.png) From a6a7c5efee8481a0ad195394b6f39a8e82f412e6 Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Fri, 2 Feb 2024 16:41:20 +0100 Subject: [PATCH 15/33] fix: readme previews --- README.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 1e3ec18..ce35282 100644 --- a/README.md +++ b/README.md @@ -110,19 +110,19 @@ The flow processed in [GitHub Actions](https://github.com/features/actions) is t ### Stake v2 -![](/tests/snapshots/nanos_stakeV2/00000.png) ![](/tests/snapshots/nanos_stakeV2/00001.png) ![](/tests/snapshots/nanos_stakeV2/00002.png) ![](/tests/snapshots/nanos_stakeV2/00003.png) ![](/tests/snapshots/nanos_stakeV2/00004.png) ![](/tests/snapshots/nanos_stakeV2/00005.png) +![](/tests/snapshots/nanos_stakev2/00000.png) ![](/tests/snapshots/nanos_stakev2/00001.png) ![](/tests/snapshots/nanos_stakev2/00002.png) ![](/tests/snapshots/nanos_stakev2/00003.png) ![](/tests/snapshots/nanos_stakev2/00004.png) ![](/tests/snapshots/nanos_stakev2/00005.png) -### RequestExit v2 +### RequestExit V2 -![](/tests/snapshots/nanos_requestExitV2/00000.png) ![](/tests/snapshots/nanos_requestExitV2/00001.png) ![](/tests/snapshots/nanos_requestExitV2/00002.png) ![](/tests/snapshots/nanos_requestExitV2/00003.png) ![](/tests/snapshots/nanos_requestExitV2/00004.png) ![](/tests/snapshots/nanos_requestExitV2/00005.png) +![](/tests/snapshots/nanos_requestExitv2/00000.png) ![](/tests/snapshots/nanos_requestExitv2/00001.png) ![](/tests/snapshots/nanos_requestExitv2/00002.png) ![](/tests/snapshots/nanos_requestExitv2/00003.png) ![](/tests/snapshots/nanos_requestExitv2/00004.png) ![](/tests/snapshots/nanos_requestExitv2/00005.png) -### MultiClaim v2 +### MultiClaim V2 -![](/tests/snapshots/nanos_multiClaimV2/00000.png) ![](/tests/snapshots/nanos_multiClaimV2/00001.png) ![](/tests/snapshots/nanos_multiClaimV2/00002.png) ![](/tests/snapshots/nanos_multiClaimV2/00003.png) ![](/tests/snapshots/nanos_multiClaimV2/00004.png) ![](/tests/snapshots/nanos_multiClaimV2/00005.png) +![](/tests/snapshots/nanos_multiClaimv2/00000.png) ![](/tests/snapshots/nanos_multiClaimv2/00001.png) ![](/tests/snapshots/nanos_multiClaimv2/00002.png) ![](/tests/snapshots/nanos_multiClaimv2/00003.png) ![](/tests/snapshots/nanos_multiClaimv2/00004.png) ![](/tests/snapshots/nanos_multiClaimv2/00005.png) -### Claim v2 +### Claim V2 -![](/tests/snapshots/nanos_claimV2/00000.png) ![](/tests/snapshots/nanos_claimV2/00001.png) ![](/tests/snapshots/nanos_claimV2/00002.png) ![](/tests/snapshots/nanos_claimV2/00003.png) ![](/tests/snapshots/nanos_claimV2/00004.png) ![](/tests/snapshots/nanos_claimV2/00005.png) +![](/tests/snapshots/nanos_claimv2/00000.png) ![](/tests/snapshots/nanos_claimv2/00001.png) ![](/tests/snapshots/nanos_claimv2/00002.png) ![](/tests/snapshots/nanos_claimv2/00003.png) ![](/tests/snapshots/nanos_claimv2/00004.png) ![](/tests/snapshots/nanos_claimv2/00005.png) ### LR Deposit Into Strategy @@ -172,19 +172,19 @@ The flow processed in [GitHub Actions](https://github.com/features/actions) is t ### Stake V2 -![](/tests/snapshots/nanox_stakeV2/00000.png) ![](/tests/snapshots/nanox_stakeV2/00001.png) ![](/tests/snapshots/nanox_stakeV2/00002.png) ![](/tests/snapshots/nanox_stakeV2/00003.png) ![](/tests/snapshots/nanox_stakeV2/00004.png) ![](/tests/snapshots/nanox_stakeV2/00005.png) +![](/tests/snapshots/nanox_stakev2/00000.png) ![](/tests/snapshots/nanox_stakev2/00001.png) ![](/tests/snapshots/nanox_stakev2/00002.png) ![](/tests/snapshots/nanox_stakev2/00003.png) ![](/tests/snapshots/nanox_stakev2/00004.png) ![](/tests/snapshots/nanox_stakev2/00005.png) ### RequestExit V2 -![](/tests/snapshots/nanox_requestExitV2/00000.png) ![](/tests/snapshots/nanox_requestExitV2/00001.png) ![](/tests/snapshots/nanox_requestExitV2/00002.png) ![](/tests/snapshots/nanox_requestExitV2/00003.png) ![](/tests/snapshots/nanox_requestExitV2/00004.png) ![](/tests/snapshots/nanox_requestExitV2/00005.png) +![](/tests/snapshots/nanox_requestExitv2/00000.png) ![](/tests/snapshots/nanox_requestExitv2/00001.png) ![](/tests/snapshots/nanox_requestExitv2/00002.png) ![](/tests/snapshots/nanox_requestExitv2/00003.png) ![](/tests/snapshots/nanox_requestExitv2/00004.png) ![](/tests/snapshots/nanox_requestExitv2/00005.png) ### MultiClaim V2 -![](/tests/snapshots/nanox_multiClaimV2/00000.png) ![](/tests/snapshots/nanox_multiClaimV2/00001.png) ![](/tests/snapshots/nanox_multiClaimV2/00002.png) ![](/tests/snapshots/nanox_multiClaimV2/00003.png) ![](/tests/snapshots/nanox_multiClaimV2/00004.png) ![](/tests/snapshots/nanox_multiClaimV2/00005.png) +![](/tests/snapshots/nanox_multiClaimv2/00000.png) ![](/tests/snapshots/nanox_multiClaimv2/00001.png) ![](/tests/snapshots/nanox_multiClaimv2/00002.png) ![](/tests/snapshots/nanox_multiClaimv2/00003.png) ![](/tests/snapshots/nanox_multiClaimv2/00004.png) ![](/tests/snapshots/nanox_multiClaimv2/00005.png) ### Claim V2 -![](/tests/snapshots/nanox_claimV2/00000.png) ![](/tests/snapshots/nanox_claimV2/00001.png) ![](/tests/snapshots/nanox_claimV2/00002.png) ![](/tests/snapshots/nanox_claimV2/00003.png) ![](/tests/snapshots/nanox_claimV2/00004.png) ![](/tests/snapshots/nanox_claimV2/00005.png) +![](/tests/snapshots/nanox_claimv2/00000.png) ![](/tests/snapshots/nanox_claimv2/00001.png) ![](/tests/snapshots/nanox_claimv2/00002.png) ![](/tests/snapshots/nanox_claimv2/00003.png) ![](/tests/snapshots/nanox_claimv2/00004.png) ![](/tests/snapshots/nanox_claimv2/00005.png) ### LR Deposit Into Strategy From e2bacadb021fe996123963743f83321bf9f9c3d5 Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Fri, 2 Feb 2024 16:45:25 +0100 Subject: [PATCH 16/33] fix: test address case --- tests/src/lrCompleteQueuedWithdrawal.test.js | 2 +- tests/src/lrQueueWithdrawal.test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/src/lrCompleteQueuedWithdrawal.test.js b/tests/src/lrCompleteQueuedWithdrawal.test.js index 74945e8..4d4fe59 100644 --- a/tests/src/lrCompleteQueuedWithdrawal.test.js +++ b/tests/src/lrCompleteQueuedWithdrawal.test.js @@ -13,7 +13,7 @@ import { ethers } from 'ethers'; import { parseEther, parseUnits } from 'ethers/lib/utils'; import { ledgerService } from '@ledgerhq/hw-app-eth'; -const contractAddr = '0x858646372CC42E1A627fcE94aa7A7033e7CF075A'; // strategy manager +const contractAddr = '0x858646372cc42e1a627fce94aa7a7033e7cf075a'; // strategy manager const pluginName = 'Kiln'; const abi_path = `../cal/abis/${contractAddr}.json`; diff --git a/tests/src/lrQueueWithdrawal.test.js b/tests/src/lrQueueWithdrawal.test.js index fc68691..47a4f4a 100644 --- a/tests/src/lrQueueWithdrawal.test.js +++ b/tests/src/lrQueueWithdrawal.test.js @@ -13,7 +13,7 @@ import { ethers } from 'ethers'; import { parseEther, parseUnits } from 'ethers/lib/utils'; import { ledgerService } from '@ledgerhq/hw-app-eth'; -const contractAddr = '0x858646372CC42E1A627fcE94aa7A7033e7CF075A'; // strategy manager +const contractAddr = '0x858646372cc42e1a627fce94aa7a7033e7cf075a'; // strategy manager const pluginName = 'Kiln'; const abi_path = `../cal/abis/${contractAddr}.json`; From 409f6cf5eb227ea512b24619543aaf87a6605154 Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Fri, 2 Feb 2024 16:53:54 +0100 Subject: [PATCH 17/33] feat: liquid restaking screens --- src/handle_query_contract_id.c | 4 ++-- src/handle_query_contract_ui.c | 4 ++-- .../nanos_lrCompleteQueuedWithdrawal/00001.png | Bin 364 -> 380 bytes .../nanos_lrCompleteQueuedWithdrawal/00002.png | Bin 491 -> 445 bytes .../snapshots/nanos_lrQueueWithdrawal/00001.png | Bin 354 -> 380 bytes .../snapshots/nanos_lrQueueWithdrawal/00002.png | Bin 456 -> 422 bytes .../nanox_lrCompleteQueuedWithdrawal/00001.png | Bin 406 -> 426 bytes .../nanox_lrCompleteQueuedWithdrawal/00002.png | Bin 561 -> 522 bytes .../snapshots/nanox_lrQueueWithdrawal/00001.png | Bin 407 -> 426 bytes .../snapshots/nanox_lrQueueWithdrawal/00002.png | Bin 541 -> 496 bytes 10 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/handle_query_contract_id.c b/src/handle_query_contract_id.c index b9c0180..285f9b2 100644 --- a/src/handle_query_contract_id.c +++ b/src/handle_query_contract_id.c @@ -49,11 +49,11 @@ void handle_query_contract_id(ethQueryContractID_t *msg) { break; case KILN_LR_QUEUE_WITHDRAWAL: - strlcpy(msg->version, "Queue Withdrawal", msg->versionLength); + strlcpy(msg->version, "Liquid Restaking", msg->versionLength); break; case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: - strlcpy(msg->version, "Queued Withdrawal", msg->versionLength); + strlcpy(msg->version, "Liquid Restaking", msg->versionLength); break; default: diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index dd38052..10784ae 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -211,7 +211,7 @@ static bool queue_withdrawal_ui_lr(ethQueryContractUI_t *msg) { switch (msg->screenIndex) { case 0: - strlcpy(msg->title, "Liquid Restaking", msg->titleLength); + strlcpy(msg->title, "EigenLayer", msg->titleLength); strlcpy(msg->msg, "Queue Withdrawal", msg->msgLength); ret = true; break; @@ -229,7 +229,7 @@ static bool complete_queued_withdrawal_ui_lr(ethQueryContractUI_t *msg) { switch (msg->screenIndex) { case 0: - strlcpy(msg->title, "Liquid Restaking", msg->titleLength); + strlcpy(msg->title, "EigenLayer", msg->titleLength); strlcpy(msg->msg, "Complete Withdrawal", msg->msgLength); ret = true; break; diff --git a/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00001.png b/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00001.png index 0f8045ce987d2e781dd12eb9686979c9169fb554..c978af0baf12daf4747b904387f03ec16315336b 100644 GIT binary patch delta 353 zcmV-n0iOQs0{jAyB!5FmL_t(|ob8$04uc>JhH;ti|G-{s7bFCG8Zxw${9l#@kz;=- zp{4`?002zQ=Md670q(-Kbz}kF-UGP8=SbVGKBlu0pu)M@C07Slkw*; zuQH?&t>y9?#gOrL_cd#yO3Pwgx}%-;w>NW7Fs=@S@dzb(D`s}|NV+JGIi3H>C5{JE z$za67WO)7|KVzNRA5z3jdyO~NB^7P|Rx8v!)L!C*qYGrQlgv6tT$`F0P767p0Ngnw z<_EZ2vs=insajow;?VvkU@$Jz5|X zKy-t%v&Jp2<#@kBSQoSk0S{qc?3)At0EFTTWHH*in15Ra00000NkvXXu0mjf{Y|7# delta 337 zcmV-X0j~c10_*~iB!4qWL_t(|ob8$24udcVg>jkh|G-}8g^59E8P)#peAz|quu#rQ z6Gj98004B&z6Hj507_x!dSn5{kXFv;OzVw?FG%%cU0qoei5>r~snZ-=Z2xI>u&S11h;VV}0(*GkW*^YJw(dW&d6xE9@ zloY^u7`yG-i%Rm9(U>t>GftFa@mS4uKELi0pnH(^g~siT+f|$8YIgEVSmW_hs|uyl jXVv~MpaB2?0PvCn**5q|VXj`y00000NkvXXu0mjfgR!DS diff --git a/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00002.png b/tests/snapshots/nanos_lrCompleteQueuedWithdrawal/00002.png index 89ba854f8ad2cbe86517f3eb08af6c993e0ae2a8..04be83262b5acaaf5c28a3957e3ad9e0eaef6fbc 100644 GIT binary patch delta 419 zcmV;U0bKs;1HA)~B!7fSL_t(|ob8#*vcfP3K%;a0{||QIUBsyfgh1K^Y&qj1%>!s2 zgkmX4k|as8h}ZM;+iLd9Otj3HtY2P$KW_s{c|FVR@h(76CGAsdS~6j`O+`y1`*=xHgBXOd|&GS4p`H5{2&%dGsa(%I3MP5#uoOOwD+N|2M=ruSbS{`Nk^*r=3# zztHR>?9feN!him7|L#dr){t5$O;|P*IHKGtEi3c2+INsEl}Sovt2O0`Tn+o!k~W~O zrK{!fbV=42xgh!AyN3oQ1B}+jSOEE`M)){a=9lc9@11t{-6w$DG5zOjjp}`R#S>6P z4`(PL!Vp&Ac5NP#vy>CjQhw%Jf=OKBuR2z{sHJIPuMP?pg;fs N002ovPDHLkV1mIe$4dYJ delta 465 zcmV;?0WSW%1M35jB!99=L_t(|ob6fJt^y$pMRWcC5B9B9SbeM{H<#^a%jv*h)$%&r*F%ub2T#?0d8{xEn$Xo^KfJ7pZ_+9)1gfEAD8sM5g00000NkvXX Hu0mjf=swmz diff --git a/tests/snapshots/nanos_lrQueueWithdrawal/00001.png b/tests/snapshots/nanos_lrQueueWithdrawal/00001.png index c5b561b357d2815884c87b57df32e0d1939cef62..c978af0baf12daf4747b904387f03ec16315336b 100644 GIT binary patch delta 353 zcmV-n0iOQi0{jAyB!5FmL_t(|ob8$04uc>JhH;ti|G-{s7bFCG8Zxw${9l#@kz;=- zp{4`?002zQ=Md670q(-Kbz}kF-UGP8=SbVGKBlu0pu)M@C07Slkw*; zuQH?&t>y9?#gOrL_cd#yO3Pwgx}%-;w>NW7Fs=@S@dzb(D`s}|NV+JGIi3H>C5{JE z$za67WO)7|KVzNRA5z3jdyO~NB^7P|Rx8v!)L!C*qYGrQlgv6tT$`F0P767p0Ngnw z<_EZ2vs=insajow;?VvkU@$Jz5|X zKy-t%v&Jp2<#@kBSQoSk0S{qc?3)At0EFTTWHH*in15Ra00000NkvXXu0mjf?}Ma8 delta 327 zcmV-N0l5DB0^$OYB!4MML_t(|ob8#>4#OY_MeVZw{|EP>doXD%sKZu4%suIYu0$v| zVum3A0000}a~_#7AAnKRbM0AxuXO+|oJZL9;xycqAg^Y{j{rQ~SuPu)y)_@}0K{y& z>rzv~j{sp!4O|Hj7SzC-0AWE5?yUT66YwX!$i4!_BqRH3WPehP>?;EeEI}2rq|Z5g z9=B&Gq!r3Lqt7~YBf?g4%2!d-AQhk<#+(8$dNU!>}O4O!8rf`002ovPDHLkV1l0Ql@0&^ diff --git a/tests/snapshots/nanos_lrQueueWithdrawal/00002.png b/tests/snapshots/nanos_lrQueueWithdrawal/00002.png index 0bf3106ac7c45ef8a2ae06c5365b3293cabb9ce6..6197bc7d7e59482bd51e2c30e36912776c9f8980 100644 GIT binary patch delta 396 zcmV;70dxMy1EvFzB!6v5L_t(|ob8#>7Q!G1K&?~%|G|4$4|bLTGH@zv^mu<8C7=__6AU%cghc?D zy$(FuMvW9EUre&OuTnl0tF#F0UiGw!e0ajgj^@G@DVH6@e1hN;YG2KMAe?dK-yMh; zSmHMe-GQA!mfs=ArEJC}U@o^w2X?(OIcW7UinUCO0bj=^D@D6HJEGUw`yy5zWI;Q# z-I63?Dx>9UV1KHcOxVB~5tLDJTUeUy5Az%NYNb{T$N&MMTDe_p5!k9_yaV;rS*3`x zlqXdV^ze380E8>l!#!MBN@@_McdoXbZkRqbYj+13+odOlb z^`;aAK@bFb&f~g8VWefbe5^2u-;;Ua@>3)C%lCAh?$;En=aC-o?{y(Jf?vr-g-76` z+~({2U2f~nIPCfYcLw1BBMva@lw7cUBfrLlW5GbazSS90hkvSN&JLIgSnQy&ZXwrZ zD;Z7;dBX(Y;*d}sz-5iMkV}(12c@75^Bgzf1E}WeKI+a!JH}`Sv`)6xQ!$U)H4%6S zK7?zJGmO&d<{-@j#$?+~94oi^VS@bV(`+N2Zy~hqn7H{Lkz}w8uE<_GIajQZ> zx}0QT4(d9%@_+CE?y!nLj=D5!#UiKc_1jv0VWgNYt<)s}2x}>VR5}x-R!X{cIR&a` z%Nmn5td%lx^1|v|)bgiVWdx;$ylt74`^6rCuU5qy&_`E^aq^?Zm#zSIlB0z?^cUX4 zyY!-AacL7Z6qMs$_1Mbw1iz{sfCUZyl*4MJyjw54QYSBwT9;R$G5jM4A_qYb1VNzS Y0|(V}kpBa?&j0`b07*qoM6N<$g0hp+0{{R3 diff --git a/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00001.png b/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00001.png index 89f04cc4d592cbf4fdf8fcb398d4662da5bed38b..f86d7e2bc7c744a8c5f9c8c987b0fefa39364db1 100644 GIT binary patch delta 400 zcmV;B0dM}61F8d%B!6*9L_t(|obA~`j>8}fKv7!FO>+Mu`7X0SgDeab5QIAO-zuS` zA=nT~LjV8(0B-j>-GI+TB!qBXS2~WTwmcsD@^iWYGh#=3>~8CQx&Z^SG#8OHAZ#`H zb7u=DxCy|}BqJhT#)q2#MBks$qud0*OGb}!6M$eALeJnS0DsBDVgLXDfEjjCII&D@ z?CNAC%QtzJwEv`i&24v0|9#sv&vy5g?P$FhrXMf;l+~XW3n%WF-6EZ)%~5@-E8Ax4 z16w(3-uXR}MxGWEwq4lH@y=_r3)}OXj?i>dr}_IsCQJ6LP?r>Qvlfg~iR>=`#Vxt4 z`|PyV{)RX;^?%1;;Xj}*H{*ht&8O>3S6($@@)0mM7;A5~+EXw?VL;<}>e^*;0sZ~ejf71cjb9^yBo=QBn?SoCZBObifJyP6o>;6o=9 ugRSUZ0000000000000000001Bn_sFVJjY}l8)N_g00{s|MNUMnLSTYV-?jn( delta 379 zcmZ3*JdJsRN`0)Si(^Q|oVPcliw-OBI0Vjm>9^;j!IU|?W4P-b7Q9-ywI*z(xoQlZV&>yJ0;?=M$3P~zKi{Nc5@a`g)fcbs)q@#T7W1BiH!}6pKo8$&0EoUF*ARjyHdi&+(4fVW70}W{ug4 z?HrXG{#9_Du9x;dKk53xxR6sgG-&-OWm zhlTGubco5s@7VFY;KAWZ{73*k-LvBR=XmXQMu=1$<@SN ziw(a?ZbP0l+XkK5YwfY diff --git a/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00002.png b/tests/snapshots/nanox_lrCompleteQueuedWithdrawal/00002.png index db2fe5f5db5da85a372d11d5bc94f987a10cc160..e6fdcb1d964f122ee239fccf6ef30ed9a96fc9a0 100644 GIT binary patch delta 496 zcmV{Q zN;C*cdK>@%06@5}m@ql#@;Rkcww#|IY5b9<;{8MhlR5g(d_69-10;Fd%JFfkx0fv` zrLx`X#qNN!qSsMo-zeWxTUT<iSNq^+CYa|QSvbI!;RNZY`orPF4@Ab09TJc-uMyElmUS=I@krmBuYjr2p zrzF413s;}J7kfc>6gP`m^~S-ygTGh1)DH$*dn23`%bM{9>xo+wJd<1QfaeDDYuMp4rw+hU%>8{D*Yma z^FM)V;Zitjmv0000O7AK+{fdlKUUYyYwSdhd~83XwseczE)R2 zL85XT000000NeSRkVz>W$8nyg(KDyV?z|Ya5tD}JkOL;N+~4Lofbz$ zMu`c4T%p{ps`K(-*(sIGnJ#VRp4?P(kRtY4@^2|yU2IjM&42gM=zjKW(kxYV{neRu z%ATr7*(}XfXDCe!&HsqXfXw|}><%k4rYdek)HS!^%ad7^0V^=FUT*60b|6tn6T+Rd zIyeA(PGeVU+P|$ByHeBPoDV?yqxEmKvo+Dqm8)U7DQ6;^GAHB>%9yz^e`Bz#@B!X9 zr%==a=hpk5&VPW9WacH@$%bd-<5V9#0019C5`=4x5-)EfE&Z<171uUfr*#XGkH($H zOOF>+O-;(G_wdWF!cHy7uBB8LX_pLLg>wH^pIx2E;-#ytRk1jVNMB94aP`|=>;P^S zSIc2#XXn420QBd{v4f`8Gn#E|k=1i((!H@t3!igZJR zol?Z(yU##6>8}fKv7!FO>+Mu`7X0SgDeab5QIAO-zuS` zA=nT~LjV8(0B-j>-GI+TB!qBXS2~WTwmcsD@^iWYGh#=3>~8CQx&Z^SG#8OHAZ#`H zb7u=DxCy|}BqJhT#)q2#MBks$qud0*OGb}!6M$eALeJnS0DsBDVgLXDfEjjCII&D@ z?CNAC%QtzJwEv`i&24v0|9#sv&vy5g?P$FhrXMf;l+~XW3n%WF-6EZ)%~5@-E8Ax4 z16w(3-uXR}MxGWEwq4lH@y=_r3)}OXj?i>dr}_IsCQJ6LP?r>Qvlfg~iR>=`#Vxt4 z`|PyV{)RX;^?%1;;Xj}*H{*ht&8O>3S6($@@)0mM7;A5~+EXw?VL;<}>e^*;0sZ~ejf71cjb9^yBo=QBn?SoCZBObifJyP6o>;6o=9 ugRSUZ0000000000000000001Bn_sFVJjY}l8)N_g00{s|MNUMnLSTYXZ?*#f delta 380 zcmV-?0fYXk1D6AkB!6B>L_t(|obB0Bl7k=&fML3`H}U>Q%3bz>S%#7t6RXg4{_kN2 zYbue5cCi!y003aR$La)*iAX7B+qTxOoBH$G&gFM?0%z2L&N$rK&*}sMhRa+;+Jw+y z@^5B_C!{Gr=q4i~S>{KY0#u)WMMtG6K$a^yDop{3`XTfkGJh4I`LY@S006*Cp55Ko z(C@IzSP^m__9~NpAM0+W)u1ncoko@dT)Z6JuYwKj+GzjHdcs1T_On61Jm`b<*IQV> zw{Gs`se}Cqzsop>m)D@tINaNRG6Xme>+jb%BmLJ14w>{q#+ljjHHJ_Emt;Gs0L~fu z2}_=#CBOIA2X%8S#tpaQVRKs7cl0~X08a=$P`^SvX4x(mfy zr*>j0Ex&80vpZs^hmsmZy%;eDaWZPK()D*C_#F%~HMkYS3jhEB000000000000000 a+~yC3bx0H%N*4ipB!9O_L_t(|obA~`a>F1DKvB2Tn{fXlahEQbGE{&78w76uTVx!E zAS?{TGkVZM2Enlx`Dy72$2Ioq6H@20x`- zL-8I|4w|2)XGDR{YWw3VSCqdhg@+hzMT~Aw?lRPXDXlf?fX)$m!c$W1KceS_i{7yn zA*N&T)-3djxN-#a1jskm^;NF;Ct_!@QTl#^@|S?9VNWRBP+u`e3K|vk>|J5C8xG delta 515 zcmV+e0{s2(1DynrB!A>dL_t(|ob8!Wa>O7AKy9Zt@%~5hF8#>Vp{OXXn$6C8ADxwm zph%1~1ONa40D$9sP3WYQLI^QNLozpxExhnrS?sNN)1|E}$xY>hRI%rhe@or!WUB+(e1E%ok8@^|X07VdU&1`5 zlvGv9W@)bKp)}$0Kdj1t%#F#^M4;nwZPo+e47#w!o zt}&zXuhH4X;tXgp=-KTzXKw}Kb&H1rFqon5aFKD<<9z0dcamq6BGl_xHIJFzVOM9s zhyiu}gx)Dv{wHs|n-{zOQF`7Q!DY_X- Date: Fri, 2 Feb 2024 17:02:21 +0100 Subject: [PATCH 18/33] fix: test name --- tests/src/lrCompleteQueuedWithdrawal.test.js | 2 +- tests/src/lrDepositIntoStrategy.test.js | 2 +- tests/src/lrQueueWithdrawal.test.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/src/lrCompleteQueuedWithdrawal.test.js b/tests/src/lrCompleteQueuedWithdrawal.test.js index 4d4fe59..ec43e7f 100644 --- a/tests/src/lrCompleteQueuedWithdrawal.test.js +++ b/tests/src/lrCompleteQueuedWithdrawal.test.js @@ -21,7 +21,7 @@ const abi = require(abi_path); nano_models.forEach(function (model) { test( - '[Nano ' + model.letter + '] Stake Eth', + '[Nano ' + model.letter + '] LR Complete Queued Withdrawal', zemu(model, async (sim, eth) => { const contract = new ethers.Contract(contractAddr, abi); diff --git a/tests/src/lrDepositIntoStrategy.test.js b/tests/src/lrDepositIntoStrategy.test.js index c47a4c0..1aaa74e 100644 --- a/tests/src/lrDepositIntoStrategy.test.js +++ b/tests/src/lrDepositIntoStrategy.test.js @@ -22,7 +22,7 @@ const right_clicks = 5; nano_models.forEach(function (model) { test( - '[Nano ' + model.letter + '] Deposit Into Strategy Normal', + '[Nano ' + model.letter + '] LR Deposit Into Strategy Normal', zemu(model, async (sim, eth) => { const contract = new ethers.Contract(contractAddr, abi); diff --git a/tests/src/lrQueueWithdrawal.test.js b/tests/src/lrQueueWithdrawal.test.js index 47a4f4a..c7d163a 100644 --- a/tests/src/lrQueueWithdrawal.test.js +++ b/tests/src/lrQueueWithdrawal.test.js @@ -21,7 +21,7 @@ const abi = require(abi_path); nano_models.forEach(function (model) { test( - '[Nano ' + model.letter + '] Stake Eth', + '[Nano ' + model.letter + '] LR Queue Withdrawal', zemu(model, async (sim, eth) => { const contract = new ethers.Contract(contractAddr, abi); From 9e7dcfb98b038e2309c6b5d928ddc60821d16dab Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Fri, 2 Feb 2024 17:34:00 +0100 Subject: [PATCH 19/33] fix: tests screen count --- .../00003.png | Bin 393 -> 383 bytes .../00004.png | Bin 315 -> 358 bytes .../00005.png | Bin 324 -> 414 bytes .../00003.png | Bin 373 -> 382 bytes .../00004.png | Bin 315 -> 358 bytes .../00005.png | Bin 324 -> 414 bytes .../00003.png | Bin 500 -> 447 bytes .../00003.png | Bin 494 -> 442 bytes tests/src/lrDepositIntoStrategy.test.js | 4 ++-- 9 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00003.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00003.png index 8d7fc5cdc90b8aeae1b018d8f1979a821e55e5b8..e15b07507cf42d2e51d35166b9218d27a312f304 100644 GIT binary patch delta 356 zcmV-q0h|7b1OEb$B!5OpL_t(|ob8#-5`r)cgo7jR|G*yf;0QH;q)?lV-ETZ#X-n9Y zW>|;-004k|o{#JZX6CJaw;T+U?0a?qHl;?(y8m5P-l1%f$7~+@PWIM+cH|SF9?OI4 zjj7zS10bSewU#S=4u;u+CewXmm;}h3eGUdlKv_BIvkM*8Mt`*|Q%(K`Ey9y6z}_6l z3-vo-iVXF;p-2t&JA)i#f?X(+^L3b=vR><}JOI|G{8=5?SZ6|OpnodT;>YiBX^A^R zSNS$Ub4H!VZw$^83Dv&~_0moZHjTU>$HS3tRm}~b6bC8twiw{YW?Z8v_o)VP>)PE{ zy9B7xSbF`(LtUU!nVa9+(c?(dimmvo-!LkljHYIszur$*0yf-o>$+u{d4KBnxG*&d zV0Wlq>~s#~z!RISzYR*InAH;vCxg_9$LPQ6xx?nhyv#NVJ=Cc&+p>K7?m^GFXxo_||Jw5&a++GPuhY4;d( zae&;}!JEboklD>7Dr#A#GyY>m*m*9K`^CQpvj*wqb=5Vvsk|7zuWvk&LXv))Bu%emI!2US{4-aM}!ojk$^l<)Rfas#oPN+xoXI$K;=M8gRy! zJiQ{qyzP5Ig=aYJ7kLz_-m4kcrwZc$i;4%)lp>KzT_gvnrm^fbOAAtTd*$S;!hK>)MYAkQOP&}s2HUIzs0Dw3=0ToOBqiJgswg3PC M07*qoM6N<$f-e8B5C8xG diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00004.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00004.png index 888975aeb8de3d63ba92842a77c85281681b1b5c..eeec6324a1f33b9b155d3e979728a086251adb10 100644 GIT binary patch delta 331 zcmV-R0kr7w8x2cd&@naNV*H4+$qsPXgG&<09aHpKxtXT1KmZt7bALMK{Ipt{4zxMEv>x1p zQ_2Ty6vG|1u)q#rxT8xbt6SjIvSJcmATRwh1$m*q09lctz8DFqp}sJPfhIVGH2D>o zbVJ8hCB^DASqdfRP^^LZu4>Ved?oGf&gPIV`f^(;vh%m0~_? zr8>V7uBLN003;6rzio;(|V~L%BSv;U%)oDp0C?AwzHfIX35>udzE}t!}z=%M%f{^lx^WB zy^6i{|98q6ptjYbJ87(0+VP0~mXqLS=XzzU*1Xc)QRmabFn{(8waXF|C+`a)iA`9%H+L@LX>a~Lh)|>!d_1me6SCv&SF@kO2+(r) z!`Y99l4`Qw88q;ORmhW5`>=YBSbKz}%kE;JcXX mKdhsD_C>P*02u%PK*j^x6>Nl0soX9A00007ENOEh^0jsFWbV&<+yj5)WEX_aERLO-`${sQ zhD#B5ZCio#FnpZvsgyOJV*hwd>m7MA*2TC`gvbxExlw9P*GWl3w#fa$g^{OWU5rzv zURSsL8^HL;(=ZJ{t@3k$n&|FdPSzHrM5CkhAHD9@5i$)x%zaJzw-<`s4Tqj`@b>t( hEI~pDA%qap!xv8s=`=m>boTx}C_;%(OK2R8!L98R2lZwRSI z_B#U&EI}2rWS)JPpC9-S-hYJOa+L1TMyP)lq(SeGBSi)jV501YAqA)~pf=GufQ#@F vZ+2({rucJf^dd`A1MvVA000000J!7@xWBxrv4;J%00000NkvXXu0mjfdM}5N diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00003.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00003.png index dbf07aa2cf9e65ef65b49917daa33bc017b8ca40..cd65dece2a08f03b6b39e1e293bc325963f79c8b 100644 GIT binary patch delta 355 zcmV-p0i6Ez0{#M!B!5LoL_t(|ob8!G62l+}MX}S||G-_ei%cy6G_(?R>VGSP8VM*G zBmw{c0LJrtjMiXfcI$WZ!8Fdkk5-@zw^7>1!}e2wKeUnQ0uLBl{Xm-~hgJ(mM*B?v3WQOn=|_Z_-V8u?g6l6Z69Q z9Vi+Z*6)U4YFNKB@WDtBg+_8Tax$tzPG1`@l<&Vyt}DnM8F8j1??*Ggc?^`*HVo3J-B$z#{CIrEzMuq`ZqWib$_2- zA2H$_;M6sz5L`t1!NYGUhl>dEO;89*+aG3(Q*8hM002ovPDHLkV1grQ Bs3rga delta 346 zcmV-g0j2)_0`&rrB!4_fL_t(|ob8xh7lR-OhH+>8{~z4NcH!1Yk?aFvp7*(G1+Mewk5{bAXye5Z$k*MAlfrO9)uE-ff#++*O9 zfV#7TFUAR|tGlp>h{rPR$zO2@E6*+L`r+@vsGIcgx~>h#hPP3pPhk?EIUG3p(GWt7 z=sSZP+zGnSoveeLgxf*X5=GAuM`mh`h#QMHPXCq03GW8GYOys~mvmy3yS*0F2^ZqI zG~c>QQ6hMfn^WXy5&gqeuUzrVSs50FND1idkBd-Ih#Wl}6E-Xf(}H|O;5dXyK&B@L sxll&QR+tvl*~E?h4gdfE004Y>1Aao7w8x2cd&@naNV*H4+$qsPXgG&<09aHpKxtXT1KmZt7bALMK{Ipt{4zxMEv>x1p zQ_2Ty6vG|1u)q#rxT8xbt6SjIvSJcmATRwh1$m*q09lctz8DFqp}sJPfhIVGH2D>o zbVJ8hCB^DASqdfRP^^LZu4>Ved?oGf&gPIV`f^(;vh%m0~_? zr8>V7uBLN003;6rzio;(|V~L%BSv;U%)oDp0C?AwzHfIX35>udzE}t!}z=%M%f{^lx^WB zy^6i{|98q6ptjYbJ87(0+VP0~mXqLS=XzzU*1Xc)QRmabFn{(8waXF|C+`a)iA`9%H+L@LX>a~Lh)|>!d_1me6SCv&SF@kO2+(r) z!`Y99l4`Qw88q;ORmhW5`>=YBSbKz}%kE;JcXX mKdhsD_C>P*02u%PK*j^x6>Nl0soX9A00007ENOEh^0jsFWbV&<+yj5)WEX_aERLO-`${sQ zhD#B5ZCio#FnpZvsgyOJV*hwd>m7MA*2TC`gvbxExlw9P*GWl3w#fa$g^{OWU5rzv zURSsL8^HL;(=ZJ{t@3k$n&|FdPSzHrM5CkhAHD9@5i$)x%zaJzw-<`s4Tqj`@b>t( hEI~pDA%qap!xv8s=`=m>boTx}C_;%(OK2R8!L98R2lZwRSI z_B#U&EI}2rWS)JPpC9-S-hYJOa+L1TMyP)lq(SeGBSi)jV501YAqA)~pf=GufQ#@F vZ+2({rucJf^dd`A1MvVA000000J!7@xWBxrv4;J%00000NkvXXu0mjfdM}5N diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00003.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00003.png index 60c5e8a49e629b6d150963de46ca97cea3189931..ce3e851a3bd894abc81a84abdcb49ba6ab528682 100644 GIT binary patch delta 421 zcmV;W0b2g_1HS{1B!7lUL_t(|obA|ca)clZfMKT7n{fXl00DLSF5s~O90(?aWkWxw|^^c9gKI8oz9e_zha?VGZ%E5753UtrtT2(t$ zQ@U7`_!&_B6ZOv{clw|zR;~`a(ACRv&N(*wX@>zgoXSO;@qbO$lM8lPg5EcSFAAOk zdTDMKcS}20!dH^ZwpfDnqI{}KcNc9p45#|X&O87BfVW|NGnhF)ES!EH3Ja@1Ro7|I zs_0*uIpfFQExCY`Xg}A(B({xP?f54r+nEW~zl(0yP7IDUFJk%=V;fENTI3X7-ur!K zUiW6)`zE|9%74;SNUp75mNd0&0J^EM^7TI^LD$)_x&2$vKB-xyZ2s+2z=fHy@^iHR zf4{sFRMoq!ooet!x@#TDnsv#)hxReCtztbk44)e1FDI&*-rKO9PMyNtGsF11g{|4 zshTRotg!C^)ty-WOxl%&DlG4v9-^$C%OM0?^~Hk$iCtQ>ihn!FCkOD7g4R{=ON@I! znVQ?=uF>`t^GtFW7b&Pr%Dbv`pQ7ypV^ICIJr4i?0N_Pvs}5VXPlM$%tjuTuRoy{@ zH{fC(AhXM^hW6dy6jRbJYeZYx1x23wm?t#W044%eq#RC^| zwFeV-g0ecrYJ0002MLud!Vj8pvXLz8$1A^`xtaA0 zc#`_Eq5%U|^ybI<1oqLU`0^Y7<3g0{{R3 diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00003.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00003.png index e55377ba07988fbb928fedd38821d687e5dfcb51..4de95ddac5f3979a6c383266f398f2a1914ea380 100644 GIT binary patch delta 416 zcmV;R0bl;^1G)o{B!7WPL_t(|obB0Bl7k=&fMIrLZ^HeL#9j7*DU%@)QKO;l|2?rH znuaw+ni2p20PwX+DW#O?C<6RO2ar-qE%lGh!8-H(7ahQ+QcBLbrl~b*yPaSjk)yin zbeEE+MTvg`y8lG^XU&~#bf>l6-CM}vt(|j@&3;;80;)r~(0>_Uq@J9xN(p-33|6rnmJ*T>6kvVFxrK-DT8gjT9q{};m&x=@jNw2VE(7HD{MgM@A z*Sag*_JZWwtbY!A{23-6>gVU|?(8SW37Cwv+pKQ~XKtbEbs(>~@hL%dD=j=JzPeg! z{!nq9=XSJNd^&^QSXQ&O=<F1DMb%Dk!u^lLUAkb(Py`sq2@>{uiwwbF zGyew}6k7xU0002svBVf-jMk$t;M;ltA|hG(WghtP`^S0!U1E$Ogd|fgq;hW1tSNg{ z=c!IrHnYNh22{Vq@@vwrEL6?%(ZfrW-E%pFV5`1(Fd%VC3xBP+lX&t1UP92m3SPu` z29%*$2lpO&u9!!XmvIq-%AkCzOY<(OZy1B_kDYk{0002Cd|3~m%Y34yTuL^R6U}_a z%xd+yoLZju8V|BeXD{(NTx`VTZ%>p&$)9D~vN|em6ugL+T#)?V59|0a4i`E#J#OX) zM+Qs= Date: Tue, 6 Feb 2024 10:04:52 +0100 Subject: [PATCH 20/33] fix: switch to union for better parameter clarity --- src/handle_init_contract.c | 1 - src/handle_provide_parameter.c | 36 +++++++++++++--------------------- src/handle_query_contract_ui.c | 13 ++++++------ src/kiln_plugin.h | 26 +++++++++++++++++++----- 4 files changed, 42 insertions(+), 34 deletions(-) diff --git a/src/handle_init_contract.c b/src/handle_init_contract.c index 147f8f5..815ca39 100644 --- a/src/handle_init_contract.c +++ b/src/handle_init_contract.c @@ -58,7 +58,6 @@ void handle_init_contract(ethPluginInitContract_t *msg) { break; case KILN_LR_DEPOSIT_INTO_STRATEGY: - context->lr_display_buffer_size = 1; context->next_param = LR_DEPOSIT_INTO_STRATEGY_STRATEGY; break; case KILN_LR_QUEUE_WITHDRAWAL: diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index 2f62dbc..1a84446 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -26,18 +26,16 @@ bool compare_addresses(const char *a, const char *b) { * @param index: index of the erc20 in the context * @param context: context to update * - * @note impacts the following context storage: - * `context->lr_strategy_to_display`: set index of the erc20 in the context + * @returns index of the erc20 in the context or -1 if not found */ -void find_lr_known_erc20(const char *address, size_t index, context_t *context) { +int find_lr_known_erc20(const char *address, context_t *context) { for (size_t i = 0; i < LR_STRATEGIES_COUNT; i++) { if (compare_addresses(address, lr_erc20_addresses[i])) { - context->lr_erc20_to_display[index] = i; - return; + return i; } } // if unknown erc20, indicate it - context->lr_erc20_to_display[index] = -1; + return -1; } /* @@ -48,18 +46,16 @@ void find_lr_known_erc20(const char *address, size_t index, context_t *context) * @param index: index of the strategy in the context * @param context: context to update * - * @note impacts the following context storage: - * `context->lr_strategy_to_display`: set index of the strategy in the context + * @returns index of the strategy in the context or -1 if not found */ -void find_lr_known_strategy(const char *address, size_t index, context_t *context) { +int find_lr_known_strategy(const char *address, context_t *context) { for (size_t i = 0; i < LR_STRATEGIES_COUNT; i++) { if (compare_addresses(address, lr_strategy_addresses[i])) { - context->lr_strategy_to_display[index] = i; - return; + return i; } } // if unknown strategy, indicate it - context->lr_strategy_to_display[index] = -1; + return -1; } /* @@ -69,12 +65,6 @@ void find_lr_known_strategy(const char *address, size_t index, context_t *contex * @param msg: message containing the parameter * @param context: context to update * - * @note impacts the following context storage: - * `context->next_param`: set to the next parameter to handle - * `context->lr_strategy_to_display`: set index of the strategy in the context - * `context->lr_erc20_to_display`: set index of the erc20 in the context - * `context->lr_erc20_amount_to_display`: set amount of the erc20 in the context - * */ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t *context) { uint8_t buffer[ADDRESS_LENGTH]; @@ -88,7 +78,8 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t sizeof(address_buffer), msg->pluginSharedRW->sha3, 0); - find_lr_known_strategy(address_buffer, 0, context); + context->param_data.lr_deposit.lr_strategy_to_display = + find_lr_known_strategy(address_buffer, context); context->next_param = LR_DEPOSIT_INTO_STRATEGY_TOKEN; break; @@ -99,14 +90,15 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t sizeof(address_buffer), msg->pluginSharedRW->sha3, 0); - find_lr_known_erc20(address_buffer, 0, context); + context->param_data.lr_deposit.lr_erc20_to_display = + find_lr_known_erc20(address_buffer, context); context->next_param = LR_DEPOSIT_INTO_STRATEGY_AMOUNT; break; case LR_DEPOSIT_INTO_STRATEGY_AMOUNT: - copy_parameter(context->lr_erc20_amount_to_display[0], + copy_parameter(context->param_data.lr_deposit.lr_erc20_amount_to_display, msg->parameter, - sizeof(context->lr_erc20_amount_to_display[0])); + sizeof(context->param_data.lr_deposit.lr_erc20_amount_to_display)); context->next_param = LR_DEPOSIT_INTO_STRATEGY_UNEXPECTED_PARAMETER; break; default: diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 10784ae..188bc5f 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -175,25 +175,26 @@ static bool claim_ui_v2(ethQueryContractUI_t *msg) { static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *context) { bool ret = false; + lr_deposit_t *params = &context->param_data.lr_deposit; switch (msg->screenIndex) { case 0: strlcpy(msg->title, "Strategy", msg->titleLength); - if (context->lr_strategy_to_display[0] == -1) { + if (params->lr_strategy_to_display == -1) { strlcpy(msg->msg, "UNKNOWN", msg->msgLength); } else { - strlcpy(msg->msg, lr_tickers[context->lr_strategy_to_display[0]], MAX_TICKER_LEN); + strlcpy(msg->msg, lr_tickers[params->lr_strategy_to_display], MAX_TICKER_LEN); } ret = true; break; case 1: strlcpy(msg->title, "Amount", msg->titleLength); - amountToString(context->lr_erc20_amount_to_display[0], - sizeof(context->lr_erc20_amount_to_display[0]), + amountToString(params->lr_erc20_amount_to_display, + sizeof(params->lr_erc20_amount_to_display), ERC20_DECIMALS, - context->lr_erc20_to_display[0] == -1 + params->lr_erc20_to_display == -1 ? "UNKNOWN" - : lr_tickers[context->lr_erc20_to_display[0]], + : lr_tickers[params->lr_erc20_to_display], msg->msg, msg->msgLength); ret = true; diff --git a/src/kiln_plugin.h b/src/kiln_plugin.h index 928724d..60f90eb 100644 --- a/src/kiln_plugin.h +++ b/src/kiln_plugin.h @@ -102,14 +102,30 @@ extern const char lr_tickers[LR_STRATEGIES_COUNT][MAX_TICKER_LEN]; // max number of strategies / erc20 to display #define MAX_DISPLAY_COUNT 3 +typedef struct { + int lr_strategy_to_display; + int lr_erc20_to_display; + uint8_t lr_erc20_amount_to_display[INT256_LENGTH]; +} lr_deposit_t; + +typedef struct { + char withdrawer[ADDRESS_STR_LEN]; +} lr_queue_withdrawal_t; + +typedef struct { + // int lr_strategy_to_display[MAX_DISPLAY_COUNT]; + // int lr_erc20_to_display[MAX_DISPLAY_COUNT]; + // uint8_t lr_erc20_amount_to_display[MAX_DISPLAY_COUNT][INT256_LENGTH]; +} lr_complete_queued_withdrawal_t; + typedef struct context_t { uint8_t next_param; - // buffers for LR display - int lr_strategy_to_display[MAX_DISPLAY_COUNT]; - int lr_erc20_to_display[MAX_DISPLAY_COUNT]; - uint8_t lr_erc20_amount_to_display[MAX_DISPLAY_COUNT][INT256_LENGTH]; - size_t lr_display_buffer_size; + union { + lr_complete_queued_withdrawal_t lr_complete_queued_withdrawal; + lr_deposit_t lr_deposit; + lr_queue_withdrawal_t lr_queue_withdrawal; + } param_data; selector_t selectorIndex; } context_t; From 513950df369ed2db948874ed54bb7ca55125b907 Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Tue, 6 Feb 2024 10:10:54 +0100 Subject: [PATCH 21/33] fix: lr deposit param data naming --- src/handle_provide_parameter.c | 10 ++++++---- src/handle_query_contract_ui.c | 19 +++++++++---------- src/kiln_plugin.h | 6 +++--- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index 1a84446..8623be2 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -78,7 +78,7 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t sizeof(address_buffer), msg->pluginSharedRW->sha3, 0); - context->param_data.lr_deposit.lr_strategy_to_display = + context->param_data.lr_deposit.strategy_to_display = find_lr_known_strategy(address_buffer, context); context->next_param = LR_DEPOSIT_INTO_STRATEGY_TOKEN; @@ -90,15 +90,15 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t sizeof(address_buffer), msg->pluginSharedRW->sha3, 0); - context->param_data.lr_deposit.lr_erc20_to_display = + context->param_data.lr_deposit.erc20_to_display = find_lr_known_erc20(address_buffer, context); context->next_param = LR_DEPOSIT_INTO_STRATEGY_AMOUNT; break; case LR_DEPOSIT_INTO_STRATEGY_AMOUNT: - copy_parameter(context->param_data.lr_deposit.lr_erc20_amount_to_display, + copy_parameter(context->param_data.lr_deposit.erc20_amount_to_display, msg->parameter, - sizeof(context->param_data.lr_deposit.lr_erc20_amount_to_display)); + sizeof(context->param_data.lr_deposit.erc20_amount_to_display)); context->next_param = LR_DEPOSIT_INTO_STRATEGY_UNEXPECTED_PARAMETER; break; default: @@ -109,6 +109,8 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t } void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *context) { + uint8_t buffer[ADDRESS_LENGTH]; + switch (context->next_param) { case LR_QUEUE_WITHDRAWAL_STRATEGY_INDEXES_OFFSET: context->next_param = LR_QUEUE_WITHDRAWAL_STRATEGIES_OFFSET; diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 188bc5f..78c87c9 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -180,23 +180,22 @@ static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *con switch (msg->screenIndex) { case 0: strlcpy(msg->title, "Strategy", msg->titleLength); - if (params->lr_strategy_to_display == -1) { + if (params->strategy_to_display == -1) { strlcpy(msg->msg, "UNKNOWN", msg->msgLength); } else { - strlcpy(msg->msg, lr_tickers[params->lr_strategy_to_display], MAX_TICKER_LEN); + strlcpy(msg->msg, lr_tickers[params->strategy_to_display], MAX_TICKER_LEN); } ret = true; break; case 1: strlcpy(msg->title, "Amount", msg->titleLength); - amountToString(params->lr_erc20_amount_to_display, - sizeof(params->lr_erc20_amount_to_display), - ERC20_DECIMALS, - params->lr_erc20_to_display == -1 - ? "UNKNOWN" - : lr_tickers[params->lr_erc20_to_display], - msg->msg, - msg->msgLength); + amountToString( + params->erc20_amount_to_display, + sizeof(params->erc20_amount_to_display), + ERC20_DECIMALS, + params->erc20_to_display == -1 ? "UNKNOWN" : lr_tickers[params->erc20_to_display], + msg->msg, + msg->msgLength); ret = true; break; default: diff --git a/src/kiln_plugin.h b/src/kiln_plugin.h index 60f90eb..bff6317 100644 --- a/src/kiln_plugin.h +++ b/src/kiln_plugin.h @@ -103,9 +103,9 @@ extern const char lr_tickers[LR_STRATEGIES_COUNT][MAX_TICKER_LEN]; #define MAX_DISPLAY_COUNT 3 typedef struct { - int lr_strategy_to_display; - int lr_erc20_to_display; - uint8_t lr_erc20_amount_to_display[INT256_LENGTH]; + int strategy_to_display; + int erc20_to_display; + uint8_t erc20_amount_to_display[INT256_LENGTH]; } lr_deposit_t; typedef struct { From 9e4836bc26a43239eb8a7890c9e74f564052fa7f Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Tue, 6 Feb 2024 10:33:32 +0100 Subject: [PATCH 22/33] feat: lr add withdrawer clear signing --- src/handle_finalize.c | 2 +- src/handle_provide_parameter.c | 6 ++++++ src/handle_query_contract_ui.c | 11 +++++++++-- .../snapshots/nanos_lrQueueWithdrawal/00003.png | Bin 358 -> 509 bytes .../snapshots/nanos_lrQueueWithdrawal/00004.png | Bin 414 -> 497 bytes .../snapshots/nanos_lrQueueWithdrawal/00005.png | Bin 349 -> 438 bytes .../snapshots/nanos_lrQueueWithdrawal/00006.png | Bin 0 -> 358 bytes .../snapshots/nanos_lrQueueWithdrawal/00007.png | Bin 0 -> 414 bytes .../snapshots/nanos_lrQueueWithdrawal/00008.png | Bin 0 -> 349 bytes .../snapshots/nanox_lrQueueWithdrawal/00003.png | Bin 415 -> 811 bytes .../snapshots/nanox_lrQueueWithdrawal/00004.png | Bin 472 -> 415 bytes .../snapshots/nanox_lrQueueWithdrawal/00005.png | Bin 381 -> 472 bytes .../snapshots/nanox_lrQueueWithdrawal/00006.png | Bin 0 -> 366 bytes .../snapshots/nanox_lrQueueWithdrawal/00007.png | Bin 0 -> 381 bytes 14 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 tests/snapshots/nanos_lrQueueWithdrawal/00006.png create mode 100644 tests/snapshots/nanos_lrQueueWithdrawal/00007.png create mode 100644 tests/snapshots/nanos_lrQueueWithdrawal/00008.png create mode 100644 tests/snapshots/nanox_lrQueueWithdrawal/00006.png create mode 100644 tests/snapshots/nanox_lrQueueWithdrawal/00007.png diff --git a/src/handle_finalize.c b/src/handle_finalize.c index 159a9eb..304b0ce 100644 --- a/src/handle_finalize.c +++ b/src/handle_finalize.c @@ -26,7 +26,7 @@ void handle_finalize(ethPluginFinalize_t *msg) { msg->result = ETH_PLUGIN_RESULT_OK; break; case KILN_LR_QUEUE_WITHDRAWAL: - msg->numScreens = 1; + msg->numScreens = 2; msg->result = ETH_PLUGIN_RESULT_OK; break; case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index 8623be2..54ea2f8 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -122,6 +122,12 @@ void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *con context->next_param = LR_QUEUE_WITHDRAWAL_WITHDRAWER; break; case LR_QUEUE_WITHDRAWAL_WITHDRAWER: + copy_address(buffer, msg->parameter, sizeof(buffer)); + getEthDisplayableAddress(buffer, + context->param_data.lr_queue_withdrawal.withdrawer, + sizeof(context->param_data.lr_queue_withdrawal.withdrawer), + msg->pluginSharedRW->sha3, + 0); context->next_param = LR_QUEUE_WITHDRAWAL_UNDELEGATEIFPOSSIBLE; break; case LR_QUEUE_WITHDRAWAL_UNDELEGATEIFPOSSIBLE: diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 78c87c9..5a2a0be 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -205,9 +205,10 @@ static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *con return ret; } -static bool queue_withdrawal_ui_lr(ethQueryContractUI_t *msg) { +static bool queue_withdrawal_ui_lr(ethQueryContractUI_t *msg, context_t *context) { // TODO: display strategies bool ret = false; + lr_queue_withdrawal_t *params = &context->param_data.lr_queue_withdrawal; switch (msg->screenIndex) { case 0: @@ -216,6 +217,12 @@ static bool queue_withdrawal_ui_lr(ethQueryContractUI_t *msg) { ret = true; break; + case 1: + strlcpy(msg->title, "Withdrawer", msg->titleLength); + strlcpy(msg->msg, params->withdrawer, msg->msgLength); + ret = true; + break; + default: PRINTF("Received an invalid screenIndex\n"); break; @@ -290,7 +297,7 @@ void handle_query_contract_ui(ethQueryContractUI_t *msg) { break; case KILN_LR_QUEUE_WITHDRAWAL: - ret = queue_withdrawal_ui_lr(msg); + ret = queue_withdrawal_ui_lr(msg, context); break; case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: diff --git a/tests/snapshots/nanos_lrQueueWithdrawal/00003.png b/tests/snapshots/nanos_lrQueueWithdrawal/00003.png index eeec6324a1f33b9b155d3e979728a086251adb10..06c3c59a9000082a980407c1e47a01c43dbfef53 100644 GIT binary patch delta 483 zcmV<90UZA30{sJ!B!9$7L_t(|ob8#*62l+}MNOyu{}1k>U1Vwr;1!jaWWrfh1;htx zXi7m41VPZx=e_yOicCP&s+!#u;6D{uo8;(DL3V|@SQ<&G6$tMNbC~rDM&aS%bKFFo z&pR!z&G44j|938CVX2N41sJOH;cn_KDuMv*;djhhjzLhO?jME&$TH=jaExnrmmF7w8x2cd&@naNV*H4+$qsPXgG&<09aHpKxtXT1KmZt7bALMK{Ipt{4zxMEv>x1p zQ_2Ty6vG|1u)q#rxT8xbt6SjIvSJcmATRwh1$m*q09lctz8DFqp}sJPfhIVGH2D>o zbVJ8hCB^DASqdfRP^^LZu4>Ved?oGf&gPIV`f^(;vh%m0~_? zr8>V7uBE_RMNV6WiNwc@!-MeqxB zM3f{+k|h1So}1sS$OP10O|?TQhStGLyJZ&Y?7jjv2UaP?)K(xo6z@2}1pVBPt7!9j z((>4N!}9q2F2y1&yBD##buE^@>ThO3wfGCLP@@)U|72kS9Dl)TTTQ$8u;a0j2(WwI zJxuX{K)e&~SfD+xqRNfp9O!BrKq8n}gzbbbu7z8S8WxUOaVWK|gLbE{KAqqJ^(8D} z*DTOrq1J{i)-gw|XHBIhe#5@#Z99wZDfeA4Lxyr`W^MrL^`EPM3d&OF>Q5&3;7l?K zoym5Q7p0j!t$*0A$QK*!Kk~4QeE;EB9g|Vth0GkNQEjPDPosW3HdVigX7&U44R$F@ zt_BFZnk-{ev(3iLXvYAEDE>ptl5R8xy2+W#I%PZ2?%@r!<6ptRzX2BuSF|0dKrWc0EhQO@06X N002ovPDHLkV1lWBaU delta 387 zcmV-}0et@P1D*qrB!6W|L_t(|ob8#-4ul{Kgh#W!{{wq)47ENOEh^0jsFWbV&<+yj5)WEX_aERLO-`${sQ zhD#B5ZCio#FnpZvsgyOJV*hwd>m7MA*2TC`gvbxExlw9P*GWl3w#fa$g^{OWU5rzv zURSsL8^HL;(=ZJ{t@3k$n&|FdPSzHrM5CkhAHD9@5i$)x%zaJzw-<`s4Tqj`@b>t( hEI~pDA%qap!xv8s=`=!r|ASrVqBBTuZbLx|(dMk6Bm@#( zMv)*0f*@$;_1u)93IbHC*zKt#L+jwR-82h2I~Twl;G-6!t%mTa)Q;1bU_JNmyD0N| z%JSIkhUM`or)m<`>PakbU8_l#mcazI_z%EQL#wjCvTOnS1b@qI746!KUDOe(hh(%i zF=PjHq;|r!@@b<$fwuPG*8(8wFgYUZm|LH2;5dfrspPgs+U>;f9gttb8n|YS9*&Ur zW?S65vFYo8Ui;l}^tK&E^OPGD3n~}%zKjikrFBj3Pl32Pyg!(T!A#;5n#tD53uzwn zj)ts`EeQhpEq_bjh4DJ)@wtu8hI0000CfH^_}!yz*BZkv^2=?Hdxc{A*JQ7n8RtPp zK=N5{Easxhaf*%Yv5kPk2P1#Has1IRPeHBs$cs9T66OLVbARr_7zz;OoG=T?BQe() z5gxob-#-pvr56zPj+vZs*7zvc)y3?k1aOLJy=-1h0GG6GZi4}#20ekxLQ8>o4!52c z$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4Es9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}l9*&ipy!C9JIc{)5O z@z$QeIQ9`eWZ?jWi`t2Mo$*Db2R}Hn&;ifF{eG`PbQ=vzUeGZ$-(viTv&jx{*n>+F z$sJSlS-F{}u|NPAS#vt({Ipt{4zxMEv>x1pQ_2Ty6vG|1u)q#rxT8xbt6SjIvSJcm zATRwh1$m*q09lctz8DFqp}sJPfhIVGH2D>obVJ8hCB^DASqdfRP^^LZu4>Ved?oGf z&gPIV`f^(;vh%m0~_?r8>V7uBj~f|{k#}B z4)Di%0(GQh%XXzDG$sKK-Q2JkKR-`QsiPFD-4d_!i{fwH;J|_aEL%ZYNu#B0FJ7G| z;=_VQWOA9;dQ4Y9)LpKCV=ri`X({49JagUwO3&5UdSK)wEJxPN%9wG}45n;lzK(aC zKtbL$y*-#9uSql`7 zENOEh^0jsFWbV&<+yj5)WEX_aERLO-`${sQhD#B5ZCio#Fr4qHlr^7X|9DL69eFa= z#kf#}$Pcl(QEE=tNl8Pt$o;~Fk*8r@j8mpwSGW8d!1&11FbzPh@^gWj=oh7f%f7G)4s^6#xJL07*qo IM6N<$g02I(Gynhq literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrQueueWithdrawal/00008.png b/tests/snapshots/nanos_lrQueueWithdrawal/00008.png new file mode 100644 index 0000000000000000000000000000000000000000..ce795f34e8569e986af689fded3b59c9a8af2961 GIT binary patch literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrQueueWithdrawal/00003.png b/tests/snapshots/nanox_lrQueueWithdrawal/00003.png index b2401b220a6db139961dbcfed78507c4de86032a..343850a22a7448ea232679f2296b3c327c526eae 100644 GIT binary patch delta 789 zcmV+w1M2*r1FHs*BYy(&Nkl-omWpa~;20m3NizX3s^scG0mW{!jZmXz zTrZG4-$_%_eMbFmIGuWRz*or8PqN9oW+qz}H_MVSGk@&%3t?-(69UI|c$WfgsgK)Vg?2W;|M}9ROVdSBx61-9GNyJaXrb3m9+Jcf-}q zxxO{Rr+-(Y^>*MUSc-7TUe8ShB8AUA?LG}aGmQY*%cWqerqp7ob6OtGRC8j3JuQq! z>s2G5;C(P~MIwW0(Z!~PESF|wY~@h^RN-jCj%#5L2MC`Vc!eB&mTkhPiYWlb#8iJ1 z?`e~&eN{KLi<v-u1C|A_iMthp;MC1Zr%A4b4 z0D597o}=enc2@EPyl4cdL}ln%$rJFd05rL;zBUS^(}{OIDO(ak2qA=!Z{$B{H&{-w TeGcdd00000NkvXXu0mjfi2Zk~ delta 389 zcmV;00eb$c2A>0vBYy#ANklQ31IlGw|9L_yRTLLS&ux#tU! z)?{o#0wDkZ008EG?1xM#ZH*XXtLJjen{n*@df&j4{!!jD&jO^BVvJ()hQHH!%W3(D zj6W`QoPO|;n2-Ayk2fOj!k(QvFKVVzN;#YPAImsuXF2GEUw?C8#U-eICc-}VTlL6) zBO;Wc)J}2Lz6Ndu5Q|AYb3-FjXGh8H*4iaTH?D#65;UITQ-x8J*vYKd`V$shg36^P zyYMK8I9q006){%{>k6AH0;EV#ic}4t92`^`#3v>Nd@5d;FNz_j~^{zjHh{ za_L&574ZIUynb)R!?;D*O#JCP;lb16*%NJ9(+e;-kJM8$d#^i;TZ(=50|m%jvajFA zv(d87C?jW|B8X_$5zh7u-s(*U(O&x|wA4&8**Bx4n(P~+2A)`jJnP-jHUi&7r)J!tjH>0GQ>>Hy7o>+xE@gDX>dI10c00000 i0000000000fN8#7PD6W~&i|+Y0000_th+EJ@M?a;sSP$R|y$S`5ehPO7RI6~ujecz5wtxHp008J>V>i`7cs)e_ z@w@x()p@w=B24`klR6(CLpxqtlZO|2IWjpO-F~*EHtLqUMt)Wc_@bMv^h#{CUFW0M z(vJ1P=5N1GhWcHM(-Xu*&bc@D4_o$^7Y|pL)I@*DzttR=&yLH#^{|TW)8Sp0qphw% zepiuSUG#WHT7NcqNRJ+amk%-{%X;;nhp_B9`AEr=dDw9t3i(CsNk{+yAcA?j8pHh( z4`E}k<5T9?EPU2iU;UyqSmD_`zrB>5?fE;*?tuI!eMUi-A4ckzs{)2>k)^r|JEVn*{XgJQwtW9;MFX{UJOON4frt$2Z+chHMhh=Kjd^-@j4hH{^Pz o?0mofTW&!B00000001%k0v=pBEoDz5?EnA(07*qoM6N<$g5fRJ4FCWD diff --git a/tests/snapshots/nanox_lrQueueWithdrawal/00005.png b/tests/snapshots/nanox_lrQueueWithdrawal/00005.png index 657887225857cf48be8a8daed2cb3e89d4b29ece..570ce28d53e82ac396ba25c370110058f3a638f9 100644 GIT binary patch delta 446 zcmV;v0YU!#0@wqPB!8btL_t(|obB0Ba)clZfMM+HO}PJ&xJw_HvRNaFRyK+Ae@_l| zDJF;*Qvv`000000fD1|~r4;K?obY2kfIGzsef69KwCLxYZAWrSumtp0n4r;5;Sx}- zau7HADO>_th+EJ@M?a;sSP$R|y$S`5ehPO7RI6~ujecz5wtxHp008J>V>i`7cs)e_ z@w@x()p@w=B24`klR6(CLpxqtlZO|2IWjpO-F~*EHtLqUMt)Wc_@bMv^h#{CUFW0M z(vJ1P=5N1GhWcHM(-Xu*&bc@D4_o$^7Y|pL)I@*DzttR=&yLH#^{|TW)8Sp0qphw% zepiuSUG#WHT7NcqNRJ+amk%-{%X;;nhp_B9`AEr=dDw9t3i(CsNk{+yAcA?j8pHh( z4`E}k<5T9?EPU2iU;UyqSmD_`zrB>5?fE;*?tuI!eMUi-A4ckzs{)2>k)^r|JEVn*{XgJQwtW9;MFX{UJOON4frt$2Z+chHMhh=Kjd^-@j4hH{^Pz o?0mofTW&!B00000001%k0v=pBEoDz5?EnA(07*qoM6N<$f`dcWY5)KL delta 354 zcmcb?{FiBhO1+Dxi(^Q|oVPcl`3@-vI0Po$;rtyhRQ<8JMIk?%eObZz=}8L@T*!1t zWzj4-;J5hht#0pj z^#9@1sLK;CE54XuefJROGCRgZUbWXBk9~WeThLU0Q`4iWuO>iVr1K`D#hTWitG2LJbl{xH#~Rq+?=K-+vfC})E&6F z@5lAeSDtRMVcZx!aqGa5zhIs*He8&r_HtpZV5M#|^ ydh?e5zlAMgw-$Yhy2~hY*m8O9PiA<4-2TmASuS-mz3kmhkeH{dpUXO@geCyx8>t5X diff --git a/tests/snapshots/nanox_lrQueueWithdrawal/00006.png b/tests/snapshots/nanox_lrQueueWithdrawal/00006.png new file mode 100644 index 0000000000000000000000000000000000000000..e90cd9db37ed7e4c669da0b1abe6e4a823770f3c GIT binary patch literal 366 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!2~2@x4h6`U|=-$ba4!+nDh2#^r}M!BCQWK z&Z&HszcjC#zcHvdGud%d*x&ujm6to+(Vp%*SqP{N3M2&u1+V{G{c>j&LwL#RobX?V zbQiII^4uMl|Z~1l7yy12MZ$b&j z?TtJM^{@JVDT&uHZn5nzWh-TPv_J7m;jgq0f(|YbTZHdAM)myZxO-=(=&Jp4l55=A zUQcBF*M05wg}=Y7bG1(&{&siyl(&8#-KTdql}}rLm3hWhy}m5glJN5fpDsOd=_5x% z{HDvZre)46&g0e%{pDoXaPf-VTe-XJSGLU(Jj!tDNp8H)+;exzHoZ2kko_Ba_xXNR zr;WUGZIbufwyah@qN*6%Wc!qrE&9UV%v{IGH{4)eXE1ondwSC@^_ATTjUX{kS3j3^ HP6U4`s1;0 z?{f>9Zfbf|_00eLCwPudd#p2Mzfg8-=Z~Y&(Z3(6-dSPln_e}2 z&8bJe=5=w3_V0Wxpw!uqXV@ zTyg#0l&4R7|Ayyoo}1J3WZRs6lez;p_x-s3`O4ERHjEo5Zk@S4@1z`Oka)v{pj(C~ z>TB;CrkB0D2@>;k^>bP0l+XkKqsFS~ literal 0 HcmV?d00001 From 3b12388f75a91054741cbddc10001c17ac4eed1f Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Tue, 6 Feb 2024 10:42:48 +0100 Subject: [PATCH 23/33] fix: cleanup and tests snapshots --- README.md | 6 +++--- src/handle_finalize.c | 2 +- src/handle_provide_parameter.c | 13 ++++--------- src/handle_query_contract_id.c | 2 +- src/handle_query_contract_ui.c | 7 ++++++- src/kiln_plugin.h | 3 --- .../nanos_lrDepositIntoStrategyNormal/00001.png | Bin 393 -> 380 bytes .../nanos_lrDepositIntoStrategyNormal/00002.png | Bin 337 -> 445 bytes .../nanos_lrDepositIntoStrategyNormal/00003.png | Bin 355 -> 337 bytes .../nanos_lrDepositIntoStrategyNormal/00004.png | Bin 358 -> 355 bytes .../nanos_lrDepositIntoStrategyNormal/00005.png | Bin 414 -> 358 bytes .../nanos_lrDepositIntoStrategyNormal/00006.png | Bin 349 -> 414 bytes .../nanos_lrDepositIntoStrategyNormal/00007.png | Bin 0 -> 349 bytes .../00001.png | Bin 393 -> 380 bytes .../00002.png | Bin 341 -> 445 bytes .../00003.png | Bin 383 -> 341 bytes .../00004.png | Bin 358 -> 383 bytes .../00005.png | Bin 414 -> 358 bytes .../00006.png | Bin 349 -> 414 bytes .../00007.png | Bin 0 -> 349 bytes .../00001.png | Bin 393 -> 380 bytes .../00002.png | Bin 396 -> 445 bytes .../00003.png | Bin 382 -> 396 bytes .../00004.png | Bin 358 -> 382 bytes .../00005.png | Bin 414 -> 358 bytes .../00006.png | Bin 349 -> 414 bytes .../00007.png | Bin 0 -> 349 bytes .../nanox_lrDepositIntoStrategyNormal/00001.png | Bin 445 -> 426 bytes .../nanox_lrDepositIntoStrategyNormal/00002.png | Bin 390 -> 533 bytes .../nanox_lrDepositIntoStrategyNormal/00003.png | Bin 410 -> 390 bytes .../nanox_lrDepositIntoStrategyNormal/00004.png | Bin 415 -> 410 bytes .../nanox_lrDepositIntoStrategyNormal/00005.png | Bin 472 -> 415 bytes .../nanox_lrDepositIntoStrategyNormal/00006.png | Bin 381 -> 472 bytes .../nanox_lrDepositIntoStrategyNormal/00007.png | Bin 0 -> 381 bytes .../00001.png | Bin 445 -> 426 bytes .../00002.png | Bin 392 -> 533 bytes .../00003.png | Bin 447 -> 392 bytes .../00004.png | Bin 415 -> 447 bytes .../00005.png | Bin 472 -> 415 bytes .../00006.png | Bin 381 -> 472 bytes .../00007.png | Bin 0 -> 381 bytes .../00001.png | Bin 445 -> 426 bytes .../00002.png | Bin 445 -> 533 bytes .../00003.png | Bin 442 -> 445 bytes .../00004.png | Bin 415 -> 442 bytes .../00005.png | Bin 472 -> 415 bytes .../00006.png | Bin 381 -> 472 bytes .../00007.png | Bin 0 -> 381 bytes tests/src/lrDepositIntoStrategy.test.js | 2 +- tests/src/lrQueueWithdrawal.test.js | 2 +- 50 files changed, 17 insertions(+), 20 deletions(-) create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyNormal/00007.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00007.png create mode 100644 tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00007.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyNormal/00007.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00007.png create mode 100644 tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00007.png diff --git a/README.md b/README.md index ce35282..7450702 100644 --- a/README.md +++ b/README.md @@ -126,11 +126,11 @@ The flow processed in [GitHub Actions](https://github.com/features/actions) is t ### LR Deposit Into Strategy -![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00000.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00001.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00002.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00003.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00004.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00005.png) +![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00000.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00001.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00002.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00003.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00004.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00005.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00006.png) ![](/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00007.png) ### LR Queue Withdrawal -![](/tests/snapshots/nanos_lrQueueWithdrawal/00000.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00001.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00002.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00003.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00004.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00005.png) +![](/tests/snapshots/nanos_lrQueueWithdrawal/00000.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00001.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00002.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00003.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00004.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00005.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00006.png) ![](/tests/snapshots/nanos_lrQueueWithdrawal/00007.png) ### LR Complete Queued Withdrawal @@ -192,7 +192,7 @@ The flow processed in [GitHub Actions](https://github.com/features/actions) is t ### LR Queue Withdrawal -![](/tests/snapshots/nanox_lrQueueWithdrawal/00000.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00001.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00002.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00003.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00004.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00005.png) +![](/tests/snapshots/nanox_lrQueueWithdrawal/00000.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00001.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00002.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00003.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00004.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00005.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00006.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00007.png) ### LR Complete Queued Withdrawal diff --git a/src/handle_finalize.c b/src/handle_finalize.c index 304b0ce..3d12efd 100644 --- a/src/handle_finalize.c +++ b/src/handle_finalize.c @@ -22,7 +22,7 @@ void handle_finalize(ethPluginFinalize_t *msg) { msg->result = ETH_PLUGIN_RESULT_OK; break; case KILN_LR_DEPOSIT_INTO_STRATEGY: - msg->numScreens = 2; + msg->numScreens = 3; msg->result = ETH_PLUGIN_RESULT_OK; break; case KILN_LR_QUEUE_WITHDRAWAL: diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index 54ea2f8..8daf313 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -23,12 +23,10 @@ bool compare_addresses(const char *a, const char *b) { * otherwise set it to unkwown (-1) * * @param address: address to compare - * @param index: index of the erc20 in the context - * @param context: context to update * * @returns index of the erc20 in the context or -1 if not found */ -int find_lr_known_erc20(const char *address, context_t *context) { +int find_lr_known_erc20(const char *address) { for (size_t i = 0; i < LR_STRATEGIES_COUNT; i++) { if (compare_addresses(address, lr_erc20_addresses[i])) { return i; @@ -43,12 +41,10 @@ int find_lr_known_erc20(const char *address, context_t *context) { * otherwise set it to unkwown (-1) * * @param address: address to compare - * @param index: index of the strategy in the context - * @param context: context to update * * @returns index of the strategy in the context or -1 if not found */ -int find_lr_known_strategy(const char *address, context_t *context) { +int find_lr_known_strategy(const char *address) { for (size_t i = 0; i < LR_STRATEGIES_COUNT; i++) { if (compare_addresses(address, lr_strategy_addresses[i])) { return i; @@ -79,7 +75,7 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t msg->pluginSharedRW->sha3, 0); context->param_data.lr_deposit.strategy_to_display = - find_lr_known_strategy(address_buffer, context); + find_lr_known_strategy(address_buffer); context->next_param = LR_DEPOSIT_INTO_STRATEGY_TOKEN; break; @@ -90,8 +86,7 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t sizeof(address_buffer), msg->pluginSharedRW->sha3, 0); - context->param_data.lr_deposit.erc20_to_display = - find_lr_known_erc20(address_buffer, context); + context->param_data.lr_deposit.erc20_to_display = find_lr_known_erc20(address_buffer); context->next_param = LR_DEPOSIT_INTO_STRATEGY_AMOUNT; break; diff --git a/src/handle_query_contract_id.c b/src/handle_query_contract_id.c index 285f9b2..2ef87e1 100644 --- a/src/handle_query_contract_id.c +++ b/src/handle_query_contract_id.c @@ -45,7 +45,7 @@ void handle_query_contract_id(ethQueryContractID_t *msg) { break; case KILN_LR_DEPOSIT_INTO_STRATEGY: - strlcpy(msg->version, "Deposit In Strategy", msg->versionLength); + strlcpy(msg->version, "Liquid Restaking", msg->versionLength); break; case KILN_LR_QUEUE_WITHDRAWAL: diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 5a2a0be..23a6bef 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -179,6 +179,11 @@ static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *con switch (msg->screenIndex) { case 0: + strlcpy(msg->title, "EigenLayer", msg->titleLength); + strlcpy(msg->msg, "Deposit In Strategy", msg->msgLength); + ret = true; + break; + case 1: strlcpy(msg->title, "Strategy", msg->titleLength); if (params->strategy_to_display == -1) { strlcpy(msg->msg, "UNKNOWN", msg->msgLength); @@ -187,7 +192,7 @@ static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *con } ret = true; break; - case 1: + case 2: strlcpy(msg->title, "Amount", msg->titleLength); amountToString( params->erc20_amount_to_display, diff --git a/src/kiln_plugin.h b/src/kiln_plugin.h index bff6317..3c97e6f 100644 --- a/src/kiln_plugin.h +++ b/src/kiln_plugin.h @@ -113,9 +113,6 @@ typedef struct { } lr_queue_withdrawal_t; typedef struct { - // int lr_strategy_to_display[MAX_DISPLAY_COUNT]; - // int lr_erc20_to_display[MAX_DISPLAY_COUNT]; - // uint8_t lr_erc20_amount_to_display[MAX_DISPLAY_COUNT][INT256_LENGTH]; } lr_complete_queued_withdrawal_t; typedef struct context_t { diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00001.png b/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00001.png index a642dd5317d03b8a3558dcfc9b52f566bb301be7..c978af0baf12daf4747b904387f03ec16315336b 100644 GIT binary patch delta 353 zcmV-n0iOPe1N;JzB!5FmL_t(|ob8$04uc>JhH;ti|G-{s7bFCG8Zxw${9l#@kz;=- zp{4`?002zQ=Md670q(-Kbz}kF-UGP8=SbVGKBlu0pu)M@C07Slkw*; zuQH?&t>y9?#gOrL_cd#yO3Pwgx}%-;w>NW7Fs=@S@dzb(D`s}|NV+JGIi3H>C5{JE z$za67WO)7|KVzNRA5z3jdyO~NB^7P|Rx8v!)L!C*qYGrQlgv6tT$`F0P767p0Ngnw z<_EZ2vs=insajow;?VvkU@$Jz5|X zKy-t%v&Jp2<#@kBSQoSk0S{qc?3)At0EFTTWHH*in15Ra00000NkvXXu0mjfb}FOo delta 366 zcmV-!0g?Xv0*M2VB!5szL_t(|ob8$05`-WKhHYni{|D}(y=cZU0v5~zID8j7t&tMH zVroi35ClPBn)5)epBF(d_*i=u;5*v^4d;=zo&1~bN`PBd@gu-9+$h;bXg{0JYzM?_ zyX#a#;YWb9rUtGANDFGlf`csy+^CD_aEhJlkd73w^u31CAO2{5grdkSUi`RhBS=wW4O#g_u4gpzhhW9jENA zs#&eV-~~+usArB~nR(hG+&H3gOL@0MqN@x`2QpW%?0m5>04KA|dgrSIKxaQNvjI!3 z8EC6Q6(-A5t)P}#hYhjhvQG8AAi&{yz*<?xR z2Q%>-h3>%bBrnWkeZrUeByh3~%1l97H5yEVG-p7*C<`~28T6(Oj08-Tz5dXF zIb9R3uT^UtNq>VHY3UT{72b<|yS^K)v;z#4%TgIqE>Fs$V2iL>4U+rRQ~T@y+t{`X z2d>ttQ_axf08JfmymHxm^GY{Q&H&*lq+MOlQ#F+Sb>$XheQ4q=D!MES7rp06Ev6I@ zDI$arLRMw-RzO5V&f_!Q-hO&4OYVTy%J|+;z?^_Q@YR7x(|lZ==6lstiB;dbF6W^w zl~1cNo))W;UkzM&c`G0y&uFznvTHRAvyOw|fE$%k3^8dNx_|WFh+q9ca=@QZrcZ9h za0!M3j4a=Z=&Gc;v6VcA#d}1{p%$%+-SHcXSMU09j4%m{beQ4q=D!MES7rp06Ev6I@ zDI$arLRMw-RzO5V&f_!Q-hO&4OYVTy%J|+;z?^_Q@YR7x(|lZ==6lstiB;dbF6W^w zl~1cNo))W;UkzM&c`G0y&uFznvTHRAvyOw|fE$%k3^8dNx_|WFh+q9ca=@QZrcZ9h za0!M3j4a=Z=&Gc;v6VcA#d}1{p%$%+-SHcXSMU09j4%m{bX zArc}0001DK=OcOsm3gc0=7TiOzDG}BOs~`Q#nUlUzXg4>CX@8lH_%CS^F17%@*^w9O zJ1`U(>boIG4fUOY4RFRE_2ZrDhQ)U=|y4)Ph9(3ums&^Mmo9u<{emkb5H3CvyiVUrDSbv|>Ye zwZPIhi9?Vl?Ljm`JeIIr0SSt6Bl;sP>yKcx4YPlAjvR0l9-a7+PV3TGCK$Z}00000 aKy6-_GQl9bVBIeO0000XN7c diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00004.png b/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00004.png index eeec6324a1f33b9b155d3e979728a086251adb10..b98a38f388eecd319350c8d48fccf8fc5e455362 100644 GIT binary patch delta 328 zcmV-O0k{6<0^X zArc}0001DK=OcOsm3gc0=7TiOzDG}BOs~`Q#nUlUzXg4>CX@8lH_%CS^F17%@*^w9O zJ1`U(>boIG4fUOY4RFRE_2ZrDhQ)U=|y4)Ph9(3ums&^Mmo9u<{emkb5H3CvyiVUrDSbv|>Ye zwZPIhi9?Vl?Ljm`JeIIr0SSt6Bl;sP>yKcx4YPlAjvR0l9-a7+PV3TGCK$Z}00000 aKy6-_GQl9bVBIeO00007w8x2cd&@naNV*H4+$qsPXgG&<09aHpKxtXT1KmZt7bALMK{Ipt{4zxMEv>x1p zQ_2Ty6vG|1u)q#rxT8xbt6SjIvSJcmATRwh1$m*q09lctz8DFqp}sJPfhIVGH2D>o zbVJ8hCB^DASqdfRP^^LZu4>Ved?oGf&gPIV`f^(;vh%m0~_? zr8>V7uB7w8x2cd&@naNV*H4+$qsPXgG&<09aHpKxtXT1KmZt7bALMK{Ipt{4zxMEv>x1p zQ_2Ty6vG|1u)q#rxT8xbt6SjIvSJcmATRwh1$m*q09lctz8DFqp}sJPfhIVGH2D>o zbVJ8hCB^DASqdfRP^^LZu4>Ved?oGf&gPIV`f^(;vh%m0~_? zr8>V7uB7ENOEh^0jsFWbV&<+yj5)WEX_aERLO-`${sQ zhD#B5ZCio#FnpZvsgyOJV*hwd>m7MA*2TC`gvbxExlw9P*GWl3w#fa$g^{OWU5rzv zURSsL8^HL;(=ZJ{t@3k$n&|FdPSzHrM5CkhAHD9@5i$)x%zaJzw-<`s4Tqj`@b>t( hEI~pDA%qap!xv8s=`=7ENOEh^0jsFWbV&<+yj5)WEX_aERLO-`${sQ zhD#B5ZCio#FnpZvsgyOJV*hwd>m7MA*2TC`gvbxExlw9P*GWl3w#fa$g^{OWU5rzv zURSsL8^HL;(=ZJ{t@3k$n&|FdPSzHrM5CkhAHD9@5i$)x%zaJzw-<`s4Tqj`@b>t( hEI~pDA%qap!xv8s=`=3a delta 322 zcmV-I0log71Kk3UB!47HL_t(|ob8#-62c%1gsEfS|A9T|fw6-G0=6YAu-~c0@)I@* zLv)T1LI|CfH^_}!yz*BZkv^2=?Hdxc{A*JQ7n8RtPp zK=N5{Easxhaf*%Yv5kPk2P1#Has1IRPeHBs$cs9T66OLVbARr_7zz;OoG=T?BQe() z5gxob-#-pvr56zPj+vZs*7zvc)y3?k1aOLJy=-1h0GG6GZi4}#20ekxLQ8>o4!52c z$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4Es9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}l9*&i5)aIsgCw diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00007.png b/tests/snapshots/nanos_lrDepositIntoStrategyNormal/00007.png new file mode 100644 index 0000000000000000000000000000000000000000..ce795f34e8569e986af689fded3b59c9a8af2961 GIT binary patch literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00001.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00001.png index a642dd5317d03b8a3558dcfc9b52f566bb301be7..c978af0baf12daf4747b904387f03ec16315336b 100644 GIT binary patch delta 353 zcmV-n0iOPe1N;JzB!5FmL_t(|ob8$04uc>JhH;ti|G-{s7bFCG8Zxw${9l#@kz;=- zp{4`?002zQ=Md670q(-Kbz}kF-UGP8=SbVGKBlu0pu)M@C07Slkw*; zuQH?&t>y9?#gOrL_cd#yO3Pwgx}%-;w>NW7Fs=@S@dzb(D`s}|NV+JGIi3H>C5{JE z$za67WO)7|KVzNRA5z3jdyO~NB^7P|Rx8v!)L!C*qYGrQlgv6tT$`F0P767p0Ngnw z<_EZ2vs=insajow;?VvkU@$Jz5|X zKy-t%v&Jp2<#@kBSQoSk0S{qc?3)At0EFTTWHH*in15Ra00000NkvXXu0mjfb}FOo delta 366 zcmV-!0g?Xv0*M2VB!5szL_t(|ob8$05`-WKhHYni{|D}(y=cZU0v5~zID8j7t&tMH zVroi35ClPBn)5)epBF(d_*i=u;5*v^4d;=zo&1~bN`PBd@gu-9+$h;bXg{0JYzM?_ zyX#a#;YWb9rUtGANDFGlf`csy+^CD_aEhJlkd73w^u31CAO2{5grdkSUi`RhBS=wW4O#g_u4gpzhhW9jENA zs#&eV-~~+usArB~nR(hG+&H3gOL@0MqN@x`2QpW%?0m5>04KA|dgrSIKxaQNvjI!3 z8EC6Q6(-A5t)P}#hYhjhvQG8AAi&{yz*<?xR z2Q%>-h3>%bBrnWkeZrUeByh3~%1l97H5yEVG-p7*C<`~28T6(Oj08-Tz5dXF zIb9R3uT^UtNq>VHY3UT{72b<|yS^K)v;z#4%TgIqE>Fs$V2iL>4U+rRQ~T@y+t{`X z2d>ttQ_axf08JfmymHxm^GY{Q&H&*lq+MOlQ#F+Sb>$Xh4#OY_MQOAB{|EP>duZY;BD!P^SH0&+9j1(n zXsrk#gpgI)q8$(sk@NVrw|AT$%aRLF8|j}r6fi3wPkgl?Qa5j#-F&XvA4C zQhC?R@ib^!{?rKN743kC+_TkB$!63r!rBjp02ivHIA&50bbqN|kFIeb3Gfgq^hst6 zNiYO(s(dY@O-r?7D|?KHw-~L4dek=d!2ei0de=XXktW09?Q=8be&Radrekh--VMR< z0l}@MpazkwRfW*F2f4Tl8e$)Iu7K1a+RYDw4}YMxQk@GWXI3Z}FJdLmh3H(M3Ly7a z*|N@bN&=bnIWxcl_;fCX+GhqB_O=Om5(*H^uq9~TZJ7{42q9zzKEOhkOjSi69RL6T M07*qoM6N<$f{n9{wEzGB diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00003.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00003.png index e15b07507cf42d2e51d35166b9218d27a312f304..9d9f05a0a8b72e6003ed4c63b990c15e5cc59db4 100644 GIT binary patch delta 314 zcmV-A0mc6R0@VVLB!3)9L_t(|ob8#>4#OY_MQOAB{|EP>duZY;BD!P^SH0&+9j1(n zXsrk#gpgI)q8$(sk@NVrw|AT$%aRLF8|j}r6fi3wPkgl?Qa5j#-F&XvA4C zQhC?R@ib^!{?rKN743kC+_TkB$!63r!rBjp02ivHIA&50bbqN|kFIeb3Gfgq^hst6 zNiYO(s(dY@O-r?7D|?KHw-~L4dek=d!2ei0de=XXktW09?Q=8be&Radrekh--VMR< z0l}@MpazkwRfW*F2f4Tl8e$)Iu7K1a+RYDw4}YMxQk@GWXI3Z}FJdLmh3H(M3Ly7a z*|N@bN&=bnIWxcl_;fCX+GhqB_O=Om5(*H^uq9~TZJ7{42q9zzKEOhkOjSi69RL6T M07*qoM6N<$g57S7_5c6? delta 356 zcmV-q0h|8S0{;S#B!5OpL_t(|ob8#-5`r)cgo7jR|G*yf;0QH;q)?lV-ETZ#X-n9Y zW>|;-004k|o{#JZX6CJaw;T+U?0a?qHl;?(y8m5P-l1%f$7~+@PWIM+cH|SF9?OI4 zjj7zS10bSewU#S=4u;u+CewXmm;}h3eGUdlKv_BIvkM*8Mt`*|Q%(K`Ey9y6z}_6l z3-vo-iVXF;p-2t&JA)i#f?X(+^L3b=vR><}JOI|G{8=5?SZ6|OpnodT;>YiBX^A^R zSNS$Ub4H!VZw$^83Dv&~_0moZHjTU>$HS3tRm}~b6bC8twiw{YW?Z8v_o)VP>)PE{ zy9B7xSbF`(LtUU!nVa9+(c?(dimmvo-!LkljHYIszur$*0yf-o>$+u{d4KBnxG*&d zV0Wlq>~s#~z!RISzYR*I|;-004k|o{#JZX6CJaw;T+U?0a?qHl;?(y8m5P-l1%f$7~+@PWIM+cH|SF9?OI4 zjj7zS10bSewU#S=4u;u+CewXmm;}h3eGUdlKv_BIvkM*8Mt`*|Q%(K`Ey9y6z}_6l z3-vo-iVXF;p-2t&JA)i#f?X(+^L3b=vR><}JOI|G{8=5?SZ6|OpnodT;>YiBX^A^R zSNS$Ub4H!VZw$^83Dv&~_0moZHjTU>$HS3tRm}~b6bC8twiw{YW?Z8v_o)VP>)PE{ zy9B7xSbF`(LtUU!nVa9+(c?(dimmvo-!LkljHYIszur$*0yf-o>$+u{d4KBnxG*&d zV0Wlq>~s#~z!RISzYR*I7w8x2cd&@naNV*H4+$qsPXgG&<09aHpKxtXT1KmZt7bALMK{Ipt{4zxMEv>x1p zQ_2Ty6vG|1u)q#rxT8xbt6SjIvSJcmATRwh1$m*q09lctz8DFqp}sJPfhIVGH2D>o zbVJ8hCB^DASqdfRP^^LZu4>Ved?oGf&gPIV`f^(;vh%m0~_? zr8>V7uBY diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00005.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00005.png index 1c9156c31edf73cb072eaebf2db3fbe1ba5c612b..eeec6324a1f33b9b155d3e979728a086251adb10 100644 GIT binary patch delta 331 zcmV-R0kr;}1LgvdB!4YQL_t(|ob8#*62l+}MYYrX{|9H0E}S}66dzI0=AKnTEwLAs zK#c(a0Ps|-=EJYk7-Q_gS(;pVIy@-x)}FvP_7Oc~;Q)k-+KGFe@kONvKRB|`0nfty zey>7w8x2cd&@naNV*H4+$qsPXgG&<09aHpKxtXT1KmZt7bALMK{Ipt{4zxMEv>x1p zQ_2Ty6vG|1u)q#rxT8xbt6SjIvSJcmATRwh1$m*q09lctz8DFqp}sJPfhIVGH2D>o zbVJ8hCB^DASqdfRP^^LZu4>Ved?oGf&gPIV`f^(;vh%m0~_? zr8>V7uB7ENOEh^0jsFWbV&<+yj5)WEX_aERLO-`${sQ zhD#B5ZCio#FnpZvsgyOJV*hwd>m7MA*2TC`gvbxExlw9P*GWl3w#fa$g^{OWU5rzv zURSsL8^HL;(=ZJ{t@3k$n&|FdPSzHrM5CkhAHD9@5i$)x%zaJzw-<`s4Tqj`@b>t( hEI~pDA%qap!xv8s=`=7ENOEh^0jsFWbV&<+yj5)WEX_aERLO-`${sQ zhD#B5ZCio#FnpZvsgyOJV*hwd>m7MA*2TC`gvbxExlw9P*GWl3w#fa$g^{OWU5rzv zURSsL8^HL;(=ZJ{t@3k$n&|FdPSzHrM5CkhAHD9@5i$)x%zaJzw-<`s4Tqj`@b>t( hEI~pDA%qap!xv8s=`=3a delta 322 zcmV-I0log71Kk3UB!47HL_t(|ob8#-62c%1gsEfS|A9T|fw6-G0=6YAu-~c0@)I@* zLv)T1LI|CfH^_}!yz*BZkv^2=?Hdxc{A*JQ7n8RtPp zK=N5{Easxhaf*%Yv5kPk2P1#Has1IRPeHBs$cs9T66OLVbARr_7zz;OoG=T?BQe() z5gxob-#-pvr56zPj+vZs*7zvc)y3?k1aOLJy=-1h0GG6GZi4}#20ekxLQ8>o4!52c z$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4Es9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}l9*&i5)aIsgCw diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00007.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownERC20/00007.png new file mode 100644 index 0000000000000000000000000000000000000000..ce795f34e8569e986af689fded3b59c9a8af2961 GIT binary patch literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00001.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00001.png index a642dd5317d03b8a3558dcfc9b52f566bb301be7..c978af0baf12daf4747b904387f03ec16315336b 100644 GIT binary patch delta 353 zcmV-n0iOPe1N;JzB!5FmL_t(|ob8$04uc>JhH;ti|G-{s7bFCG8Zxw${9l#@kz;=- zp{4`?002zQ=Md670q(-Kbz}kF-UGP8=SbVGKBlu0pu)M@C07Slkw*; zuQH?&t>y9?#gOrL_cd#yO3Pwgx}%-;w>NW7Fs=@S@dzb(D`s}|NV+JGIi3H>C5{JE z$za67WO)7|KVzNRA5z3jdyO~NB^7P|Rx8v!)L!C*qYGrQlgv6tT$`F0P767p0Ngnw z<_EZ2vs=insajow;?VvkU@$Jz5|X zKy-t%v&Jp2<#@kBSQoSk0S{qc?3)At0EFTTWHH*in15Ra00000NkvXXu0mjfb}FOo delta 366 zcmV-!0g?Xv0*M2VB!5szL_t(|ob8$05`-WKhHYni{|D}(y=cZU0v5~zID8j7t&tMH zVroi35ClPBn)5)epBF(d_*i=u;5*v^4d;=zo&1~bN`PBd@gu-9+$h;bXg{0JYzM?_ zyX#a#;YWb9rUtGANDFGlf`csy+^CD_aEhJlkd73w^u31CAO2{5grdkSUi`RhBS=wW4O#g_u4gpzhhW9jENA zs#&eV-~~+usArB~nR(hG+&H3gOL@0MqN@x`2QpW%?0m5>04KA|dgrSIKxaQNvjI!3 z8EC6Q6(-A5t)P}#hYhjhvQG8AAi&{yz*<?xR z2Q%>-h3>%bBrnWkeZrUeByh3~%1l97H5yEVG-p7*C<`~28T6(Oj08-Tz5dXF zIb9R3uT^UtNq>VHY3UT{72b<|yS^K)v;z#4%TgIqE>Fs$V2iL>4U+rRQ~T@y+t{`X z2d>ttQ_axf08JfmymHxm^GY{Q&H&*lq+MOlQ#F+Sb>$Xhss_%q#Cgo1+K5G8H4tr$8xE(F1yNkGY(KVfS|@DEAHN?M z_MYAcQn|MhAZiLDKdX~t=b^=r-cJTbfEEK^O?ZkRZFNWjsIF=G>n@W3Nq`n$F*_D8 z0d~c^Uzp93moia2aKmx@_cT=fh-ll0dSf@P8y?s^Zav$QBuSDaNpSc8GsfKuvdq?W P00000NkvXXu0mjf;bNy$ diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00003.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00003.png index cd65dece2a08f03b6b39e1e293bc325963f79c8b..f6d556916108fab7602b510c4ceb72780470fd7e 100644 GIT binary patch delta 369 zcmV-%0gnFu0*nKYB!5#$L_t(|ob8!G5`!QNMPsME|AAe!3ujUqLWmAFU&)&;ga*O< z01=6jBuSE4S)vC(L`3iPd%e8k#xX6W0IeE-+e-m61IoY`6M~E7wOTCOilQ)6`<<8f zDm_&e)fneW)pFNGD9`8t5Ycb6+9BEX8irf_Uss_%q#Cgo1+K5G8H4tr$8xE(F1yNkGY(KVfS|@DEAHN?M z_MYAcQn|MhAZiLDKdX~t=b^=r-cJTbfEEK^O?ZkRZFNWjsIF=G>n@W3Nq`n$F*_D8 z0d~c^Uzp93moia2aKmx@_cT=fh-ll0dSf@P8y?s^Zav$QBuSDaNpSc8GsfKuvdq?W P00000NkvXXu0mjfJ+h~i delta 355 zcmV-p0i6Df1O5V#B!5LoL_t(|ob8!G62l+}MX}S||G-_ei%cy6G_(?R>VGSP8VM*G zBmw{c0LJrtjMiXfcI$WZ!8Fdkk5-@zw^7>1!}e2wKeUnQ0uLBl{Xm-~hgJ(mM*B?v3WQOn=|_Z_-V8u?g6l6Z69Q z9Vi+Z*6)U4YFNKB@WDtBg+_8Tax$tzPG1`@l<&Vyt}DnM8F8j1??*Ggc?^`*HVo3J-B$z#{CIrEzMuq`ZqWib$_2- zA2H$_;M6sz5L`t1!NYGUhl>dEO;89*+aG3(Q*8hM002ovPDHLkV1kn& Br@jCH diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00004.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00004.png index eeec6324a1f33b9b155d3e979728a086251adb10..cd65dece2a08f03b6b39e1e293bc325963f79c8b 100644 GIT binary patch delta 355 zcmV-p0i6Ek0{#M!B!5LoL_t(|ob8!G62l+}MX}S||G-_ei%cy6G_(?R>VGSP8VM*G zBmw{c0LJrtjMiXfcI$WZ!8Fdkk5-@zw^7>1!}e2wKeUnQ0uLBl{Xm-~hgJ(mM*B?v3WQOn=|_Z_-V8u?g6l6Z69Q z9Vi+Z*6)U4YFNKB@WDtBg+_8Tax$tzPG1`@l<&Vyt}DnM8F8j1??*Ggc?^`*HVo3J-B$z#{CIrEzMuq`ZqWib$_2- zA2H$_;M6sz5L`t1!NYGUhl>dEO;89*+aG3(Q*8hM002ovPDHLkV1f>u Bs22bL delta 331 zcmV-R0kr=90_FmcB!4YQL_t(|ob8#*62l+}MYYrX{|9H0E}S}66dzI0=AKnTEwLAs zK#c(a0Ps|-=EJYk7-Q_gS(;pVIy@-x)}FvP_7Oc~;Q)k-+KGFe@kONvKRB|`0nfty zey>7w8x2cd&@naNV*H4+$qsPXgG&<09aHpKxtXT1KmZt7bALMK{Ipt{4zxMEv>x1p zQ_2Ty6vG|1u)q#rxT8xbt6SjIvSJcmATRwh1$m*q09lctz8DFqp}sJPfhIVGH2D>o zbVJ8hCB^DASqdfRP^^LZu4>Ved?oGf&gPIV`f^(;vh%m0~_? zr8>V7uB7w8x2cd&@naNV*H4+$qsPXgG&<09aHpKxtXT1KmZt7bALMK{Ipt{4zxMEv>x1p zQ_2Ty6vG|1u)q#rxT8xbt6SjIvSJcmATRwh1$m*q09lctz8DFqp}sJPfhIVGH2D>o zbVJ8hCB^DASqdfRP^^LZu4>Ved?oGf&gPIV`f^(;vh%m0~_? zr8>V7uB7ENOEh^0jsFWbV&<+yj5)WEX_aERLO-`${sQ zhD#B5ZCio#FnpZvsgyOJV*hwd>m7MA*2TC`gvbxExlw9P*GWl3w#fa$g^{OWU5rzv zURSsL8^HL;(=ZJ{t@3k$n&|FdPSzHrM5CkhAHD9@5i$)x%zaJzw-<`s4Tqj`@b>t( hEI~pDA%qap!xv8s=`=7ENOEh^0jsFWbV&<+yj5)WEX_aERLO-`${sQ zhD#B5ZCio#FnpZvsgyOJV*hwd>m7MA*2TC`gvbxExlw9P*GWl3w#fa$g^{OWU5rzv zURSsL8^HL;(=ZJ{t@3k$n&|FdPSzHrM5CkhAHD9@5i$)x%zaJzw-<`s4Tqj`@b>t( hEI~pDA%qap!xv8s=`=3a delta 322 zcmV-I0log71Kk3UB!47HL_t(|ob8#-62c%1gsEfS|A9T|fw6-G0=6YAu-~c0@)I@* zLv)T1LI|CfH^_}!yz*BZkv^2=?Hdxc{A*JQ7n8RtPp zK=N5{Easxhaf*%Yv5kPk2P1#Has1IRPeHBs$cs9T66OLVbARr_7zz;OoG=T?BQe() z5gxob-#-pvr56zPj+vZs*7zvc)y3?k1aOLJy=-1h0GG6GZi4}#20ekxLQ8>o4!52c z$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4Es9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}l9*&i5)aIsgCw diff --git a/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00007.png b/tests/snapshots/nanos_lrDepositIntoStrategyUnknownStrategy/00007.png new file mode 100644 index 0000000000000000000000000000000000000000..ce795f34e8569e986af689fded3b59c9a8af2961 GIT binary patch literal 349 zcmV-j0iyniP)O41}p;-~WL<=z+0=1Om1tEU@3H#qtw22}5*_5JCvCo4!52c$FXo$VhXU?0M$^Bekqgf%Ka;M*^X|4 zEs9YCQ(xfJKmNC#+8dY%2&wT+>D^<3C%}_*k1^mvtO~`RE00000NkvXXu0mjf-kqOA literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00001.png b/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00001.png index aaf1799d2cd974eff3600c592fcbd740ed6e487d..f86d7e2bc7c744a8c5f9c8c987b0fefa39364db1 100644 GIT binary patch delta 400 zcmV;B0dM}j1F8d%B!6*9L_t(|obA~`j>8}fKv7!FO>+Mu`7X0SgDeab5QIAO-zuS` zA=nT~LjV8(0B-j>-GI+TB!qBXS2~WTwmcsD@^iWYGh#=3>~8CQx&Z^SG#8OHAZ#`H zb7u=DxCy|}BqJhT#)q2#MBks$qud0*OGb}!6M$eALeJnS0DsBDVgLXDfEjjCII&D@ z?CNAC%QtzJwEv`i&24v0|9#sv&vy5g?P$FhrXMf;l+~XW3n%WF-6EZ)%~5@-E8Ax4 z16w(3-uXR}MxGWEwq4lH@y=_r3)}OXj?i>dr}_IsCQJ6LP?r>Qvlfg~iR>=`#Vxt4 z`|PyV{)RX;^?%1;;Xj}*H{*ht&8O>3S6($@@)0mM7;A5~+EXw?VL;<}>e^*;0sZ~ejf71cjb9^yBo=QBn?SoCZBObifJyP6o>;6o=9 ugRSUZ0000000000000000001Bn_sFVJjY}l8)N_g00{s|MNUMnLSTZ7&$cN5 delta 419 zcmV;U0bKs71HA)~B!7fSL_t(|obB3Cj)Wi#fMIsBH{t$A;x79@hLEC#5>V^@-;={A z=}=IF2>}2A0Jz-G-2wEaltKtG#&VoLw&nTQm*2Ysn2{UWV{^AYcL!h~x_L^e42br$ z^mS!~6Wk=gbdyObc^MyW5|BN=M_ai`fR`R^L`a;6^GDE#|x+bzG5DC~iC0EwkCaxV1^~(2*mCMnh$JIZh?t^W|Y%eU!{mL5L zS^Y|ErM7loL3}*hga}9J5x;KlfIAxj%7Lj+DIck-E>Q;SM9rpyaa%^f+_h^v&iGDQ zH|(uy!XBqhO%5*5X=HM+70n9(000000000002}}S0001N^9MaqOF+&uTZ8}r N002ovPDHLkV1lY9!({*f diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00002.png b/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00002.png index 9d059f3cdd6a78ad5e42778642285c2e3daa0830..3a306b185323cb01e28f5f83cfbe9e6644bff724 100644 GIT binary patch delta 507 zcmVRAdK%JY}iThuYdzlY&jZvg(#XjboFGDL@ z5LD_M00000z;=H23=={~ZSQ@O#P$;9OH}RWcjsWajUH;Rsd0d`z_$gb-?5C(@@DCM(Pot)ma*zc|U(wSPn$W%@IRxGV+foHRsd zFMX6fN%FE3R3nD`gcX$Z(sIm&8`9Pkq?7W1v$RO=o;w@_wnl)ytrc5qT(F1xt=L`P zY;s0Nc_D?d`fYc9tUGX{6!bsYbQ9JoR;5uMc=UxC0KkIbJzzt=){6~2rHJ%qY`iM( z7Y;Bz)rrbS%YO``9f#gL&&rEfvEu3~qxhQGF_jIJqf1M_GPk6yxV7baS_M1tyTq@v z4Y*bWD2*YZBJWX^OO#-p&^*-W$0P#g`mS9#{r}w#r)`>%RyttXf_dgyI3K50K*b3t zPjeRD>26exj>dY#iKVWYPrIaaK#vK;-B0{eSW7xz8+4kFKFNCjZ>{KB5-a3G6F!`k z)@5z7yIb9H2}9?F9u1%T!6U-|>B!rX#cF+J1i0@3Hyv~5{xNLw0f;nBjSn_(U}St? x3g!g>000000000000000000000000m;}56`xE=q8JDdOj002ovPDHLkV1gs1>>>aF delta 363 zcmV-x0hIog1cn2UB!5jwL_t(|obB0Lj>8}fKv8DYop}FC@?Pcx6(REo?W7p!Js(wG zgv0~~(hvXu0D$R!e5+U0v@9ZySMrTiHE)3GmN!na7tbCL1D76r6GstI)%crM^S#v~ zq1LNfEo7>8>4LxWt29z{(*27_wN>OP6d^0Ow;H3|>lpnI!hgf1)+jyH@k#F-78fp4 zO*&wsq~zQKUJY*EIr^u~yNfx4soIx+3c680rq#yt%|Bs8}fKv8DYop}FC@?Pcx6(REo?W7p!Js(wG zgv0~~(hvXu0D$R!e5+U0v@9ZySMrTiHE)3GmN!na7tbCL1D76r6GstI)%crM^S#v~ zq1LNfEo7>8>4LxWt29z{(*27_wN>OP6d^0Ow;H3|>lpnI!hgf1)+jyH@k#F-78fp4 zO*&wsq~zQKUJY*EIr^u~yNfx4soIx+3c680rq#yt%|Bs;EF4?skuhW^+b#F_73?*R0D!N@zEig=JhNtCmKjzSkuojg z=v^yY%mL_f(>ob0u_wi!NiXx5NloHbqwQ`EVBhOPh!-)FOO5*cFMV$<~@H*-e zec3$$i(g4+XLwO%eMej8CTUw`wAD~jqou1c*7tQ{bP(!6aB-O15acjPZvRE4z?n^000000000000000 d0002MHh(;i6M)SqLJ$A|002ovPDHLkV1mE0t)Tz_ diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00004.png b/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00004.png index b2401b220a6db139961dbcfed78507c4de86032a..2a409b85c209be284ea1c1bb9820a3c8367a5a07 100644 GIT binary patch delta 383 zcmV-_0f7FW1DXSnB!6K^L_t(|obB0Bl7k=&fZ=p!Z^HeL#9j7*8HOPNv0F&m{@)W- zQ5tH*R0IG30Qg!t=bW?mC>;EF4?skuhW^+b#F_73?*R0D!N@zEig=JhNtCmKjzSkuojg z=v^yY%mL_f(>ob0u_wi!NiXx5NloHbqwQ`EVBhOPh!-)FOO5*cFMV$<~@H*-e zec3$$i(g4+XLwO%eMej8CTUw`wAD~jqou1c*7tQ{bP(!6aB-O15acjPZvRE4z?n^000000000000000 d0002MHh(;i6M)SqLJ$A|002ovPDHLkV1nftt-1gJ delta 388 zcmV-~0ek+M1D^wsB!6Z}L_t(|obA|KZp0uAKv6pCPT2pF*vouGLDU#R9@td5=L?b6 zWNbnLApigX0Oo$|hfFDLjTmFA=W@)OaqRti-@udpQQkAp0;H5;jAHVJztefkY59nZ zKQ48ge(;f)kNX&pHzMxBo}D@`YNk?3Ih*+(%Q$LhIp~C6bAMpPC8&NT!any~^~irC zB9x)jPI1+~25toqi%C6mLnBjXN6GEh+9gIeu7UFsG@jy9g;A5($*kA<6Bb;8%B3c| z@F<8lTYl9}-P-jHUi&7r)J!tjH>0GQ>>Hy7o>+xE@gDX>dI10c00000 i0000000000fN8#7PD6W~&i|+Y0000P-jHUi&7r)J!tjH>0GQ>>Hy7o>+xE@gDX>dI10c00000 i0000000000fN8#7PD6W~&i|+Y0000_th+EJ@M?a;sSP$R|y$S`5ehPO7RI6~ujecz5wtxHp008J>V>i`7cs)e_ z@w@x()p@w=B24`klR6(CLpxqtlZO|2IWjpO-F~*EHtLqUMt)Wc_@bMv^h#{CUFW0M z(vJ1P=5N1GhWcHM(-Xu*&bc@D4_o$^7Y|pL)I@*DzttR=&yLH#^{|TW)8Sp0qphw% zepiuSUG#WHT7NcqNRJ+amk%-{%X;;nhp_B9`AEr=dDw9t3i(CsNk{+yAcA?j8pHh( z4`E}k<5T9?EPU2iU;UyqSmD_`zrB>5?fE;*?tuI!eMUi-A4ckzs{)2>k)^r|JEVn*{XgJQwtW9;MFX{UJOON4frt$2Z+chHMhh=Kjd^-@j4hH{^Pz o?0mofTW&!B00000001%k0v=pBEoDz5?EnA(07*qoM6N<$g5fRJ4FCWD diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00006.png b/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00006.png index 657887225857cf48be8a8daed2cb3e89d4b29ece..570ce28d53e82ac396ba25c370110058f3a638f9 100644 GIT binary patch delta 446 zcmV;v0YU!#0@wqPB!8btL_t(|obB0Ba)clZfMM+HO}PJ&xJw_HvRNaFRyK+Ae@_l| zDJF;*Qvv`000000fD1|~r4;K?obY2kfIGzsef69KwCLxYZAWrSumtp0n4r;5;Sx}- zau7HADO>_th+EJ@M?a;sSP$R|y$S`5ehPO7RI6~ujecz5wtxHp008J>V>i`7cs)e_ z@w@x()p@w=B24`klR6(CLpxqtlZO|2IWjpO-F~*EHtLqUMt)Wc_@bMv^h#{CUFW0M z(vJ1P=5N1GhWcHM(-Xu*&bc@D4_o$^7Y|pL)I@*DzttR=&yLH#^{|TW)8Sp0qphw% zepiuSUG#WHT7NcqNRJ+amk%-{%X;;nhp_B9`AEr=dDw9t3i(CsNk{+yAcA?j8pHh( z4`E}k<5T9?EPU2iU;UyqSmD_`zrB>5?fE;*?tuI!eMUi-A4ckzs{)2>k)^r|JEVn*{XgJQwtW9;MFX{UJOON4frt$2Z+chHMhh=Kjd^-@j4hH{^Pz o?0mofTW&!B00000001%k0v=pBEoDz5?EnA(07*qoM6N<$f`dcWY5)KL delta 354 zcmcb?{FiBhO1+Dxi(^Q|oVPcl`3@-vI0Po$;rtyhRQ<8JMIk?%eObZz=}8L@T*!1t zWzj4-;J5hht#0pj z^#9@1sLK;CE54XuefJROGCRgZUbWXBk9~WeThLU0Q`4iWuO>iVr1K`D#hTWitG2LJbl{xH#~Rq+?=K-+vfC})E&6F z@5lAeSDtRMVcZx!aqGa5zhIs*He8&r_HtpZV5M#|^ ydh?e5zlAMgw-$Yhy2~hY*m8O9PiA<4-2TmASuS-mz3kmhkeH{dpUXO@geCyx8>t5X diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00007.png b/tests/snapshots/nanox_lrDepositIntoStrategyNormal/00007.png new file mode 100644 index 0000000000000000000000000000000000000000..657887225857cf48be8a8daed2cb3e89d4b29ece GIT binary patch literal 381 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!2~2@x4h6`U|@9dba4!+nDh2#G~Xcw0f)e( zJDk7cg{nU`wU4`s1;0 z?{f>9Zfbf|_00eLCwPudd#p2Mzfg8-=Z~Y&(Z3(6-dSPln_e}2 z&8bJe=5=w3_V0Wxpw!uqXV@ zTyg#0l&4R7|Ayyoo}1J3WZRs6lez;p_x-s3`O4ERHjEo5Zk@S4@1z`Oka)v{pj(C~ z>TB;CrkB0D2@>;k^>bP0l+XkKqsFS~ literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00001.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00001.png index aaf1799d2cd974eff3600c592fcbd740ed6e487d..f86d7e2bc7c744a8c5f9c8c987b0fefa39364db1 100644 GIT binary patch delta 400 zcmV;B0dM}j1F8d%B!6*9L_t(|obA~`j>8}fKv7!FO>+Mu`7X0SgDeab5QIAO-zuS` zA=nT~LjV8(0B-j>-GI+TB!qBXS2~WTwmcsD@^iWYGh#=3>~8CQx&Z^SG#8OHAZ#`H zb7u=DxCy|}BqJhT#)q2#MBks$qud0*OGb}!6M$eALeJnS0DsBDVgLXDfEjjCII&D@ z?CNAC%QtzJwEv`i&24v0|9#sv&vy5g?P$FhrXMf;l+~XW3n%WF-6EZ)%~5@-E8Ax4 z16w(3-uXR}MxGWEwq4lH@y=_r3)}OXj?i>dr}_IsCQJ6LP?r>Qvlfg~iR>=`#Vxt4 z`|PyV{)RX;^?%1;;Xj}*H{*ht&8O>3S6($@@)0mM7;A5~+EXw?VL;<}>e^*;0sZ~ejf71cjb9^yBo=QBn?SoCZBObifJyP6o>;6o=9 ugRSUZ0000000000000000001Bn_sFVJjY}l8)N_g00{s|MNUMnLSTZ7&$cN5 delta 419 zcmV;U0bKs71HA)~B!7fSL_t(|obB3Cj)Wi#fMIsBH{t$A;x79@hLEC#5>V^@-;={A z=}=IF2>}2A0Jz-G-2wEaltKtG#&VoLw&nTQm*2Ysn2{UWV{^AYcL!h~x_L^e42br$ z^mS!~6Wk=gbdyObc^MyW5|BN=M_ai`fR`R^L`a;6^GDE#|x+bzG5DC~iC0EwkCaxV1^~(2*mCMnh$JIZh?t^W|Y%eU!{mL5L zS^Y|ErM7loL3}*hga}9J5x;KlfIAxj%7Lj+DIck-E>Q;SM9rpyaa%^f+_h^v&iGDQ zH|(uy!XBqhO%5*5X=HM+70n9(000000000002}}S0001N^9MaqOF+&uTZ8}r N002ovPDHLkV1lY9!({*f diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00002.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00002.png index b54209a0d779c558149a7fc1f1ac84c2a64ce46f..3a306b185323cb01e28f5f83cfbe9e6644bff724 100644 GIT binary patch delta 507 zcmVRAdK%JY}iThuYdzlY&jZvg(#XjboFGDL@ z5LD_M00000z;=H23=={~ZSQ@O#P$;9OH}RWcjsWajUH;Rsd0d`z_$gb-?5C(@@DCM(Pot)ma*zc|U(wSPn$W%@IRxGV+foHRsd zFMX6fN%FE3R3nD`gcX$Z(sIm&8`9Pkq?7W1v$RO=o;w@_wnl)ytrc5qT(F1xt=L`P zY;s0Nc_D?d`fYc9tUGX{6!bsYbQ9JoR;5uMc=UxC0KkIbJzzt=){6~2rHJ%qY`iM( z7Y;Bz)rrbS%YO``9f#gL&&rEfvEu3~qxhQGF_jIJqf1M_GPk6yxV7baS_M1tyTq@v z4Y*bWD2*YZBJWX^OO#-p&^*-W$0P#g`mS9#{r}w#r)`>%RyttXf_dgyI3K50K*b3t zPjeRD>26exj>dY#iKVWYPrIaaK#vK;-B0{eSW7xz8+4kFKFNCjZ>{KB5-a3G6F!`k z)@5z7yIb9H2}9?F9u1%T!6U-|>B!rX#cF+J1i0@3Hyv~5{xNLw0f;nBjSn_(U}St? x3g!g>000000000000000000000000m;}56`xE=q8JDdOj002ovPDHLkV1g%`>?8mH delta 365 zcmV-z0h0ce1c(EWB!5pyL_t(|obA|avcez?hGBHhPO|?cWiS3wQ_jYL>c5+92 zL~);*f85~~_N!XZiNq`6H3rKCnh$_qcH}i+{-IE@5ToP2NAKRTezrQZmzMHb&_FTA zzj(#8X#&FIdSDbx?+cEd_oj0A|43D~nvYksFbk=Hyq;p6_# ziMl~1`pYyzP4pKd2TF7yC9cCtgckq+0000000000000000Qi_2naSwFpWYq=00000 LNkvXXu0mjfI>oJe diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00003.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00003.png index ce3e851a3bd894abc81a84abdcb49ba6ab528682..b54209a0d779c558149a7fc1f1ac84c2a64ce46f 100644 GIT binary patch delta 365 zcmV-z0h0c|1Be5VB!5pyL_t(|obA|avcez?hGBHhPO|?cWiS3wQ_jYL>c5+92 zL~);*f85~~_N!XZiNq`6H3rKCnh$_qcH}i+{-IE@5ToP2NAKRTezrQZmzMHb&_FTA zzj(#8X#&FIdSDbx?+cEd_oj0A|43D~nvYksFbk=Hyq;p6_# ziMl~1`pYyzP4pKd2TF7yC9cCtgckq+0000000000000000Qi_2naSwFpWYq=00000 LNkvXXu0mjfbvv!2 delta 421 zcmV;W0b2fu1HS{1B!7lUL_t(|obA|ca)clZfMKT7n{fXl00DLSF5s~O90(?aWkWxw|^^c9gKI8oz9e_zha?VGZ%E5753UtrtT2(t$ zQ@U7`_!&_B6ZOv{clw|zR;~`a(ACRv&N(*wX@>zgoXSO;@qbO$lM8lPg5EcSFAAOk zdTDMKcS}20!dH^ZwpfDnqI{}KcNc9p45#|X&O87BfVW|NGnhF)ES!EH3Ja@1Ro7|I zs_0*uIpfFQExCY`Xg}A(B({xP?f54r+nEW~zl(0yP7IDUFJk%=V;fENTI3X7-ur!K zUiW6)`zE|9%74;SNUp75mNd0&0J^EM^7TI^LD$)_x&2$vKB-xyZ2s+2z=fHy@^iHR zf4{sFRMoq!ooet!x@#TDnsv#)hxReCtztbk44)e1FDI&*-rKO9PMyNtGsF11g{|00DLSF5s~O90(?aWkWxw|^^c9gKI8oz9e_zha?VGZ%E5753UtrtT2(t$ zQ@U7`_!&_B6ZOv{clw|zR;~`a(ACRv&N(*wX@>zgoXSO;@qbO$lM8lPg5EcSFAAOk zdTDMKcS}20!dH^ZwpfDnqI{}KcNc9p45#|X&O87BfVW|NGnhF)ES!EH3Ja@1Ro7|I zs_0*uIpfFQExCY`Xg}A(B({xP?f54r+nEW~zl(0yP7IDUFJk%=V;fENTI3X7-ur!K zUiW6)`zE|9%74;SNUp75mNd0&0J^EM^7TI^LD$)_x&2$vKB-xyZ2s+2z=fHy@^iHR zf4{sFRMoq!ooet!x@#TDnsv#)hxReCtztbk44)e1FDI&*-rKO9PMyNtGsF11g{|P-jHUi&7r)J!tjH>0GQ>>Hy7o>+xE@gDX>dI10c00000 i0000000000fN8#7PD6W~&i|+Y0000P-jHUi&7r)J!tjH>0GQ>>Hy7o>+xE@gDX>dI10c00000 i0000000000fN8#7PD6W~&i|+Y0000_th+EJ@M?a;sSP$R|y$S`5ehPO7RI6~ujecz5wtxHp008J>V>i`7cs)e_ z@w@x()p@w=B24`klR6(CLpxqtlZO|2IWjpO-F~*EHtLqUMt)Wc_@bMv^h#{CUFW0M z(vJ1P=5N1GhWcHM(-Xu*&bc@D4_o$^7Y|pL)I@*DzttR=&yLH#^{|TW)8Sp0qphw% zepiuSUG#WHT7NcqNRJ+amk%-{%X;;nhp_B9`AEr=dDw9t3i(CsNk{+yAcA?j8pHh( z4`E}k<5T9?EPU2iU;UyqSmD_`zrB>5?fE;*?tuI!eMUi-A4ckzs{)2>k)^r|JEVn*{XgJQwtW9;MFX{UJOON4frt$2Z+chHMhh=Kjd^-@j4hH{^Pz o?0mofTW&!B00000001%k0v=pBEoDz5?EnA(07*qoM6N<$g5fRJ4FCWD diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00006.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00006.png index 657887225857cf48be8a8daed2cb3e89d4b29ece..570ce28d53e82ac396ba25c370110058f3a638f9 100644 GIT binary patch delta 446 zcmV;v0YU!#0@wqPB!8btL_t(|obB0Ba)clZfMM+HO}PJ&xJw_HvRNaFRyK+Ae@_l| zDJF;*Qvv`000000fD1|~r4;K?obY2kfIGzsef69KwCLxYZAWrSumtp0n4r;5;Sx}- zau7HADO>_th+EJ@M?a;sSP$R|y$S`5ehPO7RI6~ujecz5wtxHp008J>V>i`7cs)e_ z@w@x()p@w=B24`klR6(CLpxqtlZO|2IWjpO-F~*EHtLqUMt)Wc_@bMv^h#{CUFW0M z(vJ1P=5N1GhWcHM(-Xu*&bc@D4_o$^7Y|pL)I@*DzttR=&yLH#^{|TW)8Sp0qphw% zepiuSUG#WHT7NcqNRJ+amk%-{%X;;nhp_B9`AEr=dDw9t3i(CsNk{+yAcA?j8pHh( z4`E}k<5T9?EPU2iU;UyqSmD_`zrB>5?fE;*?tuI!eMUi-A4ckzs{)2>k)^r|JEVn*{XgJQwtW9;MFX{UJOON4frt$2Z+chHMhh=Kjd^-@j4hH{^Pz o?0mofTW&!B00000001%k0v=pBEoDz5?EnA(07*qoM6N<$f`dcWY5)KL delta 354 zcmcb?{FiBhO1+Dxi(^Q|oVPcl`3@-vI0Po$;rtyhRQ<8JMIk?%eObZz=}8L@T*!1t zWzj4-;J5hht#0pj z^#9@1sLK;CE54XuefJROGCRgZUbWXBk9~WeThLU0Q`4iWuO>iVr1K`D#hTWitG2LJbl{xH#~Rq+?=K-+vfC})E&6F z@5lAeSDtRMVcZx!aqGa5zhIs*He8&r_HtpZV5M#|^ ydh?e5zlAMgw-$Yhy2~hY*m8O9PiA<4-2TmASuS-mz3kmhkeH{dpUXO@geCyx8>t5X diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00007.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownERC20/00007.png new file mode 100644 index 0000000000000000000000000000000000000000..657887225857cf48be8a8daed2cb3e89d4b29ece GIT binary patch literal 381 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!2~2@x4h6`U|@9dba4!+nDh2#G~Xcw0f)e( zJDk7cg{nU`wU4`s1;0 z?{f>9Zfbf|_00eLCwPudd#p2Mzfg8-=Z~Y&(Z3(6-dSPln_e}2 z&8bJe=5=w3_V0Wxpw!uqXV@ zTyg#0l&4R7|Ayyoo}1J3WZRs6lez;p_x-s3`O4ERHjEo5Zk@S4@1z`Oka)v{pj(C~ z>TB;CrkB0D2@>;k^>bP0l+XkKqsFS~ literal 0 HcmV?d00001 diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00001.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00001.png index aaf1799d2cd974eff3600c592fcbd740ed6e487d..f86d7e2bc7c744a8c5f9c8c987b0fefa39364db1 100644 GIT binary patch delta 400 zcmV;B0dM}j1F8d%B!6*9L_t(|obA~`j>8}fKv7!FO>+Mu`7X0SgDeab5QIAO-zuS` zA=nT~LjV8(0B-j>-GI+TB!qBXS2~WTwmcsD@^iWYGh#=3>~8CQx&Z^SG#8OHAZ#`H zb7u=DxCy|}BqJhT#)q2#MBks$qud0*OGb}!6M$eALeJnS0DsBDVgLXDfEjjCII&D@ z?CNAC%QtzJwEv`i&24v0|9#sv&vy5g?P$FhrXMf;l+~XW3n%WF-6EZ)%~5@-E8Ax4 z16w(3-uXR}MxGWEwq4lH@y=_r3)}OXj?i>dr}_IsCQJ6LP?r>Qvlfg~iR>=`#Vxt4 z`|PyV{)RX;^?%1;;Xj}*H{*ht&8O>3S6($@@)0mM7;A5~+EXw?VL;<}>e^*;0sZ~ejf71cjb9^yBo=QBn?SoCZBObifJyP6o>;6o=9 ugRSUZ0000000000000000001Bn_sFVJjY}l8)N_g00{s|MNUMnLSTZ7&$cN5 delta 419 zcmV;U0bKs71HA)~B!7fSL_t(|obB3Cj)Wi#fMIsBH{t$A;x79@hLEC#5>V^@-;={A z=}=IF2>}2A0Jz-G-2wEaltKtG#&VoLw&nTQm*2Ysn2{UWV{^AYcL!h~x_L^e42br$ z^mS!~6Wk=gbdyObc^MyW5|BN=M_ai`fR`R^L`a;6^GDE#|x+bzG5DC~iC0EwkCaxV1^~(2*mCMnh$JIZh?t^W|Y%eU!{mL5L zS^Y|ErM7loL3}*hga}9J5x;KlfIAxj%7Lj+DIck-E>Q;SM9rpyaa%^f+_h^v&iGDQ zH|(uy!XBqhO%5*5X=HM+70n9(000000000002}}S0001N^9MaqOF+&uTZ8}r N002ovPDHLkV1lY9!({*f diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00002.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00002.png index 94771e7febd5e3c47d0ad945f1685bcf46e696d6..3a306b185323cb01e28f5f83cfbe9e6644bff724 100644 GIT binary patch delta 507 zcmVRAdK%JY}iThuYdzlY&jZvg(#XjboFGDL@ z5LD_M00000z;=H23=={~ZSQ@O#P$;9OH}RWcjsWajUH;Rsd0d`z_$gb-?5C(@@DCM(Pot)ma*zc|U(wSPn$W%@IRxGV+foHRsd zFMX6fN%FE3R3nD`gcX$Z(sIm&8`9Pkq?7W1v$RO=o;w@_wnl)ytrc5qT(F1xt=L`P zY;s0Nc_D?d`fYc9tUGX{6!bsYbQ9JoR;5uMc=UxC0KkIbJzzt=){6~2rHJ%qY`iM( z7Y;Bz)rrbS%YO``9f#gL&&rEfvEu3~qxhQGF_jIJqf1M_GPk6yxV7baS_M1tyTq@v z4Y*bWD2*YZBJWX^OO#-p&^*-W$0P#g`mS9#{r}w#r)`>%RyttXf_dgyI3K50K*b3t zPjeRD>26exj>dY#iKVWYPrIaaK#vK;-B0{eSW7xz8+4kFKFNCjZ>{KB5-a3G6F!`k z)@5z7yIb9H2}9?F9u1%T!6U-|>B!rX#cF+J1i0@3Hyv~5{xNLw0f;nBjSn_(U}St? x3g!g>000000000000000000000000m;}56`xE=q8JDdOj002ovPDHLkV1kg6>{$Q+ delta 419 zcmV;U0bKr-1ib^0B!7fSL_t(|obB0Lj>8}fKv6pCPT2pF*vovNB4i9nBfw62&&Q}q zc}(m;ChjP_f@=zoV0-X^_f<)+Se`k+|; za5&YJ0ymnJj7Pw?!L0|!xY>HRh!#ZGw(O^%iN-NilV>~s1P>44tQ`vV(u(t!xHvUQ_vk5{}SF~@NXgfuN!qaUYG858}fKv6pCPT2pF*vovNB4i9nBfw62&&Q}q zc}(m;ChjP_f@=zoV0-X^_f<)+Se`k+|; za5&YJ0ymnJj7Pw?!L0|!xY>HRh!#ZGw(O^%iN-NilV>~s1P>44tQ`vV(u(t!xHvUQ_vk5{}SF~@NXgfuN!qaUYG85l6-CM}vt(|j@&3;;80;)r~(0>_Uq@J9xN(p-33|6rnmJ*T>6kvVFxrK-DT8gjT9q{};m&x=@jNw2VE(7HD{MgM@A z*Sag*_JZWwtbY!A{23-6>gVU|?(8SW37Cwv+pKQ~XKtbEbs(>~@hL%dD=j=JzPeg! z{!nq9=XSJNd^&^QSXQ&O=<l6-CM}vt(|j@&3;;80;)r~(0>_Uq@J9xN(p-33|6rnmJ*T>6kvVFxrK-DT8gjT9q{};m&x=@jNw2VE(7HD{MgM@A z*Sag*_JZWwtbY!A{23-6>gVU|?(8SW37Cwv+pKQ~XKtbEbs(>~@hL%dD=j=JzPeg! z{!nq9=XSJNd^&^QSXQ&O=<P-jHUi&7r)J!tjH>0GQ>>Hy7o>+xE@gDX>dI10c00000 i0000000000fN8#7PD6W~&i|+Y0000P-jHUi&7r)J!tjH>0GQ>>Hy7o>+xE@gDX>dI10c00000 i0000000000fN8#7PD6W~&i|+Y0000_th+EJ@M?a;sSP$R|y$S`5ehPO7RI6~ujecz5wtxHp008J>V>i`7cs)e_ z@w@x()p@w=B24`klR6(CLpxqtlZO|2IWjpO-F~*EHtLqUMt)Wc_@bMv^h#{CUFW0M z(vJ1P=5N1GhWcHM(-Xu*&bc@D4_o$^7Y|pL)I@*DzttR=&yLH#^{|TW)8Sp0qphw% zepiuSUG#WHT7NcqNRJ+amk%-{%X;;nhp_B9`AEr=dDw9t3i(CsNk{+yAcA?j8pHh( z4`E}k<5T9?EPU2iU;UyqSmD_`zrB>5?fE;*?tuI!eMUi-A4ckzs{)2>k)^r|JEVn*{XgJQwtW9;MFX{UJOON4frt$2Z+chHMhh=Kjd^-@j4hH{^Pz o?0mofTW&!B00000001%k0v=pBEoDz5?EnA(07*qoM6N<$g5fRJ4FCWD diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00006.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00006.png index 657887225857cf48be8a8daed2cb3e89d4b29ece..570ce28d53e82ac396ba25c370110058f3a638f9 100644 GIT binary patch delta 446 zcmV;v0YU!#0@wqPB!8btL_t(|obB0Ba)clZfMM+HO}PJ&xJw_HvRNaFRyK+Ae@_l| zDJF;*Qvv`000000fD1|~r4;K?obY2kfIGzsef69KwCLxYZAWrSumtp0n4r;5;Sx}- zau7HADO>_th+EJ@M?a;sSP$R|y$S`5ehPO7RI6~ujecz5wtxHp008J>V>i`7cs)e_ z@w@x()p@w=B24`klR6(CLpxqtlZO|2IWjpO-F~*EHtLqUMt)Wc_@bMv^h#{CUFW0M z(vJ1P=5N1GhWcHM(-Xu*&bc@D4_o$^7Y|pL)I@*DzttR=&yLH#^{|TW)8Sp0qphw% zepiuSUG#WHT7NcqNRJ+amk%-{%X;;nhp_B9`AEr=dDw9t3i(CsNk{+yAcA?j8pHh( z4`E}k<5T9?EPU2iU;UyqSmD_`zrB>5?fE;*?tuI!eMUi-A4ckzs{)2>k)^r|JEVn*{XgJQwtW9;MFX{UJOON4frt$2Z+chHMhh=Kjd^-@j4hH{^Pz o?0mofTW&!B00000001%k0v=pBEoDz5?EnA(07*qoM6N<$f`dcWY5)KL delta 354 zcmcb?{FiBhO1+Dxi(^Q|oVPcl`3@-vI0Po$;rtyhRQ<8JMIk?%eObZz=}8L@T*!1t zWzj4-;J5hht#0pj z^#9@1sLK;CE54XuefJROGCRgZUbWXBk9~WeThLU0Q`4iWuO>iVr1K`D#hTWitG2LJbl{xH#~Rq+?=K-+vfC})E&6F z@5lAeSDtRMVcZx!aqGa5zhIs*He8&r_HtpZV5M#|^ ydh?e5zlAMgw-$Yhy2~hY*m8O9PiA<4-2TmASuS-mz3kmhkeH{dpUXO@geCyx8>t5X diff --git a/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00007.png b/tests/snapshots/nanox_lrDepositIntoStrategyUnknownStrategy/00007.png new file mode 100644 index 0000000000000000000000000000000000000000..657887225857cf48be8a8daed2cb3e89d4b29ece GIT binary patch literal 381 zcmeAS@N?(olHy`uVBq!ia0vp^4M6O`!2~2@x4h6`U|@9dba4!+nDh2#G~Xcw0f)e( zJDk7cg{nU`wU4`s1;0 z?{f>9Zfbf|_00eLCwPudd#p2Mzfg8-=Z~Y&(Z3(6-dSPln_e}2 z&8bJe=5=w3_V0Wxpw!uqXV@ zTyg#0l&4R7|Ayyoo}1J3WZRs6lez;p_x-s3`O4ERHjEo5Zk@S4@1z`Oka)v{pj(C~ z>TB;CrkB0D2@>;k^>bP0l+XkKqsFS~ literal 0 HcmV?d00001 diff --git a/tests/src/lrDepositIntoStrategy.test.js b/tests/src/lrDepositIntoStrategy.test.js index 00c2399..3ac1f24 100644 --- a/tests/src/lrDepositIntoStrategy.test.js +++ b/tests/src/lrDepositIntoStrategy.test.js @@ -18,7 +18,7 @@ const contractAddr = '0x858646372cc42e1a627fce94aa7a7033e7cf075a'; // strategy m const pluginName = 'Kiln'; const abi_path = `../cal/abis/${contractAddr}.json`; const abi = require(abi_path); -const right_clicks = 5; +const right_clicks = 6; nano_models.forEach(function (model) { test( diff --git a/tests/src/lrQueueWithdrawal.test.js b/tests/src/lrQueueWithdrawal.test.js index c7d163a..3740f4b 100644 --- a/tests/src/lrQueueWithdrawal.test.js +++ b/tests/src/lrQueueWithdrawal.test.js @@ -53,7 +53,7 @@ nano_models.forEach(function (model) { } ); const tx = eth.signTransaction("44'/60'/0'/0", serializedTx, resolution); - const right_clicks = 4; + const right_clicks = 7; await waitForAppScreen(sim); await sim.navigateAndCompareSnapshots( From 0aed9cef562cad865097ce2fd152bc0b43e3cb5f Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Tue, 6 Feb 2024 10:53:03 +0100 Subject: [PATCH 24/33] fix: test on queueWithdrawal nano x --- README.md | 2 +- .../snapshots/nanox_lrQueueWithdrawal/00006.png | Bin 366 -> 381 bytes .../snapshots/nanox_lrQueueWithdrawal/00007.png | Bin 381 -> 0 bytes tests/src/lrQueueWithdrawal.test.js | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 tests/snapshots/nanox_lrQueueWithdrawal/00007.png diff --git a/README.md b/README.md index 7450702..76268c5 100644 --- a/README.md +++ b/README.md @@ -192,7 +192,7 @@ The flow processed in [GitHub Actions](https://github.com/features/actions) is t ### LR Queue Withdrawal -![](/tests/snapshots/nanox_lrQueueWithdrawal/00000.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00001.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00002.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00003.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00004.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00005.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00006.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00007.png) +![](/tests/snapshots/nanox_lrQueueWithdrawal/00000.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00001.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00002.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00003.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00004.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00005.png) ![](/tests/snapshots/nanox_lrQueueWithdrawal/00006.png) ### LR Complete Queued Withdrawal diff --git a/tests/snapshots/nanox_lrQueueWithdrawal/00006.png b/tests/snapshots/nanox_lrQueueWithdrawal/00006.png index e90cd9db37ed7e4c669da0b1abe6e4a823770f3c..657887225857cf48be8a8daed2cb3e89d4b29ece 100644 GIT binary patch delta 354 zcmaFI^p|OZO1+Dxi(^Q|oVPcl`3@-vI0Po$;rtyhRQ<8JMIk?%eObZz=}8L@T*!1t zWzj4-;J5hht#0pj z^#9@1sLK;CE54XuefJROGCRgZUbWXBk9~WeThLU0Q`4iWuO>iVr1K`D#hTWitG2LJbl{xH#~Rq+?=K-+vfC})E&6F z@5lAeSDtRMVcZx!aqGa5zhIs*He8&r_HtpZV5M#|^ ydh?e5zlAMgw-$Yhy2~hY*m8O9PiA<4-2TmASuS-mz3kmhkeH{dpUXO@geCw2HK`l` delta 339 zcmey%^p0tQO1-J4i(^Q|oVPclR~<4CX?>`1PUW-wrFq@_jX}kk$&Q=C{_bC{yxi%I z_H^ILLJV*qDJUp-{om@BJF6JNOIGKE|2m}8FsJzEVy*Ar3abyaMl!6N-kAS2*sK34 z^NtmF3uIQ$mkDi&x~{%H3tZ zvTc^&QHE1ba^rn`=AOG#w&}HTh3wzZyU+KlI&I{gYm>a+wq>>Q5mm+5Cfld1Y|$6? jX68ChzTpPU4`s1;0 z?{f>9Zfbf|_00eLCwPudd#p2Mzfg8-=Z~Y&(Z3(6-dSPln_e}2 z&8bJe=5=w3_V0Wxpw!uqXV@ zTyg#0l&4R7|Ayyoo}1J3WZRs6lez;p_x-s3`O4ERHjEo5Zk@S4@1z`Oka)v{pj(C~ z>TB;CrkB0D2@>;k^>bP0l+XkKqsFS~ diff --git a/tests/src/lrQueueWithdrawal.test.js b/tests/src/lrQueueWithdrawal.test.js index 3740f4b..0eb8910 100644 --- a/tests/src/lrQueueWithdrawal.test.js +++ b/tests/src/lrQueueWithdrawal.test.js @@ -53,7 +53,7 @@ nano_models.forEach(function (model) { } ); const tx = eth.signTransaction("44'/60'/0'/0", serializedTx, resolution); - const right_clicks = 7; + const right_clicks = model.letter === 'S' ? 7 : 5; await waitForAppScreen(sim); await sim.navigateAndCompareSnapshots( From 12a1a4c69b4c637c9c4f836324b83589f590fe9b Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Tue, 6 Feb 2024 18:19:35 +0100 Subject: [PATCH 25/33] fix: queue withdrawal error handling --- src/handle_provide_parameter.c | 64 ++++++++++++++++++++++++++++++---- src/kiln_plugin.h | 3 ++ 2 files changed, 60 insertions(+), 7 deletions(-) diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index 8daf313..6fa4cd2 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -99,21 +99,68 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t default: PRINTF("Param not supported: %d\n", context->next_param); msg->result = ETH_PLUGIN_RESULT_ERROR; - break; + return; } + msg->result = ETH_PLUGIN_RESULT_OK; } void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *context) { + // example for queue withdrawal with 2 strategies indexes, contracts and shares + // 0 selector + // 4 strat_i_offset -- starting here + // 36 strat_offset + // 68 shares_offset + // 100 withdrawal + // 132 undelegateIfPossible + // 164 strat_i_length + // 196 strat_i[0] + // 228 strat_i[1] + // 260 strat_length + // 292 strat[0] + // 324 strat[1] + // 356 shares_length + // 388 shares[0] + // 420 shares[1] + uint8_t buffer[ADDRESS_LENGTH]; + lr_queue_withdrawal_t *params = &context->param_data.lr_queue_withdrawal; + + if (params->skip_offset != 0 && params->go_to_offset == false && + msg->parameterOffset == params->skip_offset + SELECTOR_LENGTH) { + // if we reach offset, we get the size of the array and skip parsing it + // in the condition of the default switch case + + // with the example above: + // before: + // 356 shares_length -- skip_offset + // 388 shares[0] + // 420 shares[1] + params->skip_offset += + U2BE(msg->parameter, PARAMETER_LENGTH - sizeof(params->skip_offset)) * PARAMETER_LENGTH; + // after: + // 356 shares_length + // 388 shares[0] + // 420 shares[1] -- skip_offset + params->go_to_offset = true; + } switch (context->next_param) { case LR_QUEUE_WITHDRAWAL_STRATEGY_INDEXES_OFFSET: + params->go_to_offset = false; context->next_param = LR_QUEUE_WITHDRAWAL_STRATEGIES_OFFSET; break; case LR_QUEUE_WITHDRAWAL_STRATEGIES_OFFSET: context->next_param = LR_QUEUE_WITHDRAWAL_SHARES_OFFSET; break; case LR_QUEUE_WITHDRAWAL_SHARES_OFFSET: + // before: + // skip_offset = 0 + params->skip_offset = + U2BE(msg->parameter, PARAMETER_LENGTH - sizeof(params->skip_offset)); + // after: + // 356 shares_length -- skip_offset + // 388 shares[0] + // 420 shares[1] context->next_param = LR_QUEUE_WITHDRAWAL_WITHDRAWER; break; case LR_QUEUE_WITHDRAWAL_WITHDRAWER: @@ -129,9 +176,15 @@ void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *con context->next_param = LR_QUEUE_WITHDRAWAL_UNEXPECTED_PARAMETER; break; default: + if (msg->parameterOffset <= params->skip_offset + SELECTOR_LENGTH) { + // as we don't want to display the strategy indexes, strategies and shares amount + // we skip parsing them until skip_offset is reached + msg->result = ETH_PLUGIN_RESULT_OK; + return; + } PRINTF("Param not supported: %d\n", context->next_param); - // msg->result = ETH_PLUGIN_RESULT_ERROR; - break; + msg->result = ETH_PLUGIN_RESULT_ERROR; + return; } msg->result = ETH_PLUGIN_RESULT_OK; } @@ -153,7 +206,7 @@ void handle_lr_complete_queued_withdrawal(ethPluginProvideParameter_t *msg, cont default: PRINTF("Param not supported: %d\n", context->next_param); // msg->result = ETH_PLUGIN_RESULT_ERROR; - break; + return; } msg->result = ETH_PLUGIN_RESULT_OK; } @@ -197,15 +250,12 @@ void handle_provide_parameter(ethPluginProvideParameter_t *msg) { case KILN_LR_DEPOSIT_INTO_STRATEGY: handle_lr_deposit_into_strategy(msg, context); - msg->result = ETH_PLUGIN_RESULT_OK; break; case KILN_LR_QUEUE_WITHDRAWAL: handle_lr_queue_withdrawal(msg, context); - msg->result = ETH_PLUGIN_RESULT_OK; break; case KILN_LR_COMPLETE_QUEUED_WITHDRAWAL: handle_lr_complete_queued_withdrawal(msg, context); - msg->result = ETH_PLUGIN_RESULT_OK; break; default: diff --git a/src/kiln_plugin.h b/src/kiln_plugin.h index 3c97e6f..0ee559f 100644 --- a/src/kiln_plugin.h +++ b/src/kiln_plugin.h @@ -101,6 +101,7 @@ extern const char lr_tickers[LR_STRATEGIES_COUNT][MAX_TICKER_LEN]; // max number of strategies / erc20 to display #define MAX_DISPLAY_COUNT 3 +#define SELECTOR_LENGTH 4 typedef struct { int strategy_to_display; @@ -109,6 +110,8 @@ typedef struct { } lr_deposit_t; typedef struct { + uint16_t skip_offset; + bool go_to_offset; char withdrawer[ADDRESS_STR_LEN]; } lr_queue_withdrawal_t; From 8b4510f0c7d6b64a395f6b0c03af6518b4692a75 Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Tue, 6 Feb 2024 18:30:18 +0100 Subject: [PATCH 26/33] fix: func should take their address parameter as a constant-sized array rather than a raw pointer --- src/handle_provide_parameter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index 6fa4cd2..b56512d 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -9,7 +9,7 @@ * * @return true if the addresses are the same */ -bool compare_addresses(const char *a, const char *b) { +bool compare_addresses(const char a[ADDRESS_STR_LEN], const char b[ADDRESS_STR_LEN]) { for (size_t i = 0; i < ADDRESS_STR_LEN; i += 1) { if (tolower((unsigned char) a[i]) != tolower((unsigned char) b[i])) { return false; @@ -26,7 +26,7 @@ bool compare_addresses(const char *a, const char *b) { * * @returns index of the erc20 in the context or -1 if not found */ -int find_lr_known_erc20(const char *address) { +int find_lr_known_erc20(const char address[ADDRESS_STR_LEN]) { for (size_t i = 0; i < LR_STRATEGIES_COUNT; i++) { if (compare_addresses(address, lr_erc20_addresses[i])) { return i; @@ -44,7 +44,7 @@ int find_lr_known_erc20(const char *address) { * * @returns index of the strategy in the context or -1 if not found */ -int find_lr_known_strategy(const char *address) { +int find_lr_known_strategy(const char address[ADDRESS_STR_LEN]) { for (size_t i = 0; i < LR_STRATEGIES_COUNT; i++) { if (compare_addresses(address, lr_strategy_addresses[i])) { return i; From 955c935860eaa1564e47409e43fcf355c8a8c024 Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Tue, 6 Feb 2024 18:47:33 +0100 Subject: [PATCH 27/33] Checks in deposit_into_stragey_ui_lr should ensure that lr_tickers is accessed in bounds. --- src/handle_query_contract_ui.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 23a6bef..afcf28a 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -185,7 +185,8 @@ static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *con break; case 1: strlcpy(msg->title, "Strategy", msg->titleLength); - if (params->strategy_to_display == -1) { + if (params->strategy_to_display == -1 || + params->strategy_to_display >= LR_STRATEGIES_COUNT) { strlcpy(msg->msg, "UNKNOWN", msg->msgLength); } else { strlcpy(msg->msg, lr_tickers[params->strategy_to_display], MAX_TICKER_LEN); @@ -198,7 +199,9 @@ static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *con params->erc20_amount_to_display, sizeof(params->erc20_amount_to_display), ERC20_DECIMALS, - params->erc20_to_display == -1 ? "UNKNOWN" : lr_tickers[params->erc20_to_display], + params->erc20_to_display == -1 || params->erc20_to_display >= LR_STRATEGIES_COUNT + ? "UNKNOWN" + : lr_tickers[params->erc20_to_display], msg->msg, msg->msgLength); ret = true; @@ -211,7 +214,6 @@ static bool deposit_into_stragey_ui_lr(ethQueryContractUI_t *msg, context_t *con } static bool queue_withdrawal_ui_lr(ethQueryContractUI_t *msg, context_t *context) { - // TODO: display strategies bool ret = false; lr_queue_withdrawal_t *params = &context->param_data.lr_queue_withdrawal; @@ -236,7 +238,6 @@ static bool queue_withdrawal_ui_lr(ethQueryContractUI_t *msg, context_t *context } static bool complete_queued_withdrawal_ui_lr(ethQueryContractUI_t *msg) { - // TODO: display strategies bool ret = false; switch (msg->screenIndex) { From ca391d913be83de1edc41c15689ff61aeee2bcd5 Mon Sep 17 00:00:00 2001 From: "pwnh4 (@loicttn)" Date: Tue, 6 Feb 2024 19:31:16 +0100 Subject: [PATCH 28/33] fix: signal errors in handle_lr_complete_queued_withdrawal --- src/handle_provide_parameter.c | 102 +++++++++++++++++++++++++-------- src/kiln_plugin.h | 2 + 2 files changed, 79 insertions(+), 25 deletions(-) diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index b56512d..88979dd 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -105,22 +105,23 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t } void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *context) { + // queueWithdrawal(uint256[],address[],uint256[],address,bool // example for queue withdrawal with 2 strategies indexes, contracts and shares - // 0 selector - // 4 strat_i_offset -- starting here - // 36 strat_offset - // 68 shares_offset - // 100 withdrawal - // 132 undelegateIfPossible - // 164 strat_i_length - // 196 strat_i[0] - // 228 strat_i[1] - // 260 strat_length - // 292 strat[0] - // 324 strat[1] - // 356 shares_length - // 388 shares[0] - // 420 shares[1] + // [0] selector + // [4] strat_i_offset -- starting here + // [36] strat_offset + // [68] shares_offset + // [100] withdrawal + // [132] undelegateIfPossible + // [164] strat_i_length + // [196] strat_i[0] + // [228] strat_i[1] + // [260] strat_length + // [292] strat[0] + // [324] strat[1] + // [356] shares_length + // [388] shares[0] + // [420] shares[1] uint8_t buffer[ADDRESS_LENGTH]; lr_queue_withdrawal_t *params = &context->param_data.lr_queue_withdrawal; @@ -132,15 +133,15 @@ void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *con // with the example above: // before: - // 356 shares_length -- skip_offset - // 388 shares[0] - // 420 shares[1] + // [356] shares_length -- skip_offset + // [388] shares[0] + // [420] shares[1] params->skip_offset += U2BE(msg->parameter, PARAMETER_LENGTH - sizeof(params->skip_offset)) * PARAMETER_LENGTH; // after: - // 356 shares_length - // 388 shares[0] - // 420 shares[1] -- skip_offset + // [356] shares_length + // [388] shares[0] + // [420] shares[1] -- skip_offset params->go_to_offset = true; } @@ -158,9 +159,9 @@ void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *con params->skip_offset = U2BE(msg->parameter, PARAMETER_LENGTH - sizeof(params->skip_offset)); // after: - // 356 shares_length -- skip_offset - // 388 shares[0] - // 420 shares[1] + // [356] shares_length -- skip_offset + // [388] shares[0] + // [420] shares[1] context->next_param = LR_QUEUE_WITHDRAWAL_WITHDRAWER; break; case LR_QUEUE_WITHDRAWAL_WITHDRAWER: @@ -190,11 +191,56 @@ void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *con } void handle_lr_complete_queued_withdrawal(ethPluginProvideParameter_t *msg, context_t *context) { + // completeQueuedWithdrawal((address[],uint256[],address,(address,uint96),uint32,address),address[],uint256,bool) + // example for complete queued withdrawal with 2 tokens + // [0] selector + // [4] queuedWithdrawal_offset -- starting here + // [36] withdrawal_struct_offset + // [68] token_list_offset + // [100] middleware_time_index + // [132] receive_as_tokens + // [164] withdrawal_struct_offset_length + // [...] withdrawal_struct elements + // [...] withdrawal_struct elements + // [164 + nb_struct_elem * 32] token_list_length + // [...] token_list elements + // [...] token_list elements + + lr_complete_queued_withdrawal_t *params = &context->param_data.lr_complete_queued_withdrawal; + + if (params->skip_offset != 0 && params->go_to_offset == false && + msg->parameterOffset == params->skip_offset + SELECTOR_LENGTH) { + // if we reach offset, we get the size of the array and skip parsing it + // in the condition of the default switch case + + // with the example above: + // before: + // [164 + nb_struct_elem * 32] token_list_length -- skip_offset + // [...] token_list elements + // [...] token_list elements + params->skip_offset += + U2BE(msg->parameter, PARAMETER_LENGTH - sizeof(params->skip_offset)) * PARAMETER_LENGTH; + // after: + // [164 + nb_struct_elem * 32] token_list_length + // [...] token_list elements + // [...] token_list elements -- skip_offset + + params->go_to_offset = true; + } + switch (context->next_param) { case LR_COMPLETE_QUEUED_WITHDRAWAL_QUEUEDWITHDRAWAL_OFFSET: context->next_param = LR_COMPLETE_QUEUED_WITHDRAWAL_TOKENS_OFFSET; break; case LR_COMPLETE_QUEUED_WITHDRAWAL_TOKENS_OFFSET: + // before: + // skip_offset = 0 + params->skip_offset = + U2BE(msg->parameter, PARAMETER_LENGTH - sizeof(params->skip_offset)); + // after: + // [164 + nb_struct_elem * 32] token_list_length -- skip_offset + // [...] token_list elements + // [...] token_list elements context->next_param = LR_COMPLETE_QUEUED_WITHDRAWAL_MIDDLEWARETIMEINDEX; break; case LR_COMPLETE_QUEUED_WITHDRAWAL_MIDDLEWARETIMEINDEX: @@ -204,8 +250,14 @@ void handle_lr_complete_queued_withdrawal(ethPluginProvideParameter_t *msg, cont context->next_param = LR_COMPLETE_QUEUED_WITHDRAWAL_UNEXPECTED_PARAMETER; break; default: + if (msg->parameterOffset <= params->skip_offset + SELECTOR_LENGTH) { + // as we don't want to display withdrawals structures + // we skip parsing them until skip_offset is reached + msg->result = ETH_PLUGIN_RESULT_OK; + return; + } PRINTF("Param not supported: %d\n", context->next_param); - // msg->result = ETH_PLUGIN_RESULT_ERROR; + msg->result = ETH_PLUGIN_RESULT_ERROR; return; } msg->result = ETH_PLUGIN_RESULT_OK; diff --git a/src/kiln_plugin.h b/src/kiln_plugin.h index 0ee559f..b3a0781 100644 --- a/src/kiln_plugin.h +++ b/src/kiln_plugin.h @@ -116,6 +116,8 @@ typedef struct { } lr_queue_withdrawal_t; typedef struct { + uint16_t skip_offset; + bool go_to_offset; } lr_complete_queued_withdrawal_t; typedef struct context_t { From de43354dda606b670fc98802d8d638783ba473ef Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Wed, 7 Feb 2024 11:11:03 +0100 Subject: [PATCH 29/33] Updated plugin SDK --- ethereum-plugin-sdk | 2 +- src/handle_init_contract.c | 23 +++++++++++------------ src/kiln_plugin.h | 1 - 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/ethereum-plugin-sdk b/ethereum-plugin-sdk index 1fe4085..0a98664 160000 --- a/ethereum-plugin-sdk +++ b/ethereum-plugin-sdk @@ -1 +1 @@ -Subproject commit 1fe4085d04a88f4238103a4ed3db1484fdb69c63 +Subproject commit 0a98664deba849f05a51407d8a3edb05cd83d464 diff --git a/src/handle_init_contract.c b/src/handle_init_contract.c index 815ca39..7d27e3d 100644 --- a/src/handle_init_contract.c +++ b/src/handle_init_contract.c @@ -1,14 +1,5 @@ #include "kiln_plugin.h" - -static int find_selector(uint32_t selector, const uint32_t *selectors, size_t n, selector_t *out) { - for (selector_t i = 0; i < n; i++) { - if (selector == selectors[i]) { - *out = i; - return 0; - } - } - return -1; -} +#include "plugin_utils.h" void handle_init_contract(ethPluginInitContract_t *msg) { if (msg->interfaceVersion != ETH_PLUGIN_INTERFACE_VERSION_LATEST) { @@ -26,11 +17,19 @@ void handle_init_contract(ethPluginInitContract_t *msg) { memset(context, 0, sizeof(*context)); - uint32_t selector = U4BE(msg->selector, 0); - if (find_selector(selector, KILN_SELECTORS, NUM_SELECTORS, &context->selectorIndex)) { + size_t index; + if (!find_selector(U4BE(msg->selector, 0), KILN_SELECTORS, NUM_SELECTORS, &index)) { + PRINTF("Error: selector not found!\n"); msg->result = ETH_PLUGIN_RESULT_UNAVAILABLE; return; } + context->selectorIndex = index; + // check for overflow + if ((size_t) context->selectorIndex != index) { + PRINTF("Error: overflow detected on selector index!\n"); + msg->result = ETH_PLUGIN_RESULT_ERROR; + return; + } msg->result = ETH_PLUGIN_RESULT_OK; diff --git a/src/kiln_plugin.h b/src/kiln_plugin.h index b3a0781..9b83491 100644 --- a/src/kiln_plugin.h +++ b/src/kiln_plugin.h @@ -2,7 +2,6 @@ #include -#include "eth_internals.h" #include "eth_plugin_interface.h" #define PLUGIN_NAME "Kiln" From fd3527be1f8bf6af21e58b0c7d099fd2ca44d5ad Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Wed, 7 Feb 2024 11:13:13 +0100 Subject: [PATCH 30/33] Added the SDK version check workflow --- .github/workflows/check_sdk.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/check_sdk.yml diff --git a/.github/workflows/check_sdk.yml b/.github/workflows/check_sdk.yml new file mode 100644 index 0000000..8a26b45 --- /dev/null +++ b/.github/workflows/check_sdk.yml @@ -0,0 +1,16 @@ +--- +name: Check SDK submodule version + +on: + workflow_dispatch: + push: + branches: + - master + - main + - develop + pull_request: + +jobs: + job_check_SDK: + name: Check Ethereum plugin SDK submodule is up-to-date + uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_check_ethereum_sdk.yml@v1 From 1400eb09154f56b296063dd1be4f55d2538a380d Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Wed, 7 Feb 2024 11:23:12 +0100 Subject: [PATCH 31/33] Now leverages the standard plugin Makefile --- Makefile | 169 ++++++------------------------------------------------- 1 file changed, 18 insertions(+), 151 deletions(-) diff --git a/Makefile b/Makefile index 325f0db..d553b8e 100644 --- a/Makefile +++ b/Makefile @@ -1,158 +1,25 @@ -#******************************************************************************* -# Ledger App -# (c) 2017 Ledger +# **************************************************************************** +# Ledger Ethereum Plugin Boilerplate +# (c) 2023 Ledger SAS. # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -#******************************************************************************* - -ifeq ($(BOLOS_SDK),) -$(error Environment variable BOLOS_SDK is not set) -endif - -include $(BOLOS_SDK)/Makefile.defines +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# **************************************************************************** APPNAME = "Kiln" -ifeq ($(ETHEREUM_PLUGIN_SDK),) -ETHEREUM_PLUGIN_SDK=ethereum-plugin-sdk -endif - -APP_LOAD_PARAMS += --appFlags 0x800 --path "44'/60'" --curve secp256k1 - -APP_LOAD_PARAMS += $(COMMON_LOAD_PARAMS) - -APPVERSION_M = 1 -APPVERSION_N = 3 -APPVERSION_P = 0 -APPVERSION = "$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)" - -ifeq ($(TARGET_NAME), TARGET_NANOS) -ICONNAME=icons/nanos_app_kiln.gif -else ifeq ($(TARGET_NAME), TARGET_STAX) -ICONNAME=icons/stax_app_kiln.gif -DEFINES += ICONGLYPH=C_stax_kiln_64px -DEFINES += ICONBITMAP=C_stax_kiln_64px_bitmap -GLYPH_FILES += $(ICONNAME) -else -ICONNAME=icons/nanox_app_kiln.gif -endif - -################ -# Default rule # -################ -all: default - -############ -# Platform # -############ - -DEFINES += OS_IO_SEPROXYHAL -DEFINES += HAVE_SPRINTF -DEFINES += LEDGER_MAJOR_VERSION=$(APPVERSION_M) LEDGER_MINOR_VERSION=$(APPVERSION_N) LEDGER_PATCH_VERSION=$(APPVERSION_P) -DEFINES += IO_HID_EP_LENGTH=64 - -DEFINES += UNUSED\(x\)=\(void\)x -DEFINES += APPVERSION=\"$(APPVERSION)\" -CFLAGS += -DAPPNAME=\"$(APPNAME)\" - -ifneq (,$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX)) -DEFINES += HAVE_BLE BLE_COMMAND_TIMEOUT_MS=2000 -DEFINES += HAVE_BLE_APDU # basic ledger apdu transport over BLE -endif - -ifeq ($(TARGET_NAME),TARGET_NANOS) -DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=128 -else -DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=300 -endif - -ifneq ($(TARGET_NAME),TARGET_STAX) -DEFINES += HAVE_BAGL -ifneq ($(TARGET_NAME),TARGET_NANOS) -DEFINES += HAVE_GLO096 -DEFINES += HAVE_BAGL BAGL_WIDTH=128 BAGL_HEIGHT=64 -DEFINES += HAVE_BAGL_ELLIPSIS # long label truncation feature -DEFINES += HAVE_BAGL_FONT_OPEN_SANS_REGULAR_11PX -DEFINES += HAVE_BAGL_FONT_OPEN_SANS_EXTRABOLD_11PX -DEFINES += HAVE_BAGL_FONT_OPEN_SANS_LIGHT_16PX -DEFINES += HAVE_UX_FLOW -endif -endif - -# Enabling debug PRINTF -ifneq ($(DEBUG),0) - DEFINES += HAVE_SEMIHOSTED_PRINTF PRINTF=semihosted_printf - CFLAGS += -include src/dbg/debug.h -else - DEFINES += PRINTF\(...\)= -endif - -############## -# Compiler # -############## -ifneq ($(BOLOS_ENV),) -$(info BOLOS_ENV=$(BOLOS_ENV)) -CLANGPATH := $(BOLOS_ENV)/clang-arm-fropi/bin/ -GCCPATH := $(BOLOS_ENV)/gcc-arm-none-eabi-5_3-2016q1/bin/ -else -$(info BOLOS_ENV is not set: falling back to CLANGPATH and GCCPATH) -endif -ifeq ($(CLANGPATH),) -$(info CLANGPATH is not set: clang will be used from PATH) -endif -ifeq ($(GCCPATH),) -$(info GCCPATH is not set: arm-none-eabi-* will be used from PATH) -endif - -CC := $(CLANGPATH)clang - -CFLAGS += -Wno-format-invalid-specifier -Wno-format-extra-args - -AS := $(GCCPATH)arm-none-eabi-gcc - -LD := $(GCCPATH)arm-none-eabi-gcc -LDLIBS += -lm -lgcc -lc - -# import rules to compile glyphs(/pone) -include $(BOLOS_SDK)/Makefile.glyphs - -### variables processed by the common makefile.rules of the SDK to grab source files and include dirs -APP_SOURCE_PATH += src $(ETHEREUM_PLUGIN_SDK) -ifneq ($(TARGET_NAME), TARGET_STAX) -SDK_SOURCE_PATH += lib_ux -endif -ifneq (,$(findstring HAVE_BLE,$(DEFINES))) -SDK_SOURCE_PATH += lib_blewbxx lib_blewbxx_impl -endif - -### initialize plugin SDK submodule if needed -ifneq ($(shell git submodule status | grep '^[-+]'),) -$(info INFO: Need to reinitialize git submodules) -$(shell git submodule update --init) -endif - -load: all - python3 -m ledgerblue.loadApp $(APP_LOAD_PARAMS) - -delete: - python3 -m ledgerblue.deleteApp $(COMMON_DELETE_PARAMS) - -# import generic rules from the sdk -include $(BOLOS_SDK)/Makefile.rules - - -#add dependency on custom makefile filename -dep/%.d: %.c Makefile +# Application version +APPVERSION_M = 1 +APPVERSION_N = 3 +APPVERSION_P = 0 -listvariants: - @echo VARIANTS NONE kiln +include ethereum-plugin-sdk/standard_plugin.mk From e216739780d56d27332d9092b7170b7e64508fab Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Wed, 7 Feb 2024 11:23:21 +0100 Subject: [PATCH 32/33] Version bump --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d553b8e..6cf50b8 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,7 @@ APPNAME = "Kiln" # Application version APPVERSION_M = 1 -APPVERSION_N = 3 +APPVERSION_N = 4 APPVERSION_P = 0 include ethereum-plugin-sdk/standard_plugin.mk From 510ab712d8ede13714a2fd43a85ba6e4be4484c4 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Fri, 9 Feb 2024 18:16:57 +0100 Subject: [PATCH 33/33] Fix the plugin making the Ethereum app generate incorrect signatures --- src/handle_provide_parameter.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index 88979dd..4bff9e4 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -65,15 +65,12 @@ int find_lr_known_strategy(const char address[ADDRESS_STR_LEN]) { void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t *context) { uint8_t buffer[ADDRESS_LENGTH]; char address_buffer[ADDRESS_STR_LEN]; + cx_sha3_t sha3; switch (context->next_param) { case LR_DEPOSIT_INTO_STRATEGY_STRATEGY: copy_address(buffer, msg->parameter, sizeof(buffer)); - getEthDisplayableAddress(buffer, - address_buffer, - sizeof(address_buffer), - msg->pluginSharedRW->sha3, - 0); + getEthDisplayableAddress(buffer, address_buffer, sizeof(address_buffer), &sha3, 0); context->param_data.lr_deposit.strategy_to_display = find_lr_known_strategy(address_buffer); @@ -81,11 +78,7 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t break; case LR_DEPOSIT_INTO_STRATEGY_TOKEN: copy_address(buffer, msg->parameter, sizeof(buffer)); - getEthDisplayableAddress(buffer, - address_buffer, - sizeof(address_buffer), - msg->pluginSharedRW->sha3, - 0); + getEthDisplayableAddress(buffer, address_buffer, sizeof(address_buffer), &sha3, 0); context->param_data.lr_deposit.erc20_to_display = find_lr_known_erc20(address_buffer); context->next_param = LR_DEPOSIT_INTO_STRATEGY_AMOUNT; @@ -105,6 +98,8 @@ void handle_lr_deposit_into_strategy(ethPluginProvideParameter_t *msg, context_t } void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *context) { + cx_sha3_t sha3; + // queueWithdrawal(uint256[],address[],uint256[],address,bool // example for queue withdrawal with 2 strategies indexes, contracts and shares // [0] selector @@ -169,7 +164,7 @@ void handle_lr_queue_withdrawal(ethPluginProvideParameter_t *msg, context_t *con getEthDisplayableAddress(buffer, context->param_data.lr_queue_withdrawal.withdrawer, sizeof(context->param_data.lr_queue_withdrawal.withdrawer), - msg->pluginSharedRW->sha3, + &sha3, 0); context->next_param = LR_QUEUE_WITHDRAWAL_UNDELEGATEIFPOSSIBLE; break;