Commit Graph

84 Commits

Author SHA1 Message Date
Alexandre Paillier
fb28efc012 Removed the helper getNftContractAddress helper function and some NULL checks
Useless since we don't allow NFT signing without the NFT metadata anymore
2022-03-09 16:40:45 +01:00
Alexandre Paillier
c548aba364 Unify the include guards accross all header files 2022-03-09 11:52:03 +01:00
Jean-Baptiste Bédrune
ed4e10628a Change type of output length in amountToString
Defining out_buffer_size as uint8_t triggers warnings with static
analysers when sizeof() is used on the output buffer.

There is no reason to use uint8_t here.
2022-02-21 23:56:08 +01:00
Jean-Baptiste Bédrune
458ef9af52 Define better prototype for "network" functions 2022-02-21 23:46:54 +01:00
Alexandre Paillier
ce2df92741 New common function to get the NFT contract address 2022-02-15 14:33:55 +01:00
apaillier-ledger
fcc3dd6d31 Add support for ERC-721 and ERC-1155 (v3) (#218)
* First draft for erc721 token allowance

* Split ui and provide parameters into their own files

* Print txtype when not supported

* fix compilation for erc721

* Use pluginType

* Add debug statement in compound plugin

* add debug error msg in plugin error

* Add parameter parsing for all methods

* Remove debug logs

* Add SET_APPROVAL_FOR_ALL; Add correct parsing method on contract init

* Add dst_size parameter to copy functions

* Add query contract id code

* format

* Add UIs

* update ethapp.asc

* Change setExternalPlugin to setPlugin; Add support for ERC721

* clang-format

* Fix typo Unconsistent -> Inconsistent

* Add support for 721; use extraInfo

* Add extraInfo to ethpluginQueryConractUI

* Rename extraInfo to item

* Add txFromEtherscan to tests

* Add nft key and temp padding

* Remove comments around HAVE_BYPASS_SIGNATURES

* Rename TESTING_KEY to NFT_TESTING_KEY

* Add comments regarding value of queryContractUI->item

* Fix comment regarding method selector

* Rename provideToken to provideInfo; Update plugin doc

* fix caps of eth_plugin_prepare_provide_info

* fix caps of handle_provide_info

* Use verificationFn insead of hardcoded cx_ecdsa_verify

* Add comments about nftInfo_t and tokenDefinition_t

* Add erc721 test

* Remove comment from plugin interface version

* Fix network_ticker duplicate

* Add setPlugin and provideNFTInfo to doc.asc

* Add back setExternalPlugin; implement new setPlugin

* Update plugin sdk

* Call setPlugin instead of setExternalPlugin

* setPlugin work without checking sig

* Remove printf of displayed fees

* Add working 721 test

* Finalize ERC721 and add simple test

* Display NFT address on set approval and operator

* Support set approval for all for erc721

* Finish UI for set approval for all erc721

* Move copy_parameter and copy_address to eth_plugin_internal; Add tests for erc721

* update plugin sdk

* Add erc1155 plugin and 1155 tests placeholder

* Add restriction for AWS key and setPlugin

* Add NOT_OLD_INTERNAL variant; Add erc_1155_plugin_call

* Fixed compilation warnings (function pointer casting)

Co-authored-by: pscott <scott.piriou@ledger.fr>
2021-11-22 14:39:36 +01:00
Salvatore Ingala
f2ec9b296e Small improvements in app size
Signed-off-by: Edouard Merle <edouard.merle@ledger.fr>
2021-11-17 10:45:35 +01:00
TamtamHero
6bad1c4b05 Fix stark order signatures on LNX 2021-11-17 09:50:03 +01:00
pscott
330dd64338 Add arbitrum to networks 2021-09-14 10:51:16 +02:00
pscott
f8f160f809 Merge branch 'kobigurk-clabs-patch-1' into bigger_chainid 2021-09-03 15:15:53 +02:00
TamtamHero
15d729532e Fix broken array 2021-08-31 10:33:46 +02:00
TamtamHero
0d45d2e2d0 Update some prototypes to use chainId value instead of chainConfig structure 2021-08-30 11:02:55 +02:00
TamtamHero
3e25f04d05 Refactoring helper to get printable eth address from hex 2021-08-30 11:00:51 +02:00
kobigurk-clabs
913346b9a8 Add Celo mainnet and long-running testnets 2021-08-28 21:49:32 +03:00
pscott
847db91cfb Remove debugging statements 2021-08-27 17:28:24 +02:00
pscott
f2ff741767 Increase size of V 2021-08-27 14:47:59 +02:00
pscott
1fbbc33cc0 Fix offest calc in 1191 2021-08-27 11:51:27 +02:00
pscott
94363738fe Move u64_to_string 2021-08-26 13:59:42 +02:00
pscott
ef91934b23 Update NETWORK_STRING_MAX_SIZE 2021-08-26 13:21:10 +02:00
pscott
b2172e4627 Use uint64_t for chainID 2021-08-26 13:02:07 +02:00
pscott
c8bad8b2f8 Remove debug prints; secure copy of chainid into v 2021-08-06 21:07:22 +02:00
pscott
c5fb10dd47 Remove check for v length 2021-08-06 15:20:58 +02:00
pscott
d04dcd8dc6 Add printf for txtype; Fix txtype init 2021-08-04 17:42:09 +02:00
pscott
24541034c6 Merge branch 'master' into support_eip1559 2021-08-03 12:01:58 +02:00
pscott
aa2415125e Remove parsing of sender_r, sender_s and y_parity 2021-07-31 13:03:56 +02:00
Jean-Baptiste Bédrune
c27d59d792 Fix last compilation warnings
Signed-off-by: pscott <scott.piriou@ledger.fr>
2021-07-27 12:09:22 +02:00
pscott
d541f1f524 Add pointer to msg_sender in Eth_plugin_finalize (#170)
* Add some PRINTF debug statements and fir additional screens init

* Memzero struture and use two pointers less

* Clang-format

* Use ADDRESS_LENGTH where possible; Add printf statements when failing to compare contracts

* clang-format

* Remove 'token1' and 'token2' locals

* Fix typo

* apply clang-format

* Add bip32path to sharedRO for plugins

* Change getEthAddressStringFromKey to accept char instead of uint8_t

* Update ethereum plugin sdk

* Add BYPASS_SIGNATURES compilation option

* Remove bip32path and pathLength from sharedRO; add msg_sender pointer to pluginFinalize.address

* clang format eth_plugin_interface

* Update submodule

* Set address BEFORE making the finalize call

* Update SDK

Co-authored-by: TamtamHero <10632523+TamtamHero@users.noreply.github.com>
2021-07-09 11:46:36 +02:00
pscott
b646cf1b28 Fix compilation warnings (#159)
* Fix easy warnings for sdk 2.0

* Add attribute unused to bagl_elemt_t in callback functions

* Add attribute unused to io_event function

* Clang-format

* Use elfs from CI in tests (#167)

* Add Nano X build

* Use CI's build artifacts for CI's tests

* Add network display (#152)

* Add network name display instead of chainID

* Add display of correct ticker along with network

* Add FTM

* Clang-format

* Add comment in python script

* Rename SIZE_MAX to MAX_SIZE

* Change %u to %d in printf

* Remove needless PIC

* Update comment about get_chain_id()

* Update example script to follow EIP155

* Remove unused PIC calls

* Add whitespace between ticker and amount when using EIP155

* Remove decimal config per network, set back 18 everywhere

* Adapt u32_from_BE to swith cases

* Remove chainid from signTx.py

* Switch to switch in stead of if in get_chain_id

* Revert "Remove chainid from signTx.py"

This reverts commit 454e09f280ec3e3ec1c7d7cc0027247ef4390088.

* Change Ethereum chainid to 1

* Rename chainid_step to network_step

* Adapt finalizeParsing to new chainid for Ethereum

* Update snapshots

* clang-format

* Fix network display logic for clones

* Fix tests

* Add clone tests

Co-authored-by: TamtamHero <10632523+TamtamHero@users.noreply.github.com>

Co-authored-by: Jean P <10632523+TamtamHero@users.noreply.github.com>
2021-07-05 11:01:51 +02:00
pscott
a2d9a8068a Add network display (#152)
* Add network name display instead of chainID

* Add display of correct ticker along with network

* Add FTM

* Clang-format

* Add comment in python script

* Rename SIZE_MAX to MAX_SIZE

* Change %u to %d in printf

* Remove needless PIC

* Update comment about get_chain_id()

* Update example script to follow EIP155

* Remove unused PIC calls

* Add whitespace between ticker and amount when using EIP155

* Remove decimal config per network, set back 18 everywhere

* Adapt u32_from_BE to swith cases

* Remove chainid from signTx.py

* Switch to switch in stead of if in get_chain_id

* Revert "Remove chainid from signTx.py"

This reverts commit 454e09f280ec3e3ec1c7d7cc0027247ef4390088.

* Change Ethereum chainid to 1

* Rename chainid_step to network_step

* Adapt finalizeParsing to new chainid for Ethereum

* Update snapshots

* clang-format

* Fix network display logic for clones

* Fix tests

* Add clone tests

Co-authored-by: TamtamHero <10632523+TamtamHero@users.noreply.github.com>
2021-07-02 18:46:23 +02:00
pscott
032bd7b7ee clang format 2021-06-29 16:07:28 +02:00
pscott
0294c5e60f Remove detailed fees display 2021-06-29 16:04:38 +02:00
pscott
0bff1de52c Add setting to display detailed fees 2021-06-29 16:04:38 +02:00
pscott
bb6f65ad75 Add comment, remove debug 2021-06-29 16:04:38 +02:00
pscott
df4fe3c0dd Implement support for EIP1559; No settings 2021-06-29 16:04:38 +02:00
Jean-Baptiste Bédrune
ea7d3754c6 Fix compilation waring in eth sdk 2021-06-08 10:24:52 +02:00
TamtamHero
82bf81cca6 Remove dead code + expand allzeroes usage to bigger integers 2021-06-08 10:24:51 +02:00
pscott
a05ac69808 clang-format 2021-06-08 10:24:51 +02:00
pscott
5fd27ff5ca Use INT256_LENGTH and ADDRESS_LENGTH define 2021-06-08 10:24:51 +02:00
pscott
27b380ff0a Add a check for transaction type when checking for end of parsing 2021-05-20 20:18:48 +02:00
pscott
704c34a5d5 Rename to PARSING_IS_DONE 2021-04-21 17:15:43 +02:00
pscott
cac2b95136 Remove printf when parsing legacy tx 2021-04-21 17:11:51 +02:00
pscott
fa0dacb447 Remove printf when parsing chainID 2021-04-21 17:10:58 +02:00
pscott
970f0355dd Add support for EIP2718 (enveloppe) and EIP2930 (acess list tx); Display chain ID when different from 1 (ethereum mainnet) 2021-04-21 16:56:17 +02:00
pscott
5dd99c3d48 Move TxType parsing in cmd_signTx and add 0x6501 error 2021-04-15 17:59:41 +02:00
pscott
6ccc36fa39 Move txType parsing outside of forloop 2021-04-15 17:08:09 +02:00
pscott
01fd39ea96 Add LEGACY_TX 2021-04-15 16:20:39 +02:00
pscott
99950a396c Add max and min values and restrict bounds 2021-04-15 16:19:12 +02:00
pscott
9876999b8d Enumerate through variants 2021-04-15 16:13:42 +02:00
pscott
9e6610c56a Fix debug messages 2021-04-15 15:42:46 +02:00
pscott
65ac116e91 Restrict txType to be within enum bounds 2021-04-15 15:38:38 +02:00