diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..711779d
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,40 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: 'Fix [Subject of the issue]'
+labels: 'bug'
+assignees: ''
+
+---
+
+## Description
+
+Describe your issue in as much detail as possible here.
+
+## Your environment
+
+* OS and version
+* branch that causes this issue
+* Device (Nano S, Nano X, Ledger Blue)
+
+## Steps to reproduce
+
+* Tell us how to reproduce this issue
+* Where the issue is, if you know
+* Which commands triggered the issue, if any
+
+## Expected behaviour
+
+Tell us what should happen
+
+## Actual behaviour
+
+Tell us what happens instead
+
+## Logs
+
+Please paste any logs here that demonstrate the issue, if they exist
+
+## Proposed solution
+
+If you have an idea of how to fix this issue, please write it down here, so we can begin discussing it
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..f8abc52
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,18 @@
+---
+name: Feature report
+about: Suggest an idea for this project
+title: 'Add [Subject of the issue]'
+labels: 'enhancement'
+assignees: ''
+
+---
+
+## Description
+
+Describe your issue in as much detail as possible here.
+
+## Your environment
+
+* OS and version
+* branch that causes this issue
+* Device (Nano S, Nano X, Ledger Blue)
\ No newline at end of file
diff --git a/.github/ISSUE_TEMPLATE/network_request.md b/.github/ISSUE_TEMPLATE/network_request.md
new file mode 100644
index 0000000..369f21e
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/network_request.md
@@ -0,0 +1,19 @@
+---
+name: Network request
+about: Request of new chain or network
+title: 'Add {NameChain} network ({SYMBOL})'
+labels: 'enhancement, chain/network'
+assignees: ''
+
+---
+
+## Description
+- [ ] Symbol:
+- [ ] ChainId:
+- [ ] Website:
+- [ ] Block-Explorer:
+- [ ] [slip-0044](https://github.com/satoshilabs/slips/blob/master/slip-0044.md) type:
+
+## Additional comments
+
+Please post additional comments in this section if you have them, otherwise delete it.
\ No newline at end of file
diff --git a/.github/actions/commit-changes/action.yml b/.github/actions/commit-changes/action.yml
new file mode 100644
index 0000000..147feb6
--- /dev/null
+++ b/.github/actions/commit-changes/action.yml
@@ -0,0 +1,80 @@
+name: 'Commit and push if the version file has changed'
+
+inputs:
+ name:
+ description: 'The name of the commiter'
+ required: true
+ default: 'github-actions[bot]'
+ email:
+ description: 'The email of the commiter'
+ required: true
+ default: 'github-actions[bot]@users.noreply.github.com'
+ message:
+ description: 'The commit message'
+ required: true
+ default: 'New release version(s)'
+ files:
+ description: 'The file(s) to add in the commit'
+ required: true
+ default: '*'
+ directory:
+ description: 'The directory in which the action will be performed'
+ required: true
+ default: '.'
+ branch:
+ description: 'Checkout (or create) on a specific branch before commit/push'
+ required: true
+ default: 'master'
+ secret:
+ description: 'A token allowing to push the commit on the repository'
+ required: true
+ default: '.'
+ repository:
+ description: 'The repository where to push'
+ required: true
+ default: ''
+
+runs:
+ using: 'composite'
+ steps:
+ - name: Commit the changes
+ id: commit
+ run: |
+ git config --global user.name ${{ inputs.name }}
+ ORIGIN="$(pwd)"
+ cd ${{ inputs.directory }}
+ git switch ${{ inputs.branch }} 2>/dev/null || git switch -c ${{ inputs.branch }}
+ echo "-----------------------------------------------------------"
+ echo "Initial repo status"
+ git status
+ CHANGES="$(git status --porcelain ${{ inputs.files }})"
+ if [ -z "${CHANGES}" ]; \
+ then \
+ echo "-----------------------------------------------------------"; \
+ echo "No changes, stopping now"; \
+ echo "COMMIT=NO" > $GITHUB_ENV; \
+ cd "${ORIGIN}"; \
+ exit 0; \
+ fi
+ echo -e "Changes:\n${CHANGES}"
+ git add ${{ inputs.files }}
+ echo "-----------------------------------------------------------"
+ echo "Repo status before commit"
+ git status
+ git commit -am "${{ inputs.message }}"
+ echo "COMMIT=YES" > $GITHUB_ENV
+ git log -n 2
+ cd "${ORIGIN}"
+ shell: bash
+
+ - run: echo "${{ env.COMMIT }}"
+ shell: bash
+
+ - name: Push commit
+ if: ${{ env.COMMIT == 'YES' }}
+ uses: ad-m/github-push-action@master
+ with:
+ github_token: ${{ inputs.secret }}
+ branch: ${{ inputs.branch }}
+ directory: ${{ inputs.directory }}
+ repository: ${{ inputs.repository }}
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 0000000..4024641
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,21 @@
+## Description
+
+Please provide a detailed description of what was done in this PR.
+(And mentioned if linked to an issue [docs](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue))
+
+## Changes include
+
+- [ ] Bugfix (non-breaking change that solves an issue)
+- [ ] New feature (non-breaking change that adds functionality)
+- [ ] Breaking change (change that is not backwards-compatible and/or changes current functionality)
+- [ ] Tests
+- [ ] Documentation
+- [ ] Other (for changes that might not fit in any category)
+
+## Breaking changes
+
+Please complete this section if any breaking changes have been made, otherwise delete it.
+
+## Additional comments
+
+Please post additional comments in this section if you have them, otherwise delete it.
\ No newline at end of file
diff --git a/.github/workflows/auto-author-assign.yml b/.github/workflows/auto-author-assign.yml
new file mode 100644
index 0000000..a19fb99
--- /dev/null
+++ b/.github/workflows/auto-author-assign.yml
@@ -0,0 +1,14 @@
+name: 'Auto Author Assign'
+
+on:
+ pull_request_target:
+ types: [opened, reopened]
+
+permissions:
+ pull-requests: write
+
+jobs:
+ assign-author:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: toshimaru/auto-author-assign@v1.4.0
\ No newline at end of file
diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml
index 9c19c99..c3f4562 100644
--- a/.github/workflows/ci-workflow.yml
+++ b/.github/workflows/ci-workflow.yml
@@ -1,12 +1,14 @@
name: Compilation & tests
on:
+ workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
+ - develop
jobs:
job_build_debug_nano_s:
@@ -102,8 +104,27 @@ jobs:
name: scan-build
path: scan-build
+ building_for_e2e_tests:
+ name: Building binaries for E2E tests
+ runs-on: ubuntu-latest
+ container:
+ image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
+
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Build testing binaries
+ run: cd tests && ./build_local_test_elfs.sh
+
+ - name: Upload app binaries
+ uses: actions/upload-artifact@v2
+ with:
+ name: e2e_elfs
+ path: ./tests/elfs/
+
jobs-e2e-tests:
- needs: [job_build_debug_nano_s, job_build_debug_nano_x]
+ name: E2E tests
+ needs: [building_for_e2e_tests]
runs-on: ubuntu-latest
steps:
- name: Test
@@ -113,28 +134,30 @@ jobs:
echo $DISPLAY
- name: Checkout
uses: actions/checkout@v2
+
- run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev
+
- name: Install node
uses: actions/setup-node@v2
with:
node-version: "14.4.0"
+
- name: Install yarn
- run: |
- npm install -g yarn
+ run: npm install -g yarn
+
- name: Build/Install build js deps
- run: |
- cd tests && yarn install
+ run: cd tests && yarn install
+
- name: Create tmp folder for artifacts
- run: |
- mkdir tests/elfs
+ run: mkdir tests/elfs
+
- name: Download app binaries
uses: actions/download-artifact@v2
with:
- path: tests/elfs
+ path: tmp/
+
- name: Gather elfs
- run: |
- cd tests/elfs
- cp `find . -name "*.elf"` .
+ run: cp `find tmp/e2e_elfs/ -name "*.elf"` tests/elfs/
+
- name: Run zemu tests
- run: |
- cd tests && yarn test
+ run: cd tests && yarn test
diff --git a/.github/workflows/lint-workflow.yml b/.github/workflows/lint-workflow.yml
index ab0e08e..b9ea676 100644
--- a/.github/workflows/lint-workflow.yml
+++ b/.github/workflows/lint-workflow.yml
@@ -7,6 +7,7 @@ on:
pull_request:
branches:
- master
+ - develop
jobs:
job_lint:
@@ -18,8 +19,8 @@ jobs:
uses: actions/checkout@v2
- name: Lint
- uses: DoozyX/clang-format-lint-action@v0.11
+ uses: DoozyX/clang-format-lint-action@v0.13
with:
source: "./"
extensions: "h,c"
- clangFormatVersion: 10
+ clangFormatVersion: 12.0.0
diff --git a/.github/workflows/sdk-generation.yml b/.github/workflows/sdk-generation.yml
new file mode 100644
index 0000000..bb11552
--- /dev/null
+++ b/.github/workflows/sdk-generation.yml
@@ -0,0 +1,53 @@
+name: Updating the SDK
+
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - master
+ - develop
+
+jobs:
+ updating_SDK:
+ name: Updating the SDK
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Clone
+ uses: actions/checkout@v2
+ with:
+ # by default the action uses fetch-depth = 1, which creates
+ # shallow repositories from which we can't push
+ fetch-depth: 0
+ submodules: recursive
+ # needed, else the push inside the action will use default credentials
+ # instead of provided ones
+ persist-credentials: false
+
+ - name: Build new SDK
+ run: python tools/build_sdk.py
+
+ - name: Extract branch name
+ shell: bash
+ run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
+ id: extract_branch
+
+ - name: Commit & push changes in the SDK if any
+ uses: ./.github/actions/commit-changes
+ with:
+ name: 'ldg-github-ci'
+ directory: ethereum-plugin-sdk
+ branch: ${{ steps.extract_branch.outputs.branch }}
+ message: "[update] Branch ${{ steps.extract_branch.outputs.branch }} | Commit ${GITHUB_SHA}"
+ secret: ${{ secrets.CI_BOT_TOKEN }}
+ repository: LedgerHQ/ethereum-plugin-sdk
+
+ - name: Update the SDK submodule in the Ethereum app
+ uses: ./.github/actions/commit-changes
+ with:
+ name: 'ldg-github-ci'
+ files: ethereum-plugin-sdk
+ branch: ${{ steps.extract_branch.outputs.branch }}
+ message: "[update][SDK] Branch ${{ steps.extract_branch.outputs.branch }} | Commit ${GITHUB_SHA}"
+ secret: ${{ secrets.CI_BOT_TOKEN }}
+ repository: LedgerHQ/app-ethereum
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9b72ae0..d01c246 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
+## [1.9.18](https://github.com/ledgerhq/app-ethereum/compare/1.9.17...1.9.18) - 2022-04-25
+
+### Added
+
+- Easier way of adding a chain into the Makefile
+- EIP 1024 support
+- Conflux chain
+- Moonbeam chain
+- KardiaChain
+- BitTorrent Chain
+- Wethio chain
+
+### Changed
+
+- More uniform naming between the ERC-721 & ERC-1155 screens
+
+### Fixed
+
+- CI (mostly Zemu tests)
+- App crashing when trying to approve an NFT transaction without having received the NFT information beforehand
+- App refusing to approve an NFT transaction with a long collection name
+
## [1.9.17](https://github.com/ledgerhq/app-ethereum/compare/1.9.16...1.9.17) - 2022-01-14
### Added
diff --git a/Makefile b/Makefile
index 0a1a209..91a750f 100644
--- a/Makefile
+++ b/Makefile
@@ -28,222 +28,37 @@ APP_LOAD_PARAMS += --path "45'"
# Samsung temporary implementation for wallet ID on 0xda7aba5e/0xc1a551c5
APP_LOAD_PARAMS += --path "1517992542'/1101353413'"
+##################
+# Define Version #
+##################
+
APPVERSION_M=1
APPVERSION_N=9
-APPVERSION_P=17
+APPVERSION_P=18
APPVERSION=$(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P)
APP_LOAD_FLAGS= --appFlags 0x240 --dep Ethereum:$(APPVERSION)
+###########################
+# Set Chain environnement #
+###########################
+
ifeq ($(CHAIN),)
CHAIN=ethereum
endif
-ifeq ($(CHAIN),ethereum)
-# Lock the application on its standard path for 1.5. Please complain if non compliant
-APP_LOAD_PARAMS += --path "44'/60'"
-DEFINES += CHAINID_UPCASE=\"ETHEREUM\" CHAINID_COINNAME=\"ETH\" CHAIN_KIND=CHAIN_KIND_ETHEREUM CHAIN_ID=1
-# Starkware integration
-APP_LOAD_PARAMS += --path "2645'/579218131'"
-DEFINES += HAVE_STARKWARE
-DEFINES += STARK_BIP32_PATH_0=0x80000A55 STARK_BIP32_PATH_1=0xA2862AD3
-# Allow to derive ETH 2 public keys
-APP_LOAD_PARAMS += --path "12381/3600" --curve bls12381g1
-DEFINES += HAVE_ETH2
-APPNAME = "Ethereum"
-DEFINES_LIB=
-APP_LOAD_FLAGS=--appFlags 0xa40
-else ifeq ($(CHAIN),ropsten)
-APP_LOAD_PARAMS += --path "44'/60'"
-DEFINES += CHAINID_UPCASE=\"ETHEREUM\" CHAINID_COINNAME=\"ETH\" CHAIN_KIND=CHAIN_KIND_ETHEREUM CHAIN_ID=3
-# Starkware integration
-APP_LOAD_PARAMS += --path "2645'/579218131'"
-DEFINES += HAVE_STARKWARE
-# Keep for Starkware Ropsten tests
-DEFINES += HAVE_TOKENS_EXTRA_LIST
-DEFINES += STARK_BIP32_PATH_0=0x80000A55 STARK_BIP32_PATH_1=0xA2862AD3
-# Allow to derive ETH 2 public keys
-APP_LOAD_PARAMS += --path "12381/3600" --curve bls12381g1
-DEFINES += HAVE_ETH2
-APPNAME = "Eth Ropsten"
-DEFINES_LIB=
-APP_LOAD_FLAGS=--appFlags 0xa40
-else ifeq ($(CHAIN),goerli)
-APP_LOAD_PARAMS += --path "44'/60'"
-DEFINES += CHAINID_UPCASE=\"ETHEREUM\" CHAINID_COINNAME=\"ETH\" CHAIN_KIND=CHAIN_KIND_ETHEREUM CHAIN_ID=5
-# Starkware integration
-APP_LOAD_PARAMS += --path "2645'/579218131'"
-DEFINES += HAVE_STARKWARE
-# Keep for Starkware Goerli tests
-DEFINES += HAVE_TOKENS_EXTRA_LIST
-DEFINES += STARK_BIP32_PATH_0=0x80000A55 STARK_BIP32_PATH_1=0xA2862AD3
-# Allow to derive ETH 2 public keys
-APP_LOAD_PARAMS += --path "12381/3600" --curve bls12381g1
-DEFINES += HAVE_ETH2
-APPNAME = "Eth Goerli"
-DEFINES_LIB=
-APP_LOAD_FLAGS=--appFlags 0xa40
-else ifeq ($(CHAIN),ellaism)
-APP_LOAD_PARAMS += --path "44'/163'"
-DEFINES += CHAINID_UPCASE=\"ELLA\" CHAINID_COINNAME=\"ELLA\" CHAIN_KIND=CHAIN_KIND_ELLAISM CHAIN_ID=64
-APPNAME = "Ellaism"
-else ifeq ($(CHAIN),ethereum_classic)
-# Also allows ETC to access the ETH derivation path to recover forked assets
-APP_LOAD_PARAMS += --path "44'/61'" --path "44'/60'"
-DEFINES += CHAINID_UPCASE=\"ETC\" CHAINID_COINNAME=\"ETC\" CHAIN_KIND=CHAIN_KIND_ETHEREUM_CLASSIC CHAIN_ID=61
-APPNAME = "Ethereum Classic"
-else ifeq ($(CHAIN),ethersocial)
-APP_LOAD_PARAMS += --path "44'/31102'"
-DEFINES += CHAINID_UPCASE=\"ETHERSOCIAL\" CHAINID_COINNAME=\"ESN\" CHAIN_KIND=CHAIN_KIND_ETHERSOCIAL CHAIN_ID=31102
-APPNAME = "Ethersocial"
-else ifeq ($(CHAIN),ether1)
-APP_LOAD_PARAMS += --path "44'/1313114'"
-DEFINES += CHAINID_UPCASE=\"ETHER1\" CHAINID_COINNAME=\"ETHO\" CHAIN_KIND=CHAIN_KIND_ETHER1 CHAIN_ID=1313114
-APPNAME = "Ether-1"
-else ifeq ($(CHAIN),expanse)
-APP_LOAD_PARAMS += --path "44'/40'"
-DEFINES += CHAINID_UPCASE=\"EXPANSE\" CHAINID_COINNAME=\"EXP\" CHAIN_KIND=CHAIN_KIND_EXPANSE CHAIN_ID=2
-APPNAME = "Expanse"
-else ifeq ($(CHAIN),pirl)
-APP_LOAD_PARAMS += --path "44'/164'"
-DEFINES += CHAINID_UPCASE=\"PIRL\" CHAINID_COINNAME=\"PIRL\" CHAIN_KIND=CHAIN_KIND_PIRL CHAIN_ID=3125659152
-APPNAME = "Pirl"
-else ifeq ($(CHAIN),poa)
-APP_LOAD_PARAMS += --path "44'/60'"
-DEFINES += CHAINID_UPCASE=\"POA\" CHAINID_COINNAME=\"POA\" CHAIN_KIND=CHAIN_KIND_POA CHAIN_ID=99
-APPNAME = "POA"
-else ifeq ($(CHAIN),artis_sigma1)
-APP_LOAD_PARAMS += --path "44'/246529'"
-DEFINES += CHAINID_UPCASE=\"ARTISSIGMA1\" CHAINID_COINNAME=\"ATS\" CHAIN_KIND=CHAIN_KIND_ARTIS_SIGMA1 CHAIN_ID=246529
-APPNAME = "ARTIS sigma1"
-else ifeq ($(CHAIN),artis_tau1)
-APP_LOAD_PARAMS += --path "44'/246785'"
-DEFINES += CHAINID_UPCASE=\"ARTISTAU1\" CHAINID_COINNAME=\"ATS\" CHAIN_KIND=CHAIN_KIND_ARTIS_TAU1 CHAIN_ID=246785
-APPNAME = "ARTIS tau1"
-else ifeq ($(CHAIN),rsk)
-APP_LOAD_PARAMS += --path "44'/137'" --path "44'/00'"
-DEFINES += CHAINID_UPCASE=\"RSK\" CHAINID_COINNAME=\"RBTC\" CHAIN_KIND=CHAIN_KIND_RSK CHAIN_ID=30
-APPNAME = "RSK"
-else ifeq ($(CHAIN),rsk_testnet)
-APP_LOAD_PARAMS += --path "44'/37310'"
-DEFINES += CHAINID_UPCASE=\"RSKTESTNET\" CHAINID_COINNAME=\"RBTC\" CHAIN_KIND=CHAIN_KIND_RSK CHAIN_ID=31
-APPNAME = "RSK Test"
-else ifeq ($(CHAIN),ubiq)
-APP_LOAD_PARAMS += --path "44'/108'"
-DEFINES += CHAINID_UPCASE=\"UBIQ\" CHAINID_COINNAME=\"UBQ\" CHAIN_KIND=CHAIN_KIND_UBIQ CHAIN_ID=8
-APPNAME = "Ubiq"
-else ifeq ($(CHAIN),akroma)
-APP_LOAD_PARAMS += --path "44'/200625'"
-DEFINES += CHAINID_UPCASE=\"AKA\" CHAINID_COINNAME=\"AKA\" CHAIN_KIND=CHAIN_KIND_AKROMA CHAIN_ID=200625
-APPNAME = "Akroma"
-else ifeq ($(CHAIN),wanchain)
-APP_LOAD_PARAMS += --path "44'/5718350'"
-DEFINES += CHAINID_UPCASE=\"WAN\" CHAINID_COINNAME=\"WAN\" CHAIN_KIND=CHAIN_KIND_WANCHAIN CHAIN_ID=1
-APPNAME = "Wanchain"
-else ifeq ($(CHAIN),kusd)
-APP_LOAD_PARAMS += --path "44'/91927009'"
-DEFINES += CHAINID_UPCASE=\"KUSD\" CHAINID_COINNAME=\"KUSD\" CHAIN_KIND=CHAIN_KIND_KUSD CHAIN_ID=1
-APPNAME = "kUSD"
-else ifeq ($(CHAIN),musicoin)
-APP_LOAD_PARAMS += --path "44'/184'"
-DEFINES += CHAINID_UPCASE=\"MUSICOIN\" CHAINID_COINNAME=\"MUSIC\" CHAIN_KIND=CHAIN_KIND_MUSICOIN CHAIN_ID=7762959
-APPNAME = "Musicoin"
-else ifeq ($(CHAIN),callisto)
-APP_LOAD_PARAMS += --path "44'/820'"
-DEFINES += CHAINID_UPCASE=\"CALLISTO\" CHAINID_COINNAME=\"CLO\" CHAIN_KIND=CHAIN_KIND_CALLISTO CHAIN_ID=820
-APPNAME = "Callisto"
-else ifeq ($(CHAIN),ethergem)
-APP_LOAD_PARAMS += --path "44'/1987'"
-DEFINES += CHAINID_UPCASE=\"ETHERGEM\" CHAINID_COINNAME=\"EGEM\" CHAIN_KIND=CHAIN_KIND_ETHERGEM CHAIN_ID=1987
-APPNAME = "EtherGem"
-else ifeq ($(CHAIN),atheios)
-APP_LOAD_PARAMS += --path "44'/1620'"
-DEFINES += CHAINID_UPCASE=\"ATHEIOS\" CHAINID_COINNAME=\"ATH\" CHAIN_KIND=CHAIN_KIND_ATHEIOS CHAIN_ID=1620
-APPNAME = "Atheios"
-else ifeq ($(CHAIN),gochain)
-APP_LOAD_PARAMS += --path "44'/6060'"
-DEFINES += CHAINID_UPCASE=\"GOCHAIN\" CHAINID_COINNAME=\"GO\" CHAIN_KIND=CHAIN_KIND_GOCHAIN CHAIN_ID=60
-APPNAME = "GoChain"
-else ifeq ($(CHAIN),mix)
-APP_LOAD_PARAMS += --path "44'/76'"
-DEFINES += CHAINID_UPCASE=\"MIX\" CHAINID_COINNAME=\"MIX\" CHAIN_KIND=CHAIN_KIND_MIX CHAIN_ID=76
-APPNAME = "Mix"
-else ifeq ($(CHAIN),reosc)
-APP_LOAD_PARAMS += --path "44'/2894'"
-DEFINES += CHAINID_UPCASE=\"REOSC\" CHAINID_COINNAME=\"REOSC\" CHAIN_KIND=CHAIN_KIND_REOSC CHAIN_ID=2894
-APPNAME = "REOSC"
-else ifeq ($(CHAIN),hpb)
-APP_LOAD_PARAMS += --path "44'/269'"
-DEFINES += CHAINID_UPCASE=\"HPB\" CHAINID_COINNAME=\"HPB\" CHAIN_KIND=CHAIN_KIND_HPB CHAIN_ID=269
-APPNAME = "HPB"
-else ifeq ($(CHAIN),tomochain)
-APP_LOAD_PARAMS += --path "44'/889'"
-DEFINES += CHAINID_UPCASE=\"TOMOCHAIN\" CHAINID_COINNAME=\"TOMO\" CHAIN_KIND=CHAIN_KIND_TOMOCHAIN CHAIN_ID=88
-APPNAME = "TomoChain"
-else ifeq ($(CHAIN),moonriver)
-APP_LOAD_PARAMS += --path "44'/60'" --path "44'/1285'"
-DEFINES += CHAINID_UPCASE=\"MOONRIVER\" CHAINID_COINNAME=\"MOVR\" CHAIN_KIND=CHAIN_KIND_MOONRIVER CHAIN_ID=1285
-APPNAME = "Moonriver"
-else ifeq ($(CHAIN),tobalaba)
-APP_LOAD_PARAMS += --path "44'/401697'"
-DEFINES += CHAINID_UPCASE=\"TOBALABA\" CHAINID_COINNAME=\"TOBALABA\" CHAIN_KIND=CHAIN_KIND_TOBALABA CHAIN_ID=401697
-APPNAME = "Tobalaba"
-else ifeq ($(CHAIN),webchain)
-APP_LOAD_PARAMS += --path "44'/227'"
-DEFINES += CHAINID_UPCASE=\"WEBCHAIN\" CHAINID_COINNAME=\"WEB\" CHAIN_KIND=CHAIN_KIND_WEBCHAIN CHAIN_ID=24484
-APPNAME = "Webchain"
-else ifeq ($(CHAIN),dexon)
-APP_LOAD_PARAMS += --path "44'/237'"
-DEFINES += CHAINID_UPCASE=\"DEXON\" CHAINID_COINNAME=\"DXN\" CHAIN_KIND=CHAIN_KIND_DEXON CHAIN_ID=237
-APPNAME = "DEXON"
-else ifeq ($(CHAIN),volta)
-APP_LOAD_PARAMS += --path "44'/73799'" --path "44'/60'"
-DEFINES += CHAINID_UPCASE=\"VOLTA\" CHAINID_COINNAME=\"VOLTA\" CHAIN_KIND=CHAIN_KIND_VOLTA CHAIN_ID=73799
-APPNAME = "Volta"
-else ifeq ($(CHAIN),ewc)
-APP_LOAD_PARAMS += --path "44'/246'" --path "44'/60'"
-DEFINES += CHAINID_UPCASE=\"EWC\" CHAINID_COINNAME=\"EWC\" CHAIN_KIND=CHAIN_KIND_EWC CHAIN_ID=246
-APPNAME = "EnergyWebChain"
-else ifeq ($(CHAIN),thundercore)
-APP_LOAD_PARAMS += --path "44'/1001'"
-DEFINES += CHAINID_UPCASE=\"THUNDERCORE\" CHAINID_COINNAME=\"TT\" CHAIN_KIND=CHAIN_KIND_THUNDERCORE CHAIN_ID=108
-APPNAME = "ThunderCore"
-else ifeq ($(CHAIN),flare)
+SUPPORTED_CHAINS=$(shell find makefile_conf/chain/ -type f -name '*.mk'| sed 's/.*\/\(.*\).mk/\1/g' | sort)
-APP_LOAD_PARAMS += --path "44'/554'" --path "44'/60'"
-DEFINES += CHAINID_UPCASE=\"FLARE\" CHAINID_COINNAME=\"FLR\" CHAIN_KIND=CHAIN_KIND_FLARE CHAIN_ID=14
-
-# Pending review parameters
-APP_LOAD_PARAMS += --tlvraw 9F:01
-DEFINES += HAVE_PENDING_REVIEW_SCREEN
-
-APPNAME = "Flare"
-
-else ifeq ($(CHAIN),flare_coston)
-APP_LOAD_PARAMS += --path "44'/554'" --path "44'/60'"
-DEFINES += CHAINID_UPCASE=\"FLARE\" CHAINID_COINNAME=\"FLR\" CHAIN_KIND=CHAIN_KIND_FLARE CHAIN_ID=16
-APPNAME = "Flare Coston"
-else ifeq ($(CHAIN),bsc)
-APP_LOAD_PARAMS += --path "44'/60'"
-DEFINES += CHAINID_UPCASE=\"BSC\" CHAINID_COINNAME=\"BNB\" CHAIN_KIND=CHAIN_KIND_BSC CHAIN_ID=56
-APPNAME = "Binance Smart Chain"
-else ifeq ($(CHAIN),songbird)
-APP_LOAD_PARAMS += --path "44'/554'" --path "44'/60'"
-DEFINES += CHAINID_UPCASE=\"SONGBIRD\" CHAINID_COINNAME=\"SGB\" CHAIN_KIND=CHAIN_KIND_SONGBIRD CHAIN_ID=19
-APPNAME = "Songbird"
-else ifeq ($(CHAIN),polygon)
-APP_LOAD_PARAMS += --path "44'/60'"
-DEFINES += CHAINID_UPCASE=\"POLYGON\" CHAINID_COINNAME=\"MATIC\" CHAIN_KIND=CHAIN_KIND_POLYGON CHAIN_ID=137
-APPNAME = "Polygon"
-else ifeq ($(CHAIN),shyft)
-APP_LOAD_PARAMS += --path "44'/60'"
-DEFINES += CHAINID_UPCASE=\"SHYFT\" CHAINID_COINNAME=\"SHFT\" CHAIN_KIND=CHAIN_KIND_SHYFT CHAIN_ID=7341
-APPNAME = "Shyft"
+# Check if chain is available
+ifeq ($(shell test -s ./makefile_conf/chain/$(CHAIN).mk && echo -n yes), yes)
+include ./makefile_conf/chain/$(CHAIN).mk
else
-ifeq ($(filter clean,$(MAKECMDGOALS)),)
-$(error Unsupported CHAIN - use ethereum, ropsten, goerli, moonriver, ethereum_classic, expanse, poa, artis_sigma1, artis_tau1, rsk, rsk_testnet, ubiq, wanchain, kusd, musicoin, pirl, akroma, atheios, callisto, ethersocial, ellaism, ether1, ethergem, gochain, mix, reosc, hpb, tomochain, tobalaba, dexon, volta, ewc, webchain, thundercore, bsc, songbird, polygon, shyft)
-endif
+$(error Unsupported CHAIN - use $(SUPPORTED_CHAINS))
endif
+#########
+# Other #
+#########
+
APP_LOAD_PARAMS += $(APP_LOAD_FLAGS) --path "44'/1'"
DEFINES += $(DEFINES_LIB)
@@ -322,7 +137,6 @@ DEFINES += HAVE_NFT_TESTING_KEY
endif
endif
-
# Enabling debug PRINTF
DEBUG:=0
ifneq ($(DEBUG),0)
@@ -388,9 +202,8 @@ $(info INFO: Need to reinitialize git submodules)
$(shell git submodule update --init)
endif
-# rebuild
-$(shell python3 ethereum-plugin-sdk/build_sdk.py)
-$(shell find ./ethereum-plugin-sdk -iname '*.h' -o -iname '*.c' | xargs clang-format-10 -i)
+# rebuild SDK
+$(shell python3 tools/build_sdk.py)
# check if a difference is noticed (fail if it happens in CI build)
ifneq ($(shell git status | grep 'ethereum-plugin-sdk'),)
@@ -423,4 +236,4 @@ include $(BOLOS_SDK)/Makefile.rules
dep/%.d: %.c Makefile
listvariants:
- @echo VARIANTS CHAIN ethereum ropsten goerli moonriver ethereum_classic expanse poa rsk rsk_testnet ubiq wanchain pirl akroma atheios callisto ethersocial ether1 gochain musicoin ethergem mix ellaism reosc hpb tomochain dexon volta ewc thundercore bsc songbird polygon shyft
+ @echo VARIANTS CHAIN $(SUPPORTED_CHAINS)
diff --git a/README.md b/README.md
index 5fd6b9a..789a604 100644
--- a/README.md
+++ b/README.md
@@ -1,47 +1,119 @@
-# app-ethereum
-Ethereum wallet application framework for Nano S and Nano X.
-Ledger Blue is not maintained anymore, but the app can still be compiled for this target using the branch `blue-final-release`.
+
+
+
+
+
+ Table of Contents
+
+- [About the project](#about-the-project)
+- [Documentation](#documentation)
+ - [Plugins](#plugins)
+- [Testing](#testing)
+ - [Requirements](#requirements)
+ - [Build the applications required by the test suite](#build-the-applications-required-by-the-test-suite)
+ - [Running all tests](#running-all-tests)
+ - [With Makefile](#with-makefile)
+ - [With yarn](#with-yarn)
+ - [Running a specific tests](#running-a-specific-tests)
+ - [Adding tests](#adding-tests)
+ - [Zemu](#zemu)
+ - [Update binaries](#update-binaries)
+- [Contributing](#contributing)
+
+
+
+
+## About the project
+
+Ethereum wallet application framework for Nano S and Nano X.
+Ledger Blue is not maintained anymore, but the app can still be compiled for this target using the branch [`blue-final-release`](https://github.com/LedgerHQ/app-ethereum/tree/blue-final-release).
+
+## Documentation
This app follows the specification available in the `doc/` folder.
To compile it and load it on a device, please check out our [developer portal](https://developers.ledger.com/docs/nano-app/introduction/).
-# Plugins
+### Plugins
-This app support external plugins. More info in [doc/ethapp_plugin.asc](https://github.com/LedgerHQ/app-ethereum/blob/master/doc/ethapp_plugins.asc). If you wish to have a look at an existing plugin, feel free to check out the [Boilerplate plugin](https://github.com/LedgerHQ/app-plugin-boilerplate).
+We have the concept of plugins in the ETH app.
+Find the documentations here:
+- [Blog Ethereum plugins](https://blog.ledger.com/ethereum-plugins/)
+- [Ethereum application Plugins : Technical Specifications](https://github.com/LedgerHQ/app-ethereum/blob/master/doc/ethapp_plugins.asc)
+- [Plugin guide](https://hackmd.io/300Ukv5gSbCbVcp3cZuwRQ)
+- [Boilerplate plugin](https://github.com/LedgerHQ/app-plugin-boilerplate)
-# Testing
+## Testing
Testing is done via the open-source framework [zemu](https://github.com/Zondax/zemu).
-## Running tests
+### Requirements
-First [install yarn](https://classic.yarnpkg.com/en/docs/install/#debian-stable).
-Open `tests/build_local_test_elfs.sh` and add your BOLOS SDKs path to `NANOS_SDK` and `NANOX_SDK`.
-This helper script will build the applications required by the test suite and move them at the right place.
-```
-cd tests
-./build_local_test_elfs.sh
-```
-Then you can install the project by simply running:
-```
-cd ..
-make test
-```
-This will run `make install_tests` and `make run_tests`
+- [nodeJS == 16](https://github.com/nvm-sh/nvm)
+- [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#debian-stable)
+- [build environnement](https://github.com/LedgerHQ/ledger-app-builder/blob/master/Dockerfile)
-To run a specific tests (here the send test):
-```
-cd tests
-jest --runInBand --detectOpenHandles src/send.test.js
-```
+#### Build the applications required by the test suite
-Make sure you're in the `tests` folder before running `jest` or `yarn test`.
+1. Add your BOLOS SDKs path to:
+ - `NANOS_SDK` and `NANOX_SDK`
+
+2. Go to the `tests` folder and run `./build_local_test_elfs.sh`
+ - ```sh
+ cd tests
+ # This helper script will build the applications required by the test suite and move them at the right place.
+ yarn install
+ ./build_local_test_elfs.sh
+ ```
+
+### Running all tests
+#### With Makefile
+
+1. Then you can install and run tests by simply running on the `root` of the repo:
+ - ```sh
+ make test
+ ```
+ - This will run `make install_tests` and `make run_tests`
+
+#### With yarn
+
+1. Go to the `tests` folder and run:
+ - ```sh
+ yarn test
+ ```
+
+### Running a specific tests
+
+1. Go to the `tests` folder and run:
+ - ```sh
+ yarn jest --runInBand --detectOpenHandles {YourTestFile}
+ ```
+2. For example with the `send test`:
+ - ```sh
+ yarn jest --runInBand --detectOpenHandles src/send.test.js
+ ```
-## Adding tests
+### Adding tests
-### Zemu
+#### Zemu
To add tests, copy one of the already existing test files in `tests/src/`.
You then need to adapt the `buffer` and `tx` variables to adapt to the APDU you wish to send.
@@ -54,16 +126,33 @@ You then need to adapt the `buffer` and `tx` variables to adapt to the APDU you
Finally make sure you adapt the expected signature!
-### Update binaries
+#### Update binaries
Don't forget to update the binaries in the test folder. To do so, compile with those environement variables:
-```
+
+```sh
make DEBUG=1 ALLOW_DATA=1
```
Then copy the binary to the `tests/elfs` folder (in this case, compiled with SDK for nanoS):
-```
+
+```sh
cp bin/app.elf tests/elfs/ethereum_nanos.elf
```
Repeat the operation for a binary compiled with nanoX SDK and change for `ethereum_nanox.elf`.
+
+
+## Contributing
+
+Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.
+
+If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag `enhancement`.
+
+1. Fork the Project
+2. Create your Feature Branch (`git checkout -b feature/my-feature`)
+3. Commit your Changes (`git commit -m 'feat: my new feature`)
+4. Push to the Branch (`git push origin feature/my-feature`)
+5. Open a Pull Request
+
+Please try to follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/).
diff --git a/doc/ethapp.asc b/doc/ethapp.asc
index 53007b4..496ed0e 100644
--- a/doc/ethapp.asc
+++ b/doc/ethapp.asc
@@ -1,7 +1,7 @@
Ethereum application : Common Technical Specifications
=======================================================
Ledger Firmware Team
-Application version 1.5.0 - 25th of September 2020
+Application version 1.9.18 - 29th of January 2022
## 1.0
- Initial release
@@ -26,6 +26,9 @@ Application version 1.5.0 - 25th of September 2020
## 1.9.13
- Add SET PLUGIN
+## 1.9.17
+ - Add PERFORM PRIVACY OPERATION
+
## About
This application describes the APDU messages interface to communicate with the Ethereum application.
@@ -251,9 +254,9 @@ This commands provides a trusted description of an NFT to associate a contract a
It shall be run immediately before performing a transaction involving a contract calling this contract address to display the proper nft information to the user if necessary, as marked in GET APP CONFIGURATION flags.
-The signature is computed on
+The signature is computed on:
-type || version || len(collectionName) || collectionName || address || chainId || keyId || algorithmId || len(signature) || signature
+type || version || len(collectionName) || collectionName || address || chainId || keyId || algorithmId
#### Coding
@@ -379,6 +382,52 @@ type || version || len(pluginName) || pluginName || address || selector || chain
None
+### PERFORM PRIVACY OPERATION
+
+#### Description
+
+This command performs privacy operations as defined in EIP 1024 (https://ethereum-magicians.org/t/eip-1024-cross-client-encrypt-decrypt/505)
+
+It can return the public encryption key on Curve25519 for a given Ethereum account or the shared secret (generated by the scalar multiplication of the remote public key by the account private key on Curve25519) used to decrypt private data encrypted for a given Ethereum account
+
+All data can be optionally checked on the device before being returned.
+
+#### Coding
+
+'Command'
+
+[width="80%"]
+|==============================================================================================================================
+| *CLA* | *INS* | *P1* | *P2* | *Lc* | *Le*
+| E0 | 18 | 00 : return data
+
+ 01 : display data and confirm before returning
+ | 00 : return the public encryption key
+
+ 01 : return the shared secret | variable | variable
+|==============================================================================================================================
+
+'Input data'
+
+[width="80%"]
+|==============================================================================================================================
+| *Description* | *Length*
+| Number of BIP 32 derivations to perform (max 10) | 1
+| First derivation index (big endian) | 4
+| ... | 4
+| Last derivation index (big endian) | 4
+| Third party public key on Curve25519, if returning the shared secret | 32
+|==============================================================================================================================
+
+'Output data'
+
+[width="80%"]
+|==============================================================================================================================
+| *Description* | *Length*
+| Public encryption key or shared secret | 32
+|==============================================================================================================================
+
+
### GET APP CONFIGURATION
#### Description
diff --git a/ethereum-plugin-sdk b/ethereum-plugin-sdk
index 5ade2d7..0de74c6 160000
--- a/ethereum-plugin-sdk
+++ b/ethereum-plugin-sdk
@@ -1 +1 @@
-Subproject commit 5ade2d77cb6f0f366210d014bc731212a22fc29c
+Subproject commit 0de74c6382f876f89f82ef0eef90408fd94888a3
diff --git a/icons/nanos_app_bttc.gif b/icons/nanos_app_bttc.gif
new file mode 100644
index 0000000..4755095
Binary files /dev/null and b/icons/nanos_app_bttc.gif differ
diff --git a/icons/nanos_app_conflux_espace.gif b/icons/nanos_app_conflux_espace.gif
new file mode 100644
index 0000000..02e7931
Binary files /dev/null and b/icons/nanos_app_conflux_espace.gif differ
diff --git a/icons/nanos_app_kardiachain.gif b/icons/nanos_app_kardiachain.gif
new file mode 100644
index 0000000..ed09610
Binary files /dev/null and b/icons/nanos_app_kardiachain.gif differ
diff --git a/icons/nanos_app_moonbeam.gif b/icons/nanos_app_moonbeam.gif
new file mode 100644
index 0000000..2a254b2
Binary files /dev/null and b/icons/nanos_app_moonbeam.gif differ
diff --git a/icons/nanos_app_wethio.gif b/icons/nanos_app_wethio.gif
new file mode 100644
index 0000000..e676560
Binary files /dev/null and b/icons/nanos_app_wethio.gif differ
diff --git a/icons/nanox_app_bttc.gif b/icons/nanox_app_bttc.gif
new file mode 100644
index 0000000..4b0b8d4
Binary files /dev/null and b/icons/nanox_app_bttc.gif differ
diff --git a/icons/nanox_app_conflux_espace.gif b/icons/nanox_app_conflux_espace.gif
new file mode 100644
index 0000000..8b74623
Binary files /dev/null and b/icons/nanox_app_conflux_espace.gif differ
diff --git a/icons/nanox_app_kardiachain.gif b/icons/nanox_app_kardiachain.gif
new file mode 100644
index 0000000..4cd245f
Binary files /dev/null and b/icons/nanox_app_kardiachain.gif differ
diff --git a/icons/nanox_app_moonbeam.gif b/icons/nanox_app_moonbeam.gif
new file mode 100644
index 0000000..0da2ed1
Binary files /dev/null and b/icons/nanox_app_moonbeam.gif differ
diff --git a/icons/nanox_app_wethio.gif b/icons/nanox_app_wethio.gif
new file mode 100644
index 0000000..0471883
Binary files /dev/null and b/icons/nanox_app_wethio.gif differ
diff --git a/makefile_conf/chain/akroma.mk b/makefile_conf/chain/akroma.mk
new file mode 100644
index 0000000..27d91e1
--- /dev/null
+++ b/makefile_conf/chain/akroma.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/200625'"
+DEFINES += CHAINID_UPCASE=\"AKA\" CHAINID_COINNAME=\"AKA\" CHAIN_KIND=CHAIN_KIND_AKROMA CHAIN_ID=200625
+APPNAME = "Akroma"
\ No newline at end of file
diff --git a/makefile_conf/chain/artis_sigma1.mk b/makefile_conf/chain/artis_sigma1.mk
new file mode 100644
index 0000000..2170e48
--- /dev/null
+++ b/makefile_conf/chain/artis_sigma1.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/246529'"
+DEFINES += CHAINID_UPCASE=\"ARTISSIGMA1\" CHAINID_COINNAME=\"ATS\" CHAIN_KIND=CHAIN_KIND_ARTIS_SIGMA1 CHAIN_ID=246529
+APPNAME = "ARTIS sigma1"
\ No newline at end of file
diff --git a/makefile_conf/chain/artis_tau1.mk b/makefile_conf/chain/artis_tau1.mk
new file mode 100644
index 0000000..3316dc2
--- /dev/null
+++ b/makefile_conf/chain/artis_tau1.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/246785'"
+DEFINES += CHAINID_UPCASE=\"ARTISTAU1\" CHAINID_COINNAME=\"ATS\" CHAIN_KIND=CHAIN_KIND_ARTIS_TAU1 CHAIN_ID=246785
+APPNAME = "ARTIS tau1"
\ No newline at end of file
diff --git a/makefile_conf/chain/atheios.mk b/makefile_conf/chain/atheios.mk
new file mode 100644
index 0000000..111852d
--- /dev/null
+++ b/makefile_conf/chain/atheios.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/1620'"
+DEFINES += CHAINID_UPCASE=\"ATHEIOS\" CHAINID_COINNAME=\"ATH\" CHAIN_KIND=CHAIN_KIND_ATHEIOS CHAIN_ID=1620
+APPNAME = "Atheios"
\ No newline at end of file
diff --git a/makefile_conf/chain/bsc.mk b/makefile_conf/chain/bsc.mk
new file mode 100644
index 0000000..7c8f00d
--- /dev/null
+++ b/makefile_conf/chain/bsc.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/60'"
+DEFINES += CHAINID_UPCASE=\"BSC\" CHAINID_COINNAME=\"BNB\" CHAIN_KIND=CHAIN_KIND_BSC CHAIN_ID=56
+APPNAME = "Binance Smart Chain"
\ No newline at end of file
diff --git a/makefile_conf/chain/bttc.mk b/makefile_conf/chain/bttc.mk
new file mode 100644
index 0000000..af96c73
--- /dev/null
+++ b/makefile_conf/chain/bttc.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/60'"
+DEFINES += CHAINID_UPCASE=\"BTTC\" CHAINID_COINNAME=\"BTT\" CHAIN_KIND=CHAIN_KIND_BTTC CHAIN_ID=199
+APPNAME = "BTTC"
\ No newline at end of file
diff --git a/makefile_conf/chain/callisto.mk b/makefile_conf/chain/callisto.mk
new file mode 100644
index 0000000..ec068db
--- /dev/null
+++ b/makefile_conf/chain/callisto.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/820'"
+DEFINES += CHAINID_UPCASE=\"CALLISTO\" CHAINID_COINNAME=\"CLO\" CHAIN_KIND=CHAIN_KIND_CALLISTO CHAIN_ID=820
+APPNAME = "Callisto"
\ No newline at end of file
diff --git a/makefile_conf/chain/conflux_espace.mk b/makefile_conf/chain/conflux_espace.mk
new file mode 100644
index 0000000..ba67289
--- /dev/null
+++ b/makefile_conf/chain/conflux_espace.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/60'"
+DEFINES += CHAINID_UPCASE=\"CONFLUX\" CHAINID_COINNAME=\"CFX\" CHAIN_KIND=CHAIN_KIND_CONFLUX_ESPACE CHAIN_ID=1030
+APPNAME = "Conflux eSpace"
\ No newline at end of file
diff --git a/makefile_conf/chain/dexon.mk b/makefile_conf/chain/dexon.mk
new file mode 100644
index 0000000..9d9a4a5
--- /dev/null
+++ b/makefile_conf/chain/dexon.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/237'"
+DEFINES += CHAINID_UPCASE=\"DEXON\" CHAINID_COINNAME=\"DXN\" CHAIN_KIND=CHAIN_KIND_DEXON CHAIN_ID=237
+APPNAME = "DEXON"
\ No newline at end of file
diff --git a/makefile_conf/chain/ellaism.mk b/makefile_conf/chain/ellaism.mk
new file mode 100644
index 0000000..c47ad84
--- /dev/null
+++ b/makefile_conf/chain/ellaism.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/163'"
+DEFINES += CHAINID_UPCASE=\"ELLA\" CHAINID_COINNAME=\"ELLA\" CHAIN_KIND=CHAIN_KIND_ELLAISM CHAIN_ID=64
+APPNAME = "Ellaism"
\ No newline at end of file
diff --git a/makefile_conf/chain/ether1.mk b/makefile_conf/chain/ether1.mk
new file mode 100644
index 0000000..21b9a9f
--- /dev/null
+++ b/makefile_conf/chain/ether1.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/1313114'"
+DEFINES += CHAINID_UPCASE=\"ETHER1\" CHAINID_COINNAME=\"ETHO\" CHAIN_KIND=CHAIN_KIND_ETHER1 CHAIN_ID=1313114
+APPNAME = "Ether-1"
\ No newline at end of file
diff --git a/makefile_conf/chain/ethereum.mk b/makefile_conf/chain/ethereum.mk
new file mode 100644
index 0000000..73c0c16
--- /dev/null
+++ b/makefile_conf/chain/ethereum.mk
@@ -0,0 +1,13 @@
+# Lock the application on its standard path for 1.5. Please complain if non compliant
+APP_LOAD_PARAMS += --path "44'/60'"
+DEFINES += CHAINID_UPCASE=\"ETHEREUM\" CHAINID_COINNAME=\"ETH\" CHAIN_KIND=CHAIN_KIND_ETHEREUM CHAIN_ID=1
+# Starkware integration
+APP_LOAD_PARAMS += --path "2645'/579218131'"
+DEFINES += HAVE_STARKWARE
+DEFINES += STARK_BIP32_PATH_0=0x80000A55 STARK_BIP32_PATH_1=0xA2862AD3
+# Allow to derive ETH 2 public keys
+APP_LOAD_PARAMS += --path "12381/3600" --curve bls12381g1
+DEFINES += HAVE_ETH2
+APPNAME = "Ethereum"
+DEFINES_LIB=
+APP_LOAD_FLAGS=--appFlags 0xa40
\ No newline at end of file
diff --git a/makefile_conf/chain/ethereum_classic.mk b/makefile_conf/chain/ethereum_classic.mk
new file mode 100644
index 0000000..2c72c66
--- /dev/null
+++ b/makefile_conf/chain/ethereum_classic.mk
@@ -0,0 +1,4 @@
+# Also allows ETC to access the ETH derivation path to recover forked assets
+APP_LOAD_PARAMS += --path "44'/61'" --path "44'/60'"
+DEFINES += CHAINID_UPCASE=\"ETC\" CHAINID_COINNAME=\"ETC\" CHAIN_KIND=CHAIN_KIND_ETHEREUM_CLASSIC CHAIN_ID=61
+APPNAME = "Ethereum Classic"
\ No newline at end of file
diff --git a/makefile_conf/chain/ethergem.mk b/makefile_conf/chain/ethergem.mk
new file mode 100644
index 0000000..6eeb421
--- /dev/null
+++ b/makefile_conf/chain/ethergem.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/1987'"
+DEFINES += CHAINID_UPCASE=\"ETHERGEM\" CHAINID_COINNAME=\"EGEM\" CHAIN_KIND=CHAIN_KIND_ETHERGEM CHAIN_ID=1987
+APPNAME = "EtherGem"
\ No newline at end of file
diff --git a/makefile_conf/chain/ethersocial.mk b/makefile_conf/chain/ethersocial.mk
new file mode 100644
index 0000000..cbba795
--- /dev/null
+++ b/makefile_conf/chain/ethersocial.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/31102'"
+DEFINES += CHAINID_UPCASE=\"ETHERSOCIAL\" CHAINID_COINNAME=\"ESN\" CHAIN_KIND=CHAIN_KIND_ETHERSOCIAL CHAIN_ID=31102
+APPNAME = "Ethersocial"
\ No newline at end of file
diff --git a/makefile_conf/chain/ewc.mk b/makefile_conf/chain/ewc.mk
new file mode 100644
index 0000000..816a5fb
--- /dev/null
+++ b/makefile_conf/chain/ewc.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/246'" --path "44'/60'"
+DEFINES += CHAINID_UPCASE=\"EWC\" CHAINID_COINNAME=\"EWC\" CHAIN_KIND=CHAIN_KIND_EWC CHAIN_ID=246
+APPNAME = "EnergyWebChain"
\ No newline at end of file
diff --git a/makefile_conf/chain/expanse.mk b/makefile_conf/chain/expanse.mk
new file mode 100644
index 0000000..36226ef
--- /dev/null
+++ b/makefile_conf/chain/expanse.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/40'"
+DEFINES += CHAINID_UPCASE=\"EXPANSE\" CHAINID_COINNAME=\"EXP\" CHAIN_KIND=CHAIN_KIND_EXPANSE CHAIN_ID=2
+APPNAME = "Expanse"
\ No newline at end of file
diff --git a/makefile_conf/chain/flare.mk b/makefile_conf/chain/flare.mk
new file mode 100644
index 0000000..565b5bb
--- /dev/null
+++ b/makefile_conf/chain/flare.mk
@@ -0,0 +1,8 @@
+APP_LOAD_PARAMS += --path "44'/554'" --path "44'/60'"
+DEFINES += CHAINID_UPCASE=\"FLARE\" CHAINID_COINNAME=\"FLR\" CHAIN_KIND=CHAIN_KIND_FLARE CHAIN_ID=14
+
+# Pending review parameters
+APP_LOAD_PARAMS += --tlvraw 9F:01
+DEFINES += HAVE_PENDING_REVIEW_SCREEN
+
+APPNAME = "Flare"
\ No newline at end of file
diff --git a/makefile_conf/chain/flare_coston.mk b/makefile_conf/chain/flare_coston.mk
new file mode 100644
index 0000000..f546f00
--- /dev/null
+++ b/makefile_conf/chain/flare_coston.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/554'" --path "44'/60'"
+DEFINES += CHAINID_UPCASE=\"FLARE\" CHAINID_COINNAME=\"FLR\" CHAIN_KIND=CHAIN_KIND_FLARE CHAIN_ID=16
+APPNAME = "Flare Coston"
\ No newline at end of file
diff --git a/makefile_conf/chain/gochain.mk b/makefile_conf/chain/gochain.mk
new file mode 100644
index 0000000..eca804c
--- /dev/null
+++ b/makefile_conf/chain/gochain.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/6060'"
+DEFINES += CHAINID_UPCASE=\"GOCHAIN\" CHAINID_COINNAME=\"GO\" CHAIN_KIND=CHAIN_KIND_GOCHAIN CHAIN_ID=60
+APPNAME = "GoChain"
\ No newline at end of file
diff --git a/makefile_conf/chain/goerli.mk b/makefile_conf/chain/goerli.mk
new file mode 100644
index 0000000..fe6bd88
--- /dev/null
+++ b/makefile_conf/chain/goerli.mk
@@ -0,0 +1,14 @@
+APP_LOAD_PARAMS += --path "44'/60'"
+DEFINES += CHAINID_UPCASE=\"ETHEREUM\" CHAINID_COINNAME=\"ETH\" CHAIN_KIND=CHAIN_KIND_ETHEREUM CHAIN_ID=5
+# Starkware integration
+APP_LOAD_PARAMS += --path "2645'/579218131'"
+DEFINES += HAVE_STARKWARE
+# Keep for Starkware Goerli tests
+DEFINES += HAVE_TOKENS_EXTRA_LIST
+DEFINES += STARK_BIP32_PATH_0=0x80000A55 STARK_BIP32_PATH_1=0xA2862AD3
+# Allow to derive ETH 2 public keys
+APP_LOAD_PARAMS += --path "12381/3600" --curve bls12381g1
+DEFINES += HAVE_ETH2
+APPNAME = "Eth Goerli"
+DEFINES_LIB=
+APP_LOAD_FLAGS=--appFlags 0xa40
\ No newline at end of file
diff --git a/makefile_conf/chain/hpb.mk b/makefile_conf/chain/hpb.mk
new file mode 100644
index 0000000..475abf2
--- /dev/null
+++ b/makefile_conf/chain/hpb.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/269'"
+DEFINES += CHAINID_UPCASE=\"HPB\" CHAINID_COINNAME=\"HPB\" CHAIN_KIND=CHAIN_KIND_HPB CHAIN_ID=269
+APPNAME = "HPB"
\ No newline at end of file
diff --git a/makefile_conf/chain/kardiachain.mk b/makefile_conf/chain/kardiachain.mk
new file mode 100644
index 0000000..bff1af8
--- /dev/null
+++ b/makefile_conf/chain/kardiachain.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/60'"
+DEFINES += CHAINID_UPCASE=\"KARDIACHAIN\" CHAINID_COINNAME=\"KAI\" CHAIN_KIND=CHAIN_KIND_KARDIACHAIN CHAIN_ID=24
+APPNAME = "KardiaChain"
\ No newline at end of file
diff --git a/makefile_conf/chain/kusd.mk b/makefile_conf/chain/kusd.mk
new file mode 100644
index 0000000..38cf6cd
--- /dev/null
+++ b/makefile_conf/chain/kusd.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/91927009'"
+DEFINES += CHAINID_UPCASE=\"KUSD\" CHAINID_COINNAME=\"KUSD\" CHAIN_KIND=CHAIN_KIND_KUSD CHAIN_ID=1
+APPNAME = "kUSD"
\ No newline at end of file
diff --git a/makefile_conf/chain/mix.mk b/makefile_conf/chain/mix.mk
new file mode 100644
index 0000000..0c9264a
--- /dev/null
+++ b/makefile_conf/chain/mix.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/76'"
+DEFINES += CHAINID_UPCASE=\"MIX\" CHAINID_COINNAME=\"MIX\" CHAIN_KIND=CHAIN_KIND_MIX CHAIN_ID=76
+APPNAME = "Mix"
\ No newline at end of file
diff --git a/makefile_conf/chain/moonbeam.mk b/makefile_conf/chain/moonbeam.mk
new file mode 100644
index 0000000..c243367
--- /dev/null
+++ b/makefile_conf/chain/moonbeam.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/60'" --path "44'/1284'"
+DEFINES += CHAINID_UPCASE=\"MOONBEAM\" CHAINID_COINNAME=\"GLMR\" CHAIN_KIND=CHAIN_KIND_MOONBEAM CHAIN_ID=1284
+APPNAME = "Moonbeam"
\ No newline at end of file
diff --git a/makefile_conf/chain/moonriver.mk b/makefile_conf/chain/moonriver.mk
new file mode 100644
index 0000000..0234131
--- /dev/null
+++ b/makefile_conf/chain/moonriver.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/60'" --path "44'/1285'"
+DEFINES += CHAINID_UPCASE=\"MOONRIVER\" CHAINID_COINNAME=\"MOVR\" CHAIN_KIND=CHAIN_KIND_MOONRIVER CHAIN_ID=1285
+APPNAME = "Moonriver"
\ No newline at end of file
diff --git a/makefile_conf/chain/musicoin.mk b/makefile_conf/chain/musicoin.mk
new file mode 100644
index 0000000..46ede39
--- /dev/null
+++ b/makefile_conf/chain/musicoin.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/184'"
+DEFINES += CHAINID_UPCASE=\"MUSICOIN\" CHAINID_COINNAME=\"MUSIC\" CHAIN_KIND=CHAIN_KIND_MUSICOIN CHAIN_ID=7762959
+APPNAME = "Musicoin"
\ No newline at end of file
diff --git a/makefile_conf/chain/pirl.mk b/makefile_conf/chain/pirl.mk
new file mode 100644
index 0000000..e4a73e4
--- /dev/null
+++ b/makefile_conf/chain/pirl.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/164'"
+DEFINES += CHAINID_UPCASE=\"PIRL\" CHAINID_COINNAME=\"PIRL\" CHAIN_KIND=CHAIN_KIND_PIRL CHAIN_ID=3125659152
+APPNAME = "Pirl"
\ No newline at end of file
diff --git a/makefile_conf/chain/poa.mk b/makefile_conf/chain/poa.mk
new file mode 100644
index 0000000..6526b2b
--- /dev/null
+++ b/makefile_conf/chain/poa.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/60'"
+DEFINES += CHAINID_UPCASE=\"POA\" CHAINID_COINNAME=\"POA\" CHAIN_KIND=CHAIN_KIND_POA CHAIN_ID=99
+APPNAME = "POA"
\ No newline at end of file
diff --git a/makefile_conf/chain/polygon.mk b/makefile_conf/chain/polygon.mk
new file mode 100644
index 0000000..c6f6e0f
--- /dev/null
+++ b/makefile_conf/chain/polygon.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/60'"
+DEFINES += CHAINID_UPCASE=\"POLYGON\" CHAINID_COINNAME=\"MATIC\" CHAIN_KIND=CHAIN_KIND_POLYGON CHAIN_ID=137
+APPNAME = "Polygon"
\ No newline at end of file
diff --git a/makefile_conf/chain/reosc.mk b/makefile_conf/chain/reosc.mk
new file mode 100644
index 0000000..256d37f
--- /dev/null
+++ b/makefile_conf/chain/reosc.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/2894'"
+DEFINES += CHAINID_UPCASE=\"REOSC\" CHAINID_COINNAME=\"REOSC\" CHAIN_KIND=CHAIN_KIND_REOSC CHAIN_ID=2894
+APPNAME = "REOSC"
\ No newline at end of file
diff --git a/makefile_conf/chain/ropsten.mk b/makefile_conf/chain/ropsten.mk
new file mode 100644
index 0000000..384d18b
--- /dev/null
+++ b/makefile_conf/chain/ropsten.mk
@@ -0,0 +1,14 @@
+APP_LOAD_PARAMS += --path "44'/60'"
+DEFINES += CHAINID_UPCASE=\"ETHEREUM\" CHAINID_COINNAME=\"ETH\" CHAIN_KIND=CHAIN_KIND_ETHEREUM CHAIN_ID=3
+# Starkware integration
+APP_LOAD_PARAMS += --path "2645'/579218131'"
+DEFINES += HAVE_STARKWARE
+# Keep for Starkware Ropsten tests
+DEFINES += HAVE_TOKENS_EXTRA_LIST
+DEFINES += STARK_BIP32_PATH_0=0x80000A55 STARK_BIP32_PATH_1=0xA2862AD3
+# Allow to derive ETH 2 public keys
+APP_LOAD_PARAMS += --path "12381/3600" --curve bls12381g1
+DEFINES += HAVE_ETH2
+APPNAME = "Eth Ropsten"
+DEFINES_LIB=
+APP_LOAD_FLAGS=--appFlags 0xa40
\ No newline at end of file
diff --git a/makefile_conf/chain/rsk.mk b/makefile_conf/chain/rsk.mk
new file mode 100644
index 0000000..33df17b
--- /dev/null
+++ b/makefile_conf/chain/rsk.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/137'" --path "44'/00'"
+DEFINES += CHAINID_UPCASE=\"RSK\" CHAINID_COINNAME=\"RBTC\" CHAIN_KIND=CHAIN_KIND_RSK CHAIN_ID=30
+APPNAME = "RSK"
\ No newline at end of file
diff --git a/makefile_conf/chain/rsk_testnet.mk b/makefile_conf/chain/rsk_testnet.mk
new file mode 100644
index 0000000..76fe1ec
--- /dev/null
+++ b/makefile_conf/chain/rsk_testnet.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/37310'"
+DEFINES += CHAINID_UPCASE=\"RSKTESTNET\" CHAINID_COINNAME=\"RBTC\" CHAIN_KIND=CHAIN_KIND_RSK CHAIN_ID=31
+APPNAME = "RSK Test"
\ No newline at end of file
diff --git a/makefile_conf/chain/shyft.mk b/makefile_conf/chain/shyft.mk
new file mode 100644
index 0000000..c30ec7f
--- /dev/null
+++ b/makefile_conf/chain/shyft.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/60'"
+DEFINES += CHAINID_UPCASE=\"SHYFT\" CHAINID_COINNAME=\"SHFT\" CHAIN_KIND=CHAIN_KIND_SHYFT CHAIN_ID=7341
+APPNAME = "Shyft"
\ No newline at end of file
diff --git a/makefile_conf/chain/songbird.mk b/makefile_conf/chain/songbird.mk
new file mode 100644
index 0000000..c2c1e7b
--- /dev/null
+++ b/makefile_conf/chain/songbird.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/554'" --path "44'/60'"
+DEFINES += CHAINID_UPCASE=\"SONGBIRD\" CHAINID_COINNAME=\"SGB\" CHAIN_KIND=CHAIN_KIND_SONGBIRD CHAIN_ID=19
+APPNAME = "Songbird"
\ No newline at end of file
diff --git a/makefile_conf/chain/thundercore.mk b/makefile_conf/chain/thundercore.mk
new file mode 100644
index 0000000..7676978
--- /dev/null
+++ b/makefile_conf/chain/thundercore.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/1001'"
+DEFINES += CHAINID_UPCASE=\"THUNDERCORE\" CHAINID_COINNAME=\"TT\" CHAIN_KIND=CHAIN_KIND_THUNDERCORE CHAIN_ID=108
+APPNAME = "ThunderCore"
\ No newline at end of file
diff --git a/makefile_conf/chain/tobalaba.mk b/makefile_conf/chain/tobalaba.mk
new file mode 100644
index 0000000..92aa145
--- /dev/null
+++ b/makefile_conf/chain/tobalaba.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/401697'"
+DEFINES += CHAINID_UPCASE=\"TOBALABA\" CHAINID_COINNAME=\"TOBALABA\" CHAIN_KIND=CHAIN_KIND_TOBALABA CHAIN_ID=401697
+APPNAME = "Tobalaba"
\ No newline at end of file
diff --git a/makefile_conf/chain/tomochain.mk b/makefile_conf/chain/tomochain.mk
new file mode 100644
index 0000000..b0cb90c
--- /dev/null
+++ b/makefile_conf/chain/tomochain.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/889'"
+DEFINES += CHAINID_UPCASE=\"TOMOCHAIN\" CHAINID_COINNAME=\"TOMO\" CHAIN_KIND=CHAIN_KIND_TOMOCHAIN CHAIN_ID=88
+APPNAME = "TomoChain"
\ No newline at end of file
diff --git a/makefile_conf/chain/ubiq.mk b/makefile_conf/chain/ubiq.mk
new file mode 100644
index 0000000..fe86d7f
--- /dev/null
+++ b/makefile_conf/chain/ubiq.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/108'"
+DEFINES += CHAINID_UPCASE=\"UBIQ\" CHAINID_COINNAME=\"UBQ\" CHAIN_KIND=CHAIN_KIND_UBIQ CHAIN_ID=8
+APPNAME = "Ubiq"
\ No newline at end of file
diff --git a/makefile_conf/chain/volta.mk b/makefile_conf/chain/volta.mk
new file mode 100644
index 0000000..e30ca2d
--- /dev/null
+++ b/makefile_conf/chain/volta.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/73799'" --path "44'/60'"
+DEFINES += CHAINID_UPCASE=\"VOLTA\" CHAINID_COINNAME=\"VOLTA\" CHAIN_KIND=CHAIN_KIND_VOLTA CHAIN_ID=73799
+APPNAME = "Volta"
\ No newline at end of file
diff --git a/makefile_conf/chain/wanchain.mk b/makefile_conf/chain/wanchain.mk
new file mode 100644
index 0000000..4407e93
--- /dev/null
+++ b/makefile_conf/chain/wanchain.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/5718350'"
+DEFINES += CHAINID_UPCASE=\"WAN\" CHAINID_COINNAME=\"WAN\" CHAIN_KIND=CHAIN_KIND_WANCHAIN CHAIN_ID=1
+APPNAME = "Wanchain"
\ No newline at end of file
diff --git a/makefile_conf/chain/webchain.mk b/makefile_conf/chain/webchain.mk
new file mode 100644
index 0000000..f81d5b8
--- /dev/null
+++ b/makefile_conf/chain/webchain.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/227'"
+DEFINES += CHAINID_UPCASE=\"WEBCHAIN\" CHAINID_COINNAME=\"WEB\" CHAIN_KIND=CHAIN_KIND_WEBCHAIN CHAIN_ID=24484
+APPNAME = "Webchain"
\ No newline at end of file
diff --git a/makefile_conf/chain/wethio.mk b/makefile_conf/chain/wethio.mk
new file mode 100644
index 0000000..06fe6f9
--- /dev/null
+++ b/makefile_conf/chain/wethio.mk
@@ -0,0 +1,3 @@
+APP_LOAD_PARAMS += --path "44'/77777'"
+DEFINES += CHAINID_UPCASE=\"WETHIO\" CHAINID_COINNAME=\"ZYN\" CHAIN_KIND=CHAIN_KIND_WETHIO CHAIN_ID=78
+APPNAME = "Wethio"
\ No newline at end of file
diff --git a/src/apdu_constants.h b/src/apdu_constants.h
index f0c149b..9ef49d9 100644
--- a/src/apdu_constants.h
+++ b/src/apdu_constants.h
@@ -1,3 +1,6 @@
+#ifndef _APDU_CONSTANTS_H_
+#define _APDU_CONSTANTS_H_
+
#include "shared_context.h"
#define APP_FLAG_DATA_ALLOWED 0x01
@@ -17,6 +20,7 @@
#define INS_SET_EXTERNAL_PLUGIN 0x12
#define INS_PROVIDE_NFT_INFORMATION 0x14
#define INS_SET_PLUGIN 0x16
+#define INS_PERFORM_PRIVACY_OPERATION 0x18
#define P1_CONFIRM 0x01
#define P1_NON_CONFIRM 0x00
#define P2_NO_CHAINCODE 0x00
@@ -111,6 +115,13 @@ void handleSetPlugin(uint8_t p1,
unsigned int *flags,
unsigned int *tx);
+void handlePerformPrivacyOperation(uint8_t p1,
+ uint8_t p2,
+ uint8_t *workBuffer,
+ uint16_t dataLength,
+ unsigned int *flags,
+ unsigned int *tx);
+
#ifdef HAVE_ETH2
void handleGetEth2PublicKey(uint8_t p1,
@@ -156,3 +167,5 @@ void handleStarkwareUnsafeSign(uint8_t p1,
unsigned int *tx);
#endif
+
+#endif // _APDU_CONSTANTS_H_
diff --git a/src/chainConfig.h b/src/chainConfig.h
index 733a1a6..91aabe0 100644
--- a/src/chainConfig.h
+++ b/src/chainConfig.h
@@ -58,7 +58,12 @@ typedef enum chain_kind_e {
CHAIN_KIND_BSC,
CHAIN_KIND_SONGBIRD,
CHAIN_KIND_POLYGON,
- CHAIN_KIND_SHYFT
+ CHAIN_KIND_SHYFT,
+ CHAIN_KIND_CONFLUX_ESPACE,
+ CHAIN_KIND_MOONBEAM,
+ CHAIN_KIND_BTTC,
+ CHAIN_KIND_KARDIACHAIN,
+ CHAIN_KIND_WETHIO
} chain_kind_t;
typedef struct chain_config_s {
@@ -69,4 +74,4 @@ typedef struct chain_config_s {
#define ETHEREUM_MAINNET_CHAINID 1
-#endif /* _CHAIN_CONFIG_H_ */
+#endif // _CHAIN_CONFIG_H_
diff --git a/src/eth_plugin_handler.c b/src/eth_plugin_handler.c
index b82c6a5..f1944ef 100644
--- a/src/eth_plugin_handler.c
+++ b/src/eth_plugin_handler.c
@@ -3,6 +3,7 @@
#include "eth_plugin_internal.h"
#include "shared_context.h"
#include "network.h"
+#include "ethUtils.h"
void eth_plugin_prepare_init(ethPluginInitContract_t *init, uint8_t *selector, uint32_t dataSize) {
memset((uint8_t *) init, 0, sizeof(ethPluginInitContract_t));
@@ -47,14 +48,14 @@ void eth_plugin_prepare_query_contract_UI(ethQueryContractUI_t *queryContractUI,
memset((uint8_t *) queryContractUI, 0, sizeof(ethQueryContractUI_t));
// If no extra information was found, set the pointer to NULL
- if (allzeroes(&tmpCtx.transactionContext.extraInfo[1], sizeof(union extraInfo_t))) {
+ if (NO_EXTRA_INFO(tmpCtx, 1)) {
queryContractUI->item1 = NULL;
} else {
queryContractUI->item1 = &tmpCtx.transactionContext.extraInfo[1];
}
// If no extra information was found, set the pointer to NULL
- if (allzeroes(&tmpCtx.transactionContext.extraInfo[0], sizeof(union extraInfo_t))) {
+ if (NO_EXTRA_INFO(tmpCtx, 0)) {
queryContractUI->item2 = NULL;
} else {
queryContractUI->item2 = &tmpCtx.transactionContext.extraInfo[0];
@@ -110,7 +111,7 @@ static bool eth_plugin_perform_init_old_internal(uint8_t *contractAddress,
j++) {
if (memcmp(init->selector, (const void *) PIC(selectors[j]), SELECTOR_SIZE) == 0) {
if ((INTERNAL_ETH_PLUGINS[i].availableCheck == NULL) ||
- ((PluginAvailableCheck) PIC(INTERNAL_ETH_PLUGINS[i].availableCheck))()) {
+ ((PluginAvailableCheck) PIC(INTERNAL_ETH_PLUGINS[i].availableCheck)) ()) {
strlcpy(dataContext.tokenContext.pluginName,
INTERNAL_ETH_PLUGINS[i].alias,
PLUGIN_ID_LENGTH);
diff --git a/src/eth_plugin_handler.h b/src/eth_plugin_handler.h
index 864c15c..ba6ffee 100644
--- a/src/eth_plugin_handler.h
+++ b/src/eth_plugin_handler.h
@@ -1,7 +1,11 @@
-#ifndef __ETH_PLUGIN_HANDLER_H__
+#ifndef _ETH_PLUGIN_HANDLER_H_
+#define _ETH_PLUGIN_HANDLER_H_
#include "eth_plugin_interface.h"
+#define NO_EXTRA_INFO(ctx, idx) \
+ (allzeroes(&(ctx.transactionContext.extraInfo[idx]), sizeof(extraInfo_t)))
+
void eth_plugin_prepare_init(ethPluginInitContract_t *init, uint8_t *selector, uint32_t dataSize);
void eth_plugin_prepare_provide_parameter(ethPluginProvideParameter_t *provideParameter,
uint8_t *parameter,
@@ -27,4 +31,4 @@ eth_plugin_result_t eth_plugin_call(int method, void *parameter);
void plugin_ui_start(void);
-#endif
+#endif // _ETH_PLUGIN_HANDLER_H_
diff --git a/src/eth_plugin_interface.h b/src/eth_plugin_interface.h
index 512716e..48c6e67 100644
--- a/src/eth_plugin_interface.h
+++ b/src/eth_plugin_interface.h
@@ -1,6 +1,5 @@
-#ifndef __ETH_PLUGIN_INTERFACE_H__
-
-#define __ETH_PLUGIN_INTERFACE_H__
+#ifndef _ETH_PLUGIN_INTERFACE_H_
+#define _ETH_PLUGIN_INTERFACE_H_
#include "os.h"
#include "cx.h"
@@ -13,7 +12,8 @@ typedef enum {
ETH_PLUGIN_INTERFACE_VERSION_1 = 1,
ETH_PLUGIN_INTERFACE_VERSION_2 = 2,
ETH_PLUGIN_INTERFACE_VERSION_3 = 3,
- ETH_PLUGIN_INTERFACE_VERSION_LATEST = 4,
+ ETH_PLUGIN_INTERFACE_VERSION_4 = 4,
+ ETH_PLUGIN_INTERFACE_VERSION_LATEST = 5,
} eth_plugin_interface_version_t;
typedef enum {
@@ -76,7 +76,7 @@ typedef struct ethPluginInitContract_t {
ethPluginSharedRO_t *pluginSharedRO;
uint8_t *pluginContext;
size_t pluginContextLength;
- uint8_t *selector; // 4 bytes selector
+ const uint8_t *selector; // 4 bytes selector
size_t dataSize;
char *alias; // 29 bytes alias if ETH_PLUGIN_RESULT_OK_ALIAS set
@@ -89,7 +89,7 @@ typedef struct ethPluginProvideParameter_t {
ethPluginSharedRW_t *pluginSharedRW;
ethPluginSharedRO_t *pluginSharedRO;
uint8_t *pluginContext;
- uint8_t *parameter; // 32 bytes parameter
+ const uint8_t *parameter; // 32 bytes parameter
uint32_t parameterOffset;
uint8_t result;
@@ -106,9 +106,9 @@ typedef struct ethPluginFinalize_t {
uint8_t *tokenLookup1; // set by the plugin if a token should be looked up
uint8_t *tokenLookup2;
- uint8_t *amount; // set an uint256 pointer if uiType is UI_AMOUNT_ADDRESS
- uint8_t *address; // set to the destination address if uiType is UI_AMOUNT_ADDRESS. Set to the
- // user's address if uiType is UI_TYPE_GENERIC
+ const uint8_t *amount; // set an uint256 pointer if uiType is UI_AMOUNT_ADDRESS
+ const uint8_t *address; // set to the destination address if uiType is UI_AMOUNT_ADDRESS. Set
+ // to the user's address if uiType is UI_TYPE_GENERIC
uint8_t uiType;
uint8_t numScreens; // ignored if uiType is UI_AMOUNT_ADDRESS
@@ -179,4 +179,4 @@ typedef struct ethQueryContractUI_t {
} ethQueryContractUI_t;
-#endif
+#endif // _ETH_PLUGIN_INTERFACE_H_
diff --git a/src/eth_plugin_internal.c b/src/eth_plugin_internal.c
index a4789f1..0e28ca6 100644
--- a/src/eth_plugin_internal.c
+++ b/src/eth_plugin_internal.c
@@ -1,3 +1,4 @@
+#include
#include "eth_plugin_internal.h"
bool erc20_plugin_available_check(void);
@@ -5,12 +6,12 @@ bool erc20_plugin_available_check(void);
void erc20_plugin_call(int message, void* parameters);
void compound_plugin_call(int message, void* parameters);
-void copy_address(uint8_t* dst, uint8_t* parameter, uint8_t dst_size) {
+void copy_address(uint8_t* dst, const uint8_t* parameter, uint8_t dst_size) {
uint8_t copy_size = MIN(dst_size, ADDRESS_LENGTH);
memmove(dst, parameter + PARAMETER_LENGTH - copy_size, copy_size);
}
-void copy_parameter(uint8_t* dst, uint8_t* parameter, uint8_t dst_size) {
+void copy_parameter(uint8_t* dst, const uint8_t* parameter, uint8_t dst_size) {
uint8_t copy_size = MIN(dst_size, PARAMETER_LENGTH);
memmove(dst, parameter, copy_size);
}
diff --git a/src/eth_plugin_internal.h b/src/eth_plugin_internal.h
index 4f10ec5..4d26130 100644
--- a/src/eth_plugin_internal.h
+++ b/src/eth_plugin_internal.h
@@ -1,14 +1,17 @@
-#ifndef __ETH_PLUGIN_INTERNAL_H__
+#ifndef _ETH_PLUGIN_INTERNAL_H_
+#define _ETH_PLUGIN_INTERNAL_H_
+#include
+#include
#include "eth_plugin_interface.h"
#define SELECTOR_SIZE 4
#define PARAMETER_LENGTH 32
#define RUN_APPLICATION 1
-void copy_address(uint8_t* dst, uint8_t* parameter, uint8_t dst_size);
+void copy_address(uint8_t* dst, const uint8_t* parameter, uint8_t dst_size);
-void copy_parameter(uint8_t* dst, uint8_t* parameter, uint8_t dst_size);
+void copy_parameter(uint8_t* dst, const uint8_t* parameter, uint8_t dst_size);
void erc721_plugin_call(int message, void* parameters);
void erc1155_plugin_call(int message, void* parameters);
@@ -45,4 +48,4 @@ extern const uint8_t* const STARKWARE_SELECTORS[NUM_STARKWARE_SELECTORS];
extern internalEthPlugin_t const INTERNAL_ETH_PLUGINS[];
-#endif
+#endif // _ETH_PLUGIN_INTERNAL_H_
diff --git a/src/handle_check_address.c b/src/handle_check_address.c
index 48b6b94..274582a 100644
--- a/src/handle_check_address.c
+++ b/src/handle_check_address.c
@@ -6,11 +6,6 @@
#define ZERO(x) memset(&x, 0, sizeof(x))
-static int os_strcmp(const char* s1, const char* s2) {
- size_t size = strlen(s1) + 1;
- return memcmp(s1, s2, size);
-}
-
int handle_check_address(check_address_parameters_t* params, chain_config_t* chain_config) {
PRINTF("Params on the address %d\n", (unsigned int) params);
PRINTF("Address to check %s\n", params->address_to_check);
@@ -69,7 +64,7 @@ int handle_check_address(check_address_parameters_t* params, chain_config_t* cha
offset_0x = 2;
}
- if (os_strcmp(locals_union1.address, params->address_to_check + offset_0x) != 0) {
+ if (strcmp(locals_union1.address, params->address_to_check + offset_0x) != 0) {
PRINTF("Addresses don't match\n");
return 0;
}
diff --git a/src/handle_get_printable_amount.c b/src/handle_get_printable_amount.c
index 689b62e..13acc28 100644
--- a/src/handle_get_printable_amount.c
+++ b/src/handle_get_printable_amount.c
@@ -15,13 +15,6 @@ int handle_get_printable_amount(get_printable_amount_parameters_t* params, chain
PRINTF("Amount is too big, 32 bytes max but buffer has %u bytes", params->amount_length);
return 0;
}
- if (!parse_swap_config(params->coin_configuration,
- params->coin_configuration_length,
- ticker,
- &decimals)) {
- PRINTF("Error while parsing config\n");
- return 0;
- }
// If the amount is a fee, its value is nominated in ETH even if we're doing an ERC20 swap
if (params->is_fee) {
@@ -30,6 +23,15 @@ int handle_get_printable_amount(get_printable_amount_parameters_t* params, chain
ticker[ticker_len] = ' ';
ticker[ticker_len + 1] = '\0';
decimals = WEI_TO_ETHER;
+ } else {
+ // If the amount is *not* a fee, decimals and ticker are built from the given config
+ if (!parse_swap_config(params->coin_configuration,
+ params->coin_configuration_length,
+ ticker,
+ &decimals)) {
+ PRINTF("Error while parsing config\n");
+ return 0;
+ }
}
amountToString(params->amount,
diff --git a/src/handle_swap_sign_transaction.c b/src/handle_swap_sign_transaction.c
index d610e9e..75e4d3a 100644
--- a/src/handle_swap_sign_transaction.c
+++ b/src/handle_swap_sign_transaction.c
@@ -1,6 +1,6 @@
-#include "handle_swap_sign_transaction.h"
-#include "usbd_core.h"
+#include "os_io_seproxyhal.h"
#include "ux.h"
+#include "handle_swap_sign_transaction.h"
#include "shared_context.h"
#include "utils.h"
@@ -79,4 +79,4 @@ void handle_swap_sign_transaction(chain_config_t* config) {
BLE_power(1, "Nano X");
#endif // HAVE_BLE
app_main();
-}
\ No newline at end of file
+}
diff --git a/src/main.c b/src/main.c
index a06bac0..0cd2025 100644
--- a/src/main.c
+++ b/src/main.c
@@ -269,6 +269,21 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) {
case CHAIN_KIND_SHYFT:
numTokens = NUM_TOKENS_SHYFT;
break;
+ case CHAIN_KIND_CONFLUX_ESPACE:
+ numTokens = NUM_TOKENS_CONFLUX_ESPACE;
+ break;
+ case CHAIN_KIND_MOONBEAM:
+ numTokens = NUM_TOKENS_MOONBEAM;
+ break;
+ case CHAIN_KIND_KARDIACHAIN:
+ numTokens = NUM_TOKENS_KARDIACHAIN;
+ break;
+ case CHAIN_KIND_BTTC:
+ numTokens = NUM_TOKENS_BTTC;
+ break;
+ case CHAIN_KIND_WETHIO:
+ numTokens = NUM_TOKENS_WETHIO;
+ break;
}
for (i = 0; i < numTokens; i++) {
switch (chainConfig->kind) {
@@ -380,13 +395,29 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) {
case CHAIN_KIND_SHYFT:
currentToken = (tokenDefinition_t *) PIC(&TOKENS_SHYFT[i]);
break;
+ case CHAIN_KIND_CONFLUX_ESPACE:
+ currentToken = (tokenDefinition_t *) PIC(&TOKENS_CONFLUX_ESPACE[i]);
+ break;
+ case CHAIN_KIND_MOONBEAM:
+ currentToken = (tokenDefinition_t *) PIC(&TOKENS_MOONBEAM[i]);
+ break;
+ case CHAIN_KIND_BTTC:
+ currentToken = (tokenDefinition_t *) PIC(&TOKENS_BTTC[i]);
+ break;
+ case CHAIN_KIND_KARDIACHAIN:
+ currentToken = (tokenDefinition_t *) PIC(&TOKENS_KARDIACHAIN[i]);
+ break;
+ case CHAIN_KIND_WETHIO:
+ currentToken = (tokenDefinition_t *) PIC(&TOKENS_WETHIO[i]);
+ break;
}
if (memcmp(currentToken->address, tmpContent.txContent.destination, ADDRESS_LENGTH) == 0) {
return currentToken;
}
}
#endif
- //
+ // Works for ERC-20 & NFT tokens since both structs in the union have the
+ // contract address aligned
for (uint8_t i = 0; i < MAX_ITEMS; i++) {
currentItem = (union extraInfo_t *) &tmpCtx.transactionContext.extraInfo[i].token;
if (tmpCtx.transactionContext.tokenSet[i] &&
@@ -396,15 +427,6 @@ extraInfo_t *getKnownToken(uint8_t *contractAddress) {
}
}
- for (uint8_t i = 0; i < MAX_ITEMS; i++) {
- currentItem = (union extraInfo_t *) &tmpCtx.transactionContext.extraInfo[i].token;
- if (tmpCtx.transactionContext.tokenSet[i] &&
- (memcmp(currentItem->nft.contractAddress, contractAddress, ADDRESS_LENGTH) == 0)) {
- PRINTF("Token found at index %d\n", i);
- return currentItem;
- }
- }
-
return NULL;
}
@@ -548,6 +570,15 @@ void handleApdu(unsigned int *flags, unsigned int *tx) {
tx);
break;
+ case INS_PERFORM_PRIVACY_OPERATION:
+ handlePerformPrivacyOperation(G_io_apdu_buffer[OFFSET_P1],
+ G_io_apdu_buffer[OFFSET_P2],
+ G_io_apdu_buffer + OFFSET_CDATA,
+ G_io_apdu_buffer[OFFSET_LC],
+ flags,
+ tx);
+ break;
+
case INS_SIGN:
handleSign(G_io_apdu_buffer[OFFSET_P1],
G_io_apdu_buffer[OFFSET_P2],
diff --git a/src/nft.h b/src/nft.h
index f6b2d67..43ee5d1 100644
--- a/src/nft.h
+++ b/src/nft.h
@@ -1,14 +1,14 @@
-#include "tokens.h"
+#ifndef _NFT_H_
+#define _NFT_H_
-// An `nftInfo_t` must be the same size as a `tokenDefinition_t`. This is because both will be held
-// in a `extraInfo_t` which is a union of a `nftInfo_t` and a `tokenDefinition_t`. By having both
-// struct the same size, we know they will be aligned, which facilitates accessing the items.
+#include
-// We defined the collection name max length to be the size of a `tokenDefinition_t` and remove the
-// `ADDRESS_LENGTH` which corresponds to `sizeof(contractAddress`).
-#define COLLECTION_NAME_MAX_LEN sizeof(tokenDefinition_t) - ADDRESS_LENGTH
+#define COLLECTION_NAME_MAX_LEN 70
+#define NO_NFT_METADATA (NO_EXTRA_INFO(tmpCtx, 1))
typedef struct nftInfo_t {
- char collectionName[COLLECTION_NAME_MAX_LEN];
- char contractAddress[ADDRESS_LENGTH];
-} nftInfo_t;
\ No newline at end of file
+ uint8_t contractAddress[ADDRESS_LENGTH]; // must be first item
+ char collectionName[COLLECTION_NAME_MAX_LEN + 1];
+} nftInfo_t;
+
+#endif // _NFT_H_
diff --git a/src/poorstream.h b/src/poorstream.h
index 7890687..6ac17a5 100644
--- a/src/poorstream.h
+++ b/src/poorstream.h
@@ -1,5 +1,5 @@
-#ifndef __POORSTREAM_H__
-#define __POORSTREAM_H__
+#ifndef _POORSTREAM_H_
+#define _POORSTREAM_H_
#include
#include
@@ -18,4 +18,4 @@ void poorstream_init(poorstream_t *stream, uint8_t *buffer);
void poorstream_flush(poorstream_t *stream);
void poorstream_write_bits(poorstream_t *stream, uint64_t bits, uint32_t num_bits);
-#endif
+#endif // _POORSTREAM_H_
diff --git a/src/shared_context.h b/src/shared_context.h
index 035f7c2..12b21f5 100644
--- a/src/shared_context.h
+++ b/src/shared_context.h
@@ -1,17 +1,9 @@
-#ifndef __SHARED_CONTEXT_H__
-
-#define __SHARED_CONTEXT_H__
+#ifndef _SHARED_CONTEXT_H_
+#define _SHARED_CONTEXT_H_
#include
#include
-#include
-
-#include "os.h"
-#include "cx.h"
-#include "os_io_seproxyhal.h"
#include "ethUstream.h"
-#include "ethUtils.h"
-#include "uint256.h"
#include "tokens.h"
#include "chainConfig.h"
#include "nft.h"
@@ -222,4 +214,4 @@ extern uint32_t eth2WithdrawalIndex;
void reset_app_context(void);
-#endif // __SHARED_CONTEXT_H__
+#endif // _SHARED_CONTEXT_H_
diff --git a/src/stark_crypto.c b/src/stark_crypto.c
index 990216a..8f33a01 100644
--- a/src/stark_crypto.c
+++ b/src/stark_crypto.c
@@ -4,6 +4,7 @@
#include "stark_utils.h"
#include "ui_callbacks.h"
#include "utils.h"
+#include "ethUtils.h"
static unsigned char const C_cx_Stark256_n[] = {
// n: 0x0800000000000010ffffffffffffffffb781126dcae7b2321e66a241adc64d2f
@@ -16,13 +17,13 @@ static unsigned char const STARK_DERIVE_BIAS[] = {
0x38, 0xa1, 0x3b, 0x4b, 0x92, 0x0e, 0x94, 0x11, 0xae, 0x6d, 0xa5, 0xf4, 0x0b, 0x03, 0x58, 0xb1};
void starkDerivePrivateKey(uint32_t *bip32Path, uint32_t bip32PathLength, uint8_t *privateKeyData) {
-#if 0
- // Sanity check
+#if 0
+ // Sanity check
if (bip32Path[0] != STARK_BIP32_PATH_0) {
PRINTF("Invalid Stark derivation path %d\n", bip32Path[0]);
THROW(0x6a80);
}
- os_perso_derive_node_bip32(CX_CURVE_256K1, bip32Path, bip32PathLength, privateKeyData, NULL);
+ os_perso_derive_node_bip32(CX_CURVE_256K1, bip32Path, bip32PathLength, privateKeyData, NULL);
PRINTF("Private key before processing %.*H\n", 32, privateKeyData);
// TODO - support additional schemes
cx_math_modm(privateKeyData, 32, C_cx_Stark256_n, 32);
diff --git a/src/stark_crypto.h b/src/stark_crypto.h
index 635cb79..5ce1be3 100644
--- a/src/stark_crypto.h
+++ b/src/stark_crypto.h
@@ -1,5 +1,5 @@
-#ifndef __STARK_CRYPTO_H__
-#define __STARK_CRYPTO_H__
+#ifndef _STARK_CRYPTO_H_
+#define _STARK_CRYPTO_H_
#include
#include
@@ -18,4 +18,4 @@ void pedersen(FieldElement res, /* out */
FieldElement a,
FieldElement b);
-#endif
+#endif // _STARK_CRYPTO_H_
diff --git a/src/stark_utils.h b/src/stark_utils.h
index aaf9d17..9ba69a2 100644
--- a/src/stark_utils.h
+++ b/src/stark_utils.h
@@ -1,5 +1,5 @@
-#ifndef __STARK_UTILS_H__
-#define __STARK_UTILS_H__
+#ifndef _STARK_UTILS_H_
+#define _STARK_UTILS_H_
#include
#include
@@ -32,4 +32,4 @@ int stark_sign(uint8_t *signature, /* out */
FieldElement msg,
FieldElement condition);
-#endif
+#endif // _STARK_UTILS_H_
diff --git a/src/swap_lib_calls.h b/src/swap_lib_calls.h
index c041964..937d610 100644
--- a/src/swap_lib_calls.h
+++ b/src/swap_lib_calls.h
@@ -1,5 +1,5 @@
-#ifndef SWAP_LIB_CALLS
-#define SWAP_LIB_CALLS
+#ifndef _SWAP_LIB_CALLS_H_
+#define _SWAP_LIB_CALLS_H_
#include "stdbool.h"
@@ -50,4 +50,4 @@ typedef struct create_transaction_parameters_s {
char* destination_address_extra_id;
} create_transaction_parameters_t;
-#endif
+#endif // _SWAP_LIB_CALLS_H_
diff --git a/src/tokens.c b/src/tokens.c
index e1ddb5f..0347ec4 100644
--- a/src/tokens.c
+++ b/src/tokens.c
@@ -194,4 +194,14 @@ const tokenDefinition_t const TOKENS_POLYGON[NUM_TOKENS_POLYGON] = {};
const tokenDefinition_t const TOKENS_SHYFT[NUM_TOKENS_SHYFT] = {};
+const tokenDefinition_t const TOKENS_CONFLUX_ESPACE[NUM_TOKENS_CONFLUX_ESPACE] = {};
+
+const tokenDefinition_t const TOKENS_MOONBEAM[NUM_TOKENS_MOONBEAM] = {};
+
+const tokenDefinition_t const TOKENS_BTTC[NUM_TOKENS_BTTC] = {};
+
+const tokenDefinition_t const TOKENS_KARDIACHAIN[NUM_TOKENS_KARDIACHAIN] = {};
+
+const tokenDefinition_t const TOKENS_WETHIO[NUM_TOKENS_WETHIO] = {};
+
#endif
diff --git a/src/tokens.h b/src/tokens.h
index 4391d67..eb4a14e 100644
--- a/src/tokens.h
+++ b/src/tokens.h
@@ -25,14 +25,11 @@
#define MAX_ITEMS 2
typedef struct tokenDefinition_t {
+ uint8_t address[ADDRESS_LENGTH]; // must be first item
#ifdef HAVE_CONTRACT_NAME_IN_DESCRIPTOR
uint8_t contractName[ADDRESS_LENGTH];
#endif
- uint8_t address[ADDRESS_LENGTH];
char ticker[MAX_TICKER_LEN];
- char nft_pad[20]; // Adding some padding because the `nftInfo_t` is based on the size of a
- // `tokenDefinition_t`. By adding some padding here we give more space to the
- // collection name in the `nftInfo_t`. See `nftInfo_t` for more information.
uint8_t decimals;
} tokenDefinition_t;
@@ -46,25 +43,23 @@ extern tokenDefinition_t const TOKENS_EXTRA[NUM_TOKENS_EXTRA];
#ifndef HAVE_TOKENS_LIST
+static const uint8_t LEDGER_SIGNATURE_PUBLIC_KEY[] = {
#ifndef LEDGER_TEST_PUBLIC_KEY
-static const uint8_t LEDGER_SIGNATURE_PUBLIC_KEY[] = {
// production key 2019-01-11 03:07PM (erc20signer)
- 0x04, 0x5e, 0x6c, 0x10, 0x20, 0xc1, 0x4d, 0xc4, 0x64, 0x42, 0xfe, 0x89, 0xf9,
- 0x7c, 0x0b, 0x68, 0xcd, 0xb1, 0x59, 0x76, 0xdc, 0x24, 0xf2, 0x4c, 0x31, 0x6e,
- 0x7b, 0x30, 0xfe, 0x4e, 0x8c, 0xc7, 0x6b, 0x14, 0x89, 0x15, 0x0c, 0x21, 0x51,
- 0x4e, 0xbf, 0x44, 0x0f, 0xf5, 0xde, 0xa5, 0x39, 0x3d, 0x83, 0xde, 0x53, 0x58,
- 0xcd, 0x09, 0x8f, 0xce, 0x8f, 0xd0, 0xf8, 0x1d, 0xaa, 0x94, 0x97, 0x91, 0x83};
-
+ 0x04, 0x5e, 0x6c, 0x10, 0x20, 0xc1, 0x4d, 0xc4, 0x64, 0x42, 0xfe, 0x89, 0xf9, 0x7c,
+ 0x0b, 0x68, 0xcd, 0xb1, 0x59, 0x76, 0xdc, 0x24, 0xf2, 0x4c, 0x31, 0x6e, 0x7b, 0x30,
+ 0xfe, 0x4e, 0x8c, 0xc7, 0x6b, 0x14, 0x89, 0x15, 0x0c, 0x21, 0x51, 0x4e, 0xbf, 0x44,
+ 0x0f, 0xf5, 0xde, 0xa5, 0x39, 0x3d, 0x83, 0xde, 0x53, 0x58, 0xcd, 0x09, 0x8f, 0xce,
+ 0x8f, 0xd0, 0xf8, 0x1d, 0xaa, 0x94, 0x97, 0x91, 0x83
#else
-static const uint8_t LEDGER_SIGNATURE_PUBLIC_KEY[] = {
// test key 2019-01-11 03:07PM (erc20signer)
- 0x04, 0x20, 0xda, 0x62, 0x00, 0x3c, 0x0c, 0xe0, 0x97, 0xe3, 0x36, 0x44, 0xa1,
- 0x0f, 0xe4, 0xc3, 0x04, 0x54, 0x06, 0x9a, 0x44, 0x54, 0xf0, 0xfa, 0x9d, 0x4e,
- 0x84, 0xf4, 0x50, 0x91, 0x42, 0x9b, 0x52, 0x20, 0xaf, 0x9e, 0x35, 0xc0, 0xb2,
- 0xd9, 0x28, 0x93, 0x80, 0x13, 0x73, 0x07, 0xde, 0x4d, 0xd1, 0xd4, 0x18, 0x42,
- 0x8c, 0xf2, 0x1a, 0x93, 0xb3, 0x35, 0x61, 0xbb, 0x09, 0xd8, 0x8f, 0xe5, 0x79,
-};
+ 0x04, 0x20, 0xda, 0x62, 0x00, 0x3c, 0x0c, 0xe0, 0x97, 0xe3, 0x36, 0x44, 0xa1, 0x0f,
+ 0xe4, 0xc3, 0x04, 0x54, 0x06, 0x9a, 0x44, 0x54, 0xf0, 0xfa, 0x9d, 0x4e, 0x84, 0xf4,
+ 0x50, 0x91, 0x42, 0x9b, 0x52, 0x20, 0xaf, 0x9e, 0x35, 0xc0, 0xb2, 0xd9, 0x28, 0x93,
+ 0x80, 0x13, 0x73, 0x07, 0xde, 0x4d, 0xd1, 0xd4, 0x18, 0x42, 0x8c, 0xf2, 0x1a, 0x93,
+ 0xb3, 0x35, 0x61, 0xbb, 0x09, 0xd8, 0x8f, 0xe5, 0x79
#endif
+};
#else
@@ -106,6 +101,11 @@ static const uint8_t LEDGER_SIGNATURE_PUBLIC_KEY[] = {
#define NUM_TOKENS_MOONRIVER 0
#define NUM_TOKENS_POLYGON 0
#define NUM_TOKENS_SHYFT 0
+#define NUM_TOKENS_CONFLUX_ESPACE 0
+#define NUM_TOKENS_MOONBEAM 0
+#define NUM_TOKENS_BTTC 0
+#define NUM_TOKENS_KARDIACHAIN 0
+#define NUM_TOKENS_WETHIO 0
extern tokenDefinition_t const TOKENS_AKROMA[NUM_TOKENS_AKROMA];
extern tokenDefinition_t const TOKENS_ELLAISM[NUM_TOKENS_ELLAISM];
@@ -143,7 +143,12 @@ extern tokenDefinition_t const TOKENS_SONGBIRD[NUM_TOKENS_SONGBIRD];
extern tokenDefinition_t const TOKENS_MOONRIVER[NUM_TOKENS_MOONRIVER];
extern tokenDefinition_t const TOKENS_POLYGON[NUM_TOKENS_POLYGON];
extern tokenDefinition_t const TOKENS_SHYFT[NUM_TOKENS_SHYFT];
+extern tokenDefinition_t const TOKENS_CONFLUX_ESPACE[NUM_TOKENS_CONFLUX_ESPACE];
+extern tokenDefinition_t const TOKENS_MOONBEAM[NUM_TOKENS_MOONBEAM];
+extern tokenDefinition_t const TOKENS_BTTC[NUM_TOKENS_BTTC];
+extern tokenDefinition_t const TOKENS_KARDIACHAIN[NUM_TOKENS_KARDIACHAIN];
+extern tokenDefinition_t const TOKENS_WETHIO[NUM_TOKENS_WETHIO];
#endif /* HAVE_TOKENS_LIST */
-#endif /* _TOKENS_H_ */
+#endif // _TOKENS_H_
diff --git a/src/ui_callbacks.h b/src/ui_callbacks.h
index e7e78ab..2d7ff98 100644
--- a/src/ui_callbacks.h
+++ b/src/ui_callbacks.h
@@ -1,3 +1,6 @@
+#ifndef _UI_CALLBACKS_H_
+#define _UI_CALLBACKS_H_
+
#include "shared_context.h"
#include "ux.h"
@@ -14,6 +17,8 @@ unsigned int io_seproxyhal_touch_data_cancel(const bagl_element_t *e);
unsigned int io_seproxyhal_touch_signMessage712_v0_ok(const bagl_element_t *e);
unsigned int io_seproxyhal_touch_signMessage712_v0_cancel(const bagl_element_t *e);
unsigned int io_seproxyhal_touch_eth2_address_ok(const bagl_element_t *e);
+unsigned int io_seproxyhal_touch_privacy_ok(const bagl_element_t *e);
+unsigned int io_seproxyhal_touch_privacy_cancel(const bagl_element_t *e);
void ui_idle(void);
void ui_warning_contract_data(void);
@@ -22,3 +27,5 @@ void io_seproxyhal_send_status(uint32_t sw);
void format_signature_out(const uint8_t *signature);
void finalizeParsing(bool direct);
extraInfo_t *getKnownToken(uint8_t *contractAddress);
+
+#endif // _UI_CALLBACKS_H_
diff --git a/src/ui_flow.h b/src/ui_flow.h
index 8797b95..796e4da 100644
--- a/src/ui_flow.h
+++ b/src/ui_flow.h
@@ -1,3 +1,6 @@
+#ifndef _UI_FLOW_H_
+#define _UI_FLOW_H_
+
#include "shared_context.h"
#include "os_io_seproxyhal.h"
@@ -23,6 +26,10 @@ extern const ux_flow_step_t* const ux_sign_712_v0_flow[];
extern const ux_flow_step_t* const ux_display_public_eth2_flow[];
+extern const ux_flow_step_t* const ux_display_privacy_public_key_flow[];
+
+extern const ux_flow_step_t* const ux_display_privacy_shared_secret_flow[];
+
#ifdef HAVE_STARKWARE
extern const ux_flow_step_t* const ux_display_stark_public_flow[];
@@ -52,3 +59,5 @@ extern const ux_flow_step_t* const ux_approval_starkware_verify_escape_flow[];
extern const ux_flow_step_t* const ux_stark_unsafe_sign_flow[];
#endif
+
+#endif // _UI_FLOW_H_
diff --git a/src/utils.c b/src/utils.c
index 63d9230..fdda1c0 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -115,7 +115,7 @@ void amountToString(const uint8_t *amount,
uint8_t decimals,
const char *ticker,
char *out_buffer,
- uint8_t out_buffer_size) {
+ size_t out_buffer_size) {
char tmp_buffer[100] = {0};
if (uint256_to_decimal(amount, amount_size, tmp_buffer, sizeof(tmp_buffer)) == false) {
diff --git a/src/utils.h b/src/utils.h
index 6ee5d45..988ce08 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -37,8 +37,8 @@ void amountToString(const uint8_t* amount,
uint8_t decimals,
const char* ticker,
char* out_buffer,
- uint8_t out_buffer_size);
+ size_t out_buffer_size);
bool parse_swap_config(uint8_t* config, uint8_t config_len, char* ticker, uint8_t* decimals);
-#endif /* _UTILS_H_ */
\ No newline at end of file
+#endif // _UTILS_H_
diff --git a/src_common/ethUstream.h b/src_common/ethUstream.h
index e73cc95..f63dd65 100644
--- a/src_common/ethUstream.h
+++ b/src_common/ethUstream.h
@@ -164,4 +164,4 @@ parserStatus_e continueTx(txContext_t *context);
void copyTxData(txContext_t *context, uint8_t *out, uint32_t length);
uint8_t readTxByte(txContext_t *context);
-#endif /* _ETHUSTREAM_H_ */
\ No newline at end of file
+#endif // _ETHUSTREAM_H_
diff --git a/src_common/ethUtils.c b/src_common/ethUtils.c
index eb9ddf6..804837c 100644
--- a/src_common/ethUtils.c
+++ b/src_common/ethUtils.c
@@ -237,10 +237,10 @@ void getEthDisplayableAddress(uint8_t *in,
getEthAddressStringFromBinary(in, out + 2, sha3, chainId);
}
-bool adjustDecimals(char *src,
- uint32_t srcLength,
+bool adjustDecimals(const char *src,
+ size_t srcLength,
char *target,
- uint32_t targetLength,
+ size_t targetLength,
uint8_t decimals) {
uint32_t startOffset;
uint32_t lastZeroOffset = 0;
diff --git a/src_common/ethUtils.h b/src_common/ethUtils.h
index 2f66b29..3c147cc 100644
--- a/src_common/ethUtils.h
+++ b/src_common/ethUtils.h
@@ -22,6 +22,7 @@
#include "cx.h"
#include "chainConfig.h"
+
/**
* @brief Decode an RLP encoded field - see
* https://github.com/ethereum/wiki/wiki/RLP
@@ -57,10 +58,10 @@ void getEthDisplayableAddress(uint8_t *in,
cx_sha3_t *sha3,
uint64_t chainId);
-bool adjustDecimals(char *src,
- uint32_t srcLength,
+bool adjustDecimals(const char *src,
+ size_t srcLength,
char *target,
- uint32_t targetLength,
+ size_t targetLength,
uint8_t decimals);
static __attribute__((no_instrument_function)) inline int allzeroes(void *buf, size_t n) {
@@ -83,4 +84,4 @@ static __attribute__((no_instrument_function)) inline int ismaxint(uint8_t *buf,
static const char HEXDIGITS[] = "0123456789abcdef";
-#endif /* _ETHUTILS_H_ */
+#endif // _ETHUTILS_H_
diff --git a/src_common/network.c b/src_common/network.c
index f568855..392b7d5 100644
--- a/src_common/network.c
+++ b/src_common/network.c
@@ -45,27 +45,27 @@ uint64_t get_chain_id(void) {
return chain_id;
}
-network_info_t *get_network(void) {
+const network_info_t *get_network(void) {
uint64_t chain_id = get_chain_id();
- for (uint8_t i = 0; i < sizeof(NETWORK_MAPPING) / sizeof(*NETWORK_MAPPING); i++) {
+ for (size_t i = 0; i < sizeof(NETWORK_MAPPING) / sizeof(*NETWORK_MAPPING); i++) {
if (NETWORK_MAPPING[i].chain_id == chain_id) {
- return (network_info_t *) PIC(&NETWORK_MAPPING[i]);
+ return (const network_info_t *) PIC(&NETWORK_MAPPING[i]);
}
}
return NULL;
}
-char *get_network_name(void) {
- network_info_t *network = get_network();
+const char *get_network_name(void) {
+ const network_info_t *network = get_network();
if (network == NULL) {
return NULL;
} else {
- return (char *) PIC(network->name);
+ return (const char *) PIC(network->name);
}
}
-char *get_network_ticker(void) {
- network_info_t *network = get_network();
+const char *get_network_ticker(void) {
+ const network_info_t *network = get_network();
if (network == NULL) {
return chainConfig->coinName;
} else {
diff --git a/src_common/network.h b/src_common/network.h
index 23bffc1..8a4513a 100644
--- a/src_common/network.h
+++ b/src_common/network.h
@@ -1,3 +1,6 @@
+#ifndef _NETWORK_H_
+#define _NETWORK_H_
+
#include
#include "tokens.h"
#include "shared_context.h"
@@ -13,8 +16,10 @@ typedef struct network_info_s {
// Returns the current chain id. Defaults to 0 if txType was not found.
uint64_t get_chain_id(void);
// Returns a pointer to the network struct, or NULL if there is none.
-network_info_t *get_network(void);
+const network_info_t *get_network(void);
// Returns a pointer to the network name, or NULL if there is none.
-char *get_network_name(void);
+const char *get_network_name(void);
// Returns a pointer to the network ticker, or chainConfig->coinName if there is none.
-char *get_network_ticker(void);
\ No newline at end of file
+const char *get_network_ticker(void);
+
+#endif // _NETWORK_H_
diff --git a/src_common/uint256.h b/src_common/uint256.h
index c55cd0c..5683c3e 100644
--- a/src_common/uint256.h
+++ b/src_common/uint256.h
@@ -73,4 +73,4 @@ void divmod256(uint256_t *l, uint256_t *r, uint256_t *div, uint256_t *mod);
bool tostring128(uint128_t *number, uint32_t base, char *out, uint32_t outLength);
bool tostring256(uint256_t *number, uint32_t base, char *out, uint32_t outLength);
-#endif /* _UINT256_H_ */
\ No newline at end of file
+#endif // _UINT256_H_
diff --git a/src_features/getEth2PublicKey/feature_getEth2PublicKey.h b/src_features/getEth2PublicKey/feature_getEth2PublicKey.h
index 3b6dbe2..3d302f4 100644
--- a/src_features/getEth2PublicKey/feature_getEth2PublicKey.h
+++ b/src_features/getEth2PublicKey/feature_getEth2PublicKey.h
@@ -1,3 +1,8 @@
+#ifndef _GET_ETH2_PUB_KEY_H_
+#define _GET_ETH2_PUB_KEY_H_
+
#include "shared_context.h"
uint32_t set_result_get_eth2_publicKey(void);
+
+#endif // _GET_ETH2_PUB_KEY_H_
diff --git a/src_features/getEth2PublicKey/logic_getEth2PublicKey.c b/src_features/getEth2PublicKey/logic_getEth2PublicKey.c
index 9b112e2..6a0fc92 100644
--- a/src_features/getEth2PublicKey/logic_getEth2PublicKey.c
+++ b/src_features/getEth2PublicKey/logic_getEth2PublicKey.c
@@ -1,5 +1,6 @@
#ifdef HAVE_ETH2
+#include
#include "shared_context.h"
uint32_t set_result_get_eth2_publicKey() {
@@ -9,4 +10,4 @@ uint32_t set_result_get_eth2_publicKey() {
return tx;
}
-#endif
+#endif // HAVE_ETH2
diff --git a/src_features/getPublicKey/cmd_getPublicKey.c b/src_features/getPublicKey/cmd_getPublicKey.c
index ef521c4..59c9fb8 100644
--- a/src_features/getPublicKey/cmd_getPublicKey.c
+++ b/src_features/getPublicKey/cmd_getPublicKey.c
@@ -3,6 +3,7 @@
#include "ui_flow.h"
#include "feature_getPublicKey.h"
+#include "ethUtils.h"
void handleGetPublicKey(uint8_t p1,
uint8_t p2,
diff --git a/src_features/getPublicKey/feature_getPublicKey.h b/src_features/getPublicKey/feature_getPublicKey.h
index e8e041a..8f819ba 100644
--- a/src_features/getPublicKey/feature_getPublicKey.h
+++ b/src_features/getPublicKey/feature_getPublicKey.h
@@ -1,3 +1,8 @@
+#ifndef _GET_PUB_KEY_H_
+#define _GET_PUB_KEY_H_
+
#include "shared_context.h"
uint32_t set_result_get_publicKey(void);
+
+#endif // _GET_PUB_KEY_H_
diff --git a/src_features/getPublicKey/logic_getPublicKey.c b/src_features/getPublicKey/logic_getPublicKey.c
index d80896c..bc58e92 100644
--- a/src_features/getPublicKey/logic_getPublicKey.c
+++ b/src_features/getPublicKey/logic_getPublicKey.c
@@ -1,3 +1,4 @@
+#include
#include "shared_context.h"
uint32_t set_result_get_publicKey() {
diff --git a/src_features/performPrivacyOperation/cmd_performPrivacyOperation.c b/src_features/performPrivacyOperation/cmd_performPrivacyOperation.c
new file mode 100644
index 0000000..b396d33
--- /dev/null
+++ b/src_features/performPrivacyOperation/cmd_performPrivacyOperation.c
@@ -0,0 +1,122 @@
+#include "shared_context.h"
+#include "apdu_constants.h"
+
+#include "ui_flow.h"
+#include "feature_performPrivacyOperation.h"
+
+#define P2_PUBLIC_ENCRYPTION_KEY 0x00
+#define P2_SHARED_SECRET 0x01
+
+void decodeScalar(const uint8_t *scalarIn, uint8_t *scalarOut) {
+ for (uint8_t i = 0; i < 32; i++) {
+ switch (i) {
+ case 0:
+ scalarOut[0] = (scalarIn[31] & 0x7f) | 0x40;
+ break;
+ case 31:
+ scalarOut[31] = scalarIn[0] & 0xf8;
+ break;
+ default:
+ scalarOut[i] = scalarIn[31 - i];
+ }
+ }
+}
+
+void handlePerformPrivacyOperation(uint8_t p1,
+ uint8_t p2,
+ uint8_t *dataBuffer,
+ uint16_t dataLength,
+ unsigned int *flags,
+ unsigned int *tx) {
+ UNUSED(dataLength);
+ uint8_t privateKeyData[INT256_LENGTH];
+ uint8_t privateKeyDataSwapped[INT256_LENGTH];
+ uint32_t bip32Path[MAX_BIP32_PATH];
+ uint8_t bip32PathLength = *(dataBuffer++);
+ cx_err_t status = CX_OK;
+ if (p2 == P2_PUBLIC_ENCRYPTION_KEY) {
+ if (dataLength < 1 + 4 * bip32PathLength) {
+ THROW(0x6700);
+ }
+ } else if (p2 == P2_SHARED_SECRET) {
+ if (dataLength < 1 + 4 * bip32PathLength + 32) {
+ THROW(0x6700);
+ }
+ } else {
+ THROW(0x6B00);
+ }
+ cx_ecfp_private_key_t privateKey;
+ if ((bip32PathLength < 0x01) || (bip32PathLength > MAX_BIP32_PATH)) {
+ PRINTF("Invalid path\n");
+ THROW(0x6a80);
+ }
+ if ((p1 != P1_CONFIRM) && (p1 != P1_NON_CONFIRM)) {
+ THROW(0x6B00);
+ }
+ for (uint8_t i = 0; i < bip32PathLength; i++) {
+ bip32Path[i] = U4BE(dataBuffer, 0);
+ dataBuffer += 4;
+ }
+ os_perso_derive_node_bip32(
+ CX_CURVE_256K1,
+ bip32Path,
+ bip32PathLength,
+ privateKeyData,
+ (tmpCtx.publicKeyContext.getChaincode ? tmpCtx.publicKeyContext.chainCode : NULL));
+ cx_ecfp_init_private_key(CX_CURVE_256K1, privateKeyData, 32, &privateKey);
+ cx_ecfp_generate_pair(CX_CURVE_256K1, &tmpCtx.publicKeyContext.publicKey, &privateKey, 1);
+ getEthAddressStringFromKey(&tmpCtx.publicKeyContext.publicKey,
+ tmpCtx.publicKeyContext.address,
+ &global_sha3,
+ chainConfig->chainId);
+ if (p2 == P2_PUBLIC_ENCRYPTION_KEY) {
+ decodeScalar(privateKeyData, privateKeyDataSwapped);
+ cx_ecfp_init_private_key(CX_CURVE_Curve25519, privateKeyDataSwapped, 32, &privateKey);
+ cx_ecfp_generate_pair(CX_CURVE_Curve25519,
+ &tmpCtx.publicKeyContext.publicKey,
+ &privateKey,
+ 1);
+ explicit_bzero(privateKeyDataSwapped, sizeof(privateKeyDataSwapped));
+ } else {
+ memmove(tmpCtx.publicKeyContext.publicKey.W + 1, dataBuffer, 32);
+ status = cx_x25519(tmpCtx.publicKeyContext.publicKey.W + 1, privateKeyData, 32);
+ }
+ explicit_bzero(&privateKey, sizeof(privateKey));
+ explicit_bzero(privateKeyData, sizeof(privateKeyData));
+
+ if (status != CX_OK) {
+ THROW(0x6A80);
+ }
+
+#ifndef NO_CONSENT
+ if (p1 == P1_NON_CONFIRM)
+#endif // NO_CONSENT
+ {
+ *tx = set_result_perform_privacy_operation();
+ THROW(0x9000);
+ }
+#ifndef NO_CONSENT
+ else {
+ snprintf(strings.common.fullAddress,
+ sizeof(strings.common.fullAddress),
+ "0x%.*s",
+ 40,
+ tmpCtx.publicKeyContext.address);
+ for (uint8_t i = 0; i < 32; i++) {
+ privateKeyData[i] = tmpCtx.publicKeyContext.publicKey.W[32 - i];
+ }
+ snprintf(strings.common.fullAmount,
+ sizeof(strings.common.fullAmount) - 1,
+ "%.*H",
+ 32,
+ privateKeyData);
+ if (p2 == P2_PUBLIC_ENCRYPTION_KEY) {
+ ux_flow_init(0, ux_display_privacy_public_key_flow, NULL);
+ } else {
+ ux_flow_init(0, ux_display_privacy_shared_secret_flow, NULL);
+ }
+
+ *flags |= IO_ASYNCH_REPLY;
+ }
+#endif // NO_CONSENT
+}
diff --git a/src_features/performPrivacyOperation/feature_performPrivacyOperation.h b/src_features/performPrivacyOperation/feature_performPrivacyOperation.h
new file mode 100644
index 0000000..df80ffd
--- /dev/null
+++ b/src_features/performPrivacyOperation/feature_performPrivacyOperation.h
@@ -0,0 +1,3 @@
+#include "shared_context.h"
+
+uint32_t set_result_perform_privacy_operation(void);
diff --git a/src_features/performPrivacyOperation/logic_performPrivacyOperation.c b/src_features/performPrivacyOperation/logic_performPrivacyOperation.c
new file mode 100644
index 0000000..1042ac0
--- /dev/null
+++ b/src_features/performPrivacyOperation/logic_performPrivacyOperation.c
@@ -0,0 +1,8 @@
+#include "shared_context.h"
+
+uint32_t set_result_perform_privacy_operation() {
+ for (uint8_t i = 0; i < 32; i++) {
+ G_io_apdu_buffer[i] = tmpCtx.publicKeyContext.publicKey.W[32 - i];
+ }
+ return 32;
+}
diff --git a/src_features/performPrivacyOperation/ui_common_performPrivacyOperation.c b/src_features/performPrivacyOperation/ui_common_performPrivacyOperation.c
new file mode 100644
index 0000000..6cc7182
--- /dev/null
+++ b/src_features/performPrivacyOperation/ui_common_performPrivacyOperation.c
@@ -0,0 +1,26 @@
+#include "shared_context.h"
+#include "feature_getPublicKey.h"
+#include "ui_callbacks.h"
+
+unsigned int io_seproxyhal_touch_privacy_ok(__attribute__((unused)) const bagl_element_t *e) {
+ uint32_t tx = set_result_perform_privacy_operation();
+ G_io_apdu_buffer[tx++] = 0x90;
+ G_io_apdu_buffer[tx++] = 0x00;
+ reset_app_context();
+ // Send back the response, do not restart the event loop
+ io_exchange(CHANNEL_APDU | IO_RETURN_AFTER_TX, tx);
+ // Display back the original UX
+ ui_idle();
+ return 0; // do not redraw the widget
+}
+
+unsigned int io_seproxyhal_touch_privacy_cancel(__attribute__((unused)) const bagl_element_t *e) {
+ G_io_apdu_buffer[0] = 0x69;
+ G_io_apdu_buffer[1] = 0x85;
+ reset_app_context();
+ // Send back the response, do not restart the event loop
+ io_exchange(CHANNEL_APDU | IO_RETURN_AFTER_TX, 2);
+ // Display back the original UX
+ ui_idle();
+ return 0; // do not redraw the widget
+}
diff --git a/src_features/performPrivacyOperation/ui_flow_performPrivacyOperation.c b/src_features/performPrivacyOperation/ui_flow_performPrivacyOperation.c
new file mode 100644
index 0000000..5c181ef
--- /dev/null
+++ b/src_features/performPrivacyOperation/ui_flow_performPrivacyOperation.c
@@ -0,0 +1,67 @@
+#include "shared_context.h"
+#include "ui_callbacks.h"
+
+// clang-format off
+UX_STEP_NOCB(
+ ux_display_privacy_public_key_flow_1_step,
+ pnn,
+ {
+ &C_icon_eye,
+ "Provide public",
+ "privacy key",
+ });
+UX_STEP_NOCB(
+ ux_display_privacy_public_key_flow_2_step,
+ bnnn_paging,
+ {
+ .title = "Address",
+ .text = strings.common.fullAddress,
+ });
+UX_STEP_NOCB(
+ ux_display_privacy_public_key_flow_3_step,
+ bnnn_paging,
+ {
+ .title = "Key",
+ .text = strings.common.fullAmount,
+ });
+UX_STEP_CB(
+ ux_display_privacy_public_key_flow_4_step,
+ pb,
+ io_seproxyhal_touch_privacy_ok(NULL),
+ {
+ &C_icon_validate_14,
+ "Approve",
+ });
+UX_STEP_CB(
+ ux_display_privacy_public_key_flow_5_step,
+ pb,
+ io_seproxyhal_touch_privacy_cancel(NULL),
+ {
+ &C_icon_crossmark,
+ "Reject",
+ });
+
+UX_STEP_NOCB(
+ ux_display_privacy_shared_secret_flow_1_step,
+ pnn,
+ {
+ &C_icon_eye,
+ "Provide privacy",
+ "secret key",
+ });
+
+// clang-format on
+
+UX_FLOW(ux_display_privacy_public_key_flow,
+ &ux_display_privacy_public_key_flow_1_step,
+ &ux_display_privacy_public_key_flow_2_step,
+ &ux_display_privacy_public_key_flow_3_step,
+ &ux_display_privacy_public_key_flow_4_step,
+ &ux_display_privacy_public_key_flow_5_step);
+
+UX_FLOW(ux_display_privacy_shared_secret_flow,
+ &ux_display_privacy_shared_secret_flow_1_step,
+ &ux_display_privacy_public_key_flow_2_step,
+ &ux_display_privacy_public_key_flow_3_step,
+ &ux_display_privacy_public_key_flow_4_step,
+ &ux_display_privacy_public_key_flow_5_step);
diff --git a/src_features/provideNFTInformation/cmd_provideNFTInfo.c b/src_features/provideNFTInformation/cmd_provideNFTInfo.c
index a4256a3..e7fea89 100644
--- a/src_features/provideNFTInformation/cmd_provideNFTInfo.c
+++ b/src_features/provideNFTInformation/cmd_provideNFTInfo.c
@@ -9,7 +9,7 @@
#define TYPE_SIZE 1
#define VERSION_SIZE 1
#define NAME_LENGTH_SIZE 1
-#define HEADER_SIZE TYPE_SIZE + VERSION_SIZE + NAME_LENGTH_SIZE
+#define HEADER_SIZE (TYPE_SIZE + VERSION_SIZE + NAME_LENGTH_SIZE)
#define CHAIN_ID_SIZE 8
#define KEY_ID_SIZE 1
@@ -34,7 +34,6 @@ static const uint8_t LEDGER_NFT_METADATA_PUBLIC_KEY[] = {
0x7d, 0x0b, 0x46, 0x9a, 0x53, 0x11, 0xee, 0x6a, 0x1a, 0xcd, 0x1d, 0xa5, 0xaa, 0xb0,
0xf5, 0xc6, 0xdf, 0x13, 0x15, 0x8d, 0x28, 0xcc, 0x12, 0xd1, 0xdd, 0xa6, 0xec, 0xe9,
0x46, 0xb8, 0x9d, 0x5c, 0x05, 0x49, 0x92, 0x59, 0xc4
-
#else
0x04, 0x98, 0x8d, 0xa6, 0xb2, 0x46, 0xf2, 0x8e, 0x77, 0xc1, 0xba, 0xb6, 0x75, 0xcb,
0x2a, 0x27, 0x44, 0xf7, 0xf5, 0xce, 0xc5, 0x6a, 0xe6, 0xe0, 0x32, 0x23, 0x33, 0x7b,
@@ -64,8 +63,12 @@ void handleProvideNFTInformation(uint8_t p1,
UNUSED(flags);
uint8_t hash[INT256_LENGTH];
cx_ecfp_public_key_t nftKey;
- PRINTF("In handle provide NFTInformation");
+ PRINTF("In handle provide NFTInformation\n");
+ if ((pluginType != ERC721) && (pluginType != ERC1155)) {
+ PRINTF("NFT metadata provided without proper plugin loaded!\n");
+ THROW(0x6985);
+ }
tmpCtx.transactionContext.currentItemIndex =
(tmpCtx.transactionContext.currentItemIndex + 1) % MAX_ITEMS;
nftInfo_t *nft =
@@ -73,7 +76,7 @@ void handleProvideNFTInformation(uint8_t p1,
PRINTF("Provisioning currentItemIndex %d\n", tmpCtx.transactionContext.currentItemIndex);
- uint8_t offset = 0;
+ size_t offset = 0;
if (dataLength <= HEADER_SIZE) {
PRINTF("Data too small for headers: expected at least %d, got %d\n",
@@ -108,8 +111,8 @@ void handleProvideNFTInformation(uint8_t p1,
offset += NAME_LENGTH_SIZE;
// Size of the payload (everything except the signature)
- uint8_t payloadSize = HEADER_SIZE + collectionNameLength + ADDRESS_LENGTH + CHAIN_ID_SIZE +
- KEY_ID_SIZE + ALGORITHM_ID_SIZE;
+ size_t payloadSize = HEADER_SIZE + collectionNameLength + ADDRESS_LENGTH + CHAIN_ID_SIZE +
+ KEY_ID_SIZE + ALGORITHM_ID_SIZE;
if (dataLength < payloadSize) {
PRINTF("Data too small for payload: expected at least %d, got %d\n",
payloadSize,
@@ -117,10 +120,10 @@ void handleProvideNFTInformation(uint8_t p1,
THROW(0x6A80);
}
- if (collectionNameLength + 1 > sizeof(nft->collectionName)) {
+ if (collectionNameLength > COLLECTION_NAME_MAX_LEN) {
PRINTF("CollectionName too big: expected max %d, got %d\n",
- sizeof(nft->collectionName),
- collectionNameLength + 1);
+ COLLECTION_NAME_MAX_LEN,
+ collectionNameLength);
THROW(0x6A80);
}
diff --git a/src_features/setEth2WithdrawalIndex/withdrawal_index.h b/src_features/setEth2WithdrawalIndex/withdrawal_index.h
index 497b489..bf9d6a3 100644
--- a/src_features/setEth2WithdrawalIndex/withdrawal_index.h
+++ b/src_features/setEth2WithdrawalIndex/withdrawal_index.h
@@ -1,3 +1,6 @@
+#ifndef _SET_WITHDRAWAL_INDEX_H_
+#define _SET_WITHDRAWAL_INDEX_H_
+
#include "stdint.h"
void handleSetEth2WithdrawalIndex(uint8_t p1,
@@ -5,4 +8,6 @@ void handleSetEth2WithdrawalIndex(uint8_t p1,
uint8_t *dataBuffer,
uint16_t dataLength,
unsigned int *flags,
- unsigned int *tx);
\ No newline at end of file
+ unsigned int *tx);
+
+#endif // _SET_WITHDRAWAL_INDEX_H_
diff --git a/src_features/setPlugin/cmd_setPlugin.c b/src_features/setPlugin/cmd_setPlugin.c
index d2969f7..58ad8bf 100644
--- a/src_features/setPlugin/cmd_setPlugin.c
+++ b/src_features/setPlugin/cmd_setPlugin.c
@@ -18,7 +18,7 @@
#define ALGORITHM_ID_SIZE 1
#define SIGNATURE_LENGTH_SIZE 1
-#define HEADER_SIZE TYPE_SIZE + VERSION_SIZE + PLUGIN_NAME_LENGTH_SIZE
+#define HEADER_SIZE (TYPE_SIZE + VERSION_SIZE + PLUGIN_NAME_LENGTH_SIZE)
#define MIN_DER_SIG_SIZE 67
#define MAX_DER_SIG_SIZE 72
@@ -98,7 +98,7 @@ void handleSetPlugin(uint8_t p1,
cx_ecfp_public_key_t pluginKey = {0};
tokenContext_t *tokenContext = &dataContext.tokenContext;
- uint8_t offset = 0;
+ size_t offset = 0;
if (dataLength <= HEADER_SIZE) {
PRINTF("Data too small for headers: expected at least %d, got %d\n",
@@ -135,8 +135,8 @@ void handleSetPlugin(uint8_t p1,
offset += PLUGIN_NAME_LENGTH_SIZE;
// Size of the payload (everything except the signature)
- uint8_t payloadSize = HEADER_SIZE + pluginNameLength + ADDRESS_LENGTH + SELECTOR_SIZE +
- CHAIN_ID_SIZE + KEY_ID_SIZE + ALGORITHM_ID_SIZE;
+ size_t payloadSize = HEADER_SIZE + pluginNameLength + ADDRESS_LENGTH + SELECTOR_SIZE +
+ CHAIN_ID_SIZE + KEY_ID_SIZE + ALGORITHM_ID_SIZE;
if (dataLength < payloadSize) {
PRINTF("Data too small for payload: expected at least %d, got %d\n",
payloadSize,
@@ -227,7 +227,7 @@ void handleSetPlugin(uint8_t p1,
}
uint8_t signatureLen = workBuffer[offset];
- PRINTF("Sigature len: %d\n", signatureLen);
+ PRINTF("Signature len: %d\n", signatureLen);
if (signatureLen < MIN_DER_SIG_SIZE || signatureLen > MAX_DER_SIG_SIZE) {
PRINTF("SignatureLen too big or too small. Must be between %d and %d, got %d\n",
MIN_DER_SIG_SIZE,
diff --git a/src_features/signMessage/ui_common_signMessage.c b/src_features/signMessage/ui_common_signMessage.c
index 02b15c3..e2a901b 100644
--- a/src_features/signMessage/ui_common_signMessage.c
+++ b/src_features/signMessage/ui_common_signMessage.c
@@ -1,3 +1,4 @@
+#include "os_io_seproxyhal.h"
#include "shared_context.h"
#include "ui_callbacks.h"
diff --git a/src_features/signMessageEIP712/ui_common_signMessage712.c b/src_features/signMessageEIP712/ui_common_signMessage712.c
index db97137..e67cc4e 100644
--- a/src_features/signMessageEIP712/ui_common_signMessage712.c
+++ b/src_features/signMessageEIP712/ui_common_signMessage712.c
@@ -1,3 +1,4 @@
+#include "os_io_seproxyhal.h"
#include "shared_context.h"
#include "ui_callbacks.h"
diff --git a/src_features/signTx/feature_signTx.h b/src_features/signTx/feature_signTx.h
index 24400da..84d2cd5 100644
--- a/src_features/signTx/feature_signTx.h
+++ b/src_features/signTx/feature_signTx.h
@@ -1,3 +1,6 @@
+#ifndef _SIGN_TX_H_
+#define _SIGN_TX_H_
+
#include "shared_context.h"
typedef enum {
@@ -12,3 +15,5 @@ void finalizeParsing(bool direct);
void prepareFeeDisplay();
void prepareNetworkDisplay();
void ux_approve_tx(bool fromPlugin);
+
+#endif // _SIGN_TX_H_
diff --git a/src_features/signTx/logic_signTx.c b/src_features/signTx/logic_signTx.c
index 6c65cff..eb8e10f 100644
--- a/src_features/signTx/logic_signTx.c
+++ b/src_features/signTx/logic_signTx.c
@@ -214,7 +214,7 @@ static void computeFees(txInt256_t *BEgasPrice, txInt256_t *BEgasLimit, uint256_
}
static void feesToString(uint256_t *rawFee, char *displayBuffer, uint32_t displayBufferSize) {
- char *feeTicker = get_network_ticker();
+ const char *feeTicker = get_network_ticker();
uint8_t tickerOffset = 0;
uint32_t i;
@@ -261,7 +261,7 @@ void prepareFeeDisplay() {
}
void prepareNetworkDisplay() {
- char *name = get_network_name();
+ const char *name = get_network_name();
if (name == NULL) {
// No network name found so simply copy the chain ID as the network name.
uint64_t chain_id = get_chain_id();
@@ -296,7 +296,7 @@ static void get_public_key(uint8_t *out, uint8_t outLength) {
void finalizeParsing(bool direct) {
char displayBuffer[50];
uint8_t decimals = WEI_TO_ETHER;
- char *ticker = get_network_ticker();
+ const char *ticker = get_network_ticker();
ethPluginFinalize_t pluginFinalize;
bool genericUI = true;
diff --git a/src_features/signTx/ui_common_signTx.c b/src_features/signTx/ui_common_signTx.c
index 36a0bd9..3d27197 100644
--- a/src_features/signTx/ui_common_signTx.c
+++ b/src_features/signTx/ui_common_signTx.c
@@ -1,3 +1,4 @@
+#include "os_io_seproxyhal.h"
#include "shared_context.h"
#include "utils.h"
#include "ui_callbacks.h"
diff --git a/src_features/signTx/ui_plugin.h b/src_features/signTx/ui_plugin.h
index 28179b2..ae86b6a 100644
--- a/src_features/signTx/ui_plugin.h
+++ b/src_features/signTx/ui_plugin.h
@@ -1,5 +1,8 @@
-#pragma once
+#ifndef _UI_PLUGIN_H_
+#define _UI_PLUGIN_H_
void plugin_ui_get_id();
void plugin_ui_get_item();
-void display_next_plugin_item(bool entering);
\ No newline at end of file
+void display_next_plugin_item(bool entering);
+
+#endif // _UI_PLUGIN_H_
diff --git a/src_features/stark_getPublicKey/feature_stark_getPublicKey.h b/src_features/stark_getPublicKey/feature_stark_getPublicKey.h
index bb50747..4859722 100644
--- a/src_features/stark_getPublicKey/feature_stark_getPublicKey.h
+++ b/src_features/stark_getPublicKey/feature_stark_getPublicKey.h
@@ -1,3 +1,8 @@
+#ifndef _STARK_GET_PUB_KEY_H_
+#define _STARK_GET_PUB_KEY_H_
+
#include "shared_context.h"
uint32_t set_result_get_stark_publicKey(void);
+
+#endif // _STARK_GET_PUB_KEY_H_
diff --git a/src_features/stark_getPublicKey/logic_stark_getPublicKey.c b/src_features/stark_getPublicKey/logic_stark_getPublicKey.c
index 8c99cfd..9338cc4 100644
--- a/src_features/stark_getPublicKey/logic_stark_getPublicKey.c
+++ b/src_features/stark_getPublicKey/logic_stark_getPublicKey.c
@@ -1,5 +1,6 @@
#ifdef HAVE_STARKWARE
+#include
#include "shared_context.h"
#include "feature_stark_getPublicKey.h"
@@ -10,4 +11,4 @@ uint32_t set_result_get_stark_publicKey() {
return tx;
}
-#endif
+#endif // HAVE_STARKWARE
diff --git a/src_features/stark_provideQuantum/cmd_stark_provideQuantum.c b/src_features/stark_provideQuantum/cmd_stark_provideQuantum.c
index 4d390dd..1796fe5 100644
--- a/src_features/stark_provideQuantum/cmd_stark_provideQuantum.c
+++ b/src_features/stark_provideQuantum/cmd_stark_provideQuantum.c
@@ -3,6 +3,7 @@
#include "shared_context.h"
#include "apdu_constants.h"
#include "ui_flow.h"
+#include "ethUtils.h"
void handleStarkwareProvideQuantum(uint8_t p1,
__attribute__((unused)) uint8_t p2,
diff --git a/src_features/stark_sign/cmd_stark_sign.c b/src_features/stark_sign/cmd_stark_sign.c
index 9329838..12f7da7 100644
--- a/src_features/stark_sign/cmd_stark_sign.c
+++ b/src_features/stark_sign/cmd_stark_sign.c
@@ -6,6 +6,7 @@
#include "ui_flow.h"
#include "poorstream.h"
#include "ui_callbacks.h"
+#include "ethUtils.h"
#define U8BE(buf, off) \
(uint64_t)((((uint64_t) U4BE(buf, off)) << 32) | (((uint64_t) U4BE(buf, off + 4)) & 0xFFFFFFFF))
@@ -139,11 +140,11 @@ void handleStarkwareSignMessage(uint8_t p1,
poorstream_init(&bitstream, dataContext.starkContext.w3);
poorstream_write_bits(&bitstream, 0, 11); // padding
- poorstream_write_bits(
- &bitstream,
- (p1 == P1_STARK_CONDITIONAL_TRANSFER ? STARK_CONDITIONAL_TRANSFER_TYPE
- : order ? STARK_ORDER_TYPE : STARK_TRANSFER_TYPE),
- 4);
+ poorstream_write_bits(&bitstream,
+ (p1 == P1_STARK_CONDITIONAL_TRANSFER ? STARK_CONDITIONAL_TRANSFER_TYPE
+ : order ? STARK_ORDER_TYPE
+ : STARK_TRANSFER_TYPE),
+ 4);
poorstream_write_bits(&bitstream, U4BE(dataBuffer, offset), 31);
poorstream_write_bits(&bitstream, U4BE(dataBuffer, offset + 4), 31);
poorstream_write_bits(&bitstream, U8BE(dataBuffer, offset + 4 + 4), 63);
diff --git a/src_features/stark_sign/ui_common_stark_sign.c b/src_features/stark_sign/ui_common_stark_sign.c
index b5feede..533f67f 100644
--- a/src_features/stark_sign/ui_common_stark_sign.c
+++ b/src_features/stark_sign/ui_common_stark_sign.c
@@ -1,5 +1,6 @@
#ifdef HAVE_STARKWARE
+#include "os_io_seproxyhal.h"
#include "shared_context.h"
#include "stark_utils.h"
#include "ui_callbacks.h"
@@ -32,4 +33,4 @@ unsigned int io_seproxyhal_touch_stark_ok(__attribute__((unused)) const bagl_ele
return 0; // do not redraw the widget
}
-#endif
+#endif // HAVE_STARKWARE
diff --git a/src_features/stark_sign/ui_flow_stark_sign.c b/src_features/stark_sign/ui_flow_stark_sign.c
index 4ef5ddc..23c9319 100644
--- a/src_features/stark_sign/ui_flow_stark_sign.c
+++ b/src_features/stark_sign/ui_flow_stark_sign.c
@@ -2,6 +2,7 @@
#include "shared_context.h"
#include "ui_callbacks.h"
+#include "ethUtils.h"
unsigned int io_seproxyhal_touch_stark_ok(const bagl_element_t *e);
diff --git a/src_features/stark_unsafe_sign/ui_common_stark_unsafe_sign.c b/src_features/stark_unsafe_sign/ui_common_stark_unsafe_sign.c
index 2a75200..4c84e0b 100644
--- a/src_features/stark_unsafe_sign/ui_common_stark_unsafe_sign.c
+++ b/src_features/stark_unsafe_sign/ui_common_stark_unsafe_sign.c
@@ -1,5 +1,6 @@
#ifdef HAVE_STARKWARE
+#include "os_io_seproxyhal.h"
#include "shared_context.h"
#include "stark_utils.h"
#include "ui_callbacks.h"
@@ -38,4 +39,4 @@ unsigned int io_seproxyhal_touch_stark_unsafe_sign_ok(__attribute__((unused))
return 0; // do not redraw the widget
}
-#endif
+#endif // HAVE_STARKWARE
diff --git a/src_plugins/compound/compound_plugin.c b/src_plugins/compound/compound_plugin.c
index a933d89..cbb68dd 100644
--- a/src_plugins/compound/compound_plugin.c
+++ b/src_plugins/compound/compound_plugin.c
@@ -3,6 +3,7 @@
#include "shared_context.h" // TODO : rewrite as independant code
#include "eth_plugin_internal.h" // TODO : rewrite as independant code
#include "utils.h"
+#include "ethUtils.h"
typedef enum {
COMPOUND_REDEEM_UNDERLYING = 0,
diff --git a/src_plugins/erc1155/erc1155_plugin.c b/src_plugins/erc1155/erc1155_plugin.c
index dbc1b8e..4c530da 100644
--- a/src_plugins/erc1155/erc1155_plugin.c
+++ b/src_plugins/erc1155/erc1155_plugin.c
@@ -1,13 +1,16 @@
#ifdef HAVE_NFT_SUPPORT
+#include
#include "erc1155_plugin.h"
#include "eth_plugin_internal.h"
+#include "ethUtils.h"
+#include "eth_plugin_handler.h"
static const uint8_t ERC1155_APPROVE_FOR_ALL_SELECTOR[SELECTOR_SIZE] = {0xa2, 0x2c, 0xb4, 0x65};
static const uint8_t ERC1155_SAFE_TRANSFER_SELECTOR[SELECTOR_SIZE] = {0xf2, 0x42, 0x43, 0x2a};
static const uint8_t ERC1155_SAFE_BATCH_TRANSFER[SELECTOR_SIZE] = {0x2e, 0xb2, 0xc2, 0xd6};
-const uint8_t *const ERC1155_SELECTORS[NUM_ERC1155_SELECTORS] = {
+const uint8_t *const ERC1155_SELECTORS[SELECTORS_COUNT] = {
ERC1155_APPROVE_FOR_ALL_SELECTOR,
ERC1155_SAFE_TRANSFER_SELECTOR,
ERC1155_SAFE_BATCH_TRANSFER,
@@ -17,8 +20,13 @@ static void handle_init_contract(void *parameters) {
ethPluginInitContract_t *msg = (ethPluginInitContract_t *) parameters;
erc1155_context_t *context = (erc1155_context_t *) msg->pluginContext;
+ if (NO_NFT_METADATA) {
+ PRINTF("No NFT metadata when trying to sign!\n");
+ msg->result = ETH_PLUGIN_RESULT_ERROR;
+ return;
+ }
uint8_t i;
- for (i = 0; i < NUM_ERC1155_SELECTORS; i++) {
+ for (i = 0; i < SELECTORS_COUNT; i++) {
if (memcmp((uint8_t *) PIC(ERC1155_SELECTORS[i]), msg->selector, SELECTOR_SIZE) == 0) {
context->selectorIndex = i;
break;
@@ -26,7 +34,7 @@ static void handle_init_contract(void *parameters) {
}
// No selector found.
- if (i == NUM_ERC1155_SELECTORS) {
+ if (i == SELECTORS_COUNT) {
PRINTF("Unknown erc1155 selector %.*H\n", SELECTOR_SIZE, msg->selector);
msg->result = ETH_PLUGIN_RESULT_FALLBACK;
return;
@@ -63,10 +71,12 @@ static void handle_finalize(void *parameters) {
case SAFE_TRANSFER:
msg->numScreens = 5;
break;
- case SET_APPROVAL_FOR_ALL:
case SAFE_BATCH_TRANSFER:
msg->numScreens = 4;
break;
+ case SET_APPROVAL_FOR_ALL:
+ msg->numScreens = 3;
+ break;
default:
msg->result = ETH_PLUGIN_RESULT_ERROR;
return;
diff --git a/src_plugins/erc1155/erc1155_plugin.h b/src_plugins/erc1155/erc1155_plugin.h
index 0702fdf..eb174bd 100644
--- a/src_plugins/erc1155/erc1155_plugin.h
+++ b/src_plugins/erc1155/erc1155_plugin.h
@@ -1,22 +1,21 @@
+#ifndef _ERC1155_PLUGIN_H_
+#define _ERC1155_PLUGIN_H_
+
#ifdef HAVE_NFT_SUPPORT
-#pragma once
-
-#include
-#include "eth_plugin_handler.h"
-#include "shared_context.h"
-#include "ethUtils.h"
-#include "utils.h"
+#include
+#include
+#include "ethUstream.h"
#include "uint256.h"
+#include "nft.h"
// Internal plugin for EIP 1155: https://eips.ethereum.org/EIPS/eip-1155
-#define NUM_ERC1155_SELECTORS 3
-
typedef enum {
SET_APPROVAL_FOR_ALL,
SAFE_TRANSFER,
SAFE_BATCH_TRANSFER,
+ SELECTORS_COUNT
} erc1155_selector_t;
typedef enum {
@@ -53,3 +52,5 @@ void handle_provide_parameter_1155(void *parameters);
void handle_query_contract_ui_1155(void *parameters);
#endif // HAVE_NFT_SUPPORT
+
+#endif // _ERC1155_PLUGIN_H_
diff --git a/src_plugins/erc1155/erc1155_provide_parameters.c b/src_plugins/erc1155/erc1155_provide_parameters.c
index 800aafb..8b5e1ca 100644
--- a/src_plugins/erc1155/erc1155_provide_parameters.c
+++ b/src_plugins/erc1155/erc1155_provide_parameters.c
@@ -1,7 +1,10 @@
#ifdef HAVE_NFT_SUPPORT
+#include
#include "erc1155_plugin.h"
#include "eth_plugin_internal.h"
+#include "utils.h"
+#include "ethUtils.h"
static void handle_safe_transfer(ethPluginProvideParameter_t *msg, erc1155_context_t *context) {
uint8_t new_value[INT256_LENGTH];
diff --git a/src_plugins/erc1155/erc1155_ui.c b/src_plugins/erc1155/erc1155_ui.c
index 5b4e941..4306704 100644
--- a/src_plugins/erc1155/erc1155_ui.c
+++ b/src_plugins/erc1155/erc1155_ui.c
@@ -1,6 +1,10 @@
#ifdef HAVE_NFT_SUPPORT
+#include
#include "erc1155_plugin.h"
+#include "eth_plugin_interface.h"
+#include "ethUtils.h"
+#include "utils.h"
static void set_approval_for_all_ui(ethQueryContractUI_t *msg, erc1155_context_t *context) {
switch (msg->screenIndex) {
@@ -18,15 +22,11 @@ static void set_approval_for_all_ui(ethQueryContractUI_t *msg, erc1155_context_t
break;
case 1:
strlcpy(msg->title, "To Manage ALL", msg->titleLength);
- if (msg->item1) {
- strlcpy(msg->msg, (const char *) &msg->item1->nft.collectionName, msg->msgLength);
- } else {
- strlcpy(msg->msg, "Not found", msg->msgLength);
- }
+ strlcpy(msg->msg, msg->item1->nft.collectionName, msg->msgLength);
break;
case 2:
strlcpy(msg->title, "NFT Address", msg->titleLength);
- getEthDisplayableAddress(msg->pluginSharedRO->txContent->destination,
+ getEthDisplayableAddress(msg->item1->nft.contractAddress,
msg->msg,
msg->msgLength,
&global_sha3,
@@ -51,15 +51,11 @@ static void set_transfer_ui(ethQueryContractUI_t *msg, erc1155_context_t *contex
break;
case 1:
strlcpy(msg->title, "Collection Name", msg->titleLength);
- if (msg->item1) {
- strlcpy(msg->msg, (const char *) &msg->item1->nft.collectionName, msg->msgLength);
- } else {
- strlcpy(msg->msg, "Not Found", msg->msgLength);
- }
+ strlcpy(msg->msg, msg->item1->nft.collectionName, msg->msgLength);
break;
case 2:
strlcpy(msg->title, "NFT Address", msg->titleLength);
- getEthDisplayableAddress((uint8_t *) msg->item1->nft.contractAddress,
+ getEthDisplayableAddress(msg->item1->nft.contractAddress,
msg->msg,
msg->msgLength,
&global_sha3,
@@ -97,15 +93,11 @@ static void set_batch_transfer_ui(ethQueryContractUI_t *msg, erc1155_context_t *
break;
case 1:
strlcpy(msg->title, "Collection Name", msg->titleLength);
- if (msg->item1) {
- strlcpy(msg->msg, (const char *) &msg->item1->nft.collectionName, msg->msgLength);
- } else {
- strlcpy(msg->msg, "Not Found", msg->msgLength);
- }
+ strlcpy(msg->msg, msg->item1->nft.collectionName, msg->msgLength);
break;
case 2:
strlcpy(msg->title, "NFT Address", msg->titleLength);
- getEthDisplayableAddress((uint8_t *) msg->item1->nft.contractAddress,
+ getEthDisplayableAddress(msg->item1->nft.contractAddress,
msg->msg,
msg->msgLength,
&global_sha3,
diff --git a/src_plugins/erc721/erc721_plugin.c b/src_plugins/erc721/erc721_plugin.c
index badddb3..12a0a92 100644
--- a/src_plugins/erc721/erc721_plugin.c
+++ b/src_plugins/erc721/erc721_plugin.c
@@ -1,7 +1,11 @@
#ifdef HAVE_NFT_SUPPORT
+#include
#include "erc721_plugin.h"
#include "eth_plugin_internal.h"
+#include "eth_plugin_interface.h"
+#include "ethUtils.h"
+#include "eth_plugin_handler.h"
static const uint8_t ERC721_APPROVE_SELECTOR[SELECTOR_SIZE] = {0x09, 0x5e, 0xa7, 0xb3};
static const uint8_t ERC721_APPROVE_FOR_ALL_SELECTOR[SELECTOR_SIZE] = {0xa2, 0x2c, 0xb4, 0x65};
@@ -9,7 +13,7 @@ static const uint8_t ERC721_TRANSFER_SELECTOR[SELECTOR_SIZE] = {0x23, 0xb8, 0x72
static const uint8_t ERC721_SAFE_TRANSFER_SELECTOR[SELECTOR_SIZE] = {0x42, 0x84, 0x2e, 0x0e};
static const uint8_t ERC721_SAFE_TRANSFER_DATA_SELECTOR[SELECTOR_SIZE] = {0xb8, 0x8d, 0x4f, 0xde};
-const uint8_t *const ERC721_SELECTORS[NUM_ERC721_SELECTORS] = {
+const uint8_t *const ERC721_SELECTORS[SELECTORS_COUNT] = {
ERC721_APPROVE_SELECTOR,
ERC721_APPROVE_FOR_ALL_SELECTOR,
ERC721_TRANSFER_SELECTOR,
@@ -21,8 +25,13 @@ static void handle_init_contract(void *parameters) {
ethPluginInitContract_t *msg = (ethPluginInitContract_t *) parameters;
erc721_context_t *context = (erc721_context_t *) msg->pluginContext;
+ if (NO_NFT_METADATA) {
+ PRINTF("No NFT metadata when trying to sign!\n");
+ msg->result = ETH_PLUGIN_RESULT_ERROR;
+ return;
+ }
uint8_t i;
- for (i = 0; i < NUM_ERC721_SELECTORS; i++) {
+ for (i = 0; i < SELECTORS_COUNT; i++) {
if (memcmp((uint8_t *) PIC(ERC721_SELECTORS[i]), msg->selector, SELECTOR_SIZE) == 0) {
context->selectorIndex = i;
break;
@@ -30,7 +39,7 @@ static void handle_init_contract(void *parameters) {
}
// No selector found.
- if (i == NUM_ERC721_SELECTORS) {
+ if (i == SELECTORS_COUNT) {
PRINTF("Unknown erc721 selector %.*H\n", SELECTOR_SIZE, msg->selector);
msg->result = ETH_PLUGIN_RESULT_FALLBACK;
return;
diff --git a/src_plugins/erc721/erc721_plugin.h b/src_plugins/erc721/erc721_plugin.h
index 1846609..62870fa 100644
--- a/src_plugins/erc721/erc721_plugin.h
+++ b/src_plugins/erc721/erc721_plugin.h
@@ -1,23 +1,22 @@
+#ifndef _ERC721_PLUGIN_H_
+#define _ERC721_PLUGIN_H_
+
#ifdef HAVE_NFT_SUPPORT
-#pragma once
-
-#include
-#include "eth_plugin_handler.h"
-#include "shared_context.h"
-#include "ethUtils.h"
-#include "utils.h"
+#include
+#include
+#include "ethUstream.h"
+#include "nft.h"
// Internal plugin for EIP 721: https://eips.ethereum.org/EIPS/eip-721
-#define NUM_ERC721_SELECTORS 5
-
typedef enum {
APPROVE,
SET_APPROVAL_FOR_ALL,
TRANSFER,
SAFE_TRANSFER,
SAFE_TRANSFER_DATA,
+ SELECTORS_COUNT
} erc721_selector_t;
typedef enum {
@@ -44,3 +43,5 @@ void handle_provide_parameter_721(void *parameters);
void handle_query_contract_ui_721(void *parameters);
#endif // HAVE_NFT_SUPPORT
+
+#endif // _ERC721_PLUGIN_H_
diff --git a/src_plugins/erc721/erc721_ui.c b/src_plugins/erc721/erc721_ui.c
index e312932..8fc4c59 100644
--- a/src_plugins/erc721/erc721_ui.c
+++ b/src_plugins/erc721/erc721_ui.c
@@ -1,6 +1,10 @@
#ifdef HAVE_NFT_SUPPORT
+#include
#include "erc721_plugin.h"
+#include "eth_plugin_interface.h"
+#include "ethUtils.h"
+#include "utils.h"
static void set_approval_ui(ethQueryContractUI_t *msg, erc721_context_t *context) {
switch (msg->screenIndex) {
@@ -13,16 +17,12 @@ static void set_approval_ui(ethQueryContractUI_t *msg, erc721_context_t *context
chainConfig->chainId);
break;
case 1:
- strlcpy(msg->title, "To Spend Your", msg->titleLength);
- if (msg->item1) {
- strlcpy(msg->msg, (const char *) &msg->item1->nft.collectionName, msg->msgLength);
- } else {
- strlcpy(msg->msg, "Not found", msg->msgLength);
- }
+ strlcpy(msg->title, "To Manage Your", msg->titleLength);
+ strlcpy(msg->msg, msg->item1->nft.collectionName, msg->msgLength);
break;
case 2:
strlcpy(msg->title, "NFT Address", msg->titleLength);
- getEthDisplayableAddress(msg->pluginSharedRO->txContent->destination,
+ getEthDisplayableAddress(msg->item1->nft.contractAddress,
msg->msg,
msg->msgLength,
&global_sha3,
@@ -35,14 +35,6 @@ static void set_approval_ui(ethQueryContractUI_t *msg, erc721_context_t *context
msg->msg,
msg->msgLength);
break;
- case 4:
- strlcpy(msg->title, "And send", msg->titleLength);
- amountToString((uint8_t *) &msg->pluginSharedRO->txContent->value,
- sizeof(msg->pluginSharedRO->txContent->value),
- WEI_TO_ETHER,
- msg->network_ticker,
- msg->msg,
- msg->msgLength);
default:
PRINTF("Unsupported screen index %d\n", msg->screenIndex);
msg->result = ETH_PLUGIN_RESULT_ERROR;
@@ -66,28 +58,16 @@ static void set_approval_for_all_ui(ethQueryContractUI_t *msg, erc721_context_t
break;
case 1:
strlcpy(msg->title, "To Manage ALL", msg->titleLength);
- if (msg->item1) {
- strlcpy(msg->msg, (const char *) &msg->item1->nft.collectionName, msg->msgLength);
- } else {
- strlcpy(msg->msg, "Not found", msg->msgLength);
- }
+ strlcpy(msg->msg, msg->item1->nft.collectionName, msg->msgLength);
break;
case 2:
strlcpy(msg->title, "NFT Address", msg->titleLength);
- getEthDisplayableAddress(msg->pluginSharedRO->txContent->destination,
+ getEthDisplayableAddress(msg->item1->nft.contractAddress,
msg->msg,
msg->msgLength,
&global_sha3,
chainConfig->chainId);
break;
- case 3:
- strlcpy(msg->title, "And send", msg->titleLength);
- amountToString((uint8_t *) &msg->pluginSharedRO->txContent->value,
- sizeof(msg->pluginSharedRO->txContent->value),
- WEI_TO_ETHER,
- msg->network_ticker,
- msg->msg,
- msg->msgLength);
default:
PRINTF("Unsupported screen index %d\n", msg->screenIndex);
msg->result = ETH_PLUGIN_RESULT_ERROR;
@@ -107,15 +87,11 @@ static void set_transfer_ui(ethQueryContractUI_t *msg, erc721_context_t *context
break;
case 1:
strlcpy(msg->title, "Collection Name", msg->titleLength);
- if (msg->item1) {
- strlcpy(msg->msg, (const char *) &msg->item1->nft.collectionName, msg->msgLength);
- } else {
- strlcpy(msg->msg, "Not Found", msg->msgLength);
- }
+ strlcpy(msg->msg, msg->item1->nft.collectionName, msg->msgLength);
break;
case 2:
strlcpy(msg->title, "NFT Address", msg->titleLength);
- getEthDisplayableAddress((uint8_t *) msg->item1->nft.contractAddress,
+ getEthDisplayableAddress(msg->item1->nft.contractAddress,
msg->msg,
msg->msgLength,
&global_sha3,
@@ -128,14 +104,6 @@ static void set_transfer_ui(ethQueryContractUI_t *msg, erc721_context_t *context
msg->msg,
msg->msgLength);
break;
- case 4:
- strlcpy(msg->title, "And send", msg->titleLength);
- amountToString((uint8_t *) &msg->pluginSharedRO->txContent->value,
- sizeof(msg->pluginSharedRO->txContent->value),
- WEI_TO_ETHER,
- msg->network_ticker,
- msg->msg,
- msg->msgLength);
default:
PRINTF("Unsupported screen index %d\n", msg->screenIndex);
msg->result = ETH_PLUGIN_RESULT_ERROR;
diff --git a/src_plugins/starkware/starkware_plugin.c b/src_plugins/starkware/starkware_plugin.c
index f4ba5f1..9800f7c 100644
--- a/src_plugins/starkware/starkware_plugin.c
+++ b/src_plugins/starkware/starkware_plugin.c
@@ -1,9 +1,11 @@
#include
+#include "os_io_seproxyhal.h"
#include "eth_plugin_interface.h"
#include "shared_context.h" // TODO : rewrite as independant code
#include "eth_plugin_internal.h" // TODO : rewrite as independant code
#include "stark_utils.h"
#include "utils.h"
+#include "ethUtils.h"
#ifdef HAVE_STARKWARE
@@ -184,7 +186,7 @@ bool is_deversify_contract(const uint8_t *address) {
}
// TODO : rewrite as independant code
-bool starkware_verify_asset_id(uint8_t *tmp32, uint8_t *tokenId, bool assetTypeOnly) {
+bool starkware_verify_asset_id(uint8_t *tmp32, const uint8_t *tokenId, bool assetTypeOnly) {
if (quantumSet) {
cx_sha3_t sha3;
tokenDefinition_t *currentToken = NULL;
@@ -213,7 +215,7 @@ bool starkware_verify_asset_id(uint8_t *tmp32, uint8_t *tokenId, bool assetTypeO
return true;
}
-bool starkware_verify_token(uint8_t *token) {
+bool starkware_verify_token(const uint8_t *token) {
if (quantumSet) {
if (dataContext.tokenContext.quantumIndex != MAX_ITEMS) {
tokenDefinition_t *currentToken =
@@ -234,7 +236,7 @@ bool starkware_verify_token(uint8_t *token) {
return true;
}
-bool starkware_verify_quantum(uint8_t *quantum) {
+bool starkware_verify_quantum(const uint8_t *quantum) {
if (quantumSet) {
if (dataContext.tokenContext.quantumIndex != MAX_ITEMS) {
if (memcmp(quantum, dataContext.tokenContext.quantum, 32) != 0) {
@@ -253,7 +255,7 @@ bool starkware_verify_quantum(uint8_t *quantum) {
return true;
}
-bool starkware_verify_nft_token_id(uint8_t *tokenId) {
+bool starkware_verify_nft_token_id(const uint8_t *tokenId) {
if (!quantumSet) {
PRINTF("Quantum not set\n");
return false;
diff --git a/tests/build_local_test_elfs.sh b/tests/build_local_test_elfs.sh
index ab9a264..b040891 100755
--- a/tests/build_local_test_elfs.sh
+++ b/tests/build_local_test_elfs.sh
@@ -1,5 +1,7 @@
#!/usr/bin/env bash
+set -e
+
TESTS_FULL_PATH=$(dirname "$(realpath "$0")")
# FILL THESE WITH YOUR OWN SDKs PATHS
diff --git a/tests/package.json b/tests/package.json
index 98b51ae..7b08f38 100644
--- a/tests/package.json
+++ b/tests/package.json
@@ -15,7 +15,7 @@
"@ledgerhq/hw-app-eth": "^6.5.0",
"@ledgerhq/hw-transport-http": "^4.74.2",
"@ledgerhq/logs": "^5.50.0",
- "@zondax/zemu": "0.16.5",
+ "@zondax/zemu": "^0.22.1",
"bignumber.js": "^9.0.0",
"bip32-path": "^0.4.2",
"core-js": "^3.7.0",
diff --git a/tests/snapshots/nanos_approve_dai_tokens/00000.png b/tests/snapshots/nanos_approve_dai_tokens/00000.png
index 2994983..8d84cc7 100644
Binary files a/tests/snapshots/nanos_approve_dai_tokens/00000.png and b/tests/snapshots/nanos_approve_dai_tokens/00000.png differ
diff --git a/tests/snapshots/nanos_approve_dai_tokens/00001.png b/tests/snapshots/nanos_approve_dai_tokens/00001.png
index c56730d..e48314b 100644
Binary files a/tests/snapshots/nanos_approve_dai_tokens/00001.png and b/tests/snapshots/nanos_approve_dai_tokens/00001.png differ
diff --git a/tests/snapshots/nanos_approve_dai_tokens/00002.png b/tests/snapshots/nanos_approve_dai_tokens/00002.png
index 4e39c00..d514de0 100644
Binary files a/tests/snapshots/nanos_approve_dai_tokens/00002.png and b/tests/snapshots/nanos_approve_dai_tokens/00002.png differ
diff --git a/tests/snapshots/nanos_approve_dai_tokens/00003.png b/tests/snapshots/nanos_approve_dai_tokens/00003.png
index 7148c92..95968f9 100644
Binary files a/tests/snapshots/nanos_approve_dai_tokens/00003.png and b/tests/snapshots/nanos_approve_dai_tokens/00003.png differ
diff --git a/tests/snapshots/nanos_approve_dai_tokens/00004.png b/tests/snapshots/nanos_approve_dai_tokens/00004.png
index ee9bfd0..f5c1c9b 100644
Binary files a/tests/snapshots/nanos_approve_dai_tokens/00004.png and b/tests/snapshots/nanos_approve_dai_tokens/00004.png differ
diff --git a/tests/snapshots/nanos_approve_dai_tokens/00005.png b/tests/snapshots/nanos_approve_dai_tokens/00005.png
index cfe7258..839e83a 100644
Binary files a/tests/snapshots/nanos_approve_dai_tokens/00005.png and b/tests/snapshots/nanos_approve_dai_tokens/00005.png differ
diff --git a/tests/snapshots/nanos_approve_dai_tokens/00006.png b/tests/snapshots/nanos_approve_dai_tokens/00006.png
index b59840a..aca9efb 100644
Binary files a/tests/snapshots/nanos_approve_dai_tokens/00006.png and b/tests/snapshots/nanos_approve_dai_tokens/00006.png differ
diff --git a/tests/snapshots/nanos_approve_dai_tokens/00007.png b/tests/snapshots/nanos_approve_dai_tokens/00007.png
index 3158ea6..1c9156c 100644
Binary files a/tests/snapshots/nanos_approve_dai_tokens/00007.png and b/tests/snapshots/nanos_approve_dai_tokens/00007.png differ
diff --git a/tests/snapshots/nanos_approve_dai_tokens/00008.png b/tests/snapshots/nanos_approve_dai_tokens/00008.png
index 0bef4f3..9c7e704 100644
Binary files a/tests/snapshots/nanos_approve_dai_tokens/00008.png and b/tests/snapshots/nanos_approve_dai_tokens/00008.png differ
diff --git a/tests/snapshots/nanos_approve_dai_tokens/00009.png b/tests/snapshots/nanos_approve_dai_tokens/00009.png
new file mode 120000
index 0000000..10266b3
--- /dev/null
+++ b/tests/snapshots/nanos_approve_dai_tokens/00009.png
@@ -0,0 +1 @@
+00007.png
\ No newline at end of file
diff --git a/tests/snapshots/nanos_approve_dai_tokens/00010.png b/tests/snapshots/nanos_approve_dai_tokens/00010.png
new file mode 100644
index 0000000..ce795f3
Binary files /dev/null and b/tests/snapshots/nanos_approve_dai_tokens/00010.png differ
diff --git a/tests/snapshots/nanos_deposit_eth_compound_blind/00000.png b/tests/snapshots/nanos_deposit_eth_compound_blind/00000.png
index 2994983..8d84cc7 100644
Binary files a/tests/snapshots/nanos_deposit_eth_compound_blind/00000.png and b/tests/snapshots/nanos_deposit_eth_compound_blind/00000.png differ
diff --git a/tests/snapshots/nanos_deposit_eth_compound_blind/00001.png b/tests/snapshots/nanos_deposit_eth_compound_blind/00001.png
index 942f5a6..b2ab371 100644
Binary files a/tests/snapshots/nanos_deposit_eth_compound_blind/00001.png and b/tests/snapshots/nanos_deposit_eth_compound_blind/00001.png differ
diff --git a/tests/snapshots/nanos_deposit_eth_compound_blind/00002.png b/tests/snapshots/nanos_deposit_eth_compound_blind/00002.png
index 37538c7..a4fd0e1 100644
Binary files a/tests/snapshots/nanos_deposit_eth_compound_blind/00002.png and b/tests/snapshots/nanos_deposit_eth_compound_blind/00002.png differ
diff --git a/tests/snapshots/nanos_deposit_eth_compound_blind/00003.png b/tests/snapshots/nanos_deposit_eth_compound_blind/00003.png
index 49ba7bc..da34391 100644
Binary files a/tests/snapshots/nanos_deposit_eth_compound_blind/00003.png and b/tests/snapshots/nanos_deposit_eth_compound_blind/00003.png differ
diff --git a/tests/snapshots/nanos_deposit_eth_compound_blind/00004.png b/tests/snapshots/nanos_deposit_eth_compound_blind/00004.png
index 4513833..be3c17e 100644
Binary files a/tests/snapshots/nanos_deposit_eth_compound_blind/00004.png and b/tests/snapshots/nanos_deposit_eth_compound_blind/00004.png differ
diff --git a/tests/snapshots/nanos_deposit_eth_compound_blind/00005.png b/tests/snapshots/nanos_deposit_eth_compound_blind/00005.png
index 1707a8e..08c6b00 100644
Binary files a/tests/snapshots/nanos_deposit_eth_compound_blind/00005.png and b/tests/snapshots/nanos_deposit_eth_compound_blind/00005.png differ
diff --git a/tests/snapshots/nanos_deposit_eth_compound_blind/00006.png b/tests/snapshots/nanos_deposit_eth_compound_blind/00006.png
index eafd4a2..1d461c6 100644
Binary files a/tests/snapshots/nanos_deposit_eth_compound_blind/00006.png and b/tests/snapshots/nanos_deposit_eth_compound_blind/00006.png differ
diff --git a/tests/snapshots/nanos_deposit_eth_compound_blind/00007.png b/tests/snapshots/nanos_deposit_eth_compound_blind/00007.png
index 3158ea6..1c9156c 100644
Binary files a/tests/snapshots/nanos_deposit_eth_compound_blind/00007.png and b/tests/snapshots/nanos_deposit_eth_compound_blind/00007.png differ
diff --git a/tests/snapshots/nanos_deposit_eth_compound_blind/00008.png b/tests/snapshots/nanos_deposit_eth_compound_blind/00008.png
index 0bef4f3..9c7e704 100644
Binary files a/tests/snapshots/nanos_deposit_eth_compound_blind/00008.png and b/tests/snapshots/nanos_deposit_eth_compound_blind/00008.png differ
diff --git a/tests/snapshots/nanos_deposit_eth_compound_blind/00009.png b/tests/snapshots/nanos_deposit_eth_compound_blind/00009.png
new file mode 120000
index 0000000..10266b3
--- /dev/null
+++ b/tests/snapshots/nanos_deposit_eth_compound_blind/00009.png
@@ -0,0 +1 @@
+00007.png
\ No newline at end of file
diff --git a/tests/snapshots/nanos_deposit_eth_compound_blind/00010.png b/tests/snapshots/nanos_deposit_eth_compound_blind/00010.png
new file mode 100644
index 0000000..ce795f3
Binary files /dev/null and b/tests/snapshots/nanos_deposit_eth_compound_blind/00010.png differ
diff --git a/tests/snapshots/nanos_enable_blind_signing/00000.png b/tests/snapshots/nanos_enable_blind_signing/00000.png
index 0bef4f3..ce795f3 100644
Binary files a/tests/snapshots/nanos_enable_blind_signing/00000.png and b/tests/snapshots/nanos_enable_blind_signing/00000.png differ
diff --git a/tests/snapshots/nanos_enable_blind_signing/00001.png b/tests/snapshots/nanos_enable_blind_signing/00001.png
index 29a6bd3..e227980 100644
Binary files a/tests/snapshots/nanos_enable_blind_signing/00001.png and b/tests/snapshots/nanos_enable_blind_signing/00001.png differ
diff --git a/tests/snapshots/nanos_enable_blind_signing/00002.png b/tests/snapshots/nanos_enable_blind_signing/00002.png
index d4bd8ad..04259b1 100644
Binary files a/tests/snapshots/nanos_enable_blind_signing/00002.png and b/tests/snapshots/nanos_enable_blind_signing/00002.png differ
diff --git a/tests/snapshots/nanos_enable_blind_signing/00003.png b/tests/snapshots/nanos_enable_blind_signing/00003.png
index e4ad84f..c72ea3d 100644
Binary files a/tests/snapshots/nanos_enable_blind_signing/00003.png and b/tests/snapshots/nanos_enable_blind_signing/00003.png differ
diff --git a/tests/snapshots/nanos_enable_blind_signing/00004.png b/tests/snapshots/nanos_enable_blind_signing/00004.png
index 7b3e0ea..cabccc8 100644
Binary files a/tests/snapshots/nanos_enable_blind_signing/00004.png and b/tests/snapshots/nanos_enable_blind_signing/00004.png differ
diff --git a/tests/snapshots/nanos_enable_blind_signing/00005.png b/tests/snapshots/nanos_enable_blind_signing/00005.png
index 28e70e8..4c435a4 100644
Binary files a/tests/snapshots/nanos_enable_blind_signing/00005.png and b/tests/snapshots/nanos_enable_blind_signing/00005.png differ
diff --git a/tests/snapshots/nanos_enable_blind_signing/00006.png b/tests/snapshots/nanos_enable_blind_signing/00006.png
index c844a37..10dde6b 100644
Binary files a/tests/snapshots/nanos_enable_blind_signing/00006.png and b/tests/snapshots/nanos_enable_blind_signing/00006.png differ
diff --git a/tests/snapshots/nanos_enable_blind_signing/00007.png b/tests/snapshots/nanos_enable_blind_signing/00007.png
index be02838..70c9092 100644
Binary files a/tests/snapshots/nanos_enable_blind_signing/00007.png and b/tests/snapshots/nanos_enable_blind_signing/00007.png differ
diff --git a/tests/snapshots/nanos_enable_blind_signing/00008.png b/tests/snapshots/nanos_enable_blind_signing/00008.png
index 0bef4f3..ce795f3 100644
Binary files a/tests/snapshots/nanos_enable_blind_signing/00008.png and b/tests/snapshots/nanos_enable_blind_signing/00008.png differ
diff --git a/tests/snapshots/nanos_erc721_approval_for_all/00000.png b/tests/snapshots/nanos_erc721_approval_for_all/00000.png
deleted file mode 100644
index 2994983..0000000
Binary files a/tests/snapshots/nanos_erc721_approval_for_all/00000.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_approval_for_all/00001.png b/tests/snapshots/nanos_erc721_approval_for_all/00001.png
deleted file mode 100644
index ef35bb6..0000000
Binary files a/tests/snapshots/nanos_erc721_approval_for_all/00001.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_approval_for_all/00002.png b/tests/snapshots/nanos_erc721_approval_for_all/00002.png
deleted file mode 100644
index 32dd3f8..0000000
Binary files a/tests/snapshots/nanos_erc721_approval_for_all/00002.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_approval_for_all/00003.png b/tests/snapshots/nanos_erc721_approval_for_all/00003.png
deleted file mode 100644
index c8a38ae..0000000
Binary files a/tests/snapshots/nanos_erc721_approval_for_all/00003.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_approval_for_all/00004.png b/tests/snapshots/nanos_erc721_approval_for_all/00004.png
deleted file mode 100644
index c6051dd..0000000
Binary files a/tests/snapshots/nanos_erc721_approval_for_all/00004.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_approval_for_all/00005.png b/tests/snapshots/nanos_erc721_approval_for_all/00005.png
deleted file mode 100644
index 653e23c..0000000
Binary files a/tests/snapshots/nanos_erc721_approval_for_all/00005.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_approval_for_all/00006.png b/tests/snapshots/nanos_erc721_approval_for_all/00006.png
deleted file mode 100644
index b5efb21..0000000
Binary files a/tests/snapshots/nanos_erc721_approval_for_all/00006.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_approval_for_all/00007.png b/tests/snapshots/nanos_erc721_approval_for_all/00007.png
deleted file mode 100644
index bf629b4..0000000
Binary files a/tests/snapshots/nanos_erc721_approval_for_all/00007.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_approval_for_all/00008.png b/tests/snapshots/nanos_erc721_approval_for_all/00008.png
deleted file mode 100644
index 6e52ae4..0000000
Binary files a/tests/snapshots/nanos_erc721_approval_for_all/00008.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_approval_for_all/00009.png b/tests/snapshots/nanos_erc721_approval_for_all/00009.png
deleted file mode 100644
index 11c298f..0000000
Binary files a/tests/snapshots/nanos_erc721_approval_for_all/00009.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_approval_for_all/00010.png b/tests/snapshots/nanos_erc721_approval_for_all/00010.png
deleted file mode 100644
index 595591a..0000000
Binary files a/tests/snapshots/nanos_erc721_approval_for_all/00010.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_approval_for_all/00011.png b/tests/snapshots/nanos_erc721_approval_for_all/00011.png
deleted file mode 100644
index c3bc4f7..0000000
Binary files a/tests/snapshots/nanos_erc721_approval_for_all/00011.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_approval_for_all/00012.png b/tests/snapshots/nanos_erc721_approval_for_all/00012.png
deleted file mode 100644
index 3158ea6..0000000
Binary files a/tests/snapshots/nanos_erc721_approval_for_all/00012.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_approval_for_all/00013.png b/tests/snapshots/nanos_erc721_approval_for_all/00013.png
deleted file mode 100644
index 0bef4f3..0000000
Binary files a/tests/snapshots/nanos_erc721_approval_for_all/00013.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_safe_transfer/00000.png b/tests/snapshots/nanos_erc721_safe_transfer/00000.png
deleted file mode 100644
index 2994983..0000000
Binary files a/tests/snapshots/nanos_erc721_safe_transfer/00000.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_safe_transfer/00001.png b/tests/snapshots/nanos_erc721_safe_transfer/00001.png
deleted file mode 100644
index 6ff345b..0000000
Binary files a/tests/snapshots/nanos_erc721_safe_transfer/00001.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_safe_transfer/00002.png b/tests/snapshots/nanos_erc721_safe_transfer/00002.png
deleted file mode 100644
index 795947c..0000000
Binary files a/tests/snapshots/nanos_erc721_safe_transfer/00002.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_safe_transfer/00003.png b/tests/snapshots/nanos_erc721_safe_transfer/00003.png
deleted file mode 100644
index ebd34d4..0000000
Binary files a/tests/snapshots/nanos_erc721_safe_transfer/00003.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_safe_transfer/00004.png b/tests/snapshots/nanos_erc721_safe_transfer/00004.png
deleted file mode 100644
index de1b2bc..0000000
Binary files a/tests/snapshots/nanos_erc721_safe_transfer/00004.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_safe_transfer/00005.png b/tests/snapshots/nanos_erc721_safe_transfer/00005.png
deleted file mode 100644
index 5338822..0000000
Binary files a/tests/snapshots/nanos_erc721_safe_transfer/00005.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_safe_transfer/00006.png b/tests/snapshots/nanos_erc721_safe_transfer/00006.png
deleted file mode 100644
index b5efb21..0000000
Binary files a/tests/snapshots/nanos_erc721_safe_transfer/00006.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_safe_transfer/00007.png b/tests/snapshots/nanos_erc721_safe_transfer/00007.png
deleted file mode 100644
index bf629b4..0000000
Binary files a/tests/snapshots/nanos_erc721_safe_transfer/00007.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_safe_transfer/00008.png b/tests/snapshots/nanos_erc721_safe_transfer/00008.png
deleted file mode 100644
index 6e52ae4..0000000
Binary files a/tests/snapshots/nanos_erc721_safe_transfer/00008.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_safe_transfer/00009.png b/tests/snapshots/nanos_erc721_safe_transfer/00009.png
deleted file mode 100644
index 8310029..0000000
Binary files a/tests/snapshots/nanos_erc721_safe_transfer/00009.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_safe_transfer/00010.png b/tests/snapshots/nanos_erc721_safe_transfer/00010.png
deleted file mode 100644
index 3158ea6..0000000
Binary files a/tests/snapshots/nanos_erc721_safe_transfer/00010.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_safe_transfer/00011.png b/tests/snapshots/nanos_erc721_safe_transfer/00011.png
deleted file mode 100644
index 0bef4f3..0000000
Binary files a/tests/snapshots/nanos_erc721_safe_transfer/00011.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer/00000.png b/tests/snapshots/nanos_erc721_transfer/00000.png
deleted file mode 100644
index 2994983..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer/00000.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer/00001.png b/tests/snapshots/nanos_erc721_transfer/00001.png
deleted file mode 100644
index 6ff345b..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer/00001.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer/00002.png b/tests/snapshots/nanos_erc721_transfer/00002.png
deleted file mode 100644
index 36ec626..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer/00002.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer/00003.png b/tests/snapshots/nanos_erc721_transfer/00003.png
deleted file mode 100644
index b656cdf..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer/00003.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer/00004.png b/tests/snapshots/nanos_erc721_transfer/00004.png
deleted file mode 100644
index 250de70..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer/00004.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer/00005.png b/tests/snapshots/nanos_erc721_transfer/00005.png
deleted file mode 100644
index 2caf507..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer/00005.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer/00006.png b/tests/snapshots/nanos_erc721_transfer/00006.png
deleted file mode 100644
index f7676d0..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer/00006.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer/00007.png b/tests/snapshots/nanos_erc721_transfer/00007.png
deleted file mode 100644
index 9eeff67..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer/00007.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer/00008.png b/tests/snapshots/nanos_erc721_transfer/00008.png
deleted file mode 100644
index c830a35..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer/00008.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer/00009.png b/tests/snapshots/nanos_erc721_transfer/00009.png
deleted file mode 100644
index 11c298f..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer/00009.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer/00010.png b/tests/snapshots/nanos_erc721_transfer/00010.png
deleted file mode 100644
index 0a287c7..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer/00010.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer/00011.png b/tests/snapshots/nanos_erc721_transfer/00011.png
deleted file mode 100644
index 8867437..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer/00011.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer/00012.png b/tests/snapshots/nanos_erc721_transfer/00012.png
deleted file mode 100644
index 3158ea6..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer/00012.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer/00013.png b/tests/snapshots/nanos_erc721_transfer/00013.png
deleted file mode 100644
index 0bef4f3..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer/00013.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer_with_eth/00000.png b/tests/snapshots/nanos_erc721_transfer_with_eth/00000.png
deleted file mode 100644
index 2994983..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer_with_eth/00000.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer_with_eth/00001.png b/tests/snapshots/nanos_erc721_transfer_with_eth/00001.png
deleted file mode 100644
index 6ff345b..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer_with_eth/00001.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer_with_eth/00002.png b/tests/snapshots/nanos_erc721_transfer_with_eth/00002.png
deleted file mode 100644
index 36ec626..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer_with_eth/00002.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer_with_eth/00003.png b/tests/snapshots/nanos_erc721_transfer_with_eth/00003.png
deleted file mode 100644
index b656cdf..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer_with_eth/00003.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer_with_eth/00004.png b/tests/snapshots/nanos_erc721_transfer_with_eth/00004.png
deleted file mode 100644
index 250de70..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer_with_eth/00004.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer_with_eth/00005.png b/tests/snapshots/nanos_erc721_transfer_with_eth/00005.png
deleted file mode 100644
index 2caf507..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer_with_eth/00005.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer_with_eth/00006.png b/tests/snapshots/nanos_erc721_transfer_with_eth/00006.png
deleted file mode 100644
index f7676d0..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer_with_eth/00006.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer_with_eth/00007.png b/tests/snapshots/nanos_erc721_transfer_with_eth/00007.png
deleted file mode 100644
index 9eeff67..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer_with_eth/00007.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer_with_eth/00008.png b/tests/snapshots/nanos_erc721_transfer_with_eth/00008.png
deleted file mode 100644
index c830a35..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer_with_eth/00008.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer_with_eth/00009.png b/tests/snapshots/nanos_erc721_transfer_with_eth/00009.png
deleted file mode 100644
index 84d25eb..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer_with_eth/00009.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer_with_eth/00010.png b/tests/snapshots/nanos_erc721_transfer_with_eth/00010.png
deleted file mode 100644
index 11c298f..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer_with_eth/00010.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer_with_eth/00011.png b/tests/snapshots/nanos_erc721_transfer_with_eth/00011.png
deleted file mode 100644
index 0a287c7..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer_with_eth/00011.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer_with_eth/00012.png b/tests/snapshots/nanos_erc721_transfer_with_eth/00012.png
deleted file mode 100644
index 8867437..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer_with_eth/00012.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer_with_eth/00013.png b/tests/snapshots/nanos_erc721_transfer_with_eth/00013.png
deleted file mode 100644
index 3158ea6..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer_with_eth/00013.png and /dev/null differ
diff --git a/tests/snapshots/nanos_erc721_transfer_with_eth/00014.png b/tests/snapshots/nanos_erc721_transfer_with_eth/00014.png
deleted file mode 100644
index 0bef4f3..0000000
Binary files a/tests/snapshots/nanos_erc721_transfer_with_eth/00014.png and /dev/null differ
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00000.png b/tests/snapshots/nanos_starkware_usdt_deposit/00000.png
index 2994983..8d84cc7 100644
Binary files a/tests/snapshots/nanos_starkware_usdt_deposit/00000.png and b/tests/snapshots/nanos_starkware_usdt_deposit/00000.png differ
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00001.png b/tests/snapshots/nanos_starkware_usdt_deposit/00001.png
index 888cad3..049c0d8 100644
Binary files a/tests/snapshots/nanos_starkware_usdt_deposit/00001.png and b/tests/snapshots/nanos_starkware_usdt_deposit/00001.png differ
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00002.png b/tests/snapshots/nanos_starkware_usdt_deposit/00002.png
index 637a898..e902340 100644
Binary files a/tests/snapshots/nanos_starkware_usdt_deposit/00002.png and b/tests/snapshots/nanos_starkware_usdt_deposit/00002.png differ
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00003.png b/tests/snapshots/nanos_starkware_usdt_deposit/00003.png
index ef02a09..ed560d5 100644
Binary files a/tests/snapshots/nanos_starkware_usdt_deposit/00003.png and b/tests/snapshots/nanos_starkware_usdt_deposit/00003.png differ
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00004.png b/tests/snapshots/nanos_starkware_usdt_deposit/00004.png
index 3372d18..8aa3536 100644
Binary files a/tests/snapshots/nanos_starkware_usdt_deposit/00004.png and b/tests/snapshots/nanos_starkware_usdt_deposit/00004.png differ
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00005.png b/tests/snapshots/nanos_starkware_usdt_deposit/00005.png
index 0805b33..200f905 100644
Binary files a/tests/snapshots/nanos_starkware_usdt_deposit/00005.png and b/tests/snapshots/nanos_starkware_usdt_deposit/00005.png differ
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00006.png b/tests/snapshots/nanos_starkware_usdt_deposit/00006.png
index d7891ee..f108416 100644
Binary files a/tests/snapshots/nanos_starkware_usdt_deposit/00006.png and b/tests/snapshots/nanos_starkware_usdt_deposit/00006.png differ
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00007.png b/tests/snapshots/nanos_starkware_usdt_deposit/00007.png
index 5bf1130..6577660 100644
Binary files a/tests/snapshots/nanos_starkware_usdt_deposit/00007.png and b/tests/snapshots/nanos_starkware_usdt_deposit/00007.png differ
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00008.png b/tests/snapshots/nanos_starkware_usdt_deposit/00008.png
index a0286ff..2e6aeb8 100644
Binary files a/tests/snapshots/nanos_starkware_usdt_deposit/00008.png and b/tests/snapshots/nanos_starkware_usdt_deposit/00008.png differ
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00009.png b/tests/snapshots/nanos_starkware_usdt_deposit/00009.png
index c602bbd..d242dc5 100644
Binary files a/tests/snapshots/nanos_starkware_usdt_deposit/00009.png and b/tests/snapshots/nanos_starkware_usdt_deposit/00009.png differ
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00010.png b/tests/snapshots/nanos_starkware_usdt_deposit/00010.png
index c81ed09..a62ca78 100644
Binary files a/tests/snapshots/nanos_starkware_usdt_deposit/00010.png and b/tests/snapshots/nanos_starkware_usdt_deposit/00010.png differ
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00011.png b/tests/snapshots/nanos_starkware_usdt_deposit/00011.png
index d762697..6c07303 100644
Binary files a/tests/snapshots/nanos_starkware_usdt_deposit/00011.png and b/tests/snapshots/nanos_starkware_usdt_deposit/00011.png differ
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00012.png b/tests/snapshots/nanos_starkware_usdt_deposit/00012.png
index a595174..3b16ec0 100644
Binary files a/tests/snapshots/nanos_starkware_usdt_deposit/00012.png and b/tests/snapshots/nanos_starkware_usdt_deposit/00012.png differ
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00013.png b/tests/snapshots/nanos_starkware_usdt_deposit/00013.png
index 3158ea6..1c9156c 100644
Binary files a/tests/snapshots/nanos_starkware_usdt_deposit/00013.png and b/tests/snapshots/nanos_starkware_usdt_deposit/00013.png differ
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00014.png b/tests/snapshots/nanos_starkware_usdt_deposit/00014.png
index 0bef4f3..9c7e704 100644
Binary files a/tests/snapshots/nanos_starkware_usdt_deposit/00014.png and b/tests/snapshots/nanos_starkware_usdt_deposit/00014.png differ
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00015.png b/tests/snapshots/nanos_starkware_usdt_deposit/00015.png
new file mode 120000
index 0000000..79f379f
--- /dev/null
+++ b/tests/snapshots/nanos_starkware_usdt_deposit/00015.png
@@ -0,0 +1 @@
+00013.png
\ No newline at end of file
diff --git a/tests/snapshots/nanos_starkware_usdt_deposit/00016.png b/tests/snapshots/nanos_starkware_usdt_deposit/00016.png
new file mode 100644
index 0000000..ce795f3
Binary files /dev/null and b/tests/snapshots/nanos_starkware_usdt_deposit/00016.png differ
diff --git a/tests/snapshots/nanos_transfer_112233445566_network/00000.png b/tests/snapshots/nanos_transfer_112233445566_network/00000.png
index 2994983..8d84cc7 100644
Binary files a/tests/snapshots/nanos_transfer_112233445566_network/00000.png and b/tests/snapshots/nanos_transfer_112233445566_network/00000.png differ
diff --git a/tests/snapshots/nanos_transfer_112233445566_network/00001.png b/tests/snapshots/nanos_transfer_112233445566_network/00001.png
index 4cd3e38..7ebda4f 100644
Binary files a/tests/snapshots/nanos_transfer_112233445566_network/00001.png and b/tests/snapshots/nanos_transfer_112233445566_network/00001.png differ
diff --git a/tests/snapshots/nanos_transfer_112233445566_network/00002.png b/tests/snapshots/nanos_transfer_112233445566_network/00002.png
index 11ae75e..c2af54e 100644
Binary files a/tests/snapshots/nanos_transfer_112233445566_network/00002.png and b/tests/snapshots/nanos_transfer_112233445566_network/00002.png differ
diff --git a/tests/snapshots/nanos_transfer_112233445566_network/00003.png b/tests/snapshots/nanos_transfer_112233445566_network/00003.png
index e042010..a54fefd 100644
Binary files a/tests/snapshots/nanos_transfer_112233445566_network/00003.png and b/tests/snapshots/nanos_transfer_112233445566_network/00003.png differ
diff --git a/tests/snapshots/nanos_transfer_112233445566_network/00004.png b/tests/snapshots/nanos_transfer_112233445566_network/00004.png
index f979f71..8656b81 100644
Binary files a/tests/snapshots/nanos_transfer_112233445566_network/00004.png and b/tests/snapshots/nanos_transfer_112233445566_network/00004.png differ
diff --git a/tests/snapshots/nanos_transfer_112233445566_network/00005.png b/tests/snapshots/nanos_transfer_112233445566_network/00005.png
index 93c90c5..fd3155c 100644
Binary files a/tests/snapshots/nanos_transfer_112233445566_network/00005.png and b/tests/snapshots/nanos_transfer_112233445566_network/00005.png differ
diff --git a/tests/snapshots/nanos_transfer_112233445566_network/00006.png b/tests/snapshots/nanos_transfer_112233445566_network/00006.png
index 402c20d..c63f25f 100644
Binary files a/tests/snapshots/nanos_transfer_112233445566_network/00006.png and b/tests/snapshots/nanos_transfer_112233445566_network/00006.png differ
diff --git a/tests/snapshots/nanos_transfer_112233445566_network/00007.png b/tests/snapshots/nanos_transfer_112233445566_network/00007.png
index 3242d61..8e15de5 100644
Binary files a/tests/snapshots/nanos_transfer_112233445566_network/00007.png and b/tests/snapshots/nanos_transfer_112233445566_network/00007.png differ
diff --git a/tests/snapshots/nanos_transfer_112233445566_network/00008.png b/tests/snapshots/nanos_transfer_112233445566_network/00008.png
index 8b996b5..c84d3ec 100644
Binary files a/tests/snapshots/nanos_transfer_112233445566_network/00008.png and b/tests/snapshots/nanos_transfer_112233445566_network/00008.png differ
diff --git a/tests/snapshots/nanos_transfer_112233445566_network/00009.png b/tests/snapshots/nanos_transfer_112233445566_network/00009.png
index 3158ea6..1c9156c 100644
Binary files a/tests/snapshots/nanos_transfer_112233445566_network/00009.png and b/tests/snapshots/nanos_transfer_112233445566_network/00009.png differ
diff --git a/tests/snapshots/nanos_transfer_112233445566_network/00010.png b/tests/snapshots/nanos_transfer_112233445566_network/00010.png
index 0bef4f3..9c7e704 100644
Binary files a/tests/snapshots/nanos_transfer_112233445566_network/00010.png and b/tests/snapshots/nanos_transfer_112233445566_network/00010.png differ
diff --git a/tests/snapshots/nanos_transfer_112233445566_network/00011.png b/tests/snapshots/nanos_transfer_112233445566_network/00011.png
new file mode 120000
index 0000000..489390a
--- /dev/null
+++ b/tests/snapshots/nanos_transfer_112233445566_network/00011.png
@@ -0,0 +1 @@
+00009.png
\ No newline at end of file
diff --git a/tests/snapshots/nanos_transfer_112233445566_network/00012.png b/tests/snapshots/nanos_transfer_112233445566_network/00012.png
new file mode 100644
index 0000000..ce795f3
Binary files /dev/null and b/tests/snapshots/nanos_transfer_112233445566_network/00012.png differ
diff --git a/tests/snapshots/nanos_transfer_bsc/00000.png b/tests/snapshots/nanos_transfer_bsc/00000.png
index 2994983..8d84cc7 100644
Binary files a/tests/snapshots/nanos_transfer_bsc/00000.png and b/tests/snapshots/nanos_transfer_bsc/00000.png differ
diff --git a/tests/snapshots/nanos_transfer_bsc/00001.png b/tests/snapshots/nanos_transfer_bsc/00001.png
index a25e91e..837fd64 100644
Binary files a/tests/snapshots/nanos_transfer_bsc/00001.png and b/tests/snapshots/nanos_transfer_bsc/00001.png differ
diff --git a/tests/snapshots/nanos_transfer_bsc/00002.png b/tests/snapshots/nanos_transfer_bsc/00002.png
index 11ae75e..c2af54e 100644
Binary files a/tests/snapshots/nanos_transfer_bsc/00002.png and b/tests/snapshots/nanos_transfer_bsc/00002.png differ
diff --git a/tests/snapshots/nanos_transfer_bsc/00003.png b/tests/snapshots/nanos_transfer_bsc/00003.png
index e042010..a54fefd 100644
Binary files a/tests/snapshots/nanos_transfer_bsc/00003.png and b/tests/snapshots/nanos_transfer_bsc/00003.png differ
diff --git a/tests/snapshots/nanos_transfer_bsc/00004.png b/tests/snapshots/nanos_transfer_bsc/00004.png
index f979f71..8656b81 100644
Binary files a/tests/snapshots/nanos_transfer_bsc/00004.png and b/tests/snapshots/nanos_transfer_bsc/00004.png differ
diff --git a/tests/snapshots/nanos_transfer_bsc/00005.png b/tests/snapshots/nanos_transfer_bsc/00005.png
index 93c90c5..fd3155c 100644
Binary files a/tests/snapshots/nanos_transfer_bsc/00005.png and b/tests/snapshots/nanos_transfer_bsc/00005.png differ
diff --git a/tests/snapshots/nanos_transfer_bsc/00006.png b/tests/snapshots/nanos_transfer_bsc/00006.png
index 402c20d..c63f25f 100644
Binary files a/tests/snapshots/nanos_transfer_bsc/00006.png and b/tests/snapshots/nanos_transfer_bsc/00006.png differ
diff --git a/tests/snapshots/nanos_transfer_bsc/00007.png b/tests/snapshots/nanos_transfer_bsc/00007.png
index ef98ec6..371c126 100644
Binary files a/tests/snapshots/nanos_transfer_bsc/00007.png and b/tests/snapshots/nanos_transfer_bsc/00007.png differ
diff --git a/tests/snapshots/nanos_transfer_bsc/00008.png b/tests/snapshots/nanos_transfer_bsc/00008.png
index 6a16a42..95e7fbb 100644
Binary files a/tests/snapshots/nanos_transfer_bsc/00008.png and b/tests/snapshots/nanos_transfer_bsc/00008.png differ
diff --git a/tests/snapshots/nanos_transfer_bsc/00009.png b/tests/snapshots/nanos_transfer_bsc/00009.png
index 3158ea6..1c9156c 100644
Binary files a/tests/snapshots/nanos_transfer_bsc/00009.png and b/tests/snapshots/nanos_transfer_bsc/00009.png differ
diff --git a/tests/snapshots/nanos_transfer_bsc/00010.png b/tests/snapshots/nanos_transfer_bsc/00010.png
index 0bef4f3..9c7e704 100644
Binary files a/tests/snapshots/nanos_transfer_bsc/00010.png and b/tests/snapshots/nanos_transfer_bsc/00010.png differ
diff --git a/tests/snapshots/nanos_transfer_bsc/00011.png b/tests/snapshots/nanos_transfer_bsc/00011.png
new file mode 120000
index 0000000..489390a
--- /dev/null
+++ b/tests/snapshots/nanos_transfer_bsc/00011.png
@@ -0,0 +1 @@
+00009.png
\ No newline at end of file
diff --git a/tests/snapshots/nanos_transfer_bsc/00012.png b/tests/snapshots/nanos_transfer_bsc/00012.png
new file mode 100644
index 0000000..ce795f3
Binary files /dev/null and b/tests/snapshots/nanos_transfer_bsc/00012.png differ
diff --git a/tests/snapshots/nanos_transfer_eip1559/00000.png b/tests/snapshots/nanos_transfer_eip1559/00000.png
index 2994983..8d84cc7 100644
Binary files a/tests/snapshots/nanos_transfer_eip1559/00000.png and b/tests/snapshots/nanos_transfer_eip1559/00000.png differ
diff --git a/tests/snapshots/nanos_transfer_eip1559/00001.png b/tests/snapshots/nanos_transfer_eip1559/00001.png
index 0bf93d8..9f26513 100644
Binary files a/tests/snapshots/nanos_transfer_eip1559/00001.png and b/tests/snapshots/nanos_transfer_eip1559/00001.png differ
diff --git a/tests/snapshots/nanos_transfer_eip1559/00002.png b/tests/snapshots/nanos_transfer_eip1559/00002.png
index 54bb773..701b26b 100644
Binary files a/tests/snapshots/nanos_transfer_eip1559/00002.png and b/tests/snapshots/nanos_transfer_eip1559/00002.png differ
diff --git a/tests/snapshots/nanos_transfer_eip1559/00003.png b/tests/snapshots/nanos_transfer_eip1559/00003.png
index 21eac94..32a2ee9 100644
Binary files a/tests/snapshots/nanos_transfer_eip1559/00003.png and b/tests/snapshots/nanos_transfer_eip1559/00003.png differ
diff --git a/tests/snapshots/nanos_transfer_eip1559/00004.png b/tests/snapshots/nanos_transfer_eip1559/00004.png
index 4baa24f..1ed3d77 100644
Binary files a/tests/snapshots/nanos_transfer_eip1559/00004.png and b/tests/snapshots/nanos_transfer_eip1559/00004.png differ
diff --git a/tests/snapshots/nanos_transfer_eip1559/00005.png b/tests/snapshots/nanos_transfer_eip1559/00005.png
index 5512e8a..f19d91c 100644
Binary files a/tests/snapshots/nanos_transfer_eip1559/00005.png and b/tests/snapshots/nanos_transfer_eip1559/00005.png differ
diff --git a/tests/snapshots/nanos_transfer_eip1559/00006.png b/tests/snapshots/nanos_transfer_eip1559/00006.png
index 3158ea6..1c9156c 100644
Binary files a/tests/snapshots/nanos_transfer_eip1559/00006.png and b/tests/snapshots/nanos_transfer_eip1559/00006.png differ
diff --git a/tests/snapshots/nanos_transfer_eip1559/00007.png b/tests/snapshots/nanos_transfer_eip1559/00007.png
index 0bef4f3..9c7e704 100644
Binary files a/tests/snapshots/nanos_transfer_eip1559/00007.png and b/tests/snapshots/nanos_transfer_eip1559/00007.png differ
diff --git a/tests/snapshots/nanos_transfer_eip1559/00008.png b/tests/snapshots/nanos_transfer_eip1559/00008.png
new file mode 120000
index 0000000..e4abcae
--- /dev/null
+++ b/tests/snapshots/nanos_transfer_eip1559/00008.png
@@ -0,0 +1 @@
+00006.png
\ No newline at end of file
diff --git a/tests/snapshots/nanos_transfer_eip1559/00009.png b/tests/snapshots/nanos_transfer_eip1559/00009.png
new file mode 100644
index 0000000..ce795f3
Binary files /dev/null and b/tests/snapshots/nanos_transfer_eip1559/00009.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum/00000.png b/tests/snapshots/nanos_transfer_ethereum/00000.png
index 2994983..8d84cc7 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum/00000.png and b/tests/snapshots/nanos_transfer_ethereum/00000.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum/00001.png b/tests/snapshots/nanos_transfer_ethereum/00001.png
index 4cd3e38..7ebda4f 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum/00001.png and b/tests/snapshots/nanos_transfer_ethereum/00001.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum/00002.png b/tests/snapshots/nanos_transfer_ethereum/00002.png
index 11ae75e..c2af54e 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum/00002.png and b/tests/snapshots/nanos_transfer_ethereum/00002.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum/00003.png b/tests/snapshots/nanos_transfer_ethereum/00003.png
index e042010..a54fefd 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum/00003.png and b/tests/snapshots/nanos_transfer_ethereum/00003.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum/00004.png b/tests/snapshots/nanos_transfer_ethereum/00004.png
index f979f71..8656b81 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum/00004.png and b/tests/snapshots/nanos_transfer_ethereum/00004.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum/00005.png b/tests/snapshots/nanos_transfer_ethereum/00005.png
index 93c90c5..fd3155c 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum/00005.png and b/tests/snapshots/nanos_transfer_ethereum/00005.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum/00006.png b/tests/snapshots/nanos_transfer_ethereum/00006.png
index 402c20d..c63f25f 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum/00006.png and b/tests/snapshots/nanos_transfer_ethereum/00006.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum/00007.png b/tests/snapshots/nanos_transfer_ethereum/00007.png
index 8b996b5..c84d3ec 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum/00007.png and b/tests/snapshots/nanos_transfer_ethereum/00007.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum/00008.png b/tests/snapshots/nanos_transfer_ethereum/00008.png
index 3158ea6..1c9156c 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum/00008.png and b/tests/snapshots/nanos_transfer_ethereum/00008.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum/00009.png b/tests/snapshots/nanos_transfer_ethereum/00009.png
index 0bef4f3..9c7e704 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum/00009.png and b/tests/snapshots/nanos_transfer_ethereum/00009.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum/00010.png b/tests/snapshots/nanos_transfer_ethereum/00010.png
new file mode 120000
index 0000000..de12d01
--- /dev/null
+++ b/tests/snapshots/nanos_transfer_ethereum/00010.png
@@ -0,0 +1 @@
+00008.png
\ No newline at end of file
diff --git a/tests/snapshots/nanos_transfer_ethereum/00011.png b/tests/snapshots/nanos_transfer_ethereum/00011.png
new file mode 100644
index 0000000..ce795f3
Binary files /dev/null and b/tests/snapshots/nanos_transfer_ethereum/00011.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_5234_network/00000.png b/tests/snapshots/nanos_transfer_ethereum_5234_network/00000.png
index 2994983..8d84cc7 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_5234_network/00000.png and b/tests/snapshots/nanos_transfer_ethereum_5234_network/00000.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_5234_network/00001.png b/tests/snapshots/nanos_transfer_ethereum_5234_network/00001.png
index 4cd3e38..7ebda4f 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_5234_network/00001.png and b/tests/snapshots/nanos_transfer_ethereum_5234_network/00001.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_5234_network/00002.png b/tests/snapshots/nanos_transfer_ethereum_5234_network/00002.png
index 11ae75e..c2af54e 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_5234_network/00002.png and b/tests/snapshots/nanos_transfer_ethereum_5234_network/00002.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_5234_network/00003.png b/tests/snapshots/nanos_transfer_ethereum_5234_network/00003.png
index e042010..a54fefd 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_5234_network/00003.png and b/tests/snapshots/nanos_transfer_ethereum_5234_network/00003.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_5234_network/00004.png b/tests/snapshots/nanos_transfer_ethereum_5234_network/00004.png
index f979f71..8656b81 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_5234_network/00004.png and b/tests/snapshots/nanos_transfer_ethereum_5234_network/00004.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_5234_network/00005.png b/tests/snapshots/nanos_transfer_ethereum_5234_network/00005.png
index 93c90c5..fd3155c 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_5234_network/00005.png and b/tests/snapshots/nanos_transfer_ethereum_5234_network/00005.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_5234_network/00006.png b/tests/snapshots/nanos_transfer_ethereum_5234_network/00006.png
index 402c20d..c63f25f 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_5234_network/00006.png and b/tests/snapshots/nanos_transfer_ethereum_5234_network/00006.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_5234_network/00007.png b/tests/snapshots/nanos_transfer_ethereum_5234_network/00007.png
index 9dde424..e1d2861 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_5234_network/00007.png and b/tests/snapshots/nanos_transfer_ethereum_5234_network/00007.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_5234_network/00008.png b/tests/snapshots/nanos_transfer_ethereum_5234_network/00008.png
index 8b996b5..c84d3ec 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_5234_network/00008.png and b/tests/snapshots/nanos_transfer_ethereum_5234_network/00008.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_5234_network/00009.png b/tests/snapshots/nanos_transfer_ethereum_5234_network/00009.png
index 3158ea6..1c9156c 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_5234_network/00009.png and b/tests/snapshots/nanos_transfer_ethereum_5234_network/00009.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_5234_network/00010.png b/tests/snapshots/nanos_transfer_ethereum_5234_network/00010.png
index 0bef4f3..9c7e704 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_5234_network/00010.png and b/tests/snapshots/nanos_transfer_ethereum_5234_network/00010.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_5234_network/00011.png b/tests/snapshots/nanos_transfer_ethereum_5234_network/00011.png
new file mode 120000
index 0000000..489390a
--- /dev/null
+++ b/tests/snapshots/nanos_transfer_ethereum_5234_network/00011.png
@@ -0,0 +1 @@
+00009.png
\ No newline at end of file
diff --git a/tests/snapshots/nanos_transfer_ethereum_5234_network/00012.png b/tests/snapshots/nanos_transfer_ethereum_5234_network/00012.png
new file mode 100644
index 0000000..ce795f3
Binary files /dev/null and b/tests/snapshots/nanos_transfer_ethereum_5234_network/00012.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_clone/00000.png b/tests/snapshots/nanos_transfer_ethereum_clone/00000.png
index 2994983..8d84cc7 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_clone/00000.png and b/tests/snapshots/nanos_transfer_ethereum_clone/00000.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_clone/00001.png b/tests/snapshots/nanos_transfer_ethereum_clone/00001.png
index 660399c..77e79af 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_clone/00001.png and b/tests/snapshots/nanos_transfer_ethereum_clone/00001.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_clone/00002.png b/tests/snapshots/nanos_transfer_ethereum_clone/00002.png
index 11ae75e..c2af54e 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_clone/00002.png and b/tests/snapshots/nanos_transfer_ethereum_clone/00002.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_clone/00003.png b/tests/snapshots/nanos_transfer_ethereum_clone/00003.png
index e042010..a54fefd 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_clone/00003.png and b/tests/snapshots/nanos_transfer_ethereum_clone/00003.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_clone/00004.png b/tests/snapshots/nanos_transfer_ethereum_clone/00004.png
index f979f71..8656b81 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_clone/00004.png and b/tests/snapshots/nanos_transfer_ethereum_clone/00004.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_clone/00005.png b/tests/snapshots/nanos_transfer_ethereum_clone/00005.png
index 93c90c5..fd3155c 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_clone/00005.png and b/tests/snapshots/nanos_transfer_ethereum_clone/00005.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_clone/00006.png b/tests/snapshots/nanos_transfer_ethereum_clone/00006.png
index 402c20d..c63f25f 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_clone/00006.png and b/tests/snapshots/nanos_transfer_ethereum_clone/00006.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_clone/00007.png b/tests/snapshots/nanos_transfer_ethereum_clone/00007.png
index 85a8960..aa0f496 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_clone/00007.png and b/tests/snapshots/nanos_transfer_ethereum_clone/00007.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_clone/00008.png b/tests/snapshots/nanos_transfer_ethereum_clone/00008.png
index 3158ea6..1c9156c 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_clone/00008.png and b/tests/snapshots/nanos_transfer_ethereum_clone/00008.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_clone/00009.png b/tests/snapshots/nanos_transfer_ethereum_clone/00009.png
index 0bef4f3..9c7e704 100644
Binary files a/tests/snapshots/nanos_transfer_ethereum_clone/00009.png and b/tests/snapshots/nanos_transfer_ethereum_clone/00009.png differ
diff --git a/tests/snapshots/nanos_transfer_ethereum_clone/00010.png b/tests/snapshots/nanos_transfer_ethereum_clone/00010.png
new file mode 120000
index 0000000..de12d01
--- /dev/null
+++ b/tests/snapshots/nanos_transfer_ethereum_clone/00010.png
@@ -0,0 +1 @@
+00008.png
\ No newline at end of file
diff --git a/tests/snapshots/nanos_transfer_ethereum_clone/00011.png b/tests/snapshots/nanos_transfer_ethereum_clone/00011.png
new file mode 100644
index 0000000..ce795f3
Binary files /dev/null and b/tests/snapshots/nanos_transfer_ethereum_clone/00011.png differ
diff --git a/tests/snapshots/nanos_transfer_palm_network/00000.png b/tests/snapshots/nanos_transfer_palm_network/00000.png
index 2994983..8d84cc7 100644
Binary files a/tests/snapshots/nanos_transfer_palm_network/00000.png and b/tests/snapshots/nanos_transfer_palm_network/00000.png differ
diff --git a/tests/snapshots/nanos_transfer_palm_network/00001.png b/tests/snapshots/nanos_transfer_palm_network/00001.png
index d5afc7a..b66c0ff 100644
Binary files a/tests/snapshots/nanos_transfer_palm_network/00001.png and b/tests/snapshots/nanos_transfer_palm_network/00001.png differ
diff --git a/tests/snapshots/nanos_transfer_palm_network/00002.png b/tests/snapshots/nanos_transfer_palm_network/00002.png
index 11ae75e..c2af54e 100644
Binary files a/tests/snapshots/nanos_transfer_palm_network/00002.png and b/tests/snapshots/nanos_transfer_palm_network/00002.png differ
diff --git a/tests/snapshots/nanos_transfer_palm_network/00003.png b/tests/snapshots/nanos_transfer_palm_network/00003.png
index e042010..a54fefd 100644
Binary files a/tests/snapshots/nanos_transfer_palm_network/00003.png and b/tests/snapshots/nanos_transfer_palm_network/00003.png differ
diff --git a/tests/snapshots/nanos_transfer_palm_network/00004.png b/tests/snapshots/nanos_transfer_palm_network/00004.png
index f979f71..8656b81 100644
Binary files a/tests/snapshots/nanos_transfer_palm_network/00004.png and b/tests/snapshots/nanos_transfer_palm_network/00004.png differ
diff --git a/tests/snapshots/nanos_transfer_palm_network/00005.png b/tests/snapshots/nanos_transfer_palm_network/00005.png
index 93c90c5..fd3155c 100644
Binary files a/tests/snapshots/nanos_transfer_palm_network/00005.png and b/tests/snapshots/nanos_transfer_palm_network/00005.png differ
diff --git a/tests/snapshots/nanos_transfer_palm_network/00006.png b/tests/snapshots/nanos_transfer_palm_network/00006.png
index 402c20d..c63f25f 100644
Binary files a/tests/snapshots/nanos_transfer_palm_network/00006.png and b/tests/snapshots/nanos_transfer_palm_network/00006.png differ
diff --git a/tests/snapshots/nanos_transfer_palm_network/00007.png b/tests/snapshots/nanos_transfer_palm_network/00007.png
index 297527f..2bac337 100644
Binary files a/tests/snapshots/nanos_transfer_palm_network/00007.png and b/tests/snapshots/nanos_transfer_palm_network/00007.png differ
diff --git a/tests/snapshots/nanos_transfer_palm_network/00008.png b/tests/snapshots/nanos_transfer_palm_network/00008.png
index bf970a9..193f821 100644
Binary files a/tests/snapshots/nanos_transfer_palm_network/00008.png and b/tests/snapshots/nanos_transfer_palm_network/00008.png differ
diff --git a/tests/snapshots/nanos_transfer_palm_network/00009.png b/tests/snapshots/nanos_transfer_palm_network/00009.png
index 3158ea6..1c9156c 100644
Binary files a/tests/snapshots/nanos_transfer_palm_network/00009.png and b/tests/snapshots/nanos_transfer_palm_network/00009.png differ
diff --git a/tests/snapshots/nanos_transfer_palm_network/00010.png b/tests/snapshots/nanos_transfer_palm_network/00010.png
index 0bef4f3..9c7e704 100644
Binary files a/tests/snapshots/nanos_transfer_palm_network/00010.png and b/tests/snapshots/nanos_transfer_palm_network/00010.png differ
diff --git a/tests/snapshots/nanos_transfer_palm_network/00011.png b/tests/snapshots/nanos_transfer_palm_network/00011.png
new file mode 120000
index 0000000..489390a
--- /dev/null
+++ b/tests/snapshots/nanos_transfer_palm_network/00011.png
@@ -0,0 +1 @@
+00009.png
\ No newline at end of file
diff --git a/tests/snapshots/nanos_transfer_palm_network/00012.png b/tests/snapshots/nanos_transfer_palm_network/00012.png
new file mode 100644
index 0000000..ce795f3
Binary files /dev/null and b/tests/snapshots/nanos_transfer_palm_network/00012.png differ
diff --git a/tests/snapshots/nanos_try_to_blind_sign_with_setting_disabled/00000.png b/tests/snapshots/nanos_try_to_blind_sign_with_setting_disabled/00000.png
index e47d648..c2420af 100644
Binary files a/tests/snapshots/nanos_try_to_blind_sign_with_setting_disabled/00000.png and b/tests/snapshots/nanos_try_to_blind_sign_with_setting_disabled/00000.png differ
diff --git a/tests/snapshots/nanos_try_to_blind_sign_with_setting_disabled/00001.png b/tests/snapshots/nanos_try_to_blind_sign_with_setting_disabled/00001.png
index b4443b6..b31e455 100644
Binary files a/tests/snapshots/nanos_try_to_blind_sign_with_setting_disabled/00001.png and b/tests/snapshots/nanos_try_to_blind_sign_with_setting_disabled/00001.png differ
diff --git a/tests/snapshots/nanos_try_to_blind_sign_with_setting_disabled/00002.png b/tests/snapshots/nanos_try_to_blind_sign_with_setting_disabled/00002.png
index 0bef4f3..ce795f3 100644
Binary files a/tests/snapshots/nanos_try_to_blind_sign_with_setting_disabled/00002.png and b/tests/snapshots/nanos_try_to_blind_sign_with_setting_disabled/00002.png differ
diff --git a/tests/snapshots/nanox_approve_dai_tokens/00000.png b/tests/snapshots/nanox_approve_dai_tokens/00000.png
index 4a982c5..487ea10 100644
Binary files a/tests/snapshots/nanox_approve_dai_tokens/00000.png and b/tests/snapshots/nanox_approve_dai_tokens/00000.png differ
diff --git a/tests/snapshots/nanox_approve_dai_tokens/00001.png b/tests/snapshots/nanox_approve_dai_tokens/00001.png
index c9f6ee0..3add524 100644
Binary files a/tests/snapshots/nanox_approve_dai_tokens/00001.png and b/tests/snapshots/nanox_approve_dai_tokens/00001.png differ
diff --git a/tests/snapshots/nanox_approve_dai_tokens/00002.png b/tests/snapshots/nanox_approve_dai_tokens/00002.png
index 6207f9e..f42c8d1 100644
Binary files a/tests/snapshots/nanox_approve_dai_tokens/00002.png and b/tests/snapshots/nanox_approve_dai_tokens/00002.png differ
diff --git a/tests/snapshots/nanox_approve_dai_tokens/00003.png b/tests/snapshots/nanox_approve_dai_tokens/00003.png
index 4f601ca..d1a0cdc 100644
Binary files a/tests/snapshots/nanox_approve_dai_tokens/00003.png and b/tests/snapshots/nanox_approve_dai_tokens/00003.png differ
diff --git a/tests/snapshots/nanox_approve_dai_tokens/00004.png b/tests/snapshots/nanox_approve_dai_tokens/00004.png
index a15d822..ae56f60 100644
Binary files a/tests/snapshots/nanox_approve_dai_tokens/00004.png and b/tests/snapshots/nanox_approve_dai_tokens/00004.png differ
diff --git a/tests/snapshots/nanox_approve_dai_tokens/00005.png b/tests/snapshots/nanox_approve_dai_tokens/00005.png
index a2cb8f9..570ce28 100644
Binary files a/tests/snapshots/nanox_approve_dai_tokens/00005.png and b/tests/snapshots/nanox_approve_dai_tokens/00005.png differ
diff --git a/tests/snapshots/nanox_approve_dai_tokens/00006.png b/tests/snapshots/nanox_approve_dai_tokens/00006.png
index 7a77cb1..c922246 100644
Binary files a/tests/snapshots/nanox_approve_dai_tokens/00006.png and b/tests/snapshots/nanox_approve_dai_tokens/00006.png differ
diff --git a/tests/snapshots/nanox_approve_dai_tokens/00007.png b/tests/snapshots/nanox_approve_dai_tokens/00007.png
new file mode 120000
index 0000000..7159a12
--- /dev/null
+++ b/tests/snapshots/nanox_approve_dai_tokens/00007.png
@@ -0,0 +1 @@
+00005.png
\ No newline at end of file
diff --git a/tests/snapshots/nanox_approve_dai_tokens/00008.png b/tests/snapshots/nanox_approve_dai_tokens/00008.png
new file mode 100644
index 0000000..a58590b
Binary files /dev/null and b/tests/snapshots/nanox_approve_dai_tokens/00008.png differ
diff --git a/tests/snapshots/nanox_deposit_eth_compound_blind/00000.png b/tests/snapshots/nanox_deposit_eth_compound_blind/00000.png
index 4a982c5..487ea10 100644
Binary files a/tests/snapshots/nanox_deposit_eth_compound_blind/00000.png and b/tests/snapshots/nanox_deposit_eth_compound_blind/00000.png differ
diff --git a/tests/snapshots/nanox_deposit_eth_compound_blind/00001.png b/tests/snapshots/nanox_deposit_eth_compound_blind/00001.png
index 2d580d8..9901736 100644
Binary files a/tests/snapshots/nanox_deposit_eth_compound_blind/00001.png and b/tests/snapshots/nanox_deposit_eth_compound_blind/00001.png differ
diff --git a/tests/snapshots/nanox_deposit_eth_compound_blind/00002.png b/tests/snapshots/nanox_deposit_eth_compound_blind/00002.png
index 5486e4a..043c123 100644
Binary files a/tests/snapshots/nanox_deposit_eth_compound_blind/00002.png and b/tests/snapshots/nanox_deposit_eth_compound_blind/00002.png differ
diff --git a/tests/snapshots/nanox_deposit_eth_compound_blind/00003.png b/tests/snapshots/nanox_deposit_eth_compound_blind/00003.png
index 91fef4d..4749ed1 100644
Binary files a/tests/snapshots/nanox_deposit_eth_compound_blind/00003.png and b/tests/snapshots/nanox_deposit_eth_compound_blind/00003.png differ
diff --git a/tests/snapshots/nanox_deposit_eth_compound_blind/00004.png b/tests/snapshots/nanox_deposit_eth_compound_blind/00004.png
index 294140a..c0f77c9 100644
Binary files a/tests/snapshots/nanox_deposit_eth_compound_blind/00004.png and b/tests/snapshots/nanox_deposit_eth_compound_blind/00004.png differ
diff --git a/tests/snapshots/nanox_deposit_eth_compound_blind/00005.png b/tests/snapshots/nanox_deposit_eth_compound_blind/00005.png
index a2cb8f9..570ce28 100644
Binary files a/tests/snapshots/nanox_deposit_eth_compound_blind/00005.png and b/tests/snapshots/nanox_deposit_eth_compound_blind/00005.png differ
diff --git a/tests/snapshots/nanox_deposit_eth_compound_blind/00006.png b/tests/snapshots/nanox_deposit_eth_compound_blind/00006.png
index 7a77cb1..c922246 100644
Binary files a/tests/snapshots/nanox_deposit_eth_compound_blind/00006.png and b/tests/snapshots/nanox_deposit_eth_compound_blind/00006.png differ
diff --git a/tests/snapshots/nanox_deposit_eth_compound_blind/00007.png b/tests/snapshots/nanox_deposit_eth_compound_blind/00007.png
new file mode 120000
index 0000000..7159a12
--- /dev/null
+++ b/tests/snapshots/nanox_deposit_eth_compound_blind/00007.png
@@ -0,0 +1 @@
+00005.png
\ No newline at end of file
diff --git a/tests/snapshots/nanox_deposit_eth_compound_blind/00008.png b/tests/snapshots/nanox_deposit_eth_compound_blind/00008.png
new file mode 100644
index 0000000..a58590b
Binary files /dev/null and b/tests/snapshots/nanox_deposit_eth_compound_blind/00008.png differ
diff --git a/tests/snapshots/nanox_enable_blind_signing/00000.png b/tests/snapshots/nanox_enable_blind_signing/00000.png
new file mode 100644
index 0000000..a58590b
Binary files /dev/null and b/tests/snapshots/nanox_enable_blind_signing/00000.png differ
diff --git a/tests/snapshots/nanox_enable_blind_signing/00001.png b/tests/snapshots/nanox_enable_blind_signing/00001.png
new file mode 100644
index 0000000..bcb20c6
Binary files /dev/null and b/tests/snapshots/nanox_enable_blind_signing/00001.png differ
diff --git a/tests/snapshots/nanox_enable_blind_signing/00002.png b/tests/snapshots/nanox_enable_blind_signing/00002.png
new file mode 100644
index 0000000..75b78e5
Binary files /dev/null and b/tests/snapshots/nanox_enable_blind_signing/00002.png differ
diff --git a/tests/snapshots/nanox_enable_blind_signing/00003.png b/tests/snapshots/nanox_enable_blind_signing/00003.png
new file mode 100644
index 0000000..6cef7c9
Binary files /dev/null and b/tests/snapshots/nanox_enable_blind_signing/00003.png differ
diff --git a/tests/snapshots/nanox_enable_blind_signing/00004.png b/tests/snapshots/nanox_enable_blind_signing/00004.png
new file mode 100644
index 0000000..8f75e90
Binary files /dev/null and b/tests/snapshots/nanox_enable_blind_signing/00004.png differ
diff --git a/tests/snapshots/nanox_enable_blind_signing/00005.png b/tests/snapshots/nanox_enable_blind_signing/00005.png
new file mode 100644
index 0000000..a6c3f94
Binary files /dev/null and b/tests/snapshots/nanox_enable_blind_signing/00005.png differ
diff --git a/tests/snapshots/nanox_enable_blind_signing/00006.png b/tests/snapshots/nanox_enable_blind_signing/00006.png
new file mode 100644
index 0000000..123a7ac
Binary files /dev/null and b/tests/snapshots/nanox_enable_blind_signing/00006.png differ
diff --git a/tests/snapshots/nanox_enable_blind_signing/00007.png b/tests/snapshots/nanox_enable_blind_signing/00007.png
new file mode 100644
index 0000000..61861f2
Binary files /dev/null and b/tests/snapshots/nanox_enable_blind_signing/00007.png differ
diff --git a/tests/snapshots/nanox_enable_blind_signing/00008.png b/tests/snapshots/nanox_enable_blind_signing/00008.png
new file mode 100644
index 0000000..a58590b
Binary files /dev/null and b/tests/snapshots/nanox_enable_blind_signing/00008.png differ
diff --git a/tests/snapshots/nanox_erc1155_batch_transfer/00000.png b/tests/snapshots/nanox_erc1155_batch_transfer/00000.png
new file mode 100644
index 0000000..487ea10
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_batch_transfer/00000.png differ
diff --git a/tests/snapshots/nanox_erc1155_batch_transfer/00001.png b/tests/snapshots/nanox_erc1155_batch_transfer/00001.png
new file mode 100644
index 0000000..ba1dfa0
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_batch_transfer/00001.png differ
diff --git a/tests/snapshots/nanox_erc1155_batch_transfer/00002.png b/tests/snapshots/nanox_erc1155_batch_transfer/00002.png
new file mode 100644
index 0000000..7d01fe8
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_batch_transfer/00002.png differ
diff --git a/tests/snapshots/nanox_erc1155_batch_transfer/00003.png b/tests/snapshots/nanox_erc1155_batch_transfer/00003.png
new file mode 100644
index 0000000..950fd72
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_batch_transfer/00003.png differ
diff --git a/tests/snapshots/nanox_erc1155_batch_transfer/00004.png b/tests/snapshots/nanox_erc1155_batch_transfer/00004.png
new file mode 100644
index 0000000..5906d19
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_batch_transfer/00004.png differ
diff --git a/tests/snapshots/nanox_erc1155_batch_transfer/00005.png b/tests/snapshots/nanox_erc1155_batch_transfer/00005.png
new file mode 100644
index 0000000..05c1afa
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_batch_transfer/00005.png differ
diff --git a/tests/snapshots/nanox_erc1155_batch_transfer/00006.png b/tests/snapshots/nanox_erc1155_batch_transfer/00006.png
new file mode 100644
index 0000000..690bb3d
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_batch_transfer/00006.png differ
diff --git a/tests/snapshots/nanox_erc1155_batch_transfer/00007.png b/tests/snapshots/nanox_erc1155_batch_transfer/00007.png
new file mode 100644
index 0000000..570ce28
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_batch_transfer/00007.png differ
diff --git a/tests/snapshots/nanox_erc1155_batch_transfer/00008.png b/tests/snapshots/nanox_erc1155_batch_transfer/00008.png
new file mode 100644
index 0000000..c922246
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_batch_transfer/00008.png differ
diff --git a/tests/snapshots/nanox_erc1155_batch_transfer/00009.png b/tests/snapshots/nanox_erc1155_batch_transfer/00009.png
new file mode 120000
index 0000000..10266b3
--- /dev/null
+++ b/tests/snapshots/nanox_erc1155_batch_transfer/00009.png
@@ -0,0 +1 @@
+00007.png
\ No newline at end of file
diff --git a/tests/snapshots/nanox_erc1155_batch_transfer/00010.png b/tests/snapshots/nanox_erc1155_batch_transfer/00010.png
new file mode 100644
index 0000000..a58590b
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_batch_transfer/00010.png differ
diff --git a/tests/snapshots/nanox_erc1155_transfer/00000.png b/tests/snapshots/nanox_erc1155_transfer/00000.png
new file mode 100644
index 0000000..487ea10
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_transfer/00000.png differ
diff --git a/tests/snapshots/nanox_erc1155_transfer/00001.png b/tests/snapshots/nanox_erc1155_transfer/00001.png
new file mode 100644
index 0000000..2b0fd14
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_transfer/00001.png differ
diff --git a/tests/snapshots/nanox_erc1155_transfer/00002.png b/tests/snapshots/nanox_erc1155_transfer/00002.png
new file mode 100644
index 0000000..7d01fe8
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_transfer/00002.png differ
diff --git a/tests/snapshots/nanox_erc1155_transfer/00003.png b/tests/snapshots/nanox_erc1155_transfer/00003.png
new file mode 100644
index 0000000..a5790c1
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_transfer/00003.png differ
diff --git a/tests/snapshots/nanox_erc1155_transfer/00004.png b/tests/snapshots/nanox_erc1155_transfer/00004.png
new file mode 100644
index 0000000..5906d19
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_transfer/00004.png differ
diff --git a/tests/snapshots/nanox_erc1155_transfer/00005.png b/tests/snapshots/nanox_erc1155_transfer/00005.png
new file mode 100644
index 0000000..d6257d3
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_transfer/00005.png differ
diff --git a/tests/snapshots/nanox_erc1155_transfer/00006.png b/tests/snapshots/nanox_erc1155_transfer/00006.png
new file mode 100644
index 0000000..061c754
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_transfer/00006.png differ
diff --git a/tests/snapshots/nanox_erc1155_transfer/00007.png b/tests/snapshots/nanox_erc1155_transfer/00007.png
new file mode 100644
index 0000000..c748a75
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_transfer/00007.png differ
diff --git a/tests/snapshots/nanox_erc1155_transfer/00008.png b/tests/snapshots/nanox_erc1155_transfer/00008.png
new file mode 100644
index 0000000..cd509d9
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_transfer/00008.png differ
diff --git a/tests/snapshots/nanox_erc1155_transfer/00009.png b/tests/snapshots/nanox_erc1155_transfer/00009.png
new file mode 100644
index 0000000..570ce28
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_transfer/00009.png differ
diff --git a/tests/snapshots/nanox_erc1155_transfer/00010.png b/tests/snapshots/nanox_erc1155_transfer/00010.png
new file mode 100644
index 0000000..c922246
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_transfer/00010.png differ
diff --git a/tests/snapshots/nanox_erc1155_transfer/00011.png b/tests/snapshots/nanox_erc1155_transfer/00011.png
new file mode 120000
index 0000000..489390a
--- /dev/null
+++ b/tests/snapshots/nanox_erc1155_transfer/00011.png
@@ -0,0 +1 @@
+00009.png
\ No newline at end of file
diff --git a/tests/snapshots/nanox_erc1155_transfer/00012.png b/tests/snapshots/nanox_erc1155_transfer/00012.png
new file mode 100644
index 0000000..a58590b
Binary files /dev/null and b/tests/snapshots/nanox_erc1155_transfer/00012.png differ
diff --git a/tests/snapshots/nanox_erc721_transfer/00000.png b/tests/snapshots/nanox_erc721_transfer/00000.png
new file mode 100644
index 0000000..487ea10
Binary files /dev/null and b/tests/snapshots/nanox_erc721_transfer/00000.png differ
diff --git a/tests/snapshots/nanox_erc721_transfer/00001.png b/tests/snapshots/nanox_erc721_transfer/00001.png
new file mode 100644
index 0000000..2b0fd14
Binary files /dev/null and b/tests/snapshots/nanox_erc721_transfer/00001.png differ
diff --git a/tests/snapshots/nanox_erc721_transfer/00002.png b/tests/snapshots/nanox_erc721_transfer/00002.png
new file mode 100644
index 0000000..7d01fe8
Binary files /dev/null and b/tests/snapshots/nanox_erc721_transfer/00002.png differ
diff --git a/tests/snapshots/nanox_erc721_transfer/00003.png b/tests/snapshots/nanox_erc721_transfer/00003.png
new file mode 100644
index 0000000..9e8c446
Binary files /dev/null and b/tests/snapshots/nanox_erc721_transfer/00003.png differ
diff --git a/tests/snapshots/nanox_erc721_transfer/00004.png b/tests/snapshots/nanox_erc721_transfer/00004.png
new file mode 100644
index 0000000..23f2a45
Binary files /dev/null and b/tests/snapshots/nanox_erc721_transfer/00004.png differ
diff --git a/tests/snapshots/nanox_erc721_transfer/00005.png b/tests/snapshots/nanox_erc721_transfer/00005.png
new file mode 100644
index 0000000..e369a1b
Binary files /dev/null and b/tests/snapshots/nanox_erc721_transfer/00005.png differ
diff --git a/tests/snapshots/nanox_erc721_transfer/00006.png b/tests/snapshots/nanox_erc721_transfer/00006.png
new file mode 100644
index 0000000..6ce12ba
Binary files /dev/null and b/tests/snapshots/nanox_erc721_transfer/00006.png differ
diff --git a/tests/snapshots/nanox_erc721_transfer/00007.png b/tests/snapshots/nanox_erc721_transfer/00007.png
new file mode 100644
index 0000000..570ce28
Binary files /dev/null and b/tests/snapshots/nanox_erc721_transfer/00007.png differ
diff --git a/tests/snapshots/nanox_erc721_transfer/00008.png b/tests/snapshots/nanox_erc721_transfer/00008.png
new file mode 100644
index 0000000..c922246
Binary files /dev/null and b/tests/snapshots/nanox_erc721_transfer/00008.png differ
diff --git a/tests/snapshots/nanox_erc721_transfer/00009.png b/tests/snapshots/nanox_erc721_transfer/00009.png
new file mode 120000
index 0000000..10266b3
--- /dev/null
+++ b/tests/snapshots/nanox_erc721_transfer/00009.png
@@ -0,0 +1 @@
+00007.png
\ No newline at end of file
diff --git a/tests/snapshots/nanox_erc721_transfer/00010.png b/tests/snapshots/nanox_erc721_transfer/00010.png
new file mode 100644
index 0000000..a58590b
Binary files /dev/null and b/tests/snapshots/nanox_erc721_transfer/00010.png differ
diff --git a/tests/snapshots/nanox_starkware_usdt_deposit/00000.png b/tests/snapshots/nanox_starkware_usdt_deposit/00000.png
index 4a982c5..487ea10 100644
Binary files a/tests/snapshots/nanox_starkware_usdt_deposit/00000.png and b/tests/snapshots/nanox_starkware_usdt_deposit/00000.png differ
diff --git a/tests/snapshots/nanox_starkware_usdt_deposit/00001.png b/tests/snapshots/nanox_starkware_usdt_deposit/00001.png
index c1ca56b..e8ec78b 100644
Binary files a/tests/snapshots/nanox_starkware_usdt_deposit/00001.png and b/tests/snapshots/nanox_starkware_usdt_deposit/00001.png differ
diff --git a/tests/snapshots/nanox_starkware_usdt_deposit/00002.png b/tests/snapshots/nanox_starkware_usdt_deposit/00002.png
index 0329541..6735a07 100644
Binary files a/tests/snapshots/nanox_starkware_usdt_deposit/00002.png and b/tests/snapshots/nanox_starkware_usdt_deposit/00002.png differ
diff --git a/tests/snapshots/nanox_starkware_usdt_deposit/00003.png b/tests/snapshots/nanox_starkware_usdt_deposit/00003.png
index 51b084f..85f3a2b 100644
Binary files a/tests/snapshots/nanox_starkware_usdt_deposit/00003.png and b/tests/snapshots/nanox_starkware_usdt_deposit/00003.png differ
diff --git a/tests/snapshots/nanox_starkware_usdt_deposit/00004.png b/tests/snapshots/nanox_starkware_usdt_deposit/00004.png
index 214f330..e56268e 100644
Binary files a/tests/snapshots/nanox_starkware_usdt_deposit/00004.png and b/tests/snapshots/nanox_starkware_usdt_deposit/00004.png differ
diff --git a/tests/snapshots/nanox_starkware_usdt_deposit/00005.png b/tests/snapshots/nanox_starkware_usdt_deposit/00005.png
index b062f58..d8befd4 100644
Binary files a/tests/snapshots/nanox_starkware_usdt_deposit/00005.png and b/tests/snapshots/nanox_starkware_usdt_deposit/00005.png differ
diff --git a/tests/snapshots/nanox_starkware_usdt_deposit/00006.png b/tests/snapshots/nanox_starkware_usdt_deposit/00006.png
index 5c759f5..9fce3dc 100644
Binary files a/tests/snapshots/nanox_starkware_usdt_deposit/00006.png and b/tests/snapshots/nanox_starkware_usdt_deposit/00006.png differ
diff --git a/tests/snapshots/nanox_starkware_usdt_deposit/00007.png b/tests/snapshots/nanox_starkware_usdt_deposit/00007.png
index 882d04d..814adcc 100644
Binary files a/tests/snapshots/nanox_starkware_usdt_deposit/00007.png and b/tests/snapshots/nanox_starkware_usdt_deposit/00007.png differ
diff --git a/tests/snapshots/nanox_starkware_usdt_deposit/00008.png b/tests/snapshots/nanox_starkware_usdt_deposit/00008.png
index 7d24221..fcc883e 100644
Binary files a/tests/snapshots/nanox_starkware_usdt_deposit/00008.png and b/tests/snapshots/nanox_starkware_usdt_deposit/00008.png differ
diff --git a/tests/snapshots/nanox_starkware_usdt_deposit/00009.png b/tests/snapshots/nanox_starkware_usdt_deposit/00009.png
index a2cb8f9..570ce28 100644
Binary files a/tests/snapshots/nanox_starkware_usdt_deposit/00009.png and b/tests/snapshots/nanox_starkware_usdt_deposit/00009.png differ
diff --git a/tests/snapshots/nanox_starkware_usdt_deposit/00010.png b/tests/snapshots/nanox_starkware_usdt_deposit/00010.png
index 7a77cb1..c922246 100644
Binary files a/tests/snapshots/nanox_starkware_usdt_deposit/00010.png and b/tests/snapshots/nanox_starkware_usdt_deposit/00010.png differ
diff --git a/tests/snapshots/nanox_starkware_usdt_deposit/00011.png b/tests/snapshots/nanox_starkware_usdt_deposit/00011.png
new file mode 120000
index 0000000..489390a
--- /dev/null
+++ b/tests/snapshots/nanox_starkware_usdt_deposit/00011.png
@@ -0,0 +1 @@
+00009.png
\ No newline at end of file
diff --git a/tests/snapshots/nanox_starkware_usdt_deposit/00012.png b/tests/snapshots/nanox_starkware_usdt_deposit/00012.png
new file mode 100644
index 0000000..a58590b
Binary files /dev/null and b/tests/snapshots/nanox_starkware_usdt_deposit/00012.png differ
diff --git a/tests/snapshots/nanox_transfer_112233445566_network/00000.png b/tests/snapshots/nanox_transfer_112233445566_network/00000.png
index 4a982c5..487ea10 100644
Binary files a/tests/snapshots/nanox_transfer_112233445566_network/00000.png and b/tests/snapshots/nanox_transfer_112233445566_network/00000.png differ
diff --git a/tests/snapshots/nanox_transfer_112233445566_network/00001.png b/tests/snapshots/nanox_transfer_112233445566_network/00001.png
index a5592a6..0976a31 100644
Binary files a/tests/snapshots/nanox_transfer_112233445566_network/00001.png and b/tests/snapshots/nanox_transfer_112233445566_network/00001.png differ
diff --git a/tests/snapshots/nanox_transfer_112233445566_network/00002.png b/tests/snapshots/nanox_transfer_112233445566_network/00002.png
index 4228ae1..0f18eee 100644
Binary files a/tests/snapshots/nanox_transfer_112233445566_network/00002.png and b/tests/snapshots/nanox_transfer_112233445566_network/00002.png differ
diff --git a/tests/snapshots/nanox_transfer_112233445566_network/00003.png b/tests/snapshots/nanox_transfer_112233445566_network/00003.png
index f91355b..10989ee 100644
Binary files a/tests/snapshots/nanox_transfer_112233445566_network/00003.png and b/tests/snapshots/nanox_transfer_112233445566_network/00003.png differ
diff --git a/tests/snapshots/nanox_transfer_112233445566_network/00004.png b/tests/snapshots/nanox_transfer_112233445566_network/00004.png
index a67fa25..70c1b9a 100644
Binary files a/tests/snapshots/nanox_transfer_112233445566_network/00004.png and b/tests/snapshots/nanox_transfer_112233445566_network/00004.png differ
diff --git a/tests/snapshots/nanox_transfer_112233445566_network/00005.png b/tests/snapshots/nanox_transfer_112233445566_network/00005.png
index a2cb8f9..570ce28 100644
Binary files a/tests/snapshots/nanox_transfer_112233445566_network/00005.png and b/tests/snapshots/nanox_transfer_112233445566_network/00005.png differ
diff --git a/tests/snapshots/nanox_transfer_112233445566_network/00006.png b/tests/snapshots/nanox_transfer_112233445566_network/00006.png
index 7a77cb1..c922246 100644
Binary files a/tests/snapshots/nanox_transfer_112233445566_network/00006.png and b/tests/snapshots/nanox_transfer_112233445566_network/00006.png differ
diff --git a/tests/snapshots/nanox_transfer_112233445566_network/00007.png b/tests/snapshots/nanox_transfer_112233445566_network/00007.png
new file mode 120000
index 0000000..7159a12
--- /dev/null
+++ b/tests/snapshots/nanox_transfer_112233445566_network/00007.png
@@ -0,0 +1 @@
+00005.png
\ No newline at end of file
diff --git a/tests/snapshots/nanox_transfer_112233445566_network/00008.png b/tests/snapshots/nanox_transfer_112233445566_network/00008.png
new file mode 100644
index 0000000..a58590b
Binary files /dev/null and b/tests/snapshots/nanox_transfer_112233445566_network/00008.png differ
diff --git a/tests/snapshots/nanox_transfer_bsc/00000.png b/tests/snapshots/nanox_transfer_bsc/00000.png
index 4a982c5..487ea10 100644
Binary files a/tests/snapshots/nanox_transfer_bsc/00000.png and b/tests/snapshots/nanox_transfer_bsc/00000.png differ
diff --git a/tests/snapshots/nanox_transfer_bsc/00001.png b/tests/snapshots/nanox_transfer_bsc/00001.png
index 92b6eb5..4f1699a 100644
Binary files a/tests/snapshots/nanox_transfer_bsc/00001.png and b/tests/snapshots/nanox_transfer_bsc/00001.png differ
diff --git a/tests/snapshots/nanox_transfer_bsc/00002.png b/tests/snapshots/nanox_transfer_bsc/00002.png
index 4228ae1..0f18eee 100644
Binary files a/tests/snapshots/nanox_transfer_bsc/00002.png and b/tests/snapshots/nanox_transfer_bsc/00002.png differ
diff --git a/tests/snapshots/nanox_transfer_bsc/00003.png b/tests/snapshots/nanox_transfer_bsc/00003.png
index d354b8c..0d6794d 100644
Binary files a/tests/snapshots/nanox_transfer_bsc/00003.png and b/tests/snapshots/nanox_transfer_bsc/00003.png differ
diff --git a/tests/snapshots/nanox_transfer_bsc/00004.png b/tests/snapshots/nanox_transfer_bsc/00004.png
index a4514d7..3448ce1 100644
Binary files a/tests/snapshots/nanox_transfer_bsc/00004.png and b/tests/snapshots/nanox_transfer_bsc/00004.png differ
diff --git a/tests/snapshots/nanox_transfer_bsc/00005.png b/tests/snapshots/nanox_transfer_bsc/00005.png
index a2cb8f9..570ce28 100644
Binary files a/tests/snapshots/nanox_transfer_bsc/00005.png and b/tests/snapshots/nanox_transfer_bsc/00005.png differ
diff --git a/tests/snapshots/nanox_transfer_bsc/00006.png b/tests/snapshots/nanox_transfer_bsc/00006.png
index 7a77cb1..c922246 100644
Binary files a/tests/snapshots/nanox_transfer_bsc/00006.png and b/tests/snapshots/nanox_transfer_bsc/00006.png differ
diff --git a/tests/snapshots/nanox_transfer_bsc/00007.png b/tests/snapshots/nanox_transfer_bsc/00007.png
new file mode 120000
index 0000000..7159a12
--- /dev/null
+++ b/tests/snapshots/nanox_transfer_bsc/00007.png
@@ -0,0 +1 @@
+00005.png
\ No newline at end of file
diff --git a/tests/snapshots/nanox_transfer_bsc/00008.png b/tests/snapshots/nanox_transfer_bsc/00008.png
new file mode 100644
index 0000000..a58590b
Binary files /dev/null and b/tests/snapshots/nanox_transfer_bsc/00008.png differ
diff --git a/tests/snapshots/nanox_transfer_eip1559/00000.png b/tests/snapshots/nanox_transfer_eip1559/00000.png
index 4a982c5..487ea10 100644
Binary files a/tests/snapshots/nanox_transfer_eip1559/00000.png and b/tests/snapshots/nanox_transfer_eip1559/00000.png differ
diff --git a/tests/snapshots/nanox_transfer_eip1559/00001.png b/tests/snapshots/nanox_transfer_eip1559/00001.png
index be296ea..cdcc19d 100644
Binary files a/tests/snapshots/nanox_transfer_eip1559/00001.png and b/tests/snapshots/nanox_transfer_eip1559/00001.png differ
diff --git a/tests/snapshots/nanox_transfer_eip1559/00002.png b/tests/snapshots/nanox_transfer_eip1559/00002.png
index db02d0d..5b65b54 100644
Binary files a/tests/snapshots/nanox_transfer_eip1559/00002.png and b/tests/snapshots/nanox_transfer_eip1559/00002.png differ
diff --git a/tests/snapshots/nanox_transfer_eip1559/00003.png b/tests/snapshots/nanox_transfer_eip1559/00003.png
index de628de..1a7a3f3 100644
Binary files a/tests/snapshots/nanox_transfer_eip1559/00003.png and b/tests/snapshots/nanox_transfer_eip1559/00003.png differ
diff --git a/tests/snapshots/nanox_transfer_eip1559/00004.png b/tests/snapshots/nanox_transfer_eip1559/00004.png
index a2cb8f9..570ce28 100644
Binary files a/tests/snapshots/nanox_transfer_eip1559/00004.png and b/tests/snapshots/nanox_transfer_eip1559/00004.png differ
diff --git a/tests/snapshots/nanox_transfer_eip1559/00005.png b/tests/snapshots/nanox_transfer_eip1559/00005.png
index 7a77cb1..c922246 100644
Binary files a/tests/snapshots/nanox_transfer_eip1559/00005.png and b/tests/snapshots/nanox_transfer_eip1559/00005.png differ
diff --git a/tests/snapshots/nanox_transfer_eip1559/00006.png b/tests/snapshots/nanox_transfer_eip1559/00006.png
new file mode 120000
index 0000000..917964c
--- /dev/null
+++ b/tests/snapshots/nanox_transfer_eip1559/00006.png
@@ -0,0 +1 @@
+00004.png
\ No newline at end of file
diff --git a/tests/snapshots/nanox_transfer_eip1559/00007.png b/tests/snapshots/nanox_transfer_eip1559/00007.png
new file mode 100644
index 0000000..a58590b
Binary files /dev/null and b/tests/snapshots/nanox_transfer_eip1559/00007.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum/00000.png b/tests/snapshots/nanox_transfer_ethereum/00000.png
index 4a982c5..487ea10 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum/00000.png and b/tests/snapshots/nanox_transfer_ethereum/00000.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum/00001.png b/tests/snapshots/nanox_transfer_ethereum/00001.png
index a5592a6..0976a31 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum/00001.png and b/tests/snapshots/nanox_transfer_ethereum/00001.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum/00002.png b/tests/snapshots/nanox_transfer_ethereum/00002.png
index 4228ae1..0f18eee 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum/00002.png and b/tests/snapshots/nanox_transfer_ethereum/00002.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum/00003.png b/tests/snapshots/nanox_transfer_ethereum/00003.png
index a67fa25..70c1b9a 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum/00003.png and b/tests/snapshots/nanox_transfer_ethereum/00003.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum/00004.png b/tests/snapshots/nanox_transfer_ethereum/00004.png
index a2cb8f9..570ce28 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum/00004.png and b/tests/snapshots/nanox_transfer_ethereum/00004.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum/00005.png b/tests/snapshots/nanox_transfer_ethereum/00005.png
index 7a77cb1..c922246 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum/00005.png and b/tests/snapshots/nanox_transfer_ethereum/00005.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum/00006.png b/tests/snapshots/nanox_transfer_ethereum/00006.png
new file mode 120000
index 0000000..917964c
--- /dev/null
+++ b/tests/snapshots/nanox_transfer_ethereum/00006.png
@@ -0,0 +1 @@
+00004.png
\ No newline at end of file
diff --git a/tests/snapshots/nanox_transfer_ethereum/00007.png b/tests/snapshots/nanox_transfer_ethereum/00007.png
new file mode 100644
index 0000000..a58590b
Binary files /dev/null and b/tests/snapshots/nanox_transfer_ethereum/00007.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum_5234_network/00000.png b/tests/snapshots/nanox_transfer_ethereum_5234_network/00000.png
index 4a982c5..487ea10 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum_5234_network/00000.png and b/tests/snapshots/nanox_transfer_ethereum_5234_network/00000.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum_5234_network/00001.png b/tests/snapshots/nanox_transfer_ethereum_5234_network/00001.png
index a5592a6..0976a31 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum_5234_network/00001.png and b/tests/snapshots/nanox_transfer_ethereum_5234_network/00001.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum_5234_network/00002.png b/tests/snapshots/nanox_transfer_ethereum_5234_network/00002.png
index 4228ae1..0f18eee 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum_5234_network/00002.png and b/tests/snapshots/nanox_transfer_ethereum_5234_network/00002.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum_5234_network/00003.png b/tests/snapshots/nanox_transfer_ethereum_5234_network/00003.png
index e3682de..0423eb5 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum_5234_network/00003.png and b/tests/snapshots/nanox_transfer_ethereum_5234_network/00003.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum_5234_network/00004.png b/tests/snapshots/nanox_transfer_ethereum_5234_network/00004.png
index a67fa25..70c1b9a 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum_5234_network/00004.png and b/tests/snapshots/nanox_transfer_ethereum_5234_network/00004.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum_5234_network/00005.png b/tests/snapshots/nanox_transfer_ethereum_5234_network/00005.png
index a2cb8f9..570ce28 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum_5234_network/00005.png and b/tests/snapshots/nanox_transfer_ethereum_5234_network/00005.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum_5234_network/00006.png b/tests/snapshots/nanox_transfer_ethereum_5234_network/00006.png
index 7a77cb1..c922246 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum_5234_network/00006.png and b/tests/snapshots/nanox_transfer_ethereum_5234_network/00006.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum_5234_network/00007.png b/tests/snapshots/nanox_transfer_ethereum_5234_network/00007.png
new file mode 120000
index 0000000..7159a12
--- /dev/null
+++ b/tests/snapshots/nanox_transfer_ethereum_5234_network/00007.png
@@ -0,0 +1 @@
+00005.png
\ No newline at end of file
diff --git a/tests/snapshots/nanox_transfer_ethereum_5234_network/00008.png b/tests/snapshots/nanox_transfer_ethereum_5234_network/00008.png
new file mode 100644
index 0000000..a58590b
Binary files /dev/null and b/tests/snapshots/nanox_transfer_ethereum_5234_network/00008.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum_clone/00000.png b/tests/snapshots/nanox_transfer_ethereum_clone/00000.png
index 4a982c5..487ea10 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum_clone/00000.png and b/tests/snapshots/nanox_transfer_ethereum_clone/00000.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum_clone/00001.png b/tests/snapshots/nanox_transfer_ethereum_clone/00001.png
index 6b7d579..43332d4 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum_clone/00001.png and b/tests/snapshots/nanox_transfer_ethereum_clone/00001.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum_clone/00002.png b/tests/snapshots/nanox_transfer_ethereum_clone/00002.png
index 4228ae1..0f18eee 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum_clone/00002.png and b/tests/snapshots/nanox_transfer_ethereum_clone/00002.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum_clone/00003.png b/tests/snapshots/nanox_transfer_ethereum_clone/00003.png
index 4a61a9d..c59d95a 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum_clone/00003.png and b/tests/snapshots/nanox_transfer_ethereum_clone/00003.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum_clone/00004.png b/tests/snapshots/nanox_transfer_ethereum_clone/00004.png
index a2cb8f9..570ce28 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum_clone/00004.png and b/tests/snapshots/nanox_transfer_ethereum_clone/00004.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum_clone/00005.png b/tests/snapshots/nanox_transfer_ethereum_clone/00005.png
index 7a77cb1..c922246 100644
Binary files a/tests/snapshots/nanox_transfer_ethereum_clone/00005.png and b/tests/snapshots/nanox_transfer_ethereum_clone/00005.png differ
diff --git a/tests/snapshots/nanox_transfer_ethereum_clone/00006.png b/tests/snapshots/nanox_transfer_ethereum_clone/00006.png
new file mode 120000
index 0000000..917964c
--- /dev/null
+++ b/tests/snapshots/nanox_transfer_ethereum_clone/00006.png
@@ -0,0 +1 @@
+00004.png
\ No newline at end of file
diff --git a/tests/snapshots/nanox_transfer_ethereum_clone/00007.png b/tests/snapshots/nanox_transfer_ethereum_clone/00007.png
new file mode 100644
index 0000000..a58590b
Binary files /dev/null and b/tests/snapshots/nanox_transfer_ethereum_clone/00007.png differ
diff --git a/tests/snapshots/nanox_transfer_palm_network/00000.png b/tests/snapshots/nanox_transfer_palm_network/00000.png
index 4a982c5..487ea10 100644
Binary files a/tests/snapshots/nanox_transfer_palm_network/00000.png and b/tests/snapshots/nanox_transfer_palm_network/00000.png differ
diff --git a/tests/snapshots/nanox_transfer_palm_network/00001.png b/tests/snapshots/nanox_transfer_palm_network/00001.png
index 14404ae..224a9da 100644
Binary files a/tests/snapshots/nanox_transfer_palm_network/00001.png and b/tests/snapshots/nanox_transfer_palm_network/00001.png differ
diff --git a/tests/snapshots/nanox_transfer_palm_network/00002.png b/tests/snapshots/nanox_transfer_palm_network/00002.png
index 4228ae1..0f18eee 100644
Binary files a/tests/snapshots/nanox_transfer_palm_network/00002.png and b/tests/snapshots/nanox_transfer_palm_network/00002.png differ
diff --git a/tests/snapshots/nanox_transfer_palm_network/00003.png b/tests/snapshots/nanox_transfer_palm_network/00003.png
index 14a7b7b..def1ae2 100644
Binary files a/tests/snapshots/nanox_transfer_palm_network/00003.png and b/tests/snapshots/nanox_transfer_palm_network/00003.png differ
diff --git a/tests/snapshots/nanox_transfer_palm_network/00004.png b/tests/snapshots/nanox_transfer_palm_network/00004.png
index 0ee720a..0c1fa4c 100644
Binary files a/tests/snapshots/nanox_transfer_palm_network/00004.png and b/tests/snapshots/nanox_transfer_palm_network/00004.png differ
diff --git a/tests/snapshots/nanox_transfer_palm_network/00005.png b/tests/snapshots/nanox_transfer_palm_network/00005.png
index a2cb8f9..570ce28 100644
Binary files a/tests/snapshots/nanox_transfer_palm_network/00005.png and b/tests/snapshots/nanox_transfer_palm_network/00005.png differ
diff --git a/tests/snapshots/nanox_transfer_palm_network/00006.png b/tests/snapshots/nanox_transfer_palm_network/00006.png
index 7a77cb1..c922246 100644
Binary files a/tests/snapshots/nanox_transfer_palm_network/00006.png and b/tests/snapshots/nanox_transfer_palm_network/00006.png differ
diff --git a/tests/snapshots/nanox_transfer_palm_network/00007.png b/tests/snapshots/nanox_transfer_palm_network/00007.png
new file mode 120000
index 0000000..7159a12
--- /dev/null
+++ b/tests/snapshots/nanox_transfer_palm_network/00007.png
@@ -0,0 +1 @@
+00005.png
\ No newline at end of file
diff --git a/tests/snapshots/nanox_transfer_palm_network/00008.png b/tests/snapshots/nanox_transfer_palm_network/00008.png
new file mode 100644
index 0000000..a58590b
Binary files /dev/null and b/tests/snapshots/nanox_transfer_palm_network/00008.png differ
diff --git a/tests/snapshots/nanox_try_to_blind_sign_with_setting_disabled/00000.png b/tests/snapshots/nanox_try_to_blind_sign_with_setting_disabled/00000.png
index d5722b0..0446ee7 100644
Binary files a/tests/snapshots/nanox_try_to_blind_sign_with_setting_disabled/00000.png and b/tests/snapshots/nanox_try_to_blind_sign_with_setting_disabled/00000.png differ
diff --git a/tests/snapshots/nanox_try_to_blind_sign_with_setting_disabled/00001.png b/tests/snapshots/nanox_try_to_blind_sign_with_setting_disabled/00001.png
index 7a77cb1..a58590b 100644
Binary files a/tests/snapshots/nanox_try_to_blind_sign_with_setting_disabled/00001.png and b/tests/snapshots/nanox_try_to_blind_sign_with_setting_disabled/00001.png differ
diff --git a/tests/src/approve.test.js b/tests/src/approve.test.js
index 63496f5..f6380d8 100644
--- a/tests/src/approve.test.js
+++ b/tests/src/approve.test.js
@@ -1,37 +1,25 @@
import "core-js/stable";
import "regenerator-runtime/runtime";
-import { waitForAppScreen, zemu } from './test.fixture';
+import { waitForAppScreen, zemu, nano_models } from './test.fixture';
-test('[Nano S] Approve DAI tokens', zemu("nanos", async (sim, eth) => {
+nano_models.forEach(function(model) {
+ test('[Nano ' + model.letter + '] Approve DAI tokens', zemu(model, async (sim, eth) => {
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'F869468506A8B15E0082EBEB946B175474E89094C44DA98B954EEDEAC495271D0F80B844095EA7B30000000000000000000000007D2768DE32B0B80B7A3454C06BDAC94A69DDC7A9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF018080',
- );
+ const tx = eth.signTransaction(
+ "44'/60'/1'/0/0",
+ 'F869468506A8B15E0082EBEB946B175474E89094C44DA98B954EEDEAC495271D0F80B844095EA7B30000000000000000000000007D2768DE32B0B80B7A3454C06BDAC94A69DDC7A9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF018080',
+ );
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_approve_dai_tokens', [7, 0]);
+ let clicks;
+ if (model.letter === 'S') clicks = 8;
+ else clicks = 6;
+ await waitForAppScreen(sim);
+ await sim.navigateAndCompareSnapshots('.', model.name + '_approve_dai_tokens', [clicks, -1, 0]);
- await expect(tx).resolves.toEqual({
- "r": "92243511396b65a4faa735a5472ea99b3ce0f7f2338eab426206730bc0ddc57f",
- "s": "161bc0f861064d840de4f4304cfd19a571017e62df7d8f70cf605c0f025593b6",
- "v": "25",
- });
-}));
-
-test.skip('[Nano X] Approve DAI tokens', zemu("nanox", async (sim, eth) => {
-
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'F869468506A8B15E0082EBEB946B175474E89094C44DA98B954EEDEAC495271D0F80B844095EA7B30000000000000000000000007D2768DE32B0B80B7A3454C06BDAC94A69DDC7A9FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF018080',
- );
-
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanox_approve_dai_tokens', [5, 0]);
-
- await expect(tx).resolves.toEqual({
- "r": "92243511396b65a4faa735a5472ea99b3ce0f7f2338eab426206730bc0ddc57f",
- "s": "161bc0f861064d840de4f4304cfd19a571017e62df7d8f70cf605c0f025593b6",
- "v": "25",
- });
-}));
+ await expect(tx).resolves.toEqual({
+ "r": "92243511396b65a4faa735a5472ea99b3ce0f7f2338eab426206730bc0ddc57f",
+ "s": "161bc0f861064d840de4f4304cfd19a571017e62df7d8f70cf605c0f025593b6",
+ "v": "25",
+ });
+ }));
+});
diff --git a/tests/src/blind_compound_deposit.test.js b/tests/src/blind_compound_deposit.test.js
index f38fe8e..d94f6f8 100644
--- a/tests/src/blind_compound_deposit.test.js
+++ b/tests/src/blind_compound_deposit.test.js
@@ -1,39 +1,27 @@
import "core-js/stable";
import "regenerator-runtime/runtime";
-import { waitForAppScreen, zemu } from './test.fixture';
+import { waitForAppScreen, zemu, nano_models } from './test.fixture';
-test('[Nano S] Deposit ETH on compound, blind sign', zemu("nanos", async (sim, eth) => {
- // Enable blind-signing
- await sim.navigateAndCompareSnapshots('.', 'nanos_enable_blind_signing', [-2, 0, 0, 3, 0]);
+nano_models.forEach(function(model) {
+ test('[Nano ' + model.letter + '] Deposit ETH on compound, blind sign', zemu(model, async (sim, eth) => {
+ // Enable blind-signing
+ await sim.navigateAndCompareSnapshots('.', model.name + '_enable_blind_signing', [-2, 0, 0, 3, 0]);
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'f8924685028fa6ae008306599594cc9a0b7c43dc2a5f023bb9b738e45b0ef6b06e0488016345785d8a0000b864474cf53d0000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a900000000000000000000000070bc641723fad48be2df6cf63dc6270ee2f897430000000000000000000000000000000000000000000000000000000000000000018080',
- );
+ const tx = eth.signTransaction(
+ "44'/60'/1'/0/0",
+ 'f8924685028fa6ae008306599594cc9a0b7c43dc2a5f023bb9b738e45b0ef6b06e0488016345785d8a0000b864474cf53d0000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a900000000000000000000000070bc641723fad48be2df6cf63dc6270ee2f897430000000000000000000000000000000000000000000000000000000000000000018080',
+ );
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_deposit_eth_compound_blind', [7, 0]);
+ await waitForAppScreen(sim);
+ let clicks;
+ if (model.letter === 'S') clicks = 8;
+ else clicks = 6;
+ await sim.navigateAndCompareSnapshots('.', model.name + '_deposit_eth_compound_blind', [clicks, -1, 0]);
- await expect(tx).resolves.toEqual({
- "r": "b5ae3a011eb50e7d1fe9f5e6f6d91ca9f4dfca5f73805fc4866d49e72ead2f5c",
- "s": "3c6e55db5925586bb58e434b58b2c04756f662131597f98c1aa2418b16992b81",
- "v": "26",
- });
-}));
-
-test.skip('[Nano X] Deposit ETH on compound, blind sign', zemu("nanox", async (sim, eth) => {
-
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'f8924685028fa6ae008306599594cc9a0b7c43dc2a5f023bb9b738e45b0ef6b06e0488016345785d8a0000b864474cf53d0000000000000000000000007d2768de32b0b80b7a3454c06bdac94a69ddc7a900000000000000000000000070bc641723fad48be2df6cf63dc6270ee2f897430000000000000000000000000000000000000000000000000000000000000000018080',
- );
-
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanox_deposit_eth_compound_blind', [5, 0]);
-
- await expect(tx).resolves.toEqual({
- "r": "b5ae3a011eb50e7d1fe9f5e6f6d91ca9f4dfca5f73805fc4866d49e72ead2f5c",
- "s": "3c6e55db5925586bb58e434b58b2c04756f662131597f98c1aa2418b16992b81",
- "v": "26",
- });
-}));
+ await expect(tx).resolves.toEqual({
+ "r": "b5ae3a011eb50e7d1fe9f5e6f6d91ca9f4dfca5f73805fc4866d49e72ead2f5c",
+ "s": "3c6e55db5925586bb58e434b58b2c04756f662131597f98c1aa2418b16992b81",
+ "v": "26",
+ });
+ }));
+});
diff --git a/tests/src/chainid.test.js b/tests/src/chainid.test.js
index 10247fc..668b196 100644
--- a/tests/src/chainid.test.js
+++ b/tests/src/chainid.test.js
@@ -1,71 +1,47 @@
import "core-js/stable";
import "regenerator-runtime/runtime";
-import { waitForAppScreen, zemu } from './test.fixture';
+import { waitForAppScreen, zemu, nano_models } from './test.fixture';
-test('[Nano S] Transfer on network 112233445566 on Ethereum', zemu("nanos", async (sim, eth) => {
+nano_models.forEach(function(model) {
+ test('[Nano ' + model.letter + '] Transfer on network 112233445566 on Ethereum', zemu(model, async (sim, eth) => {
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'f044850306dc4200825208945a321744667052affa8386ed49e00ef223cbffc3876f9c9e7bf6181880851a21a278be8080',
- );
+ const tx = eth.signTransaction(
+ "44'/60'/1'/0/0",
+ 'f044850306dc4200825208945a321744667052affa8386ed49e00ef223cbffc3876f9c9e7bf6181880851a21a278be8080',
+ );
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_transfer_112233445566_network', [9, 0]);
+ await waitForAppScreen(sim);
+ let clicks;
+ if (model.letter === 'S') clicks = 10;
+ else clicks = 6;
+ await sim.navigateAndCompareSnapshots('.', model.name + '_transfer_112233445566_network', [clicks, -1, 0]);
- await expect(tx).resolves.toEqual({
- "r": "509981d8dfb66757e25ff47c009b9b5bc5db0f169473e4735f5212b144f1c069",
- "s": "5db989d81025de3c846e41a9ce01a3f9fd0982e2d827f1b88ffc95d73a48d04c",
- "v": "344344f19f",
- });
-}));
+ await expect(tx).resolves.toEqual({
+ "r": "509981d8dfb66757e25ff47c009b9b5bc5db0f169473e4735f5212b144f1c069",
+ "s": "5db989d81025de3c846e41a9ce01a3f9fd0982e2d827f1b88ffc95d73a48d04c",
+ "v": "344344f19f",
+ });
+ }));
+});
-test('[Nano S] Transfer on palm network on Ethereum', zemu("nanos", async (sim, eth) => {
+nano_models.forEach(function(model) {
+ test('[Nano ' + model.letter + '] Transfer on palm network on Ethereum', zemu(model, async (sim, eth) => {
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'f044850306dc4200825208945a321744667052affa8386ed49e00ef223cbffc3876f9c9e7bf61818808502a15c308d8080',
- );
+ const tx = eth.signTransaction(
+ "44'/60'/1'/0/0",
+ 'f044850306dc4200825208945a321744667052affa8386ed49e00ef223cbffc3876f9c9e7bf61818808502a15c308d8080',
+ );
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_transfer_palm_network', [9, 0]);
+ await waitForAppScreen(sim);
+ let clicks;
+ if (model.letter === 'S') clicks = 10;
+ else clicks = 6;
+ await sim.navigateAndCompareSnapshots('.', model.name + '_transfer_palm_network', [clicks, -1, 0]);
- await expect(tx).resolves.toEqual({
- "r": "946700c4972b3da24ddaa95e590ad25a8f905da62e2bd053285a4cc17f93f490",
- "s": "3698e84564e58477a49f7a9cea572ef5d672a5538db08f3ee42df5eb75a1b907",
- "v": "0542b8613d",
- });
-}));
-
-test.skip('[Nano X] Transfer on network 112233445566 on Ethereum', zemu("nanox", async (sim, eth) => {
-
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'f044850306dc4200825208945a321744667052affa8386ed49e00ef223cbffc3876f9c9e7bf6181880851a21a278be8080',
- );
-
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanox_transfer_112233445566_network', [5, 0]);
-
- await expect(tx).resolves.toEqual({
- "r": "509981d8dfb66757e25ff47c009b9b5bc5db0f169473e4735f5212b144f1c069",
- "s": "5db989d81025de3c846e41a9ce01a3f9fd0982e2d827f1b88ffc95d73a48d04c",
- "v": "344344f19f",
- });
-}));
-
-test.skip('[Nano X] Transfer on palm network on Ethereum', zemu("nanox", async (sim, eth) => {
-
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'f044850306dc4200825208945a321744667052affa8386ed49e00ef223cbffc3876f9c9e7bf61818808502a15c308d8080',
- );
-
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanox_transfer_palm_network', [5, 0]);
-
- await expect(tx).resolves.toEqual({
- "r": "946700c4972b3da24ddaa95e590ad25a8f905da62e2bd053285a4cc17f93f490",
- "s": "3698e84564e58477a49f7a9cea572ef5d672a5538db08f3ee42df5eb75a1b907",
- "v": "0542b8613d",
- });
-}));
+ await expect(tx).resolves.toEqual({
+ "r": "946700c4972b3da24ddaa95e590ad25a8f905da62e2bd053285a4cc17f93f490",
+ "s": "3698e84564e58477a49f7a9cea572ef5d672a5538db08f3ee42df5eb75a1b907",
+ "v": "0542b8613d",
+ });
+ }));
+});
diff --git a/tests/src/contract_data_warning.test.js b/tests/src/contract_data_warning.test.js
index 49fb200..7047968 100644
--- a/tests/src/contract_data_warning.test.js
+++ b/tests/src/contract_data_warning.test.js
@@ -2,34 +2,23 @@ import 'core-js/stable';
import 'regenerator-runtime/runtime';
import { expect } from "../jest";
import { TransportStatusError } from "@ledgerhq/errors";
-import { waitForAppScreen, zemu } from './test.fixture';
+import { waitForAppScreen, zemu, nano_models } from './test.fixture';
import Zemu from '@zondax/zemu';
-test('[Nano S] Try to blind sign with setting disabled', zemu("nanos", async (sim, eth) => {
- // we can't use eth.signTransaction because it detects that contract data is disabled and fails early
- let transport = await sim.getTransport();
- let buffer = Buffer.from("058000002c8000003c800000010000000000000000f849208506fc23ac008303dc3194f650c3d88d12db855b8bf7d11be6c55a4e07dcc980a4a1712d6800000000000000000000000000000000000000000000000000000000000acbc7018080", "hex");
- let tx = transport.send(0xe0, 0x04, 0x00, 0x00, buffer);
+nano_models.forEach(function(model) {
+ test('[Nano ' + model.letter + '] Try to blind sign with setting disabled', zemu(model, async (sim, eth) => {
+ // we can't use eth.signTransaction because it detects that contract data is disabled and fails early
+ let transport = await sim.getTransport();
+ let buffer = Buffer.from("058000002c8000003c800000010000000000000000f849208506fc23ac008303dc3194f650c3d88d12db855b8bf7d11be6c55a4e07dcc980a4a1712d6800000000000000000000000000000000000000000000000000000000000acbc7018080", "hex");
+ let tx = transport.send(0xe0, 0x04, 0x00, 0x00, buffer);
- await expect(tx).rejects.toEqual(new TransportStatusError(0x6a80));
+ await expect(tx).rejects.toEqual(new TransportStatusError(0x6a80));
- await Zemu.sleep(1000);
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_try_to_blind_sign_with_setting_disabled', [1, 0]);
-}));
-
-test.skip('[Nano X] Try to blind sign with setting disabled', zemu("nanox", async (sim, eth) => {
- // disable blind signing
- await sim.navigateAndCompareSnapshots('.', 'nanox_disable_blind_signing', [-2, 0, 0, 3, 0]);
-
- // we can't use eth.signTransaction because it detects that contract data is disabled and fails early
- let transport = await sim.getTransport();
- let buffer = Buffer.from("058000002c8000003c800000010000000000000000f849208506fc23ac008303dc3194f650c3d88d12db855b8bf7d11be6c55a4e07dcc980a4a1712d6800000000000000000000000000000000000000000000000000000000000acbc7018080", "hex");
- let tx = transport.send(0xe0, 0x04, 0x00, 0x00, buffer);
-
- await expect(tx).rejects.toEqual(new TransportStatusError(0x6a80));
-
- await Zemu.sleep(1000);
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanox_try_to_blind_sign_with_setting_disabled', [0]);
-}));
+ await Zemu.sleep(1000);
+ await waitForAppScreen(sim);
+ let clicks;
+ if (model.letter === 'S') clicks = [1, 0];
+ else clicks = [0];
+ await sim.navigateAndCompareSnapshots('.', model.name + '_try_to_blind_sign_with_setting_disabled', clicks);
+ }));
+});
diff --git a/tests/src/eip1559.test.js b/tests/src/eip1559.test.js
index 37c8037..41d12d4 100644
--- a/tests/src/eip1559.test.js
+++ b/tests/src/eip1559.test.js
@@ -1,39 +1,25 @@
import "core-js/stable";
import "regenerator-runtime/runtime";
-import { waitForAppScreen, zemu } from './test.fixture';
+import { waitForAppScreen, zemu, nano_models } from './test.fixture';
-test('[Nano S] Transfer eip1559', zemu("nanos", async (sim, eth) => {
+nano_models.forEach(function(model) {
+ test('[Nano ' + model.letter + '] Transfer eip1559', zemu(model, async (sim, eth) => {
- const tx = eth.signTransaction(
- "44'/60'/0'/0/0",
- '02f87001018502540be4008502540be40086246139ca800094cccccccccccccccccccccccccccccccccccccccc8000c001a0e07fb8a64ea3786c9a6649e54429e2786af3ea31c6d06165346678cf8ce44f9ba00e4a0526db1e905b7164a858fd5ebd2f1759e22e6955499448bd276a6aa62830',
- );
+ const tx = eth.signTransaction(
+ "44'/60'/0'/0/0",
+ '02f87001018502540be4008502540be40086246139ca800094cccccccccccccccccccccccccccccccccccccccc8000c001a0e07fb8a64ea3786c9a6649e54429e2786af3ea31c6d06165346678cf8ce44f9ba00e4a0526db1e905b7164a858fd5ebd2f1759e22e6955499448bd276a6aa62830',
+ );
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_transfer_eip1559', [6, 0]);
+ await waitForAppScreen(sim);
+ let clicks;
+ if (model.letter === 'S') clicks = 7;
+ else clicks = 5;
+ await sim.navigateAndCompareSnapshots('.', model.name + '_transfer_eip1559', [clicks, -1, 0]);
- await expect(tx).resolves.toEqual({
- "r": "3d6dfabc6c52374bfa34cb2c433856a0bcd9484870dd1b50249f7164a5fce052",
- "s": "0548a774dd0b63930d83cb2e1a836fe3ef24444e8b758b00585d9a076c0e98a8",
- "v": "01"
- });
-
-}));
-
-test.skip('[Nano X] Transfer eip1559', zemu("nanox", async (sim, eth) => {
-
- const tx = eth.signTransaction(
- "44'/60'/0'/0/0",
- '02f87001018502540be4008502540be40086246139ca800094cccccccccccccccccccccccccccccccccccccccc8000c001a0e07fb8a64ea3786c9a6649e54429e2786af3ea31c6d06165346678cf8ce44f9ba00e4a0526db1e905b7164a858fd5ebd2f1759e22e6955499448bd276a6aa62830',
- );
-
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanox_transfer_eip1559', [4, 0]);
-
- await expect(tx).resolves.toEqual({
- "r": "3d6dfabc6c52374bfa34cb2c433856a0bcd9484870dd1b50249f7164a5fce052",
- "s": "0548a774dd0b63930d83cb2e1a836fe3ef24444e8b758b00585d9a076c0e98a8",
- "v": "01"
- });
-
-}));
+ await expect(tx).resolves.toEqual({
+ "r": "3d6dfabc6c52374bfa34cb2c433856a0bcd9484870dd1b50249f7164a5fce052",
+ "s": "0548a774dd0b63930d83cb2e1a836fe3ef24444e8b758b00585d9a076c0e98a8",
+ "v": "01"
+ });
+ }));
+});
diff --git a/tests/src/erc1155.test.js b/tests/src/erc1155.test.js
index 59eeee0..37d1a8d 100644
--- a/tests/src/erc1155.test.js
+++ b/tests/src/erc1155.test.js
@@ -1,27 +1,67 @@
import "core-js/stable";
import "regenerator-runtime/runtime";
-import { waitForAppScreen, zemu, txFromEtherscan } from './test.fixture';
+import Zemu from '@zondax/zemu';
import { TransportStatusError } from "@ledgerhq/errors";
+import { waitForAppScreen, zemu, nano_models, apdu_as_string, send_apdu } from './test.fixture';
-// -------------------
-// TODO: Actually write the tests
+// Only LNX
+const model = nano_models[1];
-test.skip('[Nano S] Transfer 1155', zemu("nanos", async (sim, eth) => {
+{
+ const set_plugin = apdu_as_string('e01600007401010745524331313535495f947276749ce646f68ac8c248420045cb7b5ef242432a00000000000000010001473045022100ec4377d17e8d98d424bf16b29c691bc1a010825fb5b8a35de0268a9dc22eab2402206701b016fe6718bf519d18cc12e9838e9ef898cc4c143017839023c3260b2d74');
+ const provide_nft_info = apdu_as_string('e01400007b0101124f70656e53656120436f6c6c656374696f6e495f947276749ce646f68ac8c248420045cb7b5e0000000000000001000147304502210083e357a828f13d574b1296214a3749c194ab1df1f8a243655c053b1c72f91e0c02201ed93cfac7e87759445c4da2e4bfd6e1cf0405ea37c7293bc965948f51bef5cc');
+ const sign_first = apdu_as_string('e004000096058000002c8000003c800000000000000000000000f901090b8520b673dd0082bcb394495f947276749ce646f68ac8c248420045cb7b5e80b8e4f242432a0000000000000000000000006cbcd73cd8e8a42844662f0a0e76d7f79afd933d000000000000000000000000c2907efcce4011c491bbeda8a0fa63ba7aab596cabf06640f8ca8fc5e0ed471b10befcdf65a33e4300000000');
+ const sign_more = apdu_as_string('e00480008b00006a0000000064000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000043078303000000000000000000000000000000000000000000000000000000000018080');
- const rawTx = ""
- const serializedTx = txFromEtherscan(rawTx);
+ test('[Nano ' + model.letter + '] Transfer ERC-1155', zemu(model, async (sim, eth) => {
+ const current_screen = sim.getMainMenuSnapshot();
+ await send_apdu(eth.transport, set_plugin);
+ await send_apdu(eth.transport, provide_nft_info);
+ await send_apdu(eth.transport, sign_first);
+ let sign_promise = send_apdu(eth.transport, sign_more);
- // with ETH need to test
- // const serializedTx = txFromEtherscan("0x02f901350182022f8459682f0085246ad7eb3182de2994424db67b40b15ed85475c3f29dedf601b6ee75b283424242b8c4f242432a000000000000000000000000dcdb88f3754b2841093d9348a2d02df8cf06314c000000000000000000000000df9fb2eff1f2871caeeb94bf262ffba84efddddc0000000000000000000000000000000000000000000000000000000000000007000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000000c001a0c4283f86dc852e43e9fd1077b448c63fec76bdeb44dfac977730725e41fa3676a0543b2d2f99f65fb20cd548964eee94b1c1865919f4574c7089d8b95678b667c2");
+ await waitForAppScreen(sim, current_screen);
+ await sim.navigateAndCompareSnapshots('.', model.name + '_erc1155_transfer', [10, -1, 0]);
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- serializedTx,
- );
+ await sign_promise;
+ }));
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_erc721_transfer_ethereum', [12, 0]);
+ test('[Nano ' + model.letter + '] Transfer ERC-1155 w/o NFT metadata', zemu(model, async (sim, eth) => {
+ const current_screen = sim.getMainMenuSnapshot();
+ await send_apdu(eth.transport, set_plugin);
+ let sign_tx = send_apdu(eth.transport, sign_first);
- await expect(tx).resolves.toEqual({
- });
-}));
+ await expect(sign_tx).rejects.toEqual(new TransportStatusError(0x6a80));
+ }));
+
+ test('[Nano ' + model.letter + '] Transfer ERC-1155 w/o plugin loaded', zemu(model, async (sim, eth) => {
+ const current_screen = sim.getMainMenuSnapshot();
+ let nft_info = send_apdu(eth.transport, provide_nft_info);
+
+ await expect(nft_info).rejects.toEqual(new TransportStatusError(0x6985));
+ }));
+}
+
+{
+ const set_plugin = apdu_as_string('e01600007401010745524331313535495f947276749ce646f68ac8c248420045cb7b5e2eb2c2d60000000000000001000147304502210087b35cefc53fd94e25404933eb0d5ff08f20ba655d181de3b24ff0099dc3317f02204a216aa9e0b84bef6e20fcb036bd49647bf0cab66732b99b49ec277ffb682aa1');
+ const provide_nft_info = apdu_as_string('e0140000820101194f70656e536561205368617265642053746f726566726f6e74495f947276749ce646f68ac8c248420045cb7b5e00000000000000010001473045022100c74cd613a27a9f4887210f5a3a0e12745e1ba0ab3a0d284cb6485d89c3cce4e602205a13e62a91164985cf58a838f8f531c0b91b980d206a5ba8df28270023ef93a3');
+ const sign_first = apdu_as_string('e004000096058000002c8000003c800000000000000000000000f9020b0e850d8cfd86008301617d94495f947276749ce646f68ac8c248420045cb7b5e80b901e42eb2c2d60000000000000000000000006cbcd73cd8e8a42844662f0a0e76d7f79afd933d000000000000000000000000c2907efcce4011c491bbeda8a0fa63ba7aab596c00000000000000000000000000000000000000000000');
+ const sign_more_1 = apdu_as_string('e004800096000000000000000000a0000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000003abf06640f8ca8fc5e0ed471b10befcdf65a33e430000000000006a0000000064def9d99ff495856496c028c0');
+ const sign_more_2 = apdu_as_string('e00480009689732473fcd0bbbe000000000000a30000000001abf06640f8ca8fc5e0ed471b10befcdf65a33e430000000000006a00000000640000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000010000');
+ const sign_more_3 = apdu_as_string('e00480006100000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000043078303000000000000000000000000000000000000000000000000000000000018080');
+
+ test('[Nano ' + model.letter + '] Batch transfer ERC-1155', zemu(model, async (sim, eth) => {
+ const current_screen = sim.getMainMenuSnapshot();
+ await send_apdu(eth.transport, set_plugin);
+ await send_apdu(eth.transport, provide_nft_info);
+ await send_apdu(eth.transport, sign_first);
+ await send_apdu(eth.transport, sign_more_1);
+ await send_apdu(eth.transport, sign_more_2);
+ let sign_promise = send_apdu(eth.transport, sign_more_3);
+
+ await waitForAppScreen(sim, current_screen);
+ await sim.navigateAndCompareSnapshots('.', model.name + '_erc1155_batch_transfer', [8, -1, 0]);
+
+ await sign_promise;
+ }));
+}
diff --git a/tests/src/erc721.test.js b/tests/src/erc721.test.js
index 58052f1..1d05853 100644
--- a/tests/src/erc721.test.js
+++ b/tests/src/erc721.test.js
@@ -1,130 +1,41 @@
import "core-js/stable";
import "regenerator-runtime/runtime";
-import { waitForAppScreen, zemu, txFromEtherscan } from './test.fixture';
+import Zemu from '@zondax/zemu';
+import { TransportStatusError } from "@ledgerhq/errors";
+import { waitForAppScreen, zemu, nano_models, apdu_as_string, send_apdu } from './test.fixture';
-test.skip('[Nano S] Transfer erc721', zemu("nanos", async (sim, eth) => {
+// Only LNX
+const model = nano_models[1];
- // https://etherscan.io/tx/0x73cec4fc07de3a24ba42e8756e13b7ddfa9bd449126c37640881195e8ea9e679
- // Modified to put a bigger token id
- const rawTx = "0x02f8d101058459682f0085233da9943e8301865b94bd3531da5cf5857e7cfaa92426877b022e612cf880b86423b872dd0000000000000000000000004cc568b73c0dcf8e90db26d7fd3a6cfadca108a3000000000000000000000000d4c9b20950c3eca38fc1f33f54bdf9694e488799ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc080a094c8632fe7277aa8c54cea9d81a15911cfa4970a2bf7356d14d04cc5afbcdab7a013a77b8c79e5d9b2b35edb3c44db3bb41b92f5c463ff126bf19d213b2b9ba8b5"
- const serializedTx = txFromEtherscan(rawTx);
+const set_plugin = apdu_as_string('e01600007301010645524337323160f80121c31a0d46b5279700f9df786054aa5ee542842e0e0000000000000001000147304502202e2282d7d3ea714da283010f517af469e1d59654aaee0fc438f017aa557eaea50221008b369679381065bbe01135723a4f9adb229295017d37c4d30138b90a51cf6ab6');
+const provide_nft_info = apdu_as_string('e01400007001010752617269626c6560f80121c31a0d46b5279700f9df786054aa5ee500000000000000010001473045022025696986ef5f0ee2f72d9c6e41d7e2bf2e4f06373ab26d73ebe326c7fd4c7a6602210084f6b064d8750ae68ed5dd012296f37030390ec06ff534c5da6f0f4a4460af33');
+const sign_first = apdu_as_string('e004000096058000002c8000003c800000000000000000000000f88a0a852c3ce1ec008301f5679460f80121c31a0d46b5279700f9df786054aa5ee580b86442842e0e0000000000000000000000006cbcd73cd8e8a42844662f0a0e76d7f79afd933d000000000000000000000000c2907efcce4011c491bbeda8a0fa63ba7aab596c000000000000000000000000000000000000000000000000');
+const sign_more = apdu_as_string('e00480000b0000000000112999018080');
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- serializedTx,
- );
+test('[Nano ' + model.letter + '] Transfer ERC-721', zemu(model, async (sim, eth) => {
+ const current_screen = sim.getMainMenuSnapshot();
+ await send_apdu(eth.transport, set_plugin);
+ await send_apdu(eth.transport, provide_nft_info);
+ await send_apdu(eth.transport, sign_first);
+ let sign_promise = send_apdu(eth.transport, sign_more);
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_erc721_transfer', [12, 0]);
+ await waitForAppScreen(sim, current_screen);
+ await sim.navigateAndCompareSnapshots('.', model.name + '_erc721_transfer', [8, -1, 0]);
- await expect(tx).resolves.toEqual({
- "r": "59f6a9769cff66eed8be8716c44d39808d1e43f3aa0bb97538e124dba4bc4565",
- "s": "662990a841c663a165ba9a83e5cc95c03a999b851e0bd6d296aa70a0f7c96c1a",
- "v": "01",
- });
+ await sign_promise;
}));
-test.skip('[Nano S] Transfer erc721 with attached ETH', zemu("nanos", async (sim, eth) => {
+test('[Nano ' + model.letter + '] Transfer ERC-721 w/o NFT metadata', zemu(model, async(sim, eth) => {
+ const current_screen = sim.getMainMenuSnapshot();
+ await send_apdu(eth.transport, set_plugin);
+ let sign_tx = send_apdu(eth.transport, sign_first);
- const rawTx = "0x02f8d601058459682f0085233da9943e8301865b94bd3531da5cf5857e7cfaa92426877b022e612cf8854242424242b86423b872dd0000000000000000000000004cc568b73c0dcf8e90db26d7fd3a6cfadca108a3000000000000000000000000d4c9b20950c3eca38fc1f33f54bdf9694e4887990000000000000000000000000000000000000000000000000000000000000f21c080a094c8632fe7277aa8c54cea9d81a15911cfa4970a2bf7356d14d04cc5afbcdab7a013a77b8c79e5d9b2b35edb3c44db3bb41b92f5c463ff126bf19d213b2b9ba8b5"
- const serializedTx = txFromEtherscan(rawTx);
-
-
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- serializedTx,
- );
-
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_erc721_transfer_with_eth', [13, 0]);
-
- await expect(tx).resolves.toEqual({
- "r": "9c42e10b49f3ee315ab2d5f7ad96f1068c75578734b66504716cc279ead27d47",
- "s": "45dde78470ad75ffdb27a799b87e4934e2e10e98dbc6f88bc4a9bc19c4de86bc",
- "v": "00",
- });
+ await expect(sign_tx).rejects.toEqual(new TransportStatusError(0x6a80));
}));
-test.skip('[Nano S] set approval for all erc721', zemu("nanos", async (sim, eth) => {
+test('[Nano ' + model.letter + '] Transfer ERC-721 w/o plugin loaded', zemu(model, async (sim, eth) => {
+ const current_screen = sim.getMainMenuSnapshot();
+ let nft_info = send_apdu(eth.transport, provide_nft_info);
- // https://etherscan.io/tx/0x86b936db53c19fddf26b8d145f165e1c7fdff3c0f8b14b7758a38f0400cfd93f
- const rawTx = "0x02f8b0010c8459682f00852cfbb00ee682b54294d4e4078ca3495de5b1d4db434bebc5a98619778280b844a22cb4650000000000000000000000002efcb1e8d4472d35356b9747bea8a051eac2e3f50000000000000000000000000000000000000000000000000000000000000001c001a0c5b8c024c15ca1452ce8a13eacfcdc25f1c6f581bb3ce570e82f08f1b792b3aca03be4dba0302ae190618a72eb1202ce3af3e17afd7d8a94345a48cae5cad15541";
- const serializedTx = txFromEtherscan(rawTx);
-
-
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- serializedTx,
- );
-
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_erc721_approval_for_all', [12, 0]);
-
- await expect(tx).resolves.toEqual({
- "r": "8b6a70a1fe76d8e9b1250531a17eb1e367936732d4dfb9befc81a5031b271dc8",
- "s": "7658d7151bba0d8504cea2013bead64cb8407dc6be1fca829bb9594b56f679af",
- "v": "00",
- });
-}));
-
-// NOT DONE
-test.skip('[Nano S] approval erc721', zemu("nanos", async (sim, eth) => {
-
- // INCORRECT, need to find / create an approval tx
- const rawTx = "";
- const serializedTx = txFromEtherscan(rawTx);
-
-
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- serializedTx,
- );
-
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_erc721_approval', [12, 0]);
-
- await expect(tx).resolves.toEqual({
- });
-}));
-
-test.skip('[Nano S] safe transfer erc721', zemu("nanos", async (sim, eth) => {
-
- // https://etherscan.io/tx/0x1ee6ce9be1c9fe6f030ff124ba8c88a410223c022816547e4b3fedd3a4d2dc1e
- const rawTx = "0xf8cc82028585077359400083061a8094d4e4078ca3495de5b1d4db434bebc5a98619778280b86442842e0e000000000000000000000000c352b534e8b987e036a93539fd6897f53488e56a0000000000000000000000000a9287d9339c175cd3ea0ad4228f734a9f75ee6200000000000000000000000000000000000000000000000000000000000000621ca08250f4b2c8f28c5e4ef621dba4682990d1faf930c8cb6d032c6e7278e8951d92a03c1e1f6d63ed339041f69f24c6c0968ba26f244f779cb4fa7a468f3ba3d3e06e";
- const serializedTx = txFromEtherscan(rawTx);
-
-
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- serializedTx,
- );
-
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_erc721_safe_transfer', [10, 0]);
-
- await expect(tx).resolves.toEqual({
- "r": "b936684d5d0e99e09701021fb73ae9403f2ec79414d822d42c5bd1c0a2118f1a",
- "s": "23e517c6cac998f392d179be2fe7c3225f0e0a165b1af85548da5d6acaa73c4f",
- "v": "25",
- });
-}));
-
-// NOT DONE
-test.skip('[Nano S] safe transfer with data erc721', zemu("nanos", async (sim, eth) => {
-
- // need to find or create a safe transfer with data on etherscan?
- const rawTx = "";
- const serializedTx = txFromEtherscan(rawTx);
-
-
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- serializedTx,
- );
-
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_erc721_safe_transfer_with_data', [12, 0]);
-
- await expect(tx).resolves.toEqual({
- });
+ await expect(nft_info).rejects.toEqual(new TransportStatusError(0x6985));
}));
diff --git a/tests/src/send.test.js b/tests/src/send.test.js
index be27c78..ad83a4c 100644
--- a/tests/src/send.test.js
+++ b/tests/src/send.test.js
@@ -1,82 +1,60 @@
import "core-js/stable";
import "regenerator-runtime/runtime";
-import { waitForAppScreen, zemu } from './test.fixture';
+import { waitForAppScreen, zemu, nano_models } from './test.fixture';
import { TransportStatusError } from "@ledgerhq/errors";
-test('[Nano S] Transfer Ether on Ethereum app', zemu("nanos", async (sim, eth) => {
+nano_models.forEach(function(model) {
+ test('[Nano ' + model.letter + '] Transfer Ether on Ethereum app', zemu(model, async (sim, eth) => {
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'EB44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF6181880018080',
- );
+ const tx = eth.signTransaction(
+ "44'/60'/1'/0/0",
+ 'EB44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF6181880018080',
+ );
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_transfer_ethereum', [8, 0]);
+ await waitForAppScreen(sim);
+ let clicks;
+ if (model.letter === 'S') clicks = 9;
+ else clicks = 5;
+ await sim.navigateAndCompareSnapshots('.', model.name + '_transfer_ethereum', [clicks, -1, 0]);
- await expect(tx).resolves.toEqual({
- "r": "6f389d15320f0501383526ed03de917c14212716f09a262dbc98431086a5db49",
- "s": "0dc994b7b97230bb35fdf6fec2f4d8ff4cfb8bfeb2a652c364c738ff033c05dd",
- "v": "26",
- });
-}));
+ await expect(tx).resolves.toEqual({
+ "r": "6f389d15320f0501383526ed03de917c14212716f09a262dbc98431086a5db49",
+ "s": "0dc994b7b97230bb35fdf6fec2f4d8ff4cfb8bfeb2a652c364c738ff033c05dd",
+ "v": "26",
+ });
+ }));
+});
-test('[Nano S] Transfer amount >= 2^87 Eth on Ethereum app should fail', zemu("nanos", async (sim, eth) => {
+nano_models.forEach(function(model) {
+ test('[Nano ' + model.letter + '] Transfer amount >= 2^87 Eth on Ethereum app should fail', zemu(model, async (sim, eth) => {
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'f83f268e02cc9be5c53ea44bd43c289dcddc82520894dac17f958d2ee523a2206206994597c13d831ec7928db8b0861b8f7fe5df83cd553a829878000080018080',
- );
+ const tx = eth.signTransaction(
+ "44'/60'/1'/0/0",
+ 'f83f268e02cc9be5c53ea44bd43c289dcddc82520894dac17f958d2ee523a2206206994597c13d831ec7928db8b0861b8f7fe5df83cd553a829878000080018080',
+ );
- await expect(tx).rejects.toEqual(new TransportStatusError(0x6807));
-}));
+ await expect(tx).rejects.toEqual(new TransportStatusError(0x6807));
+ }));
+});
-test('[Nano S] Transfer Ether on network 5234 on Ethereum app', zemu("nanos", async (sim, eth) => {
+nano_models.forEach(function(model) {
+ test('[Nano ' + model.letter + '] Transfer Ether on network 5234 on Ethereum app', zemu(model, async (sim, eth) => {
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'ED44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF61818808214728080',
- );
+ const tx = eth.signTransaction(
+ "44'/60'/1'/0/0",
+ 'ED44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF61818808214728080',
+ );
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_transfer_ethereum_5234_network', [9, 0]);
+ await waitForAppScreen(sim);
+ let clicks;
+ if (model.letter === 'S') clicks = 10;
+ else clicks = 6;
+ await sim.navigateAndCompareSnapshots('.', model.name + '_transfer_ethereum_5234_network', [clicks, -1, 0]);
- await expect(tx).resolves.toEqual({
- "r": "07a7982dfd16360c96a03467877d0cf9c36f799deff4dace250cdb18e28a3b90",
- "s": "773318a93da2e32c1cf308ddd6add1e8c0d285973e541520a05fb4dc720e4fb1",
- "v": "2908",
- });
-}));
-
-test.skip('[Nano X] Transfer Ether on Ethereum app', zemu("nanox", async (sim, eth) => {
-
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'EB44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF6181880018080',
- );
-
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanox_transfer_ethereum', [4, 0]);
-
- await expect(tx).resolves.toEqual({
- "r": "6f389d15320f0501383526ed03de917c14212716f09a262dbc98431086a5db49",
- "s": "0dc994b7b97230bb35fdf6fec2f4d8ff4cfb8bfeb2a652c364c738ff033c05dd",
- "v": "26",
- });
-}));
-
-test.skip('[Nano X] Transfer Ether on network 5234 on Ethereum app', zemu("nanox", async (sim, eth) => {
-
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'ED44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF61818808214728080',
- );
-
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanox_transfer_ethereum_5234_network', [5, 0]);
-
- await expect(tx).resolves.toEqual({
- "r": "07a7982dfd16360c96a03467877d0cf9c36f799deff4dace250cdb18e28a3b90",
- "s": "773318a93da2e32c1cf308ddd6add1e8c0d285973e541520a05fb4dc720e4fb1",
- "v": "2908",
- });
-}));
+ await expect(tx).resolves.toEqual({
+ "r": "07a7982dfd16360c96a03467877d0cf9c36f799deff4dace250cdb18e28a3b90",
+ "s": "773318a93da2e32c1cf308ddd6add1e8c0d285973e541520a05fb4dc720e4fb1",
+ "v": "2908",
+ });
+ }));
+});
diff --git a/tests/src/send_bsc.test.js b/tests/src/send_bsc.test.js
index 02d5112..5d9daba 100644
--- a/tests/src/send_bsc.test.js
+++ b/tests/src/send_bsc.test.js
@@ -1,37 +1,25 @@
import "core-js/stable";
import "regenerator-runtime/runtime";
-import { waitForAppScreen, zemu } from './test.fixture';
+import { waitForAppScreen, zemu, nano_models } from './test.fixture';
-test('[Nano S] Transfer bsc', zemu("nanos", async (sim, eth) => {
+nano_models.forEach(function(model) {
+ test('[Nano ' + model.letter + '] Transfer bsc', zemu(model, async (sim, eth) => {
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'EB0185012A05F200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF6181880388080',
- );
+ const tx = eth.signTransaction(
+ "44'/60'/1'/0/0",
+ 'EB0185012A05F200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF6181880388080',
+ );
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_transfer_bsc', [9, 0]);
+ await waitForAppScreen(sim);
+ let clicks;
+ if (model.letter === 'S') clicks = 10;
+ else clicks = 6;
+ await sim.navigateAndCompareSnapshots('.', model.name + '_transfer_bsc', [clicks, -1, 0]);
- await expect(tx).resolves.toEqual({
- "r": "f667cc34e9815df4f052fb3463cdbe355fff5c1acf4e919b3539806521a059ad",
- "s": "6b35492b7108d9d9e1cc7aede536ed6b3173197b56dd873cbc3b43e041d6f407",
- "v": "93",
- });
-}));
-
-test.skip('[Nano X] Transfer bsc', zemu("nanox", async (sim, eth) => {
-
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'EB0185012A05F200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF6181880388080',
- );
-
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanox_transfer_bsc', [5, 0]);
-
- await expect(tx).resolves.toEqual({
- "r": "f667cc34e9815df4f052fb3463cdbe355fff5c1acf4e919b3539806521a059ad",
- "s": "6b35492b7108d9d9e1cc7aede536ed6b3173197b56dd873cbc3b43e041d6f407",
- "v": "93",
- });
-}));
+ await expect(tx).resolves.toEqual({
+ "r": "f667cc34e9815df4f052fb3463cdbe355fff5c1acf4e919b3539806521a059ad",
+ "s": "6b35492b7108d9d9e1cc7aede536ed6b3173197b56dd873cbc3b43e041d6f407",
+ "v": "93",
+ });
+ }));
+});
diff --git a/tests/src/send_etc.test.js b/tests/src/send_etc.test.js
index c1cbaa5..6b5e7d0 100644
--- a/tests/src/send_etc.test.js
+++ b/tests/src/send_etc.test.js
@@ -1,114 +1,38 @@
import "core-js/stable";
import "regenerator-runtime/runtime";
-import Eth from "@ledgerhq/hw-app-eth";
-import Zemu from "@zondax/zemu";
import { EthAppPleaseEnableContractData } from "@ledgerhq/errors";
-import { expect } from "../jest";
+import { waitForAppScreen, zemu, nano_models } from './test.fixture';
-import { waitForAppScreen, NANOS_ETH_LIB, NANOX_ETH_LIB, NANOS_CLONE_ELF_PATH, NANOX_CLONE_ELF_PATH, sim_options_nanos, sim_options_nanox, TIMEOUT} from './test.fixture';
+nano_models.forEach(function(model) {
+ test("[Nano " + model.letter + "] Transfer on Ethereum clone app", zemu(model, async (sim, eth) => {
+ const tx = eth.signTransaction(
+ "44'/60'/0'/0/0",
+ 'EB44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF61818803D8080',
+ );
-test("[Nano S] Transfer on Ethereum clone app", async () => {
- jest.setTimeout(TIMEOUT);
- const sim = new Zemu(NANOS_CLONE_ELF_PATH, NANOS_ETH_LIB);
+ await waitForAppScreen(sim);
+ let clicks;
+ if (model.letter === 'S') clicks = 9;
+ else clicks = 5;
+ await sim.navigateAndCompareSnapshots('.', model.name + '_transfer_ethereum_clone', [clicks, -1, 0]);
- try {
- await sim.start(sim_options_nanos);
-
- let transport = await sim.getTransport();
-
- const eth = new Eth(transport);
-
- const tx = eth.signTransaction(
- "44'/60'/0'/0/0",
- 'EB44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF61818803D8080',
- );
-
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_transfer_ethereum_clone', [8, 0]);
-
- await expect(tx).resolves.toEqual({
- "r": "60df850d297e355596f87dc313a742032de4b59c5579186b3d59bdf31402fec0",
- "s": "23c3a2beacabc1943d487a2e1d545e4c46c718b1e70e9d1c11a98828c9338927",
- "v": "9e",
- });
- } finally {
- await sim.close();
- }
+ await expect(tx).resolves.toEqual({
+ "r": "60df850d297e355596f87dc313a742032de4b59c5579186b3d59bdf31402fec0",
+ "s": "23c3a2beacabc1943d487a2e1d545e4c46c718b1e70e9d1c11a98828c9338927",
+ "v": "9e",
+ });
+ }, true));
});
-test("[Nano S] Transfer on network 5234 on Ethereum clone", async () => {
- jest.setTimeout(TIMEOUT);
- const sim = new Zemu(NANOS_CLONE_ELF_PATH, NANOS_ETH_LIB);
+nano_models.forEach(function(model) {
+ test("[Nano " + model.letter + "] Transfer on network 5234 on Ethereum clone", zemu(model, async (sim, eth) => {
+ const tx = eth.signTransaction(
+ "44'/60'/0'/0/0",
+ 'ED44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF61818808214728080',
+ );
- try {
- await sim.start(sim_options_nanos);
-
- let transport = await sim.getTransport();
-
- const eth = new Eth(transport);
-
- const tx = eth.signTransaction(
- "44'/60'/0'/0/0",
- 'ED44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF61818808214728080',
- );
-
- await expect(tx).rejects.toEqual(new EthAppPleaseEnableContractData(
- "Please enable Contract data on the Ethereum app Settings"
- ));
- } finally {
- await sim.close();
- }
-});
-
-test.skip("[Nano X] Transfer on Ethereum clone app", async () => {
- jest.setTimeout(TIMEOUT);
- const sim = new Zemu(NANOX_CLONE_ELF_PATH, NANOX_ETH_LIB);
-
- try {
- await sim.start(sim_options_nanox);
-
- let transport = await sim.getTransport();
-
- const eth = new Eth(transport);
-
- const tx = eth.signTransaction(
- "44'/60'/0'/0/0",
- 'EB44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF61818803D8080',
- );
-
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanox_transfer_ethereum_clone', [4, 0]);
-
- await expect(tx).resolves.toEqual({
- "r": "60df850d297e355596f87dc313a742032de4b59c5579186b3d59bdf31402fec0",
- "s": "23c3a2beacabc1943d487a2e1d545e4c46c718b1e70e9d1c11a98828c9338927",
- "v": "9e",
- });
- } finally {
- await sim.close();
- }
-});
-
-test.skip("[Nano X] Transfer on network 5234 on Ethereum clone", async () => {
- jest.setTimeout(TIMEOUT);
- const sim = new Zemu(NANOX_CLONE_ELF_PATH, NANOX_ETH_LIB);
-
- try {
- await sim.start(sim_options_nanox);
-
- let transport = await sim.getTransport();
-
- const eth = new Eth(transport);
-
- const tx = eth.signTransaction(
- "44'/60'/0'/0/0",
- 'ED44850306DC4200825208945A321744667052AFFA8386ED49E00EF223CBFFC3876F9C9E7BF61818808214728080',
- );
-
- await expect(tx).rejects.toEqual(new EthAppPleaseEnableContractData(
- "Please enable Contract data on the Ethereum app Settings"
- ));
- } finally {
- await sim.close();
- }
+ await expect(tx).rejects.toEqual(new EthAppPleaseEnableContractData(
+ "Please enable Contract data on the Ethereum app Settings"
+ ));
+ }, true));
});
diff --git a/tests/src/starkware.test.js b/tests/src/starkware.test.js
index b4dd707..91de9d0 100644
--- a/tests/src/starkware.test.js
+++ b/tests/src/starkware.test.js
@@ -1,65 +1,40 @@
import "core-js/stable";
import "regenerator-runtime/runtime";
-import { waitForAppScreen, zemu } from './test.fixture';
+import { waitForAppScreen, zemu, nano_models } from './test.fixture';
import { byContractAddressAndChainId } from '@ledgerhq/hw-app-eth/erc20'
import { BigNumber } from "bignumber.js";
-test('[Nano S] Transfer Ether on Ethereum app', zemu("nanos", async (sim, eth) => {
+nano_models.forEach(function(model) {
+ test('[Nano ' + model.letter + '] Transfer Ether on Ethereum app', zemu(model, async (sim, eth) => {
- // Provide USDT token info to the app
- const usdt_info = byContractAddressAndChainId("0xdac17f958d2ee523a2206206994597c13d831ec7", 1);
- await eth.provideERC20TokenInformation(usdt_info);
+ // Provide USDT token info to the app
+ const usdt_info = byContractAddressAndChainId("0xdac17f958d2ee523a2206206994597c13d831ec7", 1);
+ await eth.provideERC20TokenInformation(usdt_info);
- // Provide Stark quantum
- const quantization = new BigNumber(1);
- await eth.starkProvideQuantum_v2(
- "0xdac17f958d2ee523a2206206994597c13d831ec7",
- "erc20",
- quantization,
- null
- )
+ // Provide Stark quantum
+ const quantization = new BigNumber(1);
+ await eth.starkProvideQuantum_v2(
+ "0xdac17f958d2ee523a2206206994597c13d831ec7",
+ "erc20",
+ quantization,
+ null
+ )
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'f8b5018a0472698b413b43200000825208940102030405060708090a0b0c0d0e0f1011121314872bd72a24874000b8842505c3d9010101010101010102020202020202020303030303030303040404040404040402ce625e94458d39dd0bf3b45a843544dd4a14b8169045a3a3d15aa564b936c500000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000030d40808080',
- );
+ const tx = eth.signTransaction(
+ "44'/60'/1'/0/0",
+ 'f8b5018a0472698b413b43200000825208940102030405060708090a0b0c0d0e0f1011121314872bd72a24874000b8842505c3d9010101010101010102020202020202020303030303030303040404040404040402ce625e94458d39dd0bf3b45a843544dd4a14b8169045a3a3d15aa564b936c500000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000030d40808080',
+ );
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanos_starkware_usdt_deposit', [13, 0]);
+ await waitForAppScreen(sim);
+ let clicks;
+ if (model.letter === 'S') clicks = 14;
+ else clicks = 10;
+ await sim.navigateAndCompareSnapshots('.', model.name + '_starkware_usdt_deposit', [clicks, -1, 0]);
- await expect(tx).resolves.toEqual({
- "r": "14c368c0d32e399470d6113cf796c5f4cd70300766337d8b0ba71ecad21b3d52",
- "s": "4207c027959e84fc2242a1f4fd955603f137ba28f67268ffc91fef5d65071b0a",
- "v": "1c",
- });
-}));
-
-test.skip('[Nano X] Transfer Ether on Ethereum app', zemu("nanox", async (sim, eth) => {
-
- // Provide USDT token info to the app
- const usdt_info = byContractAddressAndChainId("0xdac17f958d2ee523a2206206994597c13d831ec7", 1);
- await eth.provideERC20TokenInformation(usdt_info);
-
- // Provide Stark quantum
- const quantization = new BigNumber(1);
- await eth.starkProvideQuantum_v2(
- "0xdac17f958d2ee523a2206206994597c13d831ec7",
- "erc20",
- quantization,
- null
- )
-
- const tx = eth.signTransaction(
- "44'/60'/1'/0/0",
- 'f8b5018a0472698b413b43200000825208940102030405060708090a0b0c0d0e0f1011121314872bd72a24874000b8842505c3d9010101010101010102020202020202020303030303030303040404040404040402ce625e94458d39dd0bf3b45a843544dd4a14b8169045a3a3d15aa564b936c500000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000030d40808080',
- );
-
- await waitForAppScreen(sim);
- await sim.navigateAndCompareSnapshots('.', 'nanox_starkware_usdt_deposit', [9, 0]);
-
- await expect(tx).resolves.toEqual({
- "r": "14c368c0d32e399470d6113cf796c5f4cd70300766337d8b0ba71ecad21b3d52",
- "s": "4207c027959e84fc2242a1f4fd955603f137ba28f67268ffc91fef5d65071b0a",
- "v": "1c",
- });
-}));
+ await expect(tx).resolves.toEqual({
+ "r": "14c368c0d32e399470d6113cf796c5f4cd70300766337d8b0ba71ecad21b3d52",
+ "s": "4207c027959e84fc2242a1f4fd955603f137ba28f67268ffc91fef5d65071b0a",
+ "v": "1c",
+ });
+ }));
+});
diff --git a/tests/src/test.fixture.js b/tests/src/test.fixture.js
index 70b8313..c29dbad 100644
--- a/tests/src/test.fixture.js
+++ b/tests/src/test.fixture.js
@@ -1,27 +1,20 @@
-import Zemu from '@zondax/zemu';
+import Zemu, { DEFAULT_START_OPTIONS, DeviceModel } from '@zondax/zemu';
import Eth from '@ledgerhq/hw-app-eth';
import {RLP} from "ethers/lib/utils";
const transactionUploadDelay = 60000;
-async function waitForAppScreen(sim) {
- await sim.waitUntilScreenIsNot(sim.getMainMenuSnapshot(), transactionUploadDelay);
+async function waitForAppScreen(sim, current_screen = null) {
+ if (current_screen === null) current_screen = sim.getMainMenuSnapshot();
+
+ await sim.waitUntilScreenIsNot(current_screen, transactionUploadDelay);
}
-const sim_options_nanos = {
- model: 'nanos',
+const sim_options_nano = {
+ ...DEFAULT_START_OPTIONS,
logging: true,
X11: true,
- startDelay: 5000,
- custom: '',
-};
-
-const sim_options_nanox = {
- model: 'nanox',
- logging: true,
- X11: true,
- startDelay: 5000,
- custom: '',
+ startText: 'is ready'
};
const Resolve = require('path').resolve;
@@ -29,16 +22,43 @@ const Resolve = require('path').resolve;
const NANOS_ELF_PATH = Resolve('elfs/ethereum_nanos.elf');
const NANOX_ELF_PATH = Resolve('elfs/ethereum_nanox.elf');
-const NANOS_ETH_LIB = { "Ethereum": NANOS_ELF_PATH };
-const NANOX_ETH_LIB = { "Ethereum": NANOX_ELF_PATH };
-
const NANOS_CLONE_ELF_PATH = Resolve("elfs/ethereum_classic_nanos.elf");
const NANOX_CLONE_ELF_PATH = Resolve("elfs/ethereum_classic_nanox.elf");
+const nano_models: DeviceModel[] = [
+ { name: 'nanos', letter: 'S', path: NANOS_ELF_PATH, clone_path: NANOS_CLONE_ELF_PATH },
+ { name: 'nanox', letter: 'X', path: NANOX_ELF_PATH, clone_path: NANOX_CLONE_ELF_PATH }
+];
+
const TIMEOUT = 1000000;
+// useful to take an apdu as a hex string and convert its JS representation
+function apdu_as_string(str) {
+ let buffer = [];
+
+ for (let i = 0; i < str.length; i += 2) {
+ const str_extract = str.substring(i, i + 2);
+ buffer[i / 2] = parseInt(str_extract, 16);
+ }
+ return {
+ cla: buffer[0],
+ ins: buffer[1],
+ p1: buffer[2],
+ p2: buffer[3],
+ data: Buffer.from(buffer.slice(5))
+ };
+}
+
+async function send_apdu(ts, apdu) {
+ return ts.send(apdu.cla,
+ apdu.ins,
+ apdu.p1,
+ apdu.p2,
+ apdu.data);
+}
+
// Generates a serializedTransaction from a rawHexTransaction copy pasted from etherscan.
-function txFromEtherscan(rawTx) {
+function txFromEtherscan(rawTx) {
// Remove 0x prefix
rawTx = rawTx.slice(2);
@@ -66,22 +86,21 @@ function txFromEtherscan(rawTx) {
return txType + encoded;
}
-function zemu(device, func) {
+function zemu(device, func, start_clone = false) {
return async () => {
jest.setTimeout(TIMEOUT);
- let zemu_args;
- let sim_options;
- if(device === "nanos") {
- zemu_args = [NANOS_ELF_PATH];
- sim_options = sim_options_nanos;
+ let elf_path;
+ let lib_elf;
+ if (start_clone) {
+ elf_path = device.clone_path;
+ lib_elf = { 'Ethereum': device.path };
}
else {
- zemu_args = [NANOX_ELF_PATH];
- sim_options = sim_options_nanox;
+ elf_path = device.path;
}
- const sim = new Zemu(...zemu_args);
+ const sim = new Zemu(elf_path, lib_elf);
try {
- await sim.start(sim_options);
+ await sim.start({...sim_options_nano, model: device.name});
const transport = await sim.getTransport();
await func(sim, new Eth(transport));
} finally {
@@ -93,14 +112,10 @@ function zemu(device, func) {
module.exports = {
zemu,
waitForAppScreen,
- NANOS_ELF_PATH,
- NANOX_ELF_PATH,
- NANOS_ETH_LIB,
- NANOX_ETH_LIB,
- NANOS_CLONE_ELF_PATH,
- NANOX_CLONE_ELF_PATH,
- sim_options_nanos,
- sim_options_nanox,
+ sim_options_nano,
+ nano_models,
TIMEOUT,
txFromEtherscan,
-}
\ No newline at end of file
+ apdu_as_string,
+ send_apdu
+}
diff --git a/tests/yarn.lock b/tests/yarn.lock
index 95fdaaf..238895c 100644
--- a/tests/yarn.lock
+++ b/tests/yarn.lock
@@ -900,6 +900,13 @@
pirates "^4.0.0"
source-map-support "^0.5.16"
+"@babel/runtime@^7.15.4":
+ version "7.16.7"
+ resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.7.tgz#03ff99f64106588c9c403c6ecb8c3bafbbdff1fa"
+ integrity sha512-9E9FJowqAsytyOY6LG+1KuueckRL+aQW+mKvXRXnuFGyRAyepJPmEo9vgMfXUA6O9u3IeEdv9MAkppFcaQwogQ==
+ dependencies:
+ regenerator-runtime "^0.13.4"
+
"@babel/runtime@^7.8.4":
version "7.14.0"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.14.0.tgz#46794bc20b612c5f75e62dd071e24dfd95f1cbe6"
@@ -2231,15 +2238,17 @@
dependencies:
"@types/yargs-parser" "*"
-"@zondax/zemu@0.16.5":
- version "0.16.5"
- resolved "https://registry.yarnpkg.com/@zondax/zemu/-/zemu-0.16.5.tgz#45acddf593de4a9d70861c8671441d6f54c5a461"
- integrity sha512-y5hMSE9DVVVsJuTbK8EjMxbZ49eItezSksb+JmbW9mkEwj5tIpT/50kF/2Lcu969yLbxBpwVyBUcT9gp0UoLuw==
+"@zondax/zemu@^0.22.1":
+ version "0.22.1"
+ resolved "https://registry.yarnpkg.com/@zondax/zemu/-/zemu-0.22.1.tgz#378ea193ccc4836ee5407b01028e9030f70a696e"
+ integrity sha512-WxX65myug9tyQuoXENO4XujDpTY+guQpc+mzN8rggmIwNqleNDe/HmBc5aeTqNyORBCSJkYpUVv3O9q2xcqzrg==
dependencies:
"@grpc/grpc-js" "^1.3.4"
"@grpc/proto-loader" "^0.6.4"
"@ledgerhq/hw-transport" "^6.1.0"
"@ledgerhq/hw-transport-http" "^6.1.0"
+ axios "^0.22.0"
+ axios-retry "^3.2.0"
dockerode "^3.3.0"
elfy "^1.0.0"
fs-extra "^10.0.0"
@@ -2332,9 +2341,9 @@ ansi-escapes@^4.2.1:
type-fest "^0.21.3"
ansi-regex@^4.0.0, ansi-regex@^4.1.0:
- version "4.1.0"
- resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
- integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==
+ version "4.1.1"
+ resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed"
+ integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==
ansi-regex@^5.0.0:
version "5.0.0"
@@ -2455,6 +2464,14 @@ aws4@^1.8.0:
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59"
integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==
+axios-retry@^3.2.0:
+ version "3.2.4"
+ resolved "https://registry.yarnpkg.com/axios-retry/-/axios-retry-3.2.4.tgz#f447a53c3456f5bfeca18f20c3a3272207d082ae"
+ integrity sha512-Co3UXiv4npi6lM963mfnuH90/YFLKWWDmoBYfxkHT5xtkSSWNqK9zdG3fw5/CP/dsoKB5aMMJCsgab+tp1OxLQ==
+ dependencies:
+ "@babel/runtime" "^7.15.4"
+ is-retry-allowed "^2.2.0"
+
axios@^0.19.0:
version "0.19.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27"
@@ -2469,6 +2486,13 @@ axios@^0.21.1:
dependencies:
follow-redirects "^1.10.0"
+axios@^0.22.0:
+ version "0.22.0"
+ resolved "https://registry.yarnpkg.com/axios/-/axios-0.22.0.tgz#bf702c41fb50fbca4539589d839a077117b79b25"
+ integrity sha512-Z0U3uhqQeg1oNcihswf4ZD57O3NrR1+ZXhxaROaWpDmsDTx7T2HNBV2ulBtie2hwJptu8UvgnJoK+BIqdzh/1w==
+ dependencies:
+ follow-redirects "^1.14.4"
+
babel-jest@^24.9.0:
version "24.9.0"
resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.9.0.tgz#3fc327cb8467b89d14d7bc70e315104a783ccd54"
@@ -3776,6 +3800,11 @@ follow-redirects@^1.10.0:
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.1.tgz#d9114ded0a1cfdd334e164e6662ad02bfd91ff43"
integrity sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==
+follow-redirects@^1.14.4:
+ version "1.14.7"
+ resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685"
+ integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==
+
for-each@^0.3.3:
version "0.3.3"
resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e"
@@ -4376,6 +4405,11 @@ is-regex@^1.1.3:
call-bind "^1.0.2"
has-symbols "^1.0.2"
+is-retry-allowed@^2.2.0:
+ version "2.2.0"
+ resolved "https://registry.yarnpkg.com/is-retry-allowed/-/is-retry-allowed-2.2.0.tgz#88f34cbd236e043e71b6932d09b0c65fb7b4d71d"
+ integrity sha512-XVm7LOeLpTW4jV19QSH38vkswxoLud8sQ57YwJVTPWdiaI9I8keEhGFpBlslyVsgdQy4Opg8QOLb8YRgsyZiQg==
+
is-stream@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
diff --git a/tools/build_sdk.py b/tools/build_sdk.py
new file mode 100755
index 0000000..aab3a6e
--- /dev/null
+++ b/tools/build_sdk.py
@@ -0,0 +1,180 @@
+#!/usr/bin/env python3
+
+'''
+This script extract a few specific definitions from app-ethereum that are
+required to exchange information with ethereum external plugins.
+It should always be launched from app-ethereum:
+
+python3 ethereum-plugin-sdk/build_sdk.py
+
+'''
+
+import os
+
+
+def extract_from_headers(sources, nodes_to_extract):
+ cat_sources = []
+ for source in sources:
+ with open(source, 'r') as f:
+ cat_sources += f.readlines()
+
+ sdk_body = []
+ for key, values in nodes_to_extract.items():
+ for value in values:
+ node = []
+ unclosed_curvy_brackets = False
+ unclosed_parantheses = False
+ for line in cat_sources:
+ if key in line and value in line:
+ node += [line]
+ unclosed_curvy_brackets = line.count('{') - line.count('}')
+ if unclosed_curvy_brackets == False:
+ break
+ elif (key == "fn" and value in line) or unclosed_parantheses:
+ node += [line]
+ unclosed_parantheses = line.find(")") == -1
+ if unclosed_parantheses == False:
+ break
+ elif unclosed_curvy_brackets:
+ node += [line]
+ unclosed_curvy_brackets += line.count(
+ '{') - line.count('}')
+ if unclosed_curvy_brackets:
+ continue
+ else:
+ break
+
+ sdk_body += [''.join(node)]
+
+ return '\n'.join(sdk_body)
+
+
+def extract_from_c_files(sources, nodes_to_extract):
+ cat_sources = []
+ for source in sources:
+ with open(source, 'r') as f:
+ cat_sources += f.readlines()
+
+ sdk_body = []
+ for node_name in nodes_to_extract:
+ node = []
+ copying = False
+ wait_curvy_bracket = True
+ for line in cat_sources:
+ if node_name in line:
+ copying = True
+ node += [line]
+ unclosed_curvy_brackets = line.count('{') - line.count('}')
+ elif copying:
+ node += [line]
+ unclosed_curvy_brackets += line.count('{') - line.count('}')
+ if wait_curvy_bracket:
+ wait_curvy_bracket = line.count('}') == 0
+ if unclosed_curvy_brackets != 0 or wait_curvy_bracket:
+ continue
+ else:
+ break
+
+ sdk_body += [''.join(node)]
+
+ return '\n'.join(sdk_body)
+
+
+def merge_headers(sources, nodes_to_extract):
+ includes = [
+ '#include "os.h"',
+ '#include "cx.h"',
+ '#include ',
+ '#include '
+ ]
+
+ body = extract_from_headers(sources, nodes_to_extract)
+
+ eth_internals_h = '\n\n'.join([
+ "/* This file is auto-generated, don't edit it */",
+ "#pragma once",
+ '\n'.join(includes),
+ body
+ ])
+
+ with open("ethereum-plugin-sdk/include/eth_internals.h", 'w') as f:
+ f.write(eth_internals_h)
+
+
+def copy_header(header_to_copy, merged_headers):
+
+ merged_headers = [os.path.basename(path) for path in merged_headers]
+
+ with open(header_to_copy, 'r') as f:
+ source = f.readlines()
+
+ eth_plugin_interface_h = [
+ "/* This file is auto-generated, don't edit it */\n"]
+ for line in source:
+ eth_plugin_interface_h += [line]
+ for header in merged_headers:
+ if header in line:
+ del eth_plugin_interface_h[-1]
+ break
+
+ # add '#include "eth_internals.h"'
+ include_index = eth_plugin_interface_h.index('#include "cx.h"\n')
+ eth_plugin_interface_h.insert(
+ include_index+1, '#include "eth_internals.h"\n')
+
+ # dump to file
+ with open("ethereum-plugin-sdk/include/eth_plugin_interface.h", 'w') as f:
+ f.writelines(eth_plugin_interface_h)
+
+
+def merge_c_files(sources, nodes_to_extract):
+ includes = [
+ '#include "eth_internals.h"'
+ ]
+
+ body = extract_from_c_files(sources, nodes_to_extract)
+
+ eth_internals_h = '\n\n'.join([
+ "/* This file is auto-generated, don't edit it */",
+ '\n'.join(includes),
+ body
+ ])
+
+ with open("ethereum-plugin-sdk/include/eth_internals.c", 'w') as f:
+ f.write(eth_internals_h)
+
+
+if __name__ == "__main__":
+
+ # some nodes will be extracted from these headers and merged into a new one, copied to sdk
+ headers_to_merge = [
+ "src/tokens.h",
+ "src/chainConfig.h",
+ "src/utils.h",
+ "src_common/ethUstream.h",
+ "src_common/ethUtils.h",
+ "src/shared_context.h",
+ "src/eth_plugin_internal.h",
+ "src/nft.h",
+ ]
+ nodes_to_extract = {
+ "#define": ["MAX_TICKER_LEN", "ADDRESS_LENGTH", "INT256_LENGTH", "WEI_TO_ETHER", "SELECTOR_SIZE", "PARAMETER_LENGTH", "RUN_APPLICATION", "COLLECTION_NAME_MAX_LEN"],
+ "typedef enum": [],
+ "typedef struct": ["tokenDefinition_t", "txInt256_t", "txContent_t", "nftInfo_t"],
+ "typedef union": ["extraInfo_t"],
+ "__attribute__((no_instrument_function)) inline": ["int allzeroes"],
+ "const": ["HEXDIGITS"],
+ "fn": ["void getEthAddressStringFromBinary", "void getEthAddressFromKey", "void getEthDisplayableAddress", "bool adjustDecimals", "bool uint256_to_decimal", "void amountToString", "void u64_to_string", "void copy_address", "void copy_parameter"]
+ }
+ merge_headers(headers_to_merge, nodes_to_extract)
+
+ # this header will be stripped from all #include related to previously merged headers, then copied to sdk
+ copy_header("src/eth_plugin_interface.h", headers_to_merge)
+
+ # extract and merge function bodies
+ c_files_to_merge = [
+ "src/utils.c",
+ "src_common/ethUtils.c",
+ "src/eth_plugin_internal.c"
+ ]
+ merge_c_files(c_files_to_merge, nodes_to_extract["fn"])