From 79ff681cc6aff312619966a0092c51d9ad44d558 Mon Sep 17 00:00:00 2001 From: Clement Bouvet Date: Wed, 19 Oct 2022 09:19:28 +0200 Subject: [PATCH 01/17] Stax compilation --- .gitignore | 1 + Makefile | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 5cbbd62..f02a5ce 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ debug/ dep/ obj/ tests/elfs/plugin_nano*.elf +build/ # Editors .idea/ diff --git a/Makefile b/Makefile index a413471..4c7e160 100644 --- a/Makefile +++ b/Makefile @@ -48,14 +48,15 @@ all: default ############ DEFINES += OS_IO_SEPROXYHAL -DEFINES += HAVE_BAGL HAVE_SPRINTF +DEFINES += HAVE_SPRINTF DEFINES += LEDGER_MAJOR_VERSION=$(APPVERSION_M) LEDGER_MINOR_VERSION=$(APPVERSION_N) LEDGER_PATCH_VERSION=$(APPVERSION_P) DEFINES += IO_HID_EP_LENGTH=64 DEFINES += UNUSED\(x\)=\(void\)x DEFINES += APPVERSION=\"$(APPVERSION)\" +CFLAGS += -DAPPNAME=\"$(APPNAME)\" -ifeq ($(TARGET_NAME),TARGET_NANOX) +ifneq (,$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX)) DEFINES += HAVE_BLE BLE_COMMAND_TIMEOUT_MS=2000 DEFINES += HAVE_BLE_APDU # basic ledger apdu transport over BLE endif @@ -64,6 +65,11 @@ ifeq ($(TARGET_NAME),TARGET_NANOS) DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=128 else DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=300 +endif + +ifneq ($(TARGET_NAME),TARGET_STAX) +DEFINES += HAVE_BAGL +ifneq ($(TARGET_NAME),TARGET_NANOS) DEFINES += HAVE_GLO096 DEFINES += HAVE_BAGL BAGL_WIDTH=128 BAGL_HEIGHT=64 DEFINES += HAVE_BAGL_ELLIPSIS # long label truncation feature @@ -72,12 +78,12 @@ DEFINES += HAVE_BAGL_FONT_OPEN_SANS_EXTRABOLD_11PX DEFINES += HAVE_BAGL_FONT_OPEN_SANS_LIGHT_16PX DEFINES += HAVE_UX_FLOW endif +endif # Enabling debug PRINTF -DEBUG:= 0 ifneq ($(DEBUG),0) DEFINES += HAVE_STACK_OVERFLOW_CHECK - SDK_SOURCE_PATH += lib_stusb lib_stusb_impl lib_u2f + SDK_SOURCE_PATH += lib_stusb lib_stusb_impl DEFINES += HAVE_IO_USB HAVE_L4_USBLIB IO_USB_MAX_ENDPOINTS=4 IO_HID_EP_LENGTH=64 HAVE_USB_APDU ifeq ($(DEBUG),10) @@ -115,13 +121,9 @@ endif CC := $(CLANGPATH)clang -#CFLAGS += -O0 -CFLAGS += -O3 -Os - AS := $(GCCPATH)arm-none-eabi-gcc LD := $(GCCPATH)arm-none-eabi-gcc -LDFLAGS += -O3 -Os LDLIBS += -lm -lgcc -lc # import rules to compile glyphs(/pone) @@ -129,15 +131,13 @@ include $(BOLOS_SDK)/Makefile.glyphs ### variables processed by the common makefile.rules of the SDK to grab source files and include dirs APP_SOURCE_PATH += src ethereum-plugin-sdk +ifneq ($(TARGET_NAME), TARGET_STAX) SDK_SOURCE_PATH += lib_ux -ifeq ($(TARGET_NAME),TARGET_NANOX) +endif +ifneq (,$(findstring HAVE_BLE,$(DEFINES))) SDK_SOURCE_PATH += lib_blewbxx lib_blewbxx_impl endif - -# remove UX warnings from SDK even though the plugin doesn't use it -DEFINES += HAVE_UX_FLOW - ### initialize plugin SDK submodule if needed ifneq ($(shell git submodule status | grep '^[-+]'),) $(info INFO: Need to reinitialize git submodules) From 7980e7e11ca75e0a8620a39fb2029f5aea69f83d Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Mon, 3 Apr 2023 14:14:06 +0200 Subject: [PATCH 02/17] Icon & name are now passed to the Ethereum app; Updated plugin SDK --- Makefile | 5 +++++ ethereum-plugin-sdk | 2 +- glyphs/icon_back.gif | Bin 74 -> 0 bytes glyphs/icon_back_x.gif | Bin 1123 -> 0 bytes glyphs/icon_certificate.gif | Bin 1133 -> 0 bytes glyphs/icon_crossmark.gif | Bin 1131 -> 0 bytes glyphs/icon_dashboard.gif | Bin 1133 -> 0 bytes glyphs/icon_dashboard_x.gif | Bin 1126 -> 0 bytes glyphs/icon_down.gif | Bin 1100 -> 0 bytes glyphs/icon_eye.gif | Bin 1130 -> 0 bytes glyphs/icon_left.gif | Bin 1101 -> 0 bytes glyphs/icon_right.gif | Bin 1100 -> 0 bytes glyphs/icon_toggle_reset.gif | Bin 225 -> 0 bytes glyphs/icon_toggle_set.gif | Bin 227 -> 0 bytes glyphs/icon_up.gif | Bin 1100 -> 0 bytes glyphs/icon_validate_14.gif | Bin 1125 -> 0 bytes glyphs/icon_warning.gif | Bin 85 -> 0 bytes glyphs/stax_paraswap_64px.gif | Bin 0 -> 639 bytes icons/stax_app_paraswap.gif | Bin 0 -> 360 bytes src/main.c | 19 ++++++++++++++++++- 20 files changed, 24 insertions(+), 2 deletions(-) delete mode 100644 glyphs/icon_back.gif delete mode 100644 glyphs/icon_back_x.gif delete mode 100644 glyphs/icon_certificate.gif delete mode 100644 glyphs/icon_crossmark.gif delete mode 100644 glyphs/icon_dashboard.gif delete mode 100644 glyphs/icon_dashboard_x.gif delete mode 100644 glyphs/icon_down.gif delete mode 100644 glyphs/icon_eye.gif delete mode 100644 glyphs/icon_left.gif delete mode 100644 glyphs/icon_right.gif delete mode 100644 glyphs/icon_toggle_reset.gif delete mode 100644 glyphs/icon_toggle_set.gif delete mode 100644 glyphs/icon_up.gif delete mode 100644 glyphs/icon_validate_14.gif delete mode 100644 glyphs/icon_warning.gif create mode 100644 glyphs/stax_paraswap_64px.gif create mode 100644 icons/stax_app_paraswap.gif diff --git a/Makefile b/Makefile index 4c7e160..acf3820 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,11 @@ APPNAME = "Paraswap" #prepare hsm generation ifeq ($(TARGET_NAME), TARGET_NANOS) ICONNAME=icons/nanos_app_paraswap.gif +else ifeq ($(TARGET_NAME), TARGET_STAX) +ICONNAME=icons/stax_app_paraswap.gif +DEFINES += ICONGLYPH=C_stax_paraswap_64px +DEFINES += ICONBITMAP=C_stax_paraswap_64px_bitmap +GLYPH_FILES += $(ICONNAME) else ICONNAME=icons/nanox_app_paraswap.gif endif diff --git a/ethereum-plugin-sdk b/ethereum-plugin-sdk index a4b971f..b9777e7 160000 --- a/ethereum-plugin-sdk +++ b/ethereum-plugin-sdk @@ -1 +1 @@ -Subproject commit a4b971f67980694d8c3862e793859209bc525545 +Subproject commit b9777e7a81a9c33b3f8997ffa23396fa2b3f861d diff --git a/glyphs/icon_back.gif b/glyphs/icon_back.gif deleted file mode 100644 index a2a7e6d4fa290e4875992d4024e988d14b91df26..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 74 zcmZ?wbhEHbh+i z#(Mch>H3D2mX`VkM*2oZxP`3=Lf^oD9vKom`v^ z4IGV}EX^$3V0vBhlS^|`^GaZPQxJOHaOwpmh};68%`T}$nPsUdZbkXI3Sf_0W#V>= zGfwlMdQ)(_#RaEceV}9XLD7p8-7q0w8Uiuli5JL$C;!wuV45!iCT_<6|Nj2@{p;tC z@87({PcxqRv3h4bgmo;iK$ z#u35cm<%;FYmM&SmXyJnS^XAT( zJ!|HS>C>i8nLKIYg#NzXp6;&Bj`p_Jmgc6$hWfhNn(C^`it@73lH#Jmg8aPPob0U3 zjP$hBl;otug!s7FnCPg;i14t`kl>)e0DnJUA8#*D4|g|LV6Zqk*xT9KSX)_In46iJ z7#kTH=@}C@U!{$jiyfNJ~jdh>MAe2nz`c@bmHVaC32Tu(PqUFf%a% wONgH=z;c3tK?g*D$_@r5iJtzIs~KwUGz+zPEiKD<-x8T<*15Dbij~0{0O2}{jsO4v diff --git a/glyphs/icon_certificate.gif b/glyphs/icon_certificate.gif deleted file mode 100644 index 89b529f792aeb77c8cc3b4d4782d8280b3c6c204..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1133 zcmZ?wbhEHbh+i z#(Mch>H3D2mX`VkM*2oZxP`3=Lf^oD9vKom`v^ z4IGV}EX^$3V0vBhlS^|`^GaZPQxJOHaOwpmh};68%`T}$nPsUdZbkXI3Sf_0W#V>= zGfwlMdQ)(_#RaEceV}9XLD7p8-7q0w8Uiuli5JL$C;!wuV45!iCT_<6|Nj2@{p;tC z@87({PcxqRv3h4bgmo;iK$ z#u35cm<%;FYmM&SmXyJnS^XAT( zJ!|HS>C>i8nLKIYg#NzXp6;&Bj`p_Jmgc6$hWfhNn(C^`it@73lH#Jmg8aPPob0U3 zjP$hBl;otug!s7FnCPg;i14t`kl>)e0DnJUA8#*D4|g|LV6Zqk*xT9KSX)_In46iJ z7#kTH=@}C@U!{$jiyfNJ~jdh>MAe2nz`c@bmHVaC32Tu(PqUFf%a% zONgH=z;c3tK?g*D$_@r5rJnxG17}|h+i z#(Mch>H3D2mX`VkM*2oZxP`3=Lf^oD9vKom`v^ z4IGV}EX^$3V0vBhlS^|`^GaZPQxJMxaOwpmh};68%`T}$nPsUdZbkXI3Sf_0W#V>= zBTn<6dQ)(_#R;cgeV}9XLD7p8-7q0w8Uiuli5JL$C;!wuV45!iCT_<6|Nj2@{p;tC z@87({PcxqRv3h4bgmo;iK$ z#u35cm<%;FYmM&SmXyJnS^XAT( zJ!|HS>C>i8nLKIYg#NzXp6;&Bj`p_Jmgc6$hWfhNn(C^`it@73lH#Jmg8aPPob0U3 zjP$hBl;otug!s7FnCPg;i14t`kl>)e0DnJUA8#*D4|g|LU=%qz*xT9KSX)_In46iJ z7#kTH=@}C@U!{$jiyfNJ~jdh>MAe2nz`c@bmHVaC32Tu(PqUFf%a% zONgH=z;c3tK?g*D$_@r5g`R%S3EQ{LsG1P=G9yPZ?_TW!_O_JIo#INXvMrLH1~M>M F0{{d^jh+i z#(Mch>H3D2mX`VkM*2oZx|Z5PF?(>IEf;+ybD@E~!PCWvMA{Mftf3V2@j6;&zJ# zPV=C8Q*gV*5~p5$pkwqw(Tfz_Fd<+X0x{u<7s!Dp|I|ESnlAz-ZpQ!r{{H#>>*tT} z-@bnN{ORL|_wU}mdHw3;i|5atK6(7;;e-44?%uh5>*kH?*REcZ;0$^0LyB;-bQW{Jh+p?5xa; z^t9BJ|cQ;oTXD3GodplbjYb#3&b2C#D zVqwaWPR5VIe^Qem-6vZZ1v^b~aWPW+p~p z3GtH!SWYl7=zs`N*}=f1)WgepeBpkH7I)L>0efyf`cv6&*0!WWPeHu$lGW7Enz_D= G4Aua{vX6rR diff --git a/glyphs/icon_dashboard_x.gif b/glyphs/icon_dashboard_x.gif deleted file mode 100644 index 33d9b0a74a263937a8cbb3b7c4ccfd4bd4fd2a3b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1126 zcmZ?wbhEHbh+i z#(Mch>H3D2mX`VkM*2oZx= z5l-`({PcxqRv3h4bgmo;iK$ z#u35cm<%;FYmM&SmXyJnS^XAT( zJ!|HS>C>i8nLKIYg#NzXp6;&Bj`p_Jmgc6$hWfhNn(C^`it@73lH#Jmg8aPPob0U3 zjP$hBl;otug!s7FnCPg;i14t`kl>)e0DnJUA8#*D4|g|L7iT9&2YWkP8*3{|3v)A5 z6JsMo1ARSR9c?X54RtkD6=fww1$jAH8EGj=32`w|5n&-g0e(JS9&Rp94t6$H7G@?! zUc-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*btCX0MpOk6^Wap-qB64UF}T4Rno+txOE8OpFwuK*`RgC?(A*$i)q66_97Elu=SrV5P5L zUS6(Ou9shwu5V~*X{m2uq;F)T3sj(6T$u;-oo-&SvJ%j-AOl=di<65o3raHc^Aw8G ztP+#*OG|8(lob9$J&;=fH#M(V59}GeYG-AXPsowK%`DC^;3VTp46jft7PnYGO%#QAmD%4lD=*GV)9Ei!<^I z6r7#GL8hSLo0y!L2NcundS0ve;2nVDi`Y;NgdWMu4QWZ>pz zXy|I@XlQBVYUE;UXz6Nc_}|je8K&7KKe;qFHLnDwIR&BF8LAmYFGwpWEr5aq7{EoD zWvMA{Mftf3V1HX>!rg-I6icj50lNgEH3i8fKwls^#1W@feV|kH(V`kA1WZ04CM4AY z(t84%^TORUA=Po(!~qs&z(JU`qar2$B!L7a`@1}1N-;w-Lrew&K=vgZQZhY z)5ZeMTG_VdAT{+S(zE>X{jm6Nr?&Zaj`McQIQehVWA};$o%uI|73_73^0#s@+FtPL0rFC}Ia4}c|0Jk%O AU;qFB diff --git a/glyphs/icon_eye.gif b/glyphs/icon_eye.gif deleted file mode 100644 index df4bb829e6d06e0bde643b1b96fde45c093edef1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1130 zcmZ?wbhEHbh+i z#(Mch>H3D2mX`VkM*2oZxP`3=Lf^oD9vKom`v^ z4IGV}EX^$3V0vBhlS^|`^GaZPQxJOHaOwpmh};68%`T}$nPsUdZbkXI3Sf_0W#V>= zGfwlMdQ)(_#RaEceV}9XLD7p8-7q0w8Uiuli5JL$C;!wuV45!iCT_<6|Nj2@{p;tC z@87({PcxqRv3h4bgmo;iK$ z#u35cm<%;FYmM&SmXyJnS^XAT( zJ!|HS>C>i8nLKIYg#NzXp6;&Bj`p_Jmgc6$hWfhNn(C^`it@73lH#Jmg8aPPob0U3 zjP$hBl;otug!s7FnCPg;i14t`kl>)e0DnJUA8#*D4|g|LV6Zqk*xT9KSX)_In46iJ z7#kTH=@}C@U!{$jiyfNJ~jdh>MAe2nz`c@bmHVaC32Tu(PqUFf%a% zONgH=z;c3tK?g*D$_@r5`JVojvmYFo*YYB?T-40^%iq9xH)NNlPJ66kronvNgOR}+ E02G{#(EtDd diff --git a/glyphs/icon_left.gif b/glyphs/icon_left.gif deleted file mode 100644 index 524226ba11247d9c5f797801400fd630071a049a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1101 zcmZ?wbhEHbWMN=u_`m=H|NsA2{K*1lD*orL$SqJvNi0bO(*Nx%3KEmEQ%e+*Qqwc@ zY?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*btCX0MpOk6^Wap-qB64UF}T4Rno+txOE8OpFwuK*`RgC?(A*$i)q66_97Elu=SrV5P5L zUS6(Ou9shwu5V~*X{m2uq;F)T3sj(6T$u;-oo-&SvJ%j-AOl=di<65o3raHc^Aw8G ztP+#*OG|8(lob9$J&;=fH#M(V59}GeYG-AXPsowK%`DC^;3VTp46jft7PnYGO%#QAmD%4lD=*GV)9Ei!<^I z6r7#GL8hSLo0y!L2NcundS0ve;2nVDkcY~W;U?r3IeWZ>*# zXy|I@XlQBVYUE;UXz6Nc_}|je8K&7KKe;qFHLnDwIR&BF45}GLFGwpWEr5aq7{EoD zWvMA{Mftf3V1HX>!rg-I6l1JT0lNgEH3i8fKwls^!~~~SeV|kH(V`kA1WZ04CM4AY z(t84%^TORUA=Po(!~qs&z(JU`qar2$B!L7a`@1}1N-;w-Lrew&K=vgZQZhY z)5ZeMTG_VdAT{+S(zE>X{jm6Nr?&Zaj`McQIQehVWA};$o%uI|73_73^0#s@+FmbdLb7tJW=fuch4FGsN BgIfRq diff --git a/glyphs/icon_right.gif b/glyphs/icon_right.gif deleted file mode 100644 index 15ff3cf5994421fbd6e7d593aae8e438310f33ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1100 zcmZ?wbhEHbWMN=u_`m=H|NsA2{K*1lD*orL$SqJvNi0bO(*Nx%3KEmEQ%e+*Qqwc@ zY?a>c-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*btCX0MpOk6^Wap-qB64UF}T4Rno+txOE8OpFwuK*`RgC?(A*$i)q66_97Elu=SrV5P5L zUS6(Ou9shwu5V~*X{m2uq;F)T3sj(6T$u;-oo-&SvJ%j-AOl=di<65o3raHc^Aw8G ztP+#*OG|8(lob9$J&;=fH#M(V59}GeYG-AXPsowK%`DC^;3VTp46jft7PnYGO%#QAmD%4lD=*GV)9Ei!<^I z6r7#GL8hSLo0y!L2NcundS0ve;2nVDkcY~W;U?r3IcWZ>*# zXy|I@XlQBVYUE;UXz6Nc_}|je8K&7KKe;qFHLnDwIR&BF2&x%HFGwpWEr5aq7{EoD zWvMA{Mftf3V1HX>!rg-A6jL{>P64|FqBRA{B|u*wIm7^`R(+sT^wFXkCIn1AASNW$ z0@Eju15Nk;OB7P`fT_I*n5-H9|NHyr_phHnzJL4r<@2Wx@87+B^ZM1x7tfzPee(Fx z!w2{8-Mw@B*3BE&uU)-z`O?J;=g*xzbNbZD6UUDoJ#zTa!2|pE?cK9`*UlZ=w{6|B zdDF%X>({MavwGFa70Z_`U9x!5!Ugl^&7CuQ*322xr%jzQdD6rQ{e8VX-Cdm>?QN|s z%}tFB^>wv1)m4=h1nAc$w`R`@o}*+(NU2R;bEa6!9jrm z{(inb-d>&_?ryFw&Q6XF_I9>5)>f7l=4PfQ#zuw)`g*!L+FF_#>T0Sg%1Vj~@^Z2= z(o&KV;$osA!a{-q{CvDTJltHI9PDhYEX+)d3=BG;5&~3eFfg(6@U>OF>g8gv1_1YR Bf|mdQ diff --git a/glyphs/icon_toggle_reset.gif b/glyphs/icon_toggle_reset.gif deleted file mode 100644 index 450bc869d02ecc35afc46e622e175c5e4afca20d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 225 zcmV<703QEGNk%w1VITk!0J8u9-QC^R*4EO}()RZD?d|RI^78!r{Ls+Q{{H^W&CTB4 z-p=jZ47`T76<|IEzHA^8LV00000EC2ui03ZMo000Dzut`ajNH6QXlTgGYHbual z=oS2p@Hr>=Y?x*0!CneV{8Cb2UlrYbRkT6QDgxWI!9gq*06JE~1l$0M&>}L>STr|?VH8@(Es)oYV7nDO zEa41+93?z1>BoT$Jvc-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*btCX0MpOk6^Wap-qB64UF}T4Rno+txOE8OpFwuK*`RgC?(A*$i)q66_97Elu=SrV5P5L zUS6(Ou9shwu5V~*X{m2uq;F)T3sj(6T$u;-oo-&SvJ%j-AOl=di<65o3raHc^Aw8G ztP+#*OG|8(lob9$J&;=fH#M(V59}GeYG-AXPsowK%`DC^;3VTp46jft7PnYGO%#QAmD%4lD=*GV)9Ei!<^I z6r7#GL8hSLo0y!L2NcundS0ve;2nVDi`Y;NgdWMu4SWZ>pz zXy|I@XlQBVYUE;UXz6Nc_}|je8K&7KKe;qFHLnDwIR&oS!~m)pMK4GzC@p}31Q@_Y znPsUdZbkXI3SfU*Wy0Np?i3fSP64|FqBRA{B|u*w9AfN>Q>#AEDf(zp4HE(;9}p9g zYJuq!$bqK&|0N2kdBD_O1WeY9|Ns5{^ZVD&AK$-y{qp(KhxhN^zIpxX<%{Rfo<4c} z=;4F=_wL@gee33p>({PcxqRv3h4bgmo;iK$#u35cm<%;FYmM&SmXyJnS^XAT(J!|HS>C>i8nLKIYg#NzXp6;&Bj`p_J zmgc6$hWfhNn(C^`it@73lH#Jmg8aPPob0U3jP$hBl;otug!s7FnCPg;i14t`kl>)e z0DnJUA8#*D4|g|L7iT9&2YWkP8*3{|3v)A56JsMo1ARSR9c?X54RtkD6=fww1$jAH z8EGj=32`w|5n&-g0e(JS9v*HkP7Zc9Ru*O^Mg|5QPzeDlH5i!KTar5~xYlqnSOWmI C)q;Qk diff --git a/glyphs/icon_validate_14.gif b/glyphs/icon_validate_14.gif deleted file mode 100644 index ccb5cabe38d16ff857d540b64742e4b8346a6949..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1125 zcmZ?wbhEHbh+i z#(Mch>H3D2mX`VkM*2oZx= z0Z#LvdQ)(_#So`neV}9XLD7p8-7q0w8Uiuli5JL$C;!wuV45!iCT_<6|Nj2@{p;tC z@87({PcxqRv3h4bgmo;iK$ z#u35cm<%;FYmM&SmXyJnS^XAT( zJ!|HS>C>i8nLKIYg#NzXp6;&Bj`p_Jmgc6$hWfhNn(C^`it@73lH#Jmg8aPPob0U3 zjP$hBl;otug!s7FnCPg;i14t`kl>)e0DnJUA8#*D4|g|L7iT9&2YWkP8*3{|3v)A5 z6JsMo1ARSR9c?X54RtkD6=fww1$jAH8EGj=32`w|5n&-g0e(JS9&Rp94t6$H7G@?! zU&?6WU?`4cX`X1Ru58;XE_uv!ZQnFfDM`E(fq`Hk zBo2#4VsU7gC=`Zf>@WaWuh^`%0Gl8PgF`G)5CpVnY*0)wSPL=5fsn2P0$d8!I*_{D zc4!0$T@nRY1wAfbfm(hN1_D`+ERl^@1d0+0bXkLAhnE7BfLlI$jfr}lT4A7#0&EkZ zX{s)BfpB_Nb)zu|24`smvI}H^1D}hmjuoX>0+Lq&0hBAjf;wKzZ_j70E@Z-3q^$>x zSOU6#yjQjoxRa1sYjLyyu@(1L%Ews++FHZ|unyihe0`jtBIg4TxJ~;AYFeNmqB4PW z%4G>tNCG;B{xJ+(G{%kKg#^#|6!m_Eh8^P1n6^t zft&aa)U+@Vr%wb!Ct|1w6lSG^Nu^@==x$2MoKvx3d8ncy)}R}>-YJ-Z%E4+P4(!AS zc7#7fT06W{VQFmL4GW#3P^->FN&v)8pgg-W1lItCO*ExuU}=cHSHdL7%YkaTL7YF_ zbr*WWQF?zt1g2{@>WaM}pkO6C_^acR1#sxzeIp`m4JgqZQ9``9@#DnNelH9|4vg(ZZkm2afCt0uLi2L^Nk+6-)yT1MVI7Ad$+QqVe ZCsP#=CE$Pr7HHss2qviDf+$1)06W&255fQd literal 0 HcmV?d00001 diff --git a/icons/stax_app_paraswap.gif b/icons/stax_app_paraswap.gif new file mode 100644 index 0000000000000000000000000000000000000000..592f2098aeeda5787d723126d951443b0870115f GIT binary patch literal 360 zcmZ?wbhEHbRA5kG_{_k-$jHdU!y_&(uA!k38ynl--@j?ori&LZK7aoF^XJb$fByXc z|33o~Q2faP<|+Q?_RLL8PxVbq&rHtdOHa(rO|&)8Gcg501|5(ZkPQqh-wRH9uHI|$ z`s{Ak1dXPXOElyZc@Cf2=cFjvwq1g8!TTx$g>IJBQyzU}+T^Mzpm2kaX>nhG&@&eH zXh*3Px*QEM4Gph2de5>@dst?bho3gx&GJnKA+ zZByjfL$X>s9UK!9i)6TF&50FZpTROqmMc3sm0NudLvF>KF43iJE2Q(2CA@t+rCWAL zaLtI2=E|QSS>wA_Jiv0fRFCZ@(W?whZ0b_0FN@dg$+J8yvS1Ob$?G?7PuYv@PE30G w+4h@trtqPlzyGX`tBGWMY+7)znLU>0!uEug!|ei&H)eQjT;$3p$iQF?0P$IbH2?qr literal 0 HcmV?d00001 diff --git a/src/main.c b/src/main.c index e298ba7..1128167 100644 --- a/src/main.c +++ b/src/main.c @@ -213,10 +213,27 @@ void handle_query_ui_exception(unsigned int *args) { } void call_app_ethereum() { - unsigned int libcall_params[3]; + unsigned int libcall_params[5]; + libcall_params[0] = (unsigned int) "Ethereum"; libcall_params[1] = 0x100; libcall_params[2] = RUN_APPLICATION; + libcall_params[3] = (unsigned int) NULL; +#ifdef HAVE_NBGL + caller_app_t capp; + const char name[] = APPNAME; + nbgl_icon_details_t icon_details; + uint8_t bitmap[sizeof(ICONBITMAP)]; + + memcpy(&icon_details, &ICONGLYPH, sizeof(ICONGLYPH)); + memcpy(&bitmap, &ICONBITMAP, sizeof(bitmap)); + icon_details.bitmap = (const uint8_t *) bitmap; + capp.name = (const char *) name; + capp.icon = &icon_details; + libcall_params[4] = (unsigned int) &capp; +#else + libcall_params[4] = (unsigned int) NULL; +#endif os_lib_call((unsigned int *) &libcall_params); } From 7573a95745fc403deb7dd0a0fc1d2c268bbc5499 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Tue, 16 May 2023 17:50:56 +0200 Subject: [PATCH 03/17] Stax plugin now compiled in CI --- .github/workflows/ci-workflow.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci-workflow.yml b/.github/workflows/ci-workflow.yml index cabc149..1b82da9 100644 --- a/.github/workflows/ci-workflow.yml +++ b/.github/workflows/ci-workflow.yml @@ -21,6 +21,8 @@ jobs: name: "nanox" - sdk: "$NANOSP_SDK" name: "nanosp" + - sdk: "$STAX_SDK" + name: "stax" runs-on: ubuntu-latest container: From 17309ec8d8ec3654902a55cd652b087068370a87 Mon Sep 17 00:00:00 2001 From: Alexandre Paillier Date: Mon, 16 Oct 2023 17:24:12 +0200 Subject: [PATCH 04/17] Updated to use the latest plugin SDK --- ethereum-plugin-sdk | 2 +- src/{main.c => contract.c} | 117 --------------------------------- src/handle_finalize.c | 3 +- src/handle_init_contract.c | 4 +- src/handle_provide_parameter.c | 3 +- src/handle_provide_token.c | 3 +- src/handle_query_contract_id.c | 3 +- src/handle_query_contract_ui.c | 64 +++++++++--------- src/paraswap_plugin.h | 7 -- tests/package.json | 2 +- tests/yarn.lock | 42 ++++++++---- 11 files changed, 67 insertions(+), 183 deletions(-) rename src/{main.c => contract.c} (72%) diff --git a/ethereum-plugin-sdk b/ethereum-plugin-sdk index b9777e7..1fe4085 160000 --- a/ethereum-plugin-sdk +++ b/ethereum-plugin-sdk @@ -1 +1 @@ -Subproject commit b9777e7a81a9c33b3f8997ffa23396fa2b3f861d +Subproject commit 1fe4085d04a88f4238103a4ed3db1484fdb69c63 diff --git a/src/main.c b/src/contract.c similarity index 72% rename from src/main.c rename to src/contract.c index 1128167..3c6e1c0 100644 --- a/src/main.c +++ b/src/contract.c @@ -15,14 +15,7 @@ * limitations under the License. ********************************************************************************/ -#include #include - -#include "os.h" -#include "cx.h" - -#include "glyphs.h" - #include "paraswap_plugin.h" // ---------- Paraswap V5 ------------- @@ -175,113 +168,3 @@ const uint8_t PARASWAP_ETH_ADDRESS[ADDRESS_LENGTH] = {0xee, 0xee, 0xee, 0xee, 0x const uint8_t NULL_ETH_ADDRESS[ADDRESS_LENGTH] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - -void paraswap_plugin_call(int message, void *parameters) { - switch (message) { - case ETH_PLUGIN_INIT_CONTRACT: - handle_init_contract(parameters); - break; - case ETH_PLUGIN_PROVIDE_PARAMETER: - handle_provide_parameter(parameters); - break; - case ETH_PLUGIN_FINALIZE: - handle_finalize(parameters); - break; - case ETH_PLUGIN_PROVIDE_INFO: - handle_provide_token(parameters); - break; - case ETH_PLUGIN_QUERY_CONTRACT_ID: - handle_query_contract_id(parameters); - break; - case ETH_PLUGIN_QUERY_CONTRACT_UI: - handle_query_contract_ui(parameters); - break; - default: - PRINTF("Unhandled message %d\n", message); - break; - } -} - -void handle_query_ui_exception(unsigned int *args) { - switch (args[0]) { - case ETH_PLUGIN_QUERY_CONTRACT_UI: - ((ethQueryContractUI_t *) args[1])->result = ETH_PLUGIN_RESULT_ERROR; - break; - default: - break; - } -} - -void call_app_ethereum() { - unsigned int libcall_params[5]; - - libcall_params[0] = (unsigned int) "Ethereum"; - libcall_params[1] = 0x100; - libcall_params[2] = RUN_APPLICATION; - libcall_params[3] = (unsigned int) NULL; -#ifdef HAVE_NBGL - caller_app_t capp; - const char name[] = APPNAME; - nbgl_icon_details_t icon_details; - uint8_t bitmap[sizeof(ICONBITMAP)]; - - memcpy(&icon_details, &ICONGLYPH, sizeof(ICONGLYPH)); - memcpy(&bitmap, &ICONBITMAP, sizeof(bitmap)); - icon_details.bitmap = (const uint8_t *) bitmap; - capp.name = (const char *) name; - capp.icon = &icon_details; - libcall_params[4] = (unsigned int) &capp; -#else - libcall_params[4] = (unsigned int) NULL; -#endif - os_lib_call((unsigned int *) &libcall_params); -} - -__attribute__((section(".boot"))) int main(int arg0) { - // exit critical section - __asm volatile("cpsie i"); - - // ensure exception will work as planned - os_boot(); - - // Try catch block. Please read the docs for more information on how to use those! - BEGIN_TRY { - TRY { - // Low-level black magic. - check_api_level(CX_COMPAT_APILEVEL); - // Check if we are called from the dashboard. - if (!arg0) { - // called from dashboard, launch Ethereum app - call_app_ethereum(); - return 0; - } else { - // Not called from dashboard: called from the ethereum app! - const unsigned int *args = (unsigned int *) arg0; - - // If `ETH_PLUGIN_CHECK_PRESENCE` is set, this means the caller is just trying to - // know whether this app exists or not. We can skip `paraswap_plugin_call`. - if (args[0] != ETH_PLUGIN_CHECK_PRESENCE) { - paraswap_plugin_call(args[0], (void *) args[1]); - } - } - } - CATCH_OTHER(e) { - switch (e) { - // These exceptions are only generated on handle_query_contract_ui() - case 0x6502: - case EXCEPTION_OVERFLOW: - handle_query_ui_exception((unsigned int *) arg0); - break; - default: - break; - } - PRINTF("Exception 0x%x caught\n", e); - } - FINALLY { - os_lib_end(); - } - } - END_TRY; - - return 0; -} diff --git a/src/handle_finalize.c b/src/handle_finalize.c index b4a01ae..3049c1b 100644 --- a/src/handle_finalize.c +++ b/src/handle_finalize.c @@ -1,7 +1,6 @@ #include "paraswap_plugin.h" -void handle_finalize(void *parameters) { - ethPluginFinalize_t *msg = (ethPluginFinalize_t *) parameters; +void handle_finalize(ethPluginFinalize_t *msg) { paraswap_parameters_t *context = (paraswap_parameters_t *) msg->pluginContext; if (context->valid) { msg->numScreens = 2; diff --git a/src/handle_init_contract.c b/src/handle_init_contract.c index b48ff45..a247b67 100644 --- a/src/handle_init_contract.c +++ b/src/handle_init_contract.c @@ -1,9 +1,7 @@ #include "paraswap_plugin.h" // Called once to init. -void handle_init_contract(void *parameters) { - ethPluginInitContract_t *msg = (ethPluginInitContract_t *) parameters; - +void handle_init_contract(ethPluginInitContract_t *msg) { if (msg->interfaceVersion != ETH_PLUGIN_INTERFACE_VERSION_LATEST) { PRINTF("Wrong interface version: expected %d got %d\n", ETH_PLUGIN_INTERFACE_VERSION_LATEST, diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index 771291d..d626713 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -347,8 +347,7 @@ static void handle_swap_uni_v2(ethPluginProvideParameter_t *msg, paraswap_parame } } -void handle_provide_parameter(void *parameters) { - ethPluginProvideParameter_t *msg = (ethPluginProvideParameter_t *) parameters; +void handle_provide_parameter(ethPluginProvideParameter_t *msg) { paraswap_parameters_t *context = (paraswap_parameters_t *) msg->pluginContext; msg->result = ETH_PLUGIN_RESULT_OK; diff --git a/src/handle_provide_token.c b/src/handle_provide_token.c index ef6737d..ed6f893 100644 --- a/src/handle_provide_token.c +++ b/src/handle_provide_token.c @@ -1,7 +1,6 @@ #include "paraswap_plugin.h" -void handle_provide_token(void *parameters) { - ethPluginProvideInfo_t *msg = (ethPluginProvideInfo_t *) parameters; +void handle_provide_token(ethPluginProvideInfo_t *msg) { paraswap_parameters_t *context = (paraswap_parameters_t *) msg->pluginContext; PRINTF("PARASWAP plugin provide token: 0x%p, 0x%p\n", msg->item1, msg->item2); diff --git a/src/handle_query_contract_id.c b/src/handle_query_contract_id.c index e4edb9d..ca0d09a 100644 --- a/src/handle_query_contract_id.c +++ b/src/handle_query_contract_id.c @@ -1,7 +1,6 @@ #include "paraswap_plugin.h" -void handle_query_contract_id(void *parameters) { - ethQueryContractID_t *msg = (ethQueryContractID_t *) parameters; +void handle_query_contract_id(ethQueryContractID_t *msg) { const paraswap_parameters_t *context = (paraswap_parameters_t *) msg->pluginContext; strlcpy(msg->name, PLUGIN_NAME, msg->nameLength); diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index 4024bb7..ed69a5a 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -1,7 +1,8 @@ +#include #include "paraswap_plugin.h" // Set UI for the "Send" screen. -static void set_send_ui(ethQueryContractUI_t *msg, paraswap_parameters_t *context) { +static bool set_send_ui(ethQueryContractUI_t *msg, paraswap_parameters_t *context) { switch (context->selectorIndex) { case SWAP_ON_UNI_FORK: case SWAP_ON_UNI_V2_FORK: @@ -28,23 +29,22 @@ static void set_send_ui(ethQueryContractUI_t *msg, paraswap_parameters_t *contex break; default: PRINTF("Unhandled selector Index: %d\n", context->selectorIndex); - msg->result = ETH_PLUGIN_RESULT_ERROR; - return; + return false; } if (ADDRESS_IS_NETWORK_TOKEN(context->contract_address_sent)) { strlcpy(context->ticker_sent, msg->network_ticker, sizeof(context->ticker_sent)); } - amountToString(context->amount_sent, - sizeof(context->amount_sent), - context->decimals_sent, - context->ticker_sent, - msg->msg, - msg->msgLength); + return amountToString(context->amount_sent, + sizeof(context->amount_sent), + context->decimals_sent, + context->ticker_sent, + msg->msg, + msg->msgLength); } // Set UI for "Receive" screen. -static void set_receive_ui(ethQueryContractUI_t *msg, paraswap_parameters_t *context) { +static bool set_receive_ui(ethQueryContractUI_t *msg, paraswap_parameters_t *context) { switch (context->selectorIndex) { case SWAP_ON_UNI_FORK: case SWAP_ON_UNI_V2_FORK: @@ -71,40 +71,40 @@ static void set_receive_ui(ethQueryContractUI_t *msg, paraswap_parameters_t *con break; default: PRINTF("Unhandled selector Index: %d\n", context->selectorIndex); - msg->result = ETH_PLUGIN_RESULT_ERROR; - return; + return false; } if (ADDRESS_IS_NETWORK_TOKEN(context->contract_address_received)) { strlcpy(context->ticker_received, msg->network_ticker, sizeof(context->ticker_received)); } - amountToString(context->amount_received, - sizeof(context->amount_received), - context->decimals_received, - context->ticker_received, - msg->msg, - msg->msgLength); + return amountToString(context->amount_received, + sizeof(context->amount_received), + context->decimals_received, + context->ticker_received, + msg->msg, + msg->msgLength); } // Set UI for "Beneficiary" screen. -static void set_beneficiary_ui(ethQueryContractUI_t *msg, paraswap_parameters_t *context) { +static bool set_beneficiary_ui(ethQueryContractUI_t *msg, paraswap_parameters_t *context) { strlcpy(msg->title, "Beneficiary", msg->titleLength); msg->msg[0] = '0'; msg->msg[1] = 'x'; - getEthAddressStringFromBinary((uint8_t *) context->beneficiary, - msg->msg + 2, - msg->pluginSharedRW->sha3, - 0); + return getEthAddressStringFromBinary((uint8_t *) context->beneficiary, + msg->msg + 2, + msg->pluginSharedRW->sha3, + 0); } // Set UI for "Warning" screen. -static void set_warning_ui(ethQueryContractUI_t *msg, +static bool set_warning_ui(ethQueryContractUI_t *msg, const paraswap_parameters_t *context __attribute__((unused))) { strlcpy(msg->title, "WARNING", msg->titleLength); strlcpy(msg->msg, "Unknown token", msg->msgLength); + return true; } // Helper function that returns the enum corresponding to the screen that should be displayed. @@ -173,31 +173,29 @@ static screens_t get_screen(const ethQueryContractUI_t *msg, const paraswap_para return ERROR; } -void handle_query_contract_ui(void *parameters) { - ethQueryContractUI_t *msg = (ethQueryContractUI_t *) parameters; +void handle_query_contract_ui(ethQueryContractUI_t *msg) { paraswap_parameters_t *context = (paraswap_parameters_t *) msg->pluginContext; + bool ret = false; memset(msg->title, 0, msg->titleLength); memset(msg->msg, 0, msg->msgLength); - msg->result = ETH_PLUGIN_RESULT_OK; screens_t screen = get_screen(msg, context); switch (screen) { case SEND_SCREEN: - set_send_ui(msg, context); + ret = set_send_ui(msg, context); break; case RECEIVE_SCREEN: - set_receive_ui(msg, context); + ret = set_receive_ui(msg, context); break; case BENEFICIARY_SCREEN: - set_beneficiary_ui(msg, context); + ret = set_beneficiary_ui(msg, context); break; case WARN_SCREEN: - set_warning_ui(msg, context); + ret = set_warning_ui(msg, context); break; default: PRINTF("Received an invalid screenIndex\n"); - msg->result = ETH_PLUGIN_RESULT_ERROR; - return; } + msg->result = ret ? ETH_PLUGIN_RESULT_OK : ETH_PLUGIN_RESULT_ERROR; } diff --git a/src/paraswap_plugin.h b/src/paraswap_plugin.h index ed16067..92ce717 100644 --- a/src/paraswap_plugin.h +++ b/src/paraswap_plugin.h @@ -109,10 +109,3 @@ typedef struct paraswap_parameters_t { uint8_t skip; // 4 * 1 + 2 * 2 + 7 * 1 == 8 + 7 == 15 bytes. There are 16 - 15 == 1 byte left. } paraswap_parameters_t; - -void handle_init_contract(void *parameters); -void handle_provide_parameter(void *parameters); -void handle_query_contract_ui(void *parameters); -void handle_finalize(void *parameters); -void handle_provide_token(void *parameters); -void handle_query_contract_id(void *parameters); \ No newline at end of file diff --git a/tests/package.json b/tests/package.json index 13995cc..6fb547e 100644 --- a/tests/package.json +++ b/tests/package.json @@ -15,7 +15,7 @@ "@ledgerhq/hw-app-eth": "^6.9.0", "@ledgerhq/hw-transport-http": "^4.74.2", "@ledgerhq/logs": "^5.50.0", - "@zondax/zemu": "^0.27.4", + "@zondax/zemu": "^0.32.0", "bignumber.js": "^9.0.0", "bip32-path": "^0.4.2", "core-js": "^3.7.0", diff --git a/tests/yarn.lock b/tests/yarn.lock index b7a1ab7..db98702 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -1881,16 +1881,16 @@ dependencies: "@types/yargs-parser" "*" -"@zondax/zemu@^0.27.4": - version "0.27.4" - resolved "https://registry.yarnpkg.com/@zondax/zemu/-/zemu-0.27.4.tgz#4e306ba76f5c718d901c7948516668e944a6aa1e" - integrity sha512-bbYAW9JJUx+hVBdwkTonu+0q9WkeFQpcGMRUrzS/Gfc6rvhAQ+X9KrGhwGrnxmBuzajt0oXZ50QvoEJHBR9PDA== +"@zondax/zemu@^0.32.0": + version "0.32.0" + resolved "https://registry.yarnpkg.com/@zondax/zemu/-/zemu-0.32.0.tgz#733ae016c464d813721bcaef273c759bde3be4a9" + integrity sha512-xbcTu/G3bRz1ubf3fDjUtNnZTSnwv5MPFaKWpKQFGRp+iIS0FdPBFGLRtilN/JqsGiF2DebI9DFkFNFIV+Dh9g== dependencies: "@grpc/grpc-js" "^1.5.5" "@grpc/proto-loader" "^0.6.9" "@ledgerhq/hw-transport" "^6.24.1" "@ledgerhq/hw-transport-http" "^6.24.1" - axios "^0.26.0" + axios "^0.27.2" axios-retry "^3.2.0" dockerode "^3.3.1" elfy "^1.0.0" @@ -1899,7 +1899,6 @@ path "^0.12.7" pngjs "^6.0.0" randomstring "^1.2.1" - rfb2 "^0.2.2" sleep "^6.3.0" abab@^2.0.0, abab@^2.0.3: @@ -2116,13 +2115,21 @@ axios@^0.23.0: dependencies: follow-redirects "^1.14.4" -axios@^0.26.0, axios@^0.26.1: +axios@^0.26.1: version "0.26.1" resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.1.tgz#1ede41c51fcf51bbbd6fd43669caaa4f0495aaa9" integrity sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA== dependencies: follow-redirects "^1.14.8" +axios@^0.27.2: + version "0.27.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" + integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== + dependencies: + follow-redirects "^1.14.9" + form-data "^4.0.0" + babel-jest@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-24.9.0.tgz#3fc327cb8467b89d14d7bc70e315104a783ccd54" @@ -2612,7 +2619,7 @@ colorette@^1.2.1: resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.1.tgz#4d0b921325c14faf92633086a536db6e89564b1b" integrity sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw== -combined-stream@^1.0.6, combined-stream@~1.0.6: +combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -3353,6 +3360,11 @@ follow-redirects@^1.14.8: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== +follow-redirects@^1.14.9: + version "1.15.3" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" + integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q== + for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" @@ -3363,6 +3375,15 @@ forever-agent@~0.6.1: resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + form-data@~2.3.2: version "2.3.3" resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -5821,11 +5842,6 @@ ret@~0.1.10: resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== -rfb2@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/rfb2/-/rfb2-0.2.2.tgz#f9444b8803e6a31848e57911ace562ce0fee5598" - integrity sha512-+Aw0oED0zsoNQYFE3FUsD+a/lm9y8YwdQaERlWHm7G5hey3tiSQGq7tfe5sFAw5fbN7Zms38bVEDxIUAOq3mRw== - rimraf@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" From 82a6216aa452fcc706a35e2b24cc7dcdf4904c28 Mon Sep 17 00:00:00 2001 From: Sarah Gliner <105934250+sgliner-ledger@users.noreply.github.com> Date: Wed, 29 Nov 2023 11:46:14 +0100 Subject: [PATCH 05/17] [auto]: add PR template --- .github/PULL_REQUEST_TEMPLATE.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..98b720f --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,8 @@ +# Checklist + +- [ ] App update process has been followed +- [ ] Target branch is `develop` +- [ ] Application version has been bumped + + From 19d19db180622cf9ad92f821a49ee84d42026c92 Mon Sep 17 00:00:00 2001 From: Sarah GLINER Date: Wed, 13 Mar 2024 11:55:32 +0100 Subject: [PATCH 06/17] [auto] Add manifest --- ledger_app.toml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 ledger_app.toml diff --git a/ledger_app.toml b/ledger_app.toml new file mode 100644 index 0000000..acd4ba1 --- /dev/null +++ b/ledger_app.toml @@ -0,0 +1,4 @@ +[app] +build_directory = "./" +sdk = "C" +devices = ["nanos", "nanox", "nanos+", "stax"] From 6e7ce1e8c8d229e9626a924e60e040f764515767 Mon Sep 17 00:00:00 2001 From: Sarah GLINER Date: Wed, 13 Mar 2024 14:19:41 +0100 Subject: [PATCH 07/17] [auto] Add guideline enforcer --- .github/workflows/guidelines_enforcer.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/guidelines_enforcer.yml diff --git a/.github/workflows/guidelines_enforcer.yml b/.github/workflows/guidelines_enforcer.yml new file mode 100644 index 0000000..fdaf9f2 --- /dev/null +++ b/.github/workflows/guidelines_enforcer.yml @@ -0,0 +1,23 @@ +name: Ensure compliance with Ledger guidelines + +# This workflow is mandatory in all applications +# It calls a reusable workflow guidelines_enforcer developed by Ledger's internal developer team. +# The successful completion of the reusable workflow is a mandatory step for an app to be available on the Ledger +# application store. +# +# More information on the guidelines can be found in the repository: +# LedgerHQ/ledger-app-workflows/ + +on: + workflow_dispatch: + push: + branches: + - master + - main + - develop + pull_request: + +jobs: + guidelines_enforcer: + name: Call Ledger guidelines_enforcer + uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_guidelines_enforcer.yml@v1 From 3407682da7af3bfec52acd3e0b2a2894b5aed43d Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Wed, 17 Jul 2024 14:56:42 +0200 Subject: [PATCH 08/17] Update plugin sdk --- ethereum-plugin-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethereum-plugin-sdk b/ethereum-plugin-sdk index 1fe4085..0afd2a9 160000 --- a/ethereum-plugin-sdk +++ b/ethereum-plugin-sdk @@ -1 +1 @@ -Subproject commit 1fe4085d04a88f4238103a4ed3db1484fdb69c63 +Subproject commit 0afd2a969eb23e8a508560e0e308dc51fb9219e0 From f6949ce9f6df927ef3a520f0c5cf92783e1f4f34 Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Wed, 17 Jul 2024 15:00:59 +0200 Subject: [PATCH 09/17] Remove deprecated sha3 usage --- src/handle_query_contract_ui.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index ed69a5a..b8edc5e 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -95,7 +95,6 @@ static bool set_beneficiary_ui(ethQueryContractUI_t *msg, paraswap_parameters_t return getEthAddressStringFromBinary((uint8_t *) context->beneficiary, msg->msg + 2, - msg->pluginSharedRW->sha3, 0); } From 6a1d7f996998a1308827ed800e531a009838850f Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Wed, 17 Jul 2024 15:43:09 +0200 Subject: [PATCH 10/17] Remove custom printf implementation --- src/dbg/debug.c | 68 --- src/dbg/debug.h | 6 - src/dbg/printf.c | 1060 ---------------------------------------------- src/dbg/printf.h | 112 ----- 4 files changed, 1246 deletions(-) delete mode 100644 src/dbg/debug.c delete mode 100644 src/dbg/debug.h delete mode 100644 src/dbg/printf.c delete mode 100644 src/dbg/printf.h diff --git a/src/dbg/debug.c b/src/dbg/debug.c deleted file mode 100644 index 66c2efd..0000000 --- a/src/dbg/debug.c +++ /dev/null @@ -1,68 +0,0 @@ -#include -#include -#include -#include "printf.h" - -void debug_write(const char *buf) { - asm volatile( - "movs r0, #0x04\n" - "movs r1, %0\n" - "svc 0xab\n" ::"r"(buf) - : "r0", "r1"); -} - -int semihosted_printf(const char *format, ...) { - char buf[128 + 1]; - - va_list args; - va_start(args, format); - - int ret = vsnprintf(buf, sizeof(buf) - 1, format, args); - - va_end(args); - - debug_write("semi-hosting: "); - if (ret > 0) { - buf[ret] = 0; - debug_write(buf); - } - - return ret; -} - -static const char G_HEX[] = { - '0', - '1', - '2', - '3', - '4', - '5', - '6', - '7', - '8', - '9', - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', -}; - -// %.*H doesn't work with semi-hosted printf, so here's a utility function to print bytes in hex -// format. -void print_bytes(const uint8_t *bytes, uint16_t len) { - unsigned char nibble1, nibble2; - char str[] = {0, 0, 0}; - - debug_write("bytes: "); - for (uint16_t count = 0; count < len; count++) { - nibble1 = (bytes[count] >> 4) & 0xF; - nibble2 = bytes[count] & 0xF; - str[0] = G_HEX[nibble1]; - str[1] = G_HEX[nibble2]; - debug_write(str); - debug_write(" "); - } - debug_write("\n"); -} \ No newline at end of file diff --git a/src/dbg/debug.h b/src/dbg/debug.h deleted file mode 100644 index fe72e22..0000000 --- a/src/dbg/debug.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once -#include -void debug_write(const char *buf); - -int semihosted_printf(const char *format, ...); -void print_bytes(const uint8_t *bytes, uint16_t len); \ No newline at end of file diff --git a/src/dbg/printf.c b/src/dbg/printf.c deleted file mode 100644 index 63445fb..0000000 --- a/src/dbg/printf.c +++ /dev/null @@ -1,1060 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// \author (c) Marco Paland (info@paland.com) -// 2014-2019, PALANDesign Hannover, Germany -// -// \license The MIT License (MIT) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -// \brief Tiny printf, sprintf and (v)snprintf implementation, optimized for speed on -// embedded systems with a very limited resources. These routines are thread -// safe and reentrant! -// Use this instead of the bloated standard/newlib printf cause these use -// malloc for printf (and may not be thread safe). -// -/////////////////////////////////////////////////////////////////////////////// - -#include -#include - -#include "printf.h" - -// define this globally (e.g. gcc -DPRINTF_INCLUDE_CONFIG_H ...) to include the -// printf_config.h header file -// default: undefined -#ifdef PRINTF_INCLUDE_CONFIG_H -#include "printf_config.h" -#endif - -// 'ntoa' conversion buffer size, this must be big enough to hold one converted -// numeric number including padded zeros (dynamically created on stack) -// default: 32 byte -#ifndef PRINTF_NTOA_BUFFER_SIZE -#define PRINTF_NTOA_BUFFER_SIZE 32U -#endif - -// 'ftoa' conversion buffer size, this must be big enough to hold one converted -// float number including padded zeros (dynamically created on stack) -// default: 32 byte -#ifndef PRINTF_FTOA_BUFFER_SIZE -#define PRINTF_FTOA_BUFFER_SIZE 32U -#endif - -// support for the floating point type (%f) -// default: activated -#ifndef PRINTF_DISABLE_SUPPORT_FLOAT -#define PRINTF_SUPPORT_FLOAT -#endif - -// support for exponential floating point notation (%e/%g) -// default: activated -#ifndef PRINTF_DISABLE_SUPPORT_EXPONENTIAL -#define PRINTF_SUPPORT_EXPONENTIAL -#endif - -// define the default floating point precision -// default: 6 digits -#ifndef PRINTF_DEFAULT_FLOAT_PRECISION -#define PRINTF_DEFAULT_FLOAT_PRECISION 6U -#endif - -// define the largest float suitable to print with %f -// default: 1e9 -#ifndef PRINTF_MAX_FLOAT -#define PRINTF_MAX_FLOAT 1e9 -#endif - -// support for the long long types (%llu or %p) -// default: activated -#ifndef PRINTF_DISABLE_SUPPORT_LONG_LONG -#define PRINTF_SUPPORT_LONG_LONG -#endif - -// support for the ptrdiff_t type (%t) -// ptrdiff_t is normally defined in as long or long long type -// default: activated -#ifndef PRINTF_DISABLE_SUPPORT_PTRDIFF_T -#define PRINTF_SUPPORT_PTRDIFF_T -#endif - -/////////////////////////////////////////////////////////////////////////////// - -// internal flag definitions -#define FLAGS_ZEROPAD (1U << 0U) -#define FLAGS_LEFT (1U << 1U) -#define FLAGS_PLUS (1U << 2U) -#define FLAGS_SPACE (1U << 3U) -#define FLAGS_HASH (1U << 4U) -#define FLAGS_UPPERCASE (1U << 5U) -#define FLAGS_CHAR (1U << 6U) -#define FLAGS_SHORT (1U << 7U) -#define FLAGS_LONG (1U << 8U) -#define FLAGS_LONG_LONG (1U << 9U) -#define FLAGS_PRECISION (1U << 10U) -#define FLAGS_ADAPT_EXP (1U << 11U) - -// import float.h for DBL_MAX -#if defined(PRINTF_SUPPORT_FLOAT) -#include -#endif - -// output function type -typedef void (*out_fct_type)(char character, void* buffer, size_t idx, size_t maxlen); - -// wrapper (used as buffer) for output function type -typedef struct { - void (*fct)(char character, void* arg); - void* arg; -} out_fct_wrap_type; - -// internal buffer output -static inline void _out_buffer(char character, void* buffer, size_t idx, size_t maxlen) { - if (idx < maxlen) { - ((char*) buffer)[idx] = character; - } -} - -// internal null output -static inline void _out_null(char character, void* buffer, size_t idx, size_t maxlen) { - (void) character; - (void) buffer; - (void) idx; - (void) maxlen; -} - -// internal _putchar wrapper -static inline void _out_char(char character, void* buffer, size_t idx, size_t maxlen) { - (void) buffer; - (void) idx; - (void) maxlen; - if (character) { - _putchar(character); - } -} - -// internal output function wrapper -static inline void _out_fct(char character, void* buffer, size_t idx, size_t maxlen) { - (void) idx; - (void) maxlen; - if (character) { - // buffer is the output fct pointer - ((out_fct_wrap_type*) buffer)->fct(character, ((out_fct_wrap_type*) buffer)->arg); - } -} - -// internal secure strlen -// \return The length of the string (excluding the terminating 0) limited by 'maxsize' -static inline unsigned int _strnlen_s(const char* str, size_t maxsize) { - const char* s; - for (s = str; *s && maxsize--; ++s) - ; - return (unsigned int) (s - str); -} - -// internal test if char is a digit (0-9) -// \return true if char is a digit -static inline bool _is_digit(char ch) { - return (ch >= '0') && (ch <= '9'); -} - -// internal ASCII string to unsigned int conversion -static unsigned int _atoi(const char** str) { - unsigned int i = 0U; - while (_is_digit(**str)) { - i = i * 10U + (unsigned int) (*((*str)++) - '0'); - } - return i; -} - -// output the specified string in reverse, taking care of any zero-padding -static size_t _out_rev(out_fct_type out, - char* buffer, - size_t idx, - size_t maxlen, - const char* buf, - size_t len, - unsigned int width, - unsigned int flags) { - const size_t start_idx = idx; - - // pad spaces up to given width - if (!(flags & FLAGS_LEFT) && !(flags & FLAGS_ZEROPAD)) { - for (size_t i = len; i < width; i++) { - out(' ', buffer, idx++, maxlen); - } - } - - // reverse string - while (len) { - out(buf[--len], buffer, idx++, maxlen); - } - - // append pad spaces up to given width - if (flags & FLAGS_LEFT) { - while (idx - start_idx < width) { - out(' ', buffer, idx++, maxlen); - } - } - - return idx; -} - -// internal itoa format -static size_t _ntoa_format(out_fct_type out, - char* buffer, - size_t idx, - size_t maxlen, - char* buf, - size_t len, - bool negative, - unsigned int base, - unsigned int prec, - unsigned int width, - unsigned int flags) { - // pad leading zeros - if (!(flags & FLAGS_LEFT)) { - if (width && (flags & FLAGS_ZEROPAD) && - (negative || (flags & (FLAGS_PLUS | FLAGS_SPACE)))) { - width--; - } - while ((len < prec) && (len < PRINTF_NTOA_BUFFER_SIZE)) { - buf[len++] = '0'; - } - while ((flags & FLAGS_ZEROPAD) && (len < width) && (len < PRINTF_NTOA_BUFFER_SIZE)) { - buf[len++] = '0'; - } - } - - // handle hash - if (flags & FLAGS_HASH) { - if (!(flags & FLAGS_PRECISION) && len && ((len == prec) || (len == width))) { - len--; - if (len && (base == 16U)) { - len--; - } - } - if ((base == 16U) && !(flags & FLAGS_UPPERCASE) && (len < PRINTF_NTOA_BUFFER_SIZE)) { - buf[len++] = 'x'; - } else if ((base == 16U) && (flags & FLAGS_UPPERCASE) && (len < PRINTF_NTOA_BUFFER_SIZE)) { - buf[len++] = 'X'; - } else if ((base == 2U) && (len < PRINTF_NTOA_BUFFER_SIZE)) { - buf[len++] = 'b'; - } - if (len < PRINTF_NTOA_BUFFER_SIZE) { - buf[len++] = '0'; - } - } - - if (len < PRINTF_NTOA_BUFFER_SIZE) { - if (negative) { - buf[len++] = '-'; - } else if (flags & FLAGS_PLUS) { - buf[len++] = '+'; // ignore the space if the '+' exists - } else if (flags & FLAGS_SPACE) { - buf[len++] = ' '; - } - } - - return _out_rev(out, buffer, idx, maxlen, buf, len, width, flags); -} - -// internal itoa for 'long' type -static size_t _ntoa_long(out_fct_type out, - char* buffer, - size_t idx, - size_t maxlen, - unsigned long value, - bool negative, - unsigned long base, - unsigned int prec, - unsigned int width, - unsigned int flags) { - char buf[PRINTF_NTOA_BUFFER_SIZE]; - size_t len = 0U; - - // no hash for 0 values - if (!value) { - flags &= ~FLAGS_HASH; - } - - // write if precision != 0 and value is != 0 - if (!(flags & FLAGS_PRECISION) || value) { - do { - const char digit = (char) (value % base); - buf[len++] = - digit < 10 ? '0' + digit : (flags & FLAGS_UPPERCASE ? 'A' : 'a') + digit - 10; - value /= base; - } while (value && (len < PRINTF_NTOA_BUFFER_SIZE)); - } - - return _ntoa_format(out, - buffer, - idx, - maxlen, - buf, - len, - negative, - (unsigned int) base, - prec, - width, - flags); -} - -// internal itoa for 'long long' type -#if defined(PRINTF_SUPPORT_LONG_LONG) -static size_t _ntoa_long_long(out_fct_type out, - char* buffer, - size_t idx, - size_t maxlen, - unsigned long long value, - bool negative, - unsigned long long base, - unsigned int prec, - unsigned int width, - unsigned int flags) { - char buf[PRINTF_NTOA_BUFFER_SIZE]; - size_t len = 0U; - - // no hash for 0 values - if (!value) { - flags &= ~FLAGS_HASH; - } - - // write if precision != 0 and value is != 0 - if (!(flags & FLAGS_PRECISION) || value) { - do { - const char digit = (char) (value % base); - buf[len++] = - digit < 10 ? '0' + digit : (flags & FLAGS_UPPERCASE ? 'A' : 'a') + digit - 10; - value /= base; - } while (value && (len < PRINTF_NTOA_BUFFER_SIZE)); - } - - return _ntoa_format(out, - buffer, - idx, - maxlen, - buf, - len, - negative, - (unsigned int) base, - prec, - width, - flags); -} -#endif // PRINTF_SUPPORT_LONG_LONG - -#if defined(PRINTF_SUPPORT_FLOAT) - -#if defined(PRINTF_SUPPORT_EXPONENTIAL) -// forward declaration so that _ftoa can switch to exp notation for values > PRINTF_MAX_FLOAT -static size_t _etoa(out_fct_type out, - char* buffer, - size_t idx, - size_t maxlen, - double value, - unsigned int prec, - unsigned int width, - unsigned int flags); -#endif - -// internal ftoa for fixed decimal floating point -static size_t _ftoa(out_fct_type out, - char* buffer, - size_t idx, - size_t maxlen, - double value, - unsigned int prec, - unsigned int width, - unsigned int flags) { - char buf[PRINTF_FTOA_BUFFER_SIZE]; - size_t len = 0U; - double diff = 0.0; - - // powers of 10 - static const double pow10[] = - {1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000}; - - // test for special values - if (value != value) return _out_rev(out, buffer, idx, maxlen, "nan", 3, width, flags); - if (value < -DBL_MAX) return _out_rev(out, buffer, idx, maxlen, "fni-", 4, width, flags); - if (value > DBL_MAX) - return _out_rev(out, - buffer, - idx, - maxlen, - (flags & FLAGS_PLUS) ? "fni+" : "fni", - (flags & FLAGS_PLUS) ? 4U : 3U, - width, - flags); - - // test for very large values - // standard printf behavior is to print EVERY whole number digit -- which could be 100s of - // characters overflowing your buffers == bad - if ((value > PRINTF_MAX_FLOAT) || (value < -PRINTF_MAX_FLOAT)) { -#if defined(PRINTF_SUPPORT_EXPONENTIAL) - return _etoa(out, buffer, idx, maxlen, value, prec, width, flags); -#else - return 0U; -#endif - } - - // test for negative - bool negative = false; - if (value < 0) { - negative = true; - value = 0 - value; - } - - // set default precision, if not set explicitly - if (!(flags & FLAGS_PRECISION)) { - prec = PRINTF_DEFAULT_FLOAT_PRECISION; - } - // limit precision to 9, cause a prec >= 10 can lead to overflow errors - while ((len < PRINTF_FTOA_BUFFER_SIZE) && (prec > 9U)) { - buf[len++] = '0'; - prec--; - } - - int whole = (int) value; - double tmp = (value - whole) * pow10[prec]; - unsigned long frac = (unsigned long) tmp; - diff = tmp - frac; - - if (diff > 0.5) { - ++frac; - // handle rollover, e.g. case 0.99 with prec 1 is 1.0 - if (frac >= pow10[prec]) { - frac = 0; - ++whole; - } - } else if (diff < 0.5) { - } else if ((frac == 0U) || (frac & 1U)) { - // if halfway, round up if odd OR if last digit is 0 - ++frac; - } - - if (prec == 0U) { - diff = value - (double) whole; - if ((!(diff < 0.5) || (diff > 0.5)) && (whole & 1)) { - // exactly 0.5 and ODD, then round up - // 1.5 -> 2, but 2.5 -> 2 - ++whole; - } - } else { - unsigned int count = prec; - // now do fractional part, as an unsigned number - while (len < PRINTF_FTOA_BUFFER_SIZE) { - --count; - buf[len++] = (char) (48U + (frac % 10U)); - if (!(frac /= 10U)) { - break; - } - } - // add extra 0s - while ((len < PRINTF_FTOA_BUFFER_SIZE) && (count-- > 0U)) { - buf[len++] = '0'; - } - if (len < PRINTF_FTOA_BUFFER_SIZE) { - // add decimal - buf[len++] = '.'; - } - } - - // do whole part, number is reversed - while (len < PRINTF_FTOA_BUFFER_SIZE) { - buf[len++] = (char) (48 + (whole % 10)); - if (!(whole /= 10)) { - break; - } - } - - // pad leading zeros - if (!(flags & FLAGS_LEFT) && (flags & FLAGS_ZEROPAD)) { - if (width && (negative || (flags & (FLAGS_PLUS | FLAGS_SPACE)))) { - width--; - } - while ((len < width) && (len < PRINTF_FTOA_BUFFER_SIZE)) { - buf[len++] = '0'; - } - } - - if (len < PRINTF_FTOA_BUFFER_SIZE) { - if (negative) { - buf[len++] = '-'; - } else if (flags & FLAGS_PLUS) { - buf[len++] = '+'; // ignore the space if the '+' exists - } else if (flags & FLAGS_SPACE) { - buf[len++] = ' '; - } - } - - return _out_rev(out, buffer, idx, maxlen, buf, len, width, flags); -} - -#if defined(PRINTF_SUPPORT_EXPONENTIAL) -// internal ftoa variant for exponential floating-point type, contributed by Martijn Jasperse -// -static size_t _etoa(out_fct_type out, - char* buffer, - size_t idx, - size_t maxlen, - double value, - unsigned int prec, - unsigned int width, - unsigned int flags) { - // check for NaN and special values - if ((value != value) || (value > DBL_MAX) || (value < -DBL_MAX)) { - return _ftoa(out, buffer, idx, maxlen, value, prec, width, flags); - } - - // determine the sign - const bool negative = value < 0; - if (negative) { - value = -value; - } - - // default precision - if (!(flags & FLAGS_PRECISION)) { - prec = PRINTF_DEFAULT_FLOAT_PRECISION; - } - - // determine the decimal exponent - // based on the algorithm by David Gay (https://www.ampl.com/netlib/fp/dtoa.c) - union { - uint64_t U; - double F; - } conv; - - conv.F = value; - int exp2 = (int) ((conv.U >> 52U) & 0x07FFU) - 1023; // effectively log2 - conv.U = (conv.U & ((1ULL << 52U) - 1U)) | - (1023ULL << 52U); // drop the exponent so conv.F is now in [1,2) - // now approximate log10 from the log2 integer part and an expansion of ln around 1.5 - int expval = - (int) (0.1760912590558 + exp2 * 0.301029995663981 + (conv.F - 1.5) * 0.289529654602168); - // now we want to compute 10^expval but we want to be sure it won't overflow - exp2 = (int) (expval * 3.321928094887362 + 0.5); - const double z = expval * 2.302585092994046 - exp2 * 0.6931471805599453; - const double z2 = z * z; - conv.U = (uint64_t) (exp2 + 1023) << 52U; - // compute exp(z) using continued fractions, see - // https://en.wikipedia.org/wiki/Exponential_function#Continued_fractions_for_ex - conv.F *= 1 + 2 * z / (2 - z + (z2 / (6 + (z2 / (10 + z2 / 14))))); - // correct for rounding errors - if (value < conv.F) { - expval--; - conv.F /= 10; - } - - // the exponent format is "%+03d" and largest value is "307", so set aside 4-5 characters - unsigned int minwidth = ((expval < 100) && (expval > -100)) ? 4U : 5U; - - // in "%g" mode, "prec" is the number of *significant figures* not decimals - if (flags & FLAGS_ADAPT_EXP) { - // do we want to fall-back to "%f" mode? - if ((value >= 1e-4) && (value < 1e6)) { - if ((int) prec > expval) { - prec = (unsigned) ((int) prec - expval - 1); - } else { - prec = 0; - } - flags |= FLAGS_PRECISION; // make sure _ftoa respects precision - // no characters in exponent - minwidth = 0U; - expval = 0; - } else { - // we use one sigfig for the whole part - if ((prec > 0) && (flags & FLAGS_PRECISION)) { - --prec; - } - } - } - - // will everything fit? - unsigned int fwidth = width; - if (width > minwidth) { - // we didn't fall-back so subtract the characters required for the exponent - fwidth -= minwidth; - } else { - // not enough characters, so go back to default sizing - fwidth = 0U; - } - if ((flags & FLAGS_LEFT) && minwidth) { - // if we're padding on the right, DON'T pad the floating part - fwidth = 0U; - } - - // rescale the float value - if (expval) { - value /= conv.F; - } - - // output the floating part - const size_t start_idx = idx; - idx = _ftoa(out, - buffer, - idx, - maxlen, - negative ? -value : value, - prec, - fwidth, - flags & ~FLAGS_ADAPT_EXP); - - // output the exponent part - if (minwidth) { - // output the exponential symbol - out((flags & FLAGS_UPPERCASE) ? 'E' : 'e', buffer, idx++, maxlen); - // output the exponent value - idx = _ntoa_long(out, - buffer, - idx, - maxlen, - (expval < 0) ? -expval : expval, - expval < 0, - 10, - 0, - minwidth - 1, - FLAGS_ZEROPAD | FLAGS_PLUS); - // might need to right-pad spaces - if (flags & FLAGS_LEFT) { - while (idx - start_idx < width) out(' ', buffer, idx++, maxlen); - } - } - return idx; -} -#endif // PRINTF_SUPPORT_EXPONENTIAL -#endif // PRINTF_SUPPORT_FLOAT - -// internal vsnprintf -static int _vsnprintf(out_fct_type out, - char* buffer, - const size_t maxlen, - const char* format, - va_list va) { - unsigned int flags, width, precision, n; - size_t idx = 0U; - - if (!buffer) { - // use null output function - out = _out_null; - } - - while (*format) { - // format specifier? %[flags][width][.precision][length] - if (*format != '%') { - // no - out(*format, buffer, idx++, maxlen); - format++; - continue; - } else { - // yes, evaluate it - format++; - } - - // evaluate flags - flags = 0U; - do { - switch (*format) { - case '0': - flags |= FLAGS_ZEROPAD; - format++; - n = 1U; - break; - case '-': - flags |= FLAGS_LEFT; - format++; - n = 1U; - break; - case '+': - flags |= FLAGS_PLUS; - format++; - n = 1U; - break; - case ' ': - flags |= FLAGS_SPACE; - format++; - n = 1U; - break; - case '#': - flags |= FLAGS_HASH; - format++; - n = 1U; - break; - default: - n = 0U; - break; - } - } while (n); - - // evaluate width field - width = 0U; - if (_is_digit(*format)) { - width = _atoi(&format); - } else if (*format == '*') { - const int w = va_arg(va, int); - if (w < 0) { - flags |= FLAGS_LEFT; // reverse padding - width = (unsigned int) -w; - } else { - width = (unsigned int) w; - } - format++; - } - - // evaluate precision field - precision = 0U; - if (*format == '.') { - flags |= FLAGS_PRECISION; - format++; - if (_is_digit(*format)) { - precision = _atoi(&format); - } else if (*format == '*') { - const int prec = (int) va_arg(va, int); - precision = prec > 0 ? (unsigned int) prec : 0U; - format++; - } - } - - // evaluate length field - switch (*format) { - case 'l': - flags |= FLAGS_LONG; - format++; - if (*format == 'l') { - flags |= FLAGS_LONG_LONG; - format++; - } - break; - case 'h': - flags |= FLAGS_SHORT; - format++; - if (*format == 'h') { - flags |= FLAGS_CHAR; - format++; - } - break; -#if defined(PRINTF_SUPPORT_PTRDIFF_T) - case 't': - flags |= (sizeof(ptrdiff_t) == sizeof(long) ? FLAGS_LONG : FLAGS_LONG_LONG); - format++; - break; -#endif - case 'j': - flags |= (sizeof(intmax_t) == sizeof(long) ? FLAGS_LONG : FLAGS_LONG_LONG); - format++; - break; - case 'z': - flags |= (sizeof(size_t) == sizeof(long) ? FLAGS_LONG : FLAGS_LONG_LONG); - format++; - break; - default: - break; - } - - // evaluate specifier - switch (*format) { - case 'd': - case 'i': - case 'u': - case 'x': - case 'X': - case 'o': - case 'b': { - // set the base - unsigned int base; - if (*format == 'x' || *format == 'X') { - base = 16U; - } else if (*format == 'o') { - base = 8U; - } else if (*format == 'b') { - base = 2U; - } else { - base = 10U; - flags &= ~FLAGS_HASH; // no hash for dec format - } - // uppercase - if (*format == 'X') { - flags |= FLAGS_UPPERCASE; - } - - // no plus or space flag for u, x, X, o, b - if ((*format != 'i') && (*format != 'd')) { - flags &= ~(FLAGS_PLUS | FLAGS_SPACE); - } - - // ignore '0' flag when precision is given - if (flags & FLAGS_PRECISION) { - flags &= ~FLAGS_ZEROPAD; - } - - // convert the integer - if ((*format == 'i') || (*format == 'd')) { - // signed - if (flags & FLAGS_LONG_LONG) { -#if defined(PRINTF_SUPPORT_LONG_LONG) - const long long value = va_arg(va, long long); - idx = _ntoa_long_long(out, - buffer, - idx, - maxlen, - (unsigned long long) (value > 0 ? value : 0 - value), - value < 0, - base, - precision, - width, - flags); -#endif - } else if (flags & FLAGS_LONG) { - const long value = va_arg(va, long); - idx = _ntoa_long(out, - buffer, - idx, - maxlen, - (unsigned long) (value > 0 ? value : 0 - value), - value < 0, - base, - precision, - width, - flags); - } else { - const int value = (flags & FLAGS_CHAR) ? (char) va_arg(va, int) - : (flags & FLAGS_SHORT) ? (short int) va_arg(va, int) - : va_arg(va, int); - idx = _ntoa_long(out, - buffer, - idx, - maxlen, - (unsigned int) (value > 0 ? value : 0 - value), - value < 0, - base, - precision, - width, - flags); - } - } else { - // unsigned - if (flags & FLAGS_LONG_LONG) { -#if defined(PRINTF_SUPPORT_LONG_LONG) - idx = _ntoa_long_long(out, - buffer, - idx, - maxlen, - va_arg(va, unsigned long long), - false, - base, - precision, - width, - flags); -#endif - } else if (flags & FLAGS_LONG) { - idx = _ntoa_long(out, - buffer, - idx, - maxlen, - va_arg(va, unsigned long), - false, - base, - precision, - width, - flags); - } else { - const unsigned int value = - (flags & FLAGS_CHAR) ? (unsigned char) va_arg(va, unsigned int) - : (flags & FLAGS_SHORT) ? (unsigned short int) va_arg(va, unsigned int) - : va_arg(va, unsigned int); - idx = _ntoa_long(out, - buffer, - idx, - maxlen, - value, - false, - base, - precision, - width, - flags); - } - } - format++; - break; - } -#if defined(PRINTF_SUPPORT_FLOAT) - case 'f': - case 'F': - if (*format == 'F') flags |= FLAGS_UPPERCASE; - idx = _ftoa(out, buffer, idx, maxlen, va_arg(va, double), precision, width, flags); - format++; - break; -#if defined(PRINTF_SUPPORT_EXPONENTIAL) - case 'e': - case 'E': - case 'g': - case 'G': - if ((*format == 'g') || (*format == 'G')) flags |= FLAGS_ADAPT_EXP; - if ((*format == 'E') || (*format == 'G')) flags |= FLAGS_UPPERCASE; - idx = _etoa(out, buffer, idx, maxlen, va_arg(va, double), precision, width, flags); - format++; - break; -#endif // PRINTF_SUPPORT_EXPONENTIAL -#endif // PRINTF_SUPPORT_FLOAT - case 'c': { - unsigned int l = 1U; - // pre padding - if (!(flags & FLAGS_LEFT)) { - while (l++ < width) { - out(' ', buffer, idx++, maxlen); - } - } - // char output - out((char) va_arg(va, int), buffer, idx++, maxlen); - // post padding - if (flags & FLAGS_LEFT) { - while (l++ < width) { - out(' ', buffer, idx++, maxlen); - } - } - format++; - break; - } - - case 's': { - const char* p = va_arg(va, char*); - unsigned int l = _strnlen_s(p, precision ? precision : (size_t) -1); - // pre padding - if (flags & FLAGS_PRECISION) { - l = (l < precision ? l : precision); - } - if (!(flags & FLAGS_LEFT)) { - while (l++ < width) { - out(' ', buffer, idx++, maxlen); - } - } - // string output - while ((*p != 0) && (!(flags & FLAGS_PRECISION) || precision--)) { - out(*(p++), buffer, idx++, maxlen); - } - // post padding - if (flags & FLAGS_LEFT) { - while (l++ < width) { - out(' ', buffer, idx++, maxlen); - } - } - format++; - break; - } - - case 'p': { - width = sizeof(void*) * 2U; - flags |= FLAGS_ZEROPAD | FLAGS_UPPERCASE; -#if defined(PRINTF_SUPPORT_LONG_LONG) - const bool is_ll = sizeof(uintptr_t) == sizeof(long long); - if (is_ll) { - idx = _ntoa_long_long(out, - buffer, - idx, - maxlen, - (uintptr_t) va_arg(va, void*), - false, - 16U, - precision, - width, - flags); - } else { -#endif - idx = _ntoa_long(out, - buffer, - idx, - maxlen, - (unsigned long) ((uintptr_t) va_arg(va, void*)), - false, - 16U, - precision, - width, - flags); -#if defined(PRINTF_SUPPORT_LONG_LONG) - } -#endif - format++; - break; - } - - case '%': - out('%', buffer, idx++, maxlen); - format++; - break; - - default: - out(*format, buffer, idx++, maxlen); - format++; - break; - } - } - - // termination - out((char) 0, buffer, idx < maxlen ? idx : maxlen - 1U, maxlen); - - // return written chars without terminating \0 - return (int) idx; -} - -/////////////////////////////////////////////////////////////////////////////// - -int printf_(const char* format, ...) { - va_list va; - va_start(va, format); - char buffer[1]; - const int ret = _vsnprintf(_out_char, buffer, (size_t) -1, format, va); - va_end(va); - return ret; -} - -int sprintf_(char* buffer, const char* format, ...) { - va_list va; - va_start(va, format); - const int ret = _vsnprintf(_out_buffer, buffer, (size_t) -1, format, va); - va_end(va); - return ret; -} - -int snprintf_(char* buffer, size_t count, const char* format, ...) { - va_list va; - va_start(va, format); - const int ret = _vsnprintf(_out_buffer, buffer, count, format, va); - va_end(va); - return ret; -} - -int vprintf_(const char* format, va_list va) { - char buffer[1]; - return _vsnprintf(_out_char, buffer, (size_t) -1, format, va); -} - -int vsnprintf_(char* buffer, size_t count, const char* format, va_list va) { - return _vsnprintf(_out_buffer, buffer, count, format, va); -} - -int fctprintf(void (*out)(char character, void* arg), void* arg, const char* format, ...) { - va_list va; - va_start(va, format); - const out_fct_wrap_type out_fct_wrap = {out, arg}; - const int ret = - _vsnprintf(_out_fct, (char*) (uintptr_t) &out_fct_wrap, (size_t) -1, format, va); - va_end(va); - return ret; -} diff --git a/src/dbg/printf.h b/src/dbg/printf.h deleted file mode 100644 index 6cda5a5..0000000 --- a/src/dbg/printf.h +++ /dev/null @@ -1,112 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// \author (c) Marco Paland (info@paland.com) -// 2014-2019, PALANDesign Hannover, Germany -// -// \license The MIT License (MIT) -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// -// \brief Tiny printf, sprintf and snprintf implementation, optimized for speed on -// embedded systems with a very limited resources. -// Use this instead of bloated standard/newlib printf. -// These routines are thread safe and reentrant. -// -/////////////////////////////////////////////////////////////////////////////// - -#ifndef _PRINTF_H_ -#define _PRINTF_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Output a character to a custom device like UART, used by the printf() function - * This function is declared here only. You have to write your custom implementation somewhere - * \param character Character to output - */ -void _putchar(char character); - -/** - * Tiny printf implementation - * You have to implement _putchar if you use printf() - * To avoid conflicts with the regular printf() API it is overridden by macro defines - * and internal underscore-appended functions like printf_() are used - * \param format A string that specifies the format of the output - * \return The number of characters that are written into the array, not counting the terminating - * null character - */ -#define printf printf_ -int printf_(const char* format, ...); - -/** - * Tiny sprintf implementation - * Due to security reasons (buffer overflow) YOU SHOULD CONSIDER USING (V)SNPRINTF INSTEAD! - * \param buffer A pointer to the buffer where to store the formatted string. MUST be big enough to - * store the output! \param format A string that specifies the format of the output \return The - * number of characters that are WRITTEN into the buffer, not counting the terminating null - * character - */ -#define sprintf sprintf_ -int sprintf_(char* buffer, const char* format, ...); - -/** - * Tiny snprintf/vsnprintf implementation - * \param buffer A pointer to the buffer where to store the formatted string - * \param count The maximum number of characters to store in the buffer, including a terminating - * null character \param format A string that specifies the format of the output \param va A value - * identifying a variable arguments list \return The number of characters that COULD have been - * written into the buffer, not counting the terminating null character. A value equal or larger - * than count indicates truncation. Only when the returned value is non-negative and less than - * count, the string has been completely written. - */ -#define snprintf snprintf_ -#define vsnprintf vsnprintf_ -int snprintf_(char* buffer, size_t count, const char* format, ...); -int vsnprintf_(char* buffer, size_t count, const char* format, va_list va); - -/** - * Tiny vprintf implementation - * \param format A string that specifies the format of the output - * \param va A value identifying a variable arguments list - * \return The number of characters that are WRITTEN into the buffer, not counting the terminating - * null character - */ -#define vprintf vprintf_ -int vprintf_(const char* format, va_list va); - -/** - * printf with output function - * You may use this as dynamic alternative to printf() with its fixed _putchar() output - * \param out An output function which takes one character and an argument pointer - * \param arg An argument pointer for user data passed to output function - * \param format A string that specifies the format of the output - * \return The number of characters that are sent to the output function, not counting the - * terminating null character - */ -int fctprintf(void (*out)(char character, void* arg), void* arg, const char* format, ...); - -#ifdef __cplusplus -} -#endif - -#endif // _PRINTF_H_ \ No newline at end of file From 0690739ac4d2671a509c643d49d729ee017ee232 Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Wed, 17 Jul 2024 15:49:04 +0200 Subject: [PATCH 11/17] Remove include of deprecated sdk header --- src/paraswap_plugin.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/paraswap_plugin.h b/src/paraswap_plugin.h index 92ce717..378c2cb 100644 --- a/src/paraswap_plugin.h +++ b/src/paraswap_plugin.h @@ -1,6 +1,5 @@ #pragma once -#include "eth_internals.h" #include "eth_plugin_interface.h" #include From 6410c447f335253c860a46f0e4404649b64eeec8 Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Wed, 17 Jul 2024 17:55:21 +0200 Subject: [PATCH 12/17] Use standard Makefile --- Makefile | 151 ++----------------------------------------------------- 1 file changed, 5 insertions(+), 146 deletions(-) diff --git a/Makefile b/Makefile index acf3820..f30d4d9 100644 --- a/Makefile +++ b/Makefile @@ -15,152 +15,11 @@ # limitations under the License. #******************************************************************************* -ifeq ($(BOLOS_SDK),) -$(error Environment variable BOLOS_SDK is not set) -endif - -include $(BOLOS_SDK)/Makefile.defines - -APP_LOAD_PARAMS += --appFlags 0x800 --path "44'/60'" --path "45'" --curve secp256k1 -APP_LOAD_PARAMS += $(COMMON_LOAD_PARAMS) - -APPVERSION_M = 2 -APPVERSION_N = 1 -APPVERSION_P = 1 -APPVERSION = $(APPVERSION_M).$(APPVERSION_N).$(APPVERSION_P) - APPNAME = "Paraswap" -#prepare hsm generation -ifeq ($(TARGET_NAME), TARGET_NANOS) -ICONNAME=icons/nanos_app_paraswap.gif -else ifeq ($(TARGET_NAME), TARGET_STAX) -ICONNAME=icons/stax_app_paraswap.gif -DEFINES += ICONGLYPH=C_stax_paraswap_64px -DEFINES += ICONBITMAP=C_stax_paraswap_64px_bitmap -GLYPH_FILES += $(ICONNAME) -else -ICONNAME=icons/nanox_app_paraswap.gif -endif - -################ -# Default rule # -################ -all: default - -############ -# Platform # -############ - -DEFINES += OS_IO_SEPROXYHAL -DEFINES += HAVE_SPRINTF -DEFINES += LEDGER_MAJOR_VERSION=$(APPVERSION_M) LEDGER_MINOR_VERSION=$(APPVERSION_N) LEDGER_PATCH_VERSION=$(APPVERSION_P) -DEFINES += IO_HID_EP_LENGTH=64 - -DEFINES += UNUSED\(x\)=\(void\)x -DEFINES += APPVERSION=\"$(APPVERSION)\" -CFLAGS += -DAPPNAME=\"$(APPNAME)\" - -ifneq (,$(filter $(TARGET_NAME),TARGET_NANOX TARGET_STAX)) -DEFINES += HAVE_BLE BLE_COMMAND_TIMEOUT_MS=2000 -DEFINES += HAVE_BLE_APDU # basic ledger apdu transport over BLE -endif - -ifeq ($(TARGET_NAME),TARGET_NANOS) -DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=128 -else -DEFINES += IO_SEPROXYHAL_BUFFER_SIZE_B=300 -endif - -ifneq ($(TARGET_NAME),TARGET_STAX) -DEFINES += HAVE_BAGL -ifneq ($(TARGET_NAME),TARGET_NANOS) -DEFINES += HAVE_GLO096 -DEFINES += HAVE_BAGL BAGL_WIDTH=128 BAGL_HEIGHT=64 -DEFINES += HAVE_BAGL_ELLIPSIS # long label truncation feature -DEFINES += HAVE_BAGL_FONT_OPEN_SANS_REGULAR_11PX -DEFINES += HAVE_BAGL_FONT_OPEN_SANS_EXTRABOLD_11PX -DEFINES += HAVE_BAGL_FONT_OPEN_SANS_LIGHT_16PX -DEFINES += HAVE_UX_FLOW -endif -endif - -# Enabling debug PRINTF -ifneq ($(DEBUG),0) - DEFINES += HAVE_STACK_OVERFLOW_CHECK - SDK_SOURCE_PATH += lib_stusb lib_stusb_impl - DEFINES += HAVE_IO_USB HAVE_L4_USBLIB IO_USB_MAX_ENDPOINTS=4 IO_HID_EP_LENGTH=64 HAVE_USB_APDU - - ifeq ($(DEBUG),10) - $(warning Using semihosted PRINTF. Only run with speculos!) - CFLAGS += -include src/dbg/debug.h - DEFINES += HAVE_PRINTF PRINTF=semihosted_printf - else - ifeq ($(TARGET_NAME),TARGET_NANOS) - DEFINES += HAVE_PRINTF PRINTF=screen_printf - else - DEFINES += HAVE_PRINTF PRINTF=mcu_usb_printf - endif - - endif -else - DEFINES += PRINTF\(...\)= -endif - -############## -# Compiler # -############## -ifneq ($(BOLOS_ENV),) -$(info BOLOS_ENV=$(BOLOS_ENV)) -CLANGPATH := $(BOLOS_ENV)/clang-arm-fropi/bin/ -GCCPATH := $(BOLOS_ENV)/gcc-arm-none-eabi-5_3-2016q1/bin/ -else -$(info BOLOS_ENV is not set: falling back to CLANGPATH and GCCPATH) -endif -ifeq ($(CLANGPATH),) -$(info CLANGPATH is not set: clang will be used from PATH) -endif -ifeq ($(GCCPATH),) -$(info GCCPATH is not set: arm-none-eabi-* will be used from PATH) -endif - -CC := $(CLANGPATH)clang - -AS := $(GCCPATH)arm-none-eabi-gcc - -LD := $(GCCPATH)arm-none-eabi-gcc -LDLIBS += -lm -lgcc -lc - -# import rules to compile glyphs(/pone) -include $(BOLOS_SDK)/Makefile.glyphs - -### variables processed by the common makefile.rules of the SDK to grab source files and include dirs -APP_SOURCE_PATH += src ethereum-plugin-sdk -ifneq ($(TARGET_NAME), TARGET_STAX) -SDK_SOURCE_PATH += lib_ux -endif -ifneq (,$(findstring HAVE_BLE,$(DEFINES))) -SDK_SOURCE_PATH += lib_blewbxx lib_blewbxx_impl -endif - -### initialize plugin SDK submodule if needed -ifneq ($(shell git submodule status | grep '^[-+]'),) -$(info INFO: Need to reinitialize git submodules) -$(shell git submodule update --init) -endif - -load: all - python3 -m ledgerblue.loadApp $(APP_LOAD_PARAMS) - -delete: - python3 -m ledgerblue.deleteApp $(COMMON_DELETE_PARAMS) - -# import generic rules from the sdk -include $(BOLOS_SDK)/Makefile.rules - - -#add dependency on custom makefile filename -dep/%.d: %.c Makefile +# Application version +APPVERSION_M = 2 +APPVERSION_N = 1 +APPVERSION_P = 1 -listvariants: - @echo VARIANTS NONE paraswap +include ethereum-plugin-sdk/standard_plugin.mk From 3ecef2cf78262c0e5c19b228e0e332b9bd235ca0 Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Wed, 17 Jul 2024 18:10:00 +0200 Subject: [PATCH 13/17] Fix lint --- src/handle_query_contract_ui.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/handle_query_contract_ui.c b/src/handle_query_contract_ui.c index b8edc5e..ed518df 100644 --- a/src/handle_query_contract_ui.c +++ b/src/handle_query_contract_ui.c @@ -93,9 +93,7 @@ static bool set_beneficiary_ui(ethQueryContractUI_t *msg, paraswap_parameters_t msg->msg[0] = '0'; msg->msg[1] = 'x'; - return getEthAddressStringFromBinary((uint8_t *) context->beneficiary, - msg->msg + 2, - 0); + return getEthAddressStringFromBinary((uint8_t *) context->beneficiary, msg->msg + 2, 0); } // Set UI for "Warning" screen. From be6a5fb539e9f69ff3d9cf79e8a348d180ea70b9 Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Wed, 17 Jul 2024 18:11:36 +0200 Subject: [PATCH 14/17] Add Flex support --- icons/flex_app_paraswap.gif | Bin 0 -> 529 bytes ledger_app.toml | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 icons/flex_app_paraswap.gif diff --git a/icons/flex_app_paraswap.gif b/icons/flex_app_paraswap.gif new file mode 100644 index 0000000000000000000000000000000000000000..9ca793c32ef2ca7918050873f396de158b8fd4d4 GIT binary patch literal 529 zcmZ?wbhEHb)L_tH_{_rq1Z-?1x-hRaQ4h?30`5wW^CqL_ZhIPh$xfh%FScpkmhKuwpUk?W-kt7 zWHWXSV~W-6w@VCmWAS006xu$!JT<7nhMSYMo`Gpz%yPNSti}^Juy%!HX!OhMP0!rx zQc$~ON8bwBN-r6PhJY zYaCcFoYpZT$grr9hR{wh~?3#x!&dLR;}*%arV;T z?~`Zi9o+Rzb`ASEWi!Kx5|%;yoIb}lDu_SWvUt Date: Thu, 18 Jul 2024 15:48:15 +0200 Subject: [PATCH 15/17] Add reusable build CI --- .github/workflows/release-build.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 .github/workflows/release-build.yml diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml new file mode 100644 index 0000000..ca465e5 --- /dev/null +++ b/.github/workflows/release-build.yml @@ -0,0 +1,18 @@ +--- +name: Release build + +on: + workflow_dispatch: + push: + branches: + - main + - master + - develop + pull_request: + +jobs: + build: + name: Build application using the reusable workflow + uses: LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1 + with: + upload_app_binaries_artifact: "compiled_app_bindaries" From 77bef7dc2df59d74afcd5c507841458ebf19885c Mon Sep 17 00:00:00 2001 From: Francois Beutin Date: Mon, 22 Jul 2024 14:34:41 +0200 Subject: [PATCH 16/17] Fix compilation warnings --- src/handle_provide_parameter.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/handle_provide_parameter.c b/src/handle_provide_parameter.c index d626713..1b16929 100644 --- a/src/handle_provide_parameter.c +++ b/src/handle_provide_parameter.c @@ -296,13 +296,15 @@ static void handle_megaswap(ethPluginProvideParameter_t *msg, paraswap_parameter } context->next_param = PATHS_LEN; break; - case PATHS_LEN: - if (!U2BE_from_parameter(msg->parameter, &context->skip)) { + case PATHS_LEN: { + uint16_t skip; + if (!U2BE_from_parameter(msg->parameter, &skip)) { msg->result = ETH_PLUGIN_RESULT_ERROR; } + context->skip = (uint8_t) skip; context->skip--; // Decrease by one because we wish to acces path[-1]. context->next_param = PATH; - break; + } break; case PATH: context->checkpoint = msg->parameterOffset; if (!U2BE_from_parameter(msg->parameter, &context->offset)) { From 3b6c8e4feb6f3075fee77c5945bdffa0cf3c245e Mon Sep 17 00:00:00 2001 From: GuilaneDen <83951892+GuilaneDen@users.noreply.github.com> Date: Thu, 5 Dec 2024 11:38:03 +0100 Subject: [PATCH 17/17] Merge branch 'master' into develop --- tests/package.json | 13 -- tests/yarn.lock | 496 ++------------------------------------------- 2 files changed, 13 insertions(+), 496 deletions(-) diff --git a/tests/package.json b/tests/package.json index 058b8b9..39cb381 100644 --- a/tests/package.json +++ b/tests/package.json @@ -9,19 +9,6 @@ "author": "", "license": "ISC", "dependencies": { - "@babel/plugin-proposal-class-properties": "^7.12.1", - "@zondax/zemu": "^0.32.0", - "bignumber.js": "^9.0.0", - "bip32-path": "^0.4.2", - "core-js": "^3.7.0", - "ethereum-tx-decoder": "^3.0.0", - "ethers": "^5.4.7", - "fs-extra": "^10.0.0", - "google-protobuf": "^3.11.0", - "jest-serial-runner": "^1.1.0", - "js-sha256": "^0.9.0", - "regenerator-runtime": "^0.13.7", - "secp256k1": "^3.7.1", "@ledgerhq/hw-app-eth": "^6.27.1", "@ledgerhq/hw-transport-http": "^6.27.1", "@ledgerhq/logs": "^6.2.0", diff --git a/tests/yarn.lock b/tests/yarn.lock index bbf66f8..fa0d0c0 100644 --- a/tests/yarn.lock +++ b/tests/yarn.lock @@ -56,13 +56,6 @@ "@jridgewell/trace-mapping" "^0.3.25" jsesc "^3.0.2" -"@babel/helper-annotate-as-pure@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.25.9.tgz#d8eac4d2dc0d7b6e11fa6e535332e0d3184f06b4" - integrity sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g== - dependencies: - "@babel/types" "^7.25.9" - "@babel/helper-compilation-targets@^7.25.9": version "7.25.9" resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.25.9.tgz#55af025ce365be3cdc0c1c1e56c6af617ce88875" @@ -74,27 +67,6 @@ lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-create-class-features-plugin@^7.18.6": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.25.9.tgz#7644147706bb90ff613297d49ed5266bde729f83" - integrity sha512-UTZQMvt0d/rSz6KI+qdu7GQze5TIajwTS++GUozlw8VBJDEOAqSXwm1WvmYEZwqdqSGQshRocPDqrt4HBZB3fQ== - dependencies: - "@babel/helper-annotate-as-pure" "^7.25.9" - "@babel/helper-member-expression-to-functions" "^7.25.9" - "@babel/helper-optimise-call-expression" "^7.25.9" - "@babel/helper-replace-supers" "^7.25.9" - "@babel/helper-skip-transparent-expression-wrappers" "^7.25.9" - "@babel/traverse" "^7.25.9" - semver "^6.3.1" - -"@babel/helper-member-expression-to-functions@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.25.9.tgz#9dfffe46f727005a5ea29051ac835fb735e4c1a3" - integrity sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ== - dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - "@babel/helper-module-imports@^7.25.9": version "7.25.9" resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.25.9.tgz#e7f8d20602ebdbf9ebbea0a0751fb0f2a4141715" @@ -112,35 +84,11 @@ "@babel/helper-validator-identifier" "^7.25.9" "@babel/traverse" "^7.25.9" -"@babel/helper-optimise-call-expression@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.25.9.tgz#3324ae50bae7e2ab3c33f60c9a877b6a0146b54e" - integrity sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ== - dependencies: - "@babel/types" "^7.25.9" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.25.9", "@babel/helper-plugin-utils@^7.8.0": +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.25.9", "@babel/helper-plugin-utils@^7.8.0": version "7.25.9" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.25.9.tgz#9cbdd63a9443a2c92a725cca7ebca12cc8dd9f46" integrity sha512-kSMlyUVdWe25rEsRGviIgOWnoT/nfABVWlqt9N19/dIPWViAOW2s9wznP5tURbs/IDuNk4gPy3YdYRgH3uxhBw== -"@babel/helper-replace-supers@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.25.9.tgz#ba447224798c3da3f8713fc272b145e33da6a5c5" - integrity sha512-IiDqTOTBQy0sWyeXyGSC5TBJpGFXBkRynjBeXsvbhQFKj2viwJC76Epz35YLU1fpe/Am6Vppb7W7zM4fPQzLsQ== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.25.9" - "@babel/helper-optimise-call-expression" "^7.25.9" - "@babel/traverse" "^7.25.9" - -"@babel/helper-skip-transparent-expression-wrappers@^7.25.9": - version "7.25.9" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.25.9.tgz#0b2e1b62d560d6b1954893fd2b705dc17c91f0c9" - integrity sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA== - dependencies: - "@babel/traverse" "^7.25.9" - "@babel/types" "^7.25.9" - "@babel/helper-string-parser@^7.25.9": version "7.25.9" resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz#1aabb72ee72ed35789b4bbcad3ca2862ce614e8c" @@ -171,14 +119,6 @@ dependencies: "@babel/types" "^7.26.3" -"@babel/plugin-proposal-class-properties@^7.12.1": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3" - integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ== - dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.6" - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" @@ -298,13 +238,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.25.9" -"@babel/runtime@^7.15.4": - version "7.26.0" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.26.0.tgz#8600c2f595f277c60815256418b85356a65173c1" - integrity sha512-FDSOghenHTiToteC/QRlv2q3DhPZ/oOXTBoirfWNx1Cx3TMVcGWQtMMmQcSvb/JjpNeGzx8Pq/b4fKEJuWm1sw== - dependencies: - regenerator-runtime "^0.14.0" - "@babel/template@^7.25.9", "@babel/template@^7.3.3": version "7.25.9" resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.25.9.tgz#ecb62d81a8a6f5dc5fe8abfc3901fc52ddf15016" @@ -743,7 +676,7 @@ "@ethersproject/properties" "^5.7.0" "@ethersproject/strings" "^5.7.0" -"@grpc/grpc-js@^1.11.1", "@grpc/grpc-js@^1.5.5": +"@grpc/grpc-js@^1.11.1": version "1.12.4" resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.12.4.tgz#3208808435ebf1e495f9a5c5c5a0bc3dc8c9e891" integrity sha512-NBhrxEWnFh0FxeA0d//YP95lRFsSx2TNLEUQg4/W+5f/BMxcCjgOOIT24iD+ZB/tZw057j44DaIxja7w4XMrhg== @@ -751,17 +684,6 @@ "@grpc/proto-loader" "^0.7.13" "@js-sdsl/ordered-map" "^4.4.2" -"@grpc/proto-loader@^0.6.9": - version "0.6.13" - resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.6.13.tgz#008f989b72a40c60c96cd4088522f09b05ac66bc" - integrity sha512-FjxPYDRTn6Ec3V0arm1FtSpmP6V50wuph2yILpyvTKzjc76oDdoihXqM1DzOW5ubvCC8GivfCnNtfaRE8myJ7g== - dependencies: - "@types/long" "^4.0.1" - lodash.camelcase "^4.3.0" - long "^4.0.0" - protobufjs "^6.11.3" - yargs "^16.2.0" - "@grpc/proto-loader@^0.7.13": version "0.7.13" resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.7.13.tgz#f6a44b2b7c9f7b609f5748c6eac2d420e37670cf" @@ -1112,7 +1034,7 @@ bignumber.js "^9.1.2" semver "^7.3.5" -"@ledgerhq/hw-transport-http@^6.24.1", "@ledgerhq/hw-transport-http@^6.27.1", "@ledgerhq/hw-transport-http@^6.30.1": +"@ledgerhq/hw-transport-http@^6.27.1", "@ledgerhq/hw-transport-http@^6.30.1": version "6.30.4" resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport-http/-/hw-transport-http-6.30.4.tgz#5c9e07e5b7afe4165e2c9be09e7f2c550bd538bd" integrity sha512-1dF/mZQWsh9jms9gMOfl2VZHa12+j6qvBrztpDXwPh/IDsKnt4zq/ePwfS7tJrkO8c4rCTyA9TA/qrnNC1gWFw== @@ -1132,7 +1054,7 @@ "@ledgerhq/logs" "^6.12.0" rxjs "^7.8.1" -"@ledgerhq/hw-transport@^6.24.1", "@ledgerhq/hw-transport@^6.31.4": +"@ledgerhq/hw-transport@^6.31.4": version "6.31.4" resolved "https://registry.yarnpkg.com/@ledgerhq/hw-transport/-/hw-transport-6.31.4.tgz#9b23a6de4a4caaa5c24b149c2dea8adde46f0eb1" integrity sha512-6c1ir/cXWJm5dCWdq55NPgCJ3UuKuuxRvf//Xs36Bq9BwkV2YaRQhZITAkads83l07NAdR16hkTWqqpwFMaI6A== @@ -1365,11 +1287,6 @@ dependencies: "@types/node" "*" -"@types/long@^4.0.1": - version "4.0.2" - resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" - integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== - "@types/node@*", "@types/node@>=13.7.0": version "22.10.1" resolved "https://registry.yarnpkg.com/@types/node/-/node-22.10.1.tgz#41ffeee127b8975a05f8c4f83fb89bcb2987d766" @@ -1488,26 +1405,6 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== -"@zondax/zemu@^0.32.0": - version "0.32.0" - resolved "https://registry.yarnpkg.com/@zondax/zemu/-/zemu-0.32.0.tgz#733ae016c464d813721bcaef273c759bde3be4a9" - integrity sha512-xbcTu/G3bRz1ubf3fDjUtNnZTSnwv5MPFaKWpKQFGRp+iIS0FdPBFGLRtilN/JqsGiF2DebI9DFkFNFIV+Dh9g== - dependencies: - "@grpc/grpc-js" "^1.5.5" - "@grpc/proto-loader" "^0.6.9" - "@ledgerhq/hw-transport" "^6.24.1" - "@ledgerhq/hw-transport-http" "^6.24.1" - axios "^0.27.2" - axios-retry "^3.2.0" - dockerode "^3.3.1" - elfy "^1.0.0" - fs-extra "^10.0.0" - get-port "^5.1.1" - path "^0.12.7" - pngjs "^6.0.0" - randomstring "^1.2.1" - sleep "^6.3.0" - acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" @@ -1684,14 +1581,6 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -axios-retry@^3.2.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/axios-retry/-/axios-retry-3.9.1.tgz#c8924a8781c8e0a2c5244abf773deb7566b3830d" - integrity sha512-8PJDLJv7qTTMMwdnbMvrLYuvB47M81wRtxQmEdV5w4rgbTXTt+vtPkXwajOfOdSyv/wZICJOC+/UhXH4aQ/R+w== - dependencies: - "@babel/runtime" "^7.15.4" - is-retry-allowed "^2.2.0" - axios-retry@^4.4.1: version "4.5.0" resolved "https://registry.yarnpkg.com/axios-retry/-/axios-retry-4.5.0.tgz#441fdc32cedf63d6abd5de5d53db3667afd4c39b" @@ -1708,14 +1597,6 @@ axios@1.7.7: form-data "^4.0.0" proxy-from-env "^1.1.0" -axios@^0.27.2: - version "0.27.2" - resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972" - integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== - dependencies: - follow-redirects "^1.14.9" - form-data "^4.0.0" - axios@^1.7.2: version "1.7.9" resolved "https://registry.yarnpkg.com/axios/-/axios-1.7.9.tgz#d7d071380c132a24accda1b2cfc1535b79ec650a" @@ -1810,30 +1691,11 @@ bech32@1.1.4: resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== -bignumber.js@^9.0.0, bignumber.js@^9.1.2: +bignumber.js@^9.1.2: version "9.1.2" resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c" integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug== -bindings@^1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" - integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== - dependencies: - file-uri-to-path "1.0.0" - -bip32-path@^0.4.2: - version "0.4.2" - resolved "https://registry.yarnpkg.com/bip32-path/-/bip32-path-0.4.2.tgz#5db0416ad6822712f077836e2557b8697c0c7c99" - integrity sha512-ZBMCELjJfcNMkz5bDuJ1WrYvjlhEF5k6mQ8vUr4N7MbVRsXei7ZOg8VhhwMfNiW68NWmLkgkc6WvTickrLGprQ== - -bip66@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/bip66/-/bip66-1.1.5.tgz#01fa8748785ca70955d5011217d1b3139969ca22" - integrity sha512-nemMHz95EmS38a26XbbdxIYj5csHd3RMP3H5bwQknX0WYHF01qhpufP42mLOwVICuH2JmhIhXiWs89MfUGL7Xw== - dependencies: - safe-buffer "^5.0.1" - bl@^4.0.3: version "4.1.0" resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" @@ -1848,7 +1710,7 @@ blakejs@^1.1.1: resolved "https://registry.yarnpkg.com/blakejs/-/blakejs-1.2.1.tgz#5057e4206eadb4a97f7c0b6e197a505042fc3814" integrity sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ== -bn.js@^4.11.8, bn.js@^4.11.9: +bn.js@^4.11.9: version "4.12.1" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.1.tgz#215741fe3c9dba2d7e12c001d0cfdbae43975ba7" integrity sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg== @@ -1885,18 +1747,6 @@ brorand@^1.1.0: resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== -browserify-aes@^1.0.6: - version "1.2.0" - resolved "https://registry.yarnpkg.com/browserify-aes/-/browserify-aes-1.2.0.tgz#326734642f403dabc3003209853bb70ad428ef48" - integrity sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA== - dependencies: - buffer-xor "^1.0.3" - cipher-base "^1.0.0" - create-hash "^1.1.0" - evp_bytestokey "^1.0.3" - inherits "^2.0.1" - safe-buffer "^5.0.1" - browserslist@^4.24.0: version "4.24.2" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" @@ -1926,11 +1776,6 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== -buffer-xor@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/buffer-xor/-/buffer-xor-1.0.3.tgz#26e61ed1422fb70dd42e6e36729ed51d855fe8d9" - integrity sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ== - buffer@^5.5.0: version "5.7.1" resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" @@ -1998,28 +1843,11 @@ ci-info@^3.2.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== -cipher-base@^1.0.0, cipher-base@^1.0.1, cipher-base@^1.0.3: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cipher-base/-/cipher-base-1.0.6.tgz#8fe672437d01cd6c4561af5334e0cc50ff1955f7" - integrity sha512-3Ek9H3X6pj5TgenXYtNWdaBon1tgYCaebd+XPg0keyjEbEfkD4KkmAxkQ/i1vYvxdcT5nscLBfq9VJRmCBcFSw== - dependencies: - inherits "^2.0.4" - safe-buffer "^5.2.1" - cjs-module-lexer@^1.0.0: version "1.4.1" resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.4.1.tgz#707413784dbb3a72aa11c2f2b042a0bef4004170" integrity sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA== -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - cliui@^8.0.1: version "8.0.1" resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" @@ -2068,11 +1896,6 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -core-js@^3.7.0: - version "3.39.0" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.39.0.tgz#57f7647f4d2d030c32a72ea23a0555b2eaa30f83" - integrity sha512-raM0ew0/jJUqkJ0E6e8UDtl+y/7ktFivgWvqw8dNSQeNWoSDLvQ1H/RN3aPXB9tBd4/FhyR4RDPGhsNIMsAn7g== - cpu-features@~0.0.10: version "0.0.10" resolved "https://registry.yarnpkg.com/cpu-features/-/cpu-features-0.0.10.tgz#9aae536db2710c7254d7ed67cb3cbc7d29ad79c5" @@ -2081,29 +1904,6 @@ cpu-features@~0.0.10: buildcheck "~0.0.6" nan "^2.19.0" -create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" - integrity sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg== - dependencies: - cipher-base "^1.0.1" - inherits "^2.0.1" - md5.js "^1.3.4" - ripemd160 "^2.0.1" - sha.js "^2.4.0" - -create-hmac@^1.1.4: - version "1.1.7" - resolved "https://registry.yarnpkg.com/create-hmac/-/create-hmac-1.1.7.tgz#69170c78b3ab957147b2b8b04572e47ead2243ff" - integrity sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg== - dependencies: - cipher-base "^1.0.3" - create-hash "^1.1.0" - inherits "^2.0.1" - ripemd160 "^2.0.0" - safe-buffer "^5.0.1" - sha.js "^2.4.8" - create-jest@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" @@ -2237,16 +2037,6 @@ dir-glob@^3.0.1: dependencies: path-type "^4.0.0" -docker-modem@^3.0.0: - version "3.0.8" - resolved "https://registry.yarnpkg.com/docker-modem/-/docker-modem-3.0.8.tgz#ef62c8bdff6e8a7d12f0160988c295ea8705e77a" - integrity sha512-f0ReSURdM3pcKPNS30mxOHSbaFLcknGmQjwSfmbcdOw1XWKXVhukM3NJHhr7NpY9BIyyWQb0EBo3KQvvuU5egQ== - dependencies: - debug "^4.1.1" - readable-stream "^3.5.0" - split-ca "^1.0.1" - ssh2 "^1.11.0" - docker-modem@^5.0.3: version "5.0.3" resolved "https://registry.yarnpkg.com/docker-modem/-/docker-modem-5.0.3.tgz#50c06f11285289f58112b5c4c4d89824541c41d0" @@ -2257,15 +2047,6 @@ docker-modem@^5.0.3: split-ca "^1.0.1" ssh2 "^1.15.0" -dockerode@^3.3.1: - version "3.3.5" - resolved "https://registry.yarnpkg.com/dockerode/-/dockerode-3.3.5.tgz#7ae3f40f2bec53ae5e9a741ce655fff459745629" - integrity sha512-/0YNa3ZDNeLr/tSckmD69+Gq+qVNhvKfAHNeZJBnp7EOP6RGKV8ORrJHkUn20So5wU+xxT7+1n5u8PjHbfjbSA== - dependencies: - "@balena/dockerignore" "^1.0.2" - docker-modem "^3.0.0" - tar-fs "~2.0.1" - dockerode@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/dockerode/-/dockerode-4.0.2.tgz#dedc8529a1db3ac46d186f5912389899bc309f7d" @@ -2289,15 +2070,6 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -drbg.js@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/drbg.js/-/drbg.js-1.0.1.tgz#3e36b6c42b37043823cdbc332d58f31e2445480b" - integrity sha512-F4wZ06PvqxYLFEZKkFxTDcns9oFNk34hvmJSEwdzsxVQ8YI5YaxtACgQatkYgv2VI2CFkUd2Y+xosPQnHv809g== - dependencies: - browserify-aes "^1.0.6" - create-hash "^1.1.2" - create-hmac "^1.1.4" - ed25519-supercop@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/ed25519-supercop/-/ed25519-supercop-2.0.1.tgz#5b317dec9b17a0ff2c303d2a5b600983f9df1806" @@ -2345,19 +2117,6 @@ elliptic@6.5.4: minimalistic-assert "^1.0.1" minimalistic-crypto-utils "^1.0.1" -elliptic@^6.5.7: - version "6.6.1" - resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.6.1.tgz#3b8ffb02670bf69e382c7f65bf524c97c5405c06" - integrity sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g== - dependencies: - bn.js "^4.11.9" - brorand "^1.1.0" - hash.js "^1.0.0" - hmac-drbg "^1.0.1" - inherits "^2.0.4" - minimalistic-assert "^1.0.1" - minimalistic-crypto-utils "^1.0.1" - emittery@^0.13.1: version "0.13.1" resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" @@ -2666,29 +2425,7 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== -ethereum-tx-decoder@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ethereum-tx-decoder/-/ethereum-tx-decoder-3.0.0.tgz#7ef704c1b7e228128cdb81d6a3d2ab57a378b90f" - integrity sha512-l+/K/CNAobJjfGs6lO4RrR17KQrwESrGH2GrkASn7MH2FAJRkItFP21Iy2fCOUjy1Y1nBVoTO6w1GPCgVQH2hg== - dependencies: - ethers "^4.0.37" - -ethers@^4.0.37: - version "4.0.49" - resolved "https://registry.yarnpkg.com/ethers/-/ethers-4.0.49.tgz#0eb0e9161a0c8b4761be547396bbe2fb121a8894" - integrity sha512-kPltTvWiyu+OktYy1IStSO16i2e7cS9D9OxZ81q2UUaiNPVrm/RTcbxamCXF9VUSKzJIdJV68EAIhTEVBalRWg== - dependencies: - aes-js "3.0.0" - bn.js "^4.11.9" - elliptic "6.5.4" - hash.js "1.1.3" - js-sha3 "0.5.7" - scrypt-js "2.0.4" - setimmediate "1.0.4" - uuid "2.0.1" - xmlhttprequest "1.8.0" - -ethers@^5.4.7: +ethers@^5.6.3: version "5.7.2" resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== @@ -2729,14 +2466,6 @@ events@^3.3.0: resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== -evp_bytestokey@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" - integrity sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA== - dependencies: - md5.js "^1.3.4" - safe-buffer "^5.1.1" - execa@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" @@ -2820,11 +2549,6 @@ file-entry-cache@^6.0.1: dependencies: flat-cache "^3.0.4" -file-uri-to-path@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" - integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== - filelist@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.4.tgz#f78978a1e944775ff9e62e744424f215e58352b5" @@ -2869,7 +2593,7 @@ flatted@^3.2.9: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.3.2.tgz#adba1448a9841bec72b42c532ea23dbbedef1a27" integrity sha512-AiwGJM8YcNOaobumgtng+6NHuOqC3A7MixFeDafM3X9cIUM+xUXoS5Vfgf+OihAYe20fxqNM9yPBXJzRtZ/4eA== -follow-redirects@^1.14.9, follow-redirects@^1.15.6: +follow-redirects@^1.15.6: version "1.15.9" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== @@ -2895,15 +2619,6 @@ fs-constants@^1.0.0: resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad" integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow== -fs-extra@^10.0.0: - version "10.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf" - integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ== - dependencies: - graceful-fs "^4.2.0" - jsonfile "^6.0.1" - universalify "^2.0.0" - fs-extra@^11.2.0: version "11.2.0" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.2.0.tgz#e70e17dfad64232287d01929399e0ea7c86b0e5b" @@ -3046,11 +2761,6 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" -google-protobuf@^3.11.0: - version "3.21.4" - resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.21.4.tgz#2f933e8b6e5e9f8edde66b7be0024b68f77da6c9" - integrity sha512-MnG7N936zcKTco4Jd2PX2U96Kf9PxygAPKBug+74LHzmHXmceN16MmRcdgZv+DGef/S9YvQAfRsNCn4cjf9yyQ== - gopd@^1.0.1, gopd@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" @@ -3102,23 +2812,6 @@ has-tostringtag@^1.0.0, has-tostringtag@^1.0.2: dependencies: has-symbols "^1.0.3" -hash-base@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/hash-base/-/hash-base-3.1.0.tgz#55c381d9e06e1d2997a883b4a3fddfe7f0d3af33" - integrity sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA== - dependencies: - inherits "^2.0.4" - readable-stream "^3.6.0" - safe-buffer "^5.2.0" - -hash.js@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.3.tgz#340dedbe6290187151c1ea1d777a3448935df846" - integrity sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA== - dependencies: - inherits "^2.0.3" - minimalistic-assert "^1.0.0" - hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" @@ -3192,16 +2885,11 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4: +inherits@2, inherits@^2.0.3, inherits@^2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw== - internal-slot@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.7.tgz#c06dcca3ed874249881007b0a5523b172a190802" @@ -3759,11 +3447,6 @@ jest-runtime@^29.7.0: slash "^3.0.0" strip-bom "^4.0.0" -jest-serial-runner@^1.1.0: - version "1.2.1" - resolved "https://registry.yarnpkg.com/jest-serial-runner/-/jest-serial-runner-1.2.1.tgz#0f5f8dbe6f077119bd1fdd7e8518f92353c194d5" - integrity sha512-d59fF+7HdjNvQEL7B4WyFE+f8q5tGzlNUqtOnxTrT1ofun7O6/Lgm/j255BBgCY2fmSue/34M7Xy9+VWRByP0Q== - jest-snapshot@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.7.0.tgz#c2c574c3f51865da1bb329036778a69bf88a6be5" @@ -3848,16 +3531,6 @@ jest@^29.5.0: import-local "^3.0.2" jest-cli "^29.7.0" -js-sha256@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966" - integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA== - -js-sha3@0.5.7: - version "0.5.7" - resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" - integrity sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g== - js-sha3@0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" @@ -4002,11 +3675,6 @@ lodash.merge@^4.6.2: resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -long@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" - integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== - long@^5.0.0: version "5.2.3" resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" @@ -4045,15 +3713,6 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" -md5.js@^1.3.4: - version "1.3.5" - resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" - integrity sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - safe-buffer "^5.1.2" - merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -4128,7 +3787,7 @@ ms@^2.1.1, ms@^2.1.3: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -nan@^2.14.0, nan@^2.14.1, nan@^2.19.0, nan@^2.20.0: +nan@^2.19.0, nan@^2.20.0: version "2.22.0" resolved "https://registry.yarnpkg.com/nan/-/nan-2.22.0.tgz#31bc433fc33213c97bad36404bb68063de604de3" integrity sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw== @@ -4329,14 +3988,6 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -path@^0.12.7: - version "0.12.7" - resolved "https://registry.yarnpkg.com/path/-/path-0.12.7.tgz#d4dc2a506c4ce2197eb481ebfcd5b36c0140b10f" - integrity sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q== - dependencies: - process "^0.11.1" - util "^0.10.3" - picocolors@^1.0.0, picocolors@^1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" @@ -4359,11 +4010,6 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" -pngjs@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-6.0.0.tgz#ca9e5d2aa48db0228a52c419c3308e87720da821" - integrity sha512-TRzzuFRRmEoSW/p1KVAmiOgPco2Irlah+bGFCeNfJXxxYGwSw7YwAOAcd7X28K/m5bjBWKsC29KyoMfHbypayg== - pngjs@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-7.0.0.tgz#a8b7446020ebbc6ac739db6c5415a65d17090e26" @@ -4400,11 +4046,6 @@ pretty-format@^29.0.0, pretty-format@^29.7.0: ansi-styles "^5.0.0" react-is "^18.0.0" -process@^0.11.1: - version "0.11.10" - resolved "https://registry.yarnpkg.com/process/-/process-0.11.10.tgz#7332300e840161bda3e69a1d1d91a7d4bc16f182" - integrity sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A== - prompts@^2.0.1: version "2.4.2" resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" @@ -4413,25 +4054,6 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -protobufjs@^6.11.3: - version "6.11.4" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.4.tgz#29a412c38bf70d89e537b6d02d904a6f448173aa" - integrity sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw== - dependencies: - "@protobufjs/aspromise" "^1.1.2" - "@protobufjs/base64" "^1.1.2" - "@protobufjs/codegen" "^2.0.4" - "@protobufjs/eventemitter" "^1.1.0" - "@protobufjs/fetch" "^1.1.0" - "@protobufjs/float" "^1.0.2" - "@protobufjs/inquire" "^1.1.0" - "@protobufjs/path" "^1.1.2" - "@protobufjs/pool" "^1.1.0" - "@protobufjs/utf8" "^1.1.0" - "@types/long" "^4.0.1" - "@types/node" ">=13.7.0" - long "^4.0.0" - protobufjs@^7.2.5: version "7.4.0" resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.4.0.tgz#7efe324ce9b3b61c82aae5de810d287bc08a248a" @@ -4483,7 +4105,7 @@ randombytes@2.0.3: resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.0.3.tgz#674c99760901c3c4112771a31e521dc349cc09ec" integrity sha512-lDVjxQQFoCG1jcrP06LNo2lbWp4QTShEXnhActFBwYuHprllQV6VUpwreApsYqCgD+N1mHoqJ/BI/4eV4R2GYg== -randomstring@^1.2.1, randomstring@^1.3.0: +randomstring@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/randomstring/-/randomstring-1.3.0.tgz#1bf9d730066899e70aee3285573f84708278683d" integrity sha512-gY7aQ4i1BgwZ8I1Op4YseITAyiDiajeZOPQUbIq9TPGPhUm5FX59izIaOpmKbME1nmnEiABf28d9K2VSii6BBg== @@ -4532,16 +4154,6 @@ reflect.getprototypeof@^1.0.6: gopd "^1.0.1" which-builtin-type "^1.1.4" -regenerator-runtime@^0.13.7: - version "0.13.11" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" - integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== - -regenerator-runtime@^0.14.0: - version "0.14.1" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz#356ade10263f685dda125100cd862c1db895327f" - integrity sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw== - regexp.prototype.flags@^1.5.3: version "1.5.3" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.3.tgz#b3ae40b1d2499b8350ab2c3fe6ef3845d3a96f42" @@ -4600,14 +4212,6 @@ rimraf@^3.0.2: dependencies: glob "^7.1.3" -ripemd160@^2.0.0, ripemd160@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" - integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA== - dependencies: - hash-base "^3.0.0" - inherits "^2.0.1" - run-parallel@^1.1.9: version "1.2.0" resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" @@ -4632,7 +4236,7 @@ safe-array-concat@^1.1.2: has-symbols "^1.0.3" isarray "^2.0.5" -safe-buffer@^5.0.1, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: +safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -4658,30 +4262,11 @@ scheduler@^0.23.2: dependencies: loose-envify "^1.1.0" -scrypt-js@2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-2.0.4.tgz#32f8c5149f0797672e551c07e230f834b6af5f16" - integrity sha512-4KsaGcPnuhtCZQCxFxN3GVYIhKFPTdLd8PLC552XwbMndtD0cjRFAhDuuydXQ0h08ZfPgzqe6EKHozpuH74iDw== - scrypt-js@3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" integrity sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA== -secp256k1@^3.7.1: - version "3.8.1" - resolved "https://registry.yarnpkg.com/secp256k1/-/secp256k1-3.8.1.tgz#b62a62a882d6b16f9b51fe599c6b3a861e36c59f" - integrity sha512-tArjQw2P0RTdY7QmkNehgp6TVvQXq6ulIhxv8gaH6YubKG/wxxAoNKcbuXjDhybbc+b2Ihc7e0xxiGN744UIiQ== - dependencies: - bindings "^1.5.0" - bip66 "^1.1.5" - bn.js "^4.11.8" - create-hash "^1.2.0" - drbg.js "^1.0.1" - elliptic "^6.5.7" - nan "^2.14.0" - safe-buffer "^5.1.2" - semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" @@ -4714,19 +4299,6 @@ set-function-name@^2.0.2: functions-have-names "^1.2.3" has-property-descriptors "^1.0.2" -setimmediate@1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.4.tgz#20e81de622d4a02588ce0c8da8973cbcf1d3138f" - integrity sha512-/TjEmXQVEzdod/FFskf3o7oOAsGhHf2j1dZqRFbDzq4F3mvvxflIIi4Hd3bLQE9y/CpwqfSQam5JakI/mi3Pog== - -sha.js@^2.4.0, sha.js@^2.4.8: - version "2.4.11" - resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" - integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ== - dependencies: - inherits "^2.0.1" - safe-buffer "^5.0.1" - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -4764,13 +4336,6 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== -sleep@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/sleep/-/sleep-6.3.0.tgz#c524e0e6d8d2e45d3f14e0ba5650fbe45f2ae876" - integrity sha512-+WgYl951qdUlb1iS97UvQ01pkauoBK9ML9I/CMPg41v0Ze4EyMlTgFTDDo32iYj98IYqxIjDMRd+L71lawFfpQ== - dependencies: - nan "^2.14.1" - source-map-support@0.5.13: version "0.5.13" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" @@ -4794,7 +4359,7 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== -ssh2@^1.11.0, ssh2@^1.15.0: +ssh2@^1.15.0: version "1.16.0" resolved "https://registry.yarnpkg.com/ssh2/-/ssh2-1.16.0.tgz#79221d40cbf4d03d07fe881149de0a9de928c9f0" integrity sha512-r1X4KsBGedJqo7h8F5c4Ybpcr5RjyP+aWIG007uBPRjmdQWfEiVLzSK71Zji1B9sKxwaCvD8y8cwSkYrlLiRRg== @@ -5135,23 +4700,11 @@ util-deprecate@^1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== -util@^0.10.3: - version "0.10.4" - resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901" - integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A== - dependencies: - inherits "2.0.3" - utility-types@^3.10.0: version "3.11.0" resolved "https://registry.yarnpkg.com/utility-types/-/utility-types-3.11.0.tgz#607c40edb4f258915e901ea7995607fdf319424c" integrity sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw== -uuid@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-2.0.1.tgz#c2a30dedb3e535d72ccf82e343941a50ba8533ac" - integrity sha512-nWg9+Oa3qD2CQzHIP4qKUqwNfzKn8P0LtFhotaCTFchsV7ZfDhAybeip/HZVeMIpZi9JgY1E3nUlwaCmZT1sEg== - v8-compile-cache-lib@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" @@ -5268,11 +4821,6 @@ ws@^7.5.2: resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== -xmlhttprequest@1.8.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz#67fe075c5c24fef39f9d65f5f7b7fe75171968fc" - integrity sha512-58Im/U0mlVBLM38NdZjHyhuMtCqa61469k2YP/AaPbvCoV9aQGUpbJBj1QRm2ytRiVQBD/fsw7L2bJGDVQswBA== - y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" @@ -5283,29 +4831,11 @@ yallist@^3.0.2: resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== -yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== -yargs@^16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - yargs@^17.3.1, yargs@^17.7.2: version "17.7.2" resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269"