-
Notifications
You must be signed in to change notification settings - Fork 9
feat(legacy): misc features add #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
WalkthroughAdds Gnosis Safe EIP-712 messages and UI/flow for SafeTx; refactors on-device passphrase input and layout input; collapses multiple EVM token lists to a minimal schema; adds approver registry, button combo detection, new i18n keys/translations, layout/UI helpers, and bumps firmware version to 3.15.0. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Device
participant Signer as Signing Logic
participant Safe as SafeTx Handler
participant UI as Display/UI
User->>Device: Submit Ethereum payload
Device->>Signer: ethereum_signing_init_onekey()
Signer->>Signer: detect_contract_action()
alt SafeTx detected
Signer->>Safe: is_safe_tx() true
Safe->>Safe: compute domain & message hashes
Safe->>UI: layoutTransactionSafeApproveHash() / layoutSafeTx()
UI->>User: Show multi-page SafeTx details (to, value, data, gas, nonce)
User->>UI: Confirm/Reject
UI->>Signer: Result
else Standard tx / ERC20 / NFT
Signer->>UI: layoutEthereumConfirmTx()
UI->>User: Show standard tx details
User->>UI: Confirm/Reject
UI->>Signer: Result
end
Signer->>Device: Sign or abort transaction
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 19
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (33)
common/defs/evm_tokens/1.json(1 hunks)common/defs/evm_tokens/137.json(1 hunks)common/defs/evm_tokens/42161.json(1 hunks)common/defs/evm_tokens/56.json(1 hunks)common/defs/evm_tokens/8453.json(1 hunks)common/protob/messages-ethereum-eip712-onekey.proto(1 hunks)common/protob/messages.proto(1 hunks)legacy/buttons.c(1 hunks)legacy/buttons.h(2 hunks)legacy/firmware/cosmos_networks.c(1 hunks)legacy/firmware/ethereum.c(1 hunks)legacy/firmware/ethereum_approveres.h(1 hunks)legacy/firmware/ethereum_onekey.c(17 hunks)legacy/firmware/ethereum_typed_data.h(5 hunks)legacy/firmware/i18n/i18n.h(1 hunks)legacy/firmware/i18n/keys.h(3 hunks)legacy/firmware/i18n/locales/de.inc(1 hunks)legacy/firmware/i18n/locales/en.inc(2 hunks)legacy/firmware/i18n/locales/es.inc(3 hunks)legacy/firmware/i18n/locales/ja.inc(3 hunks)legacy/firmware/i18n/locales/ko_kr.inc(2 hunks)legacy/firmware/i18n/locales/pt_br.inc(1 hunks)legacy/firmware/i18n/locales/zh_cn.inc(1 hunks)legacy/firmware/i18n/locales/zh_tw.inc(1 hunks)legacy/firmware/layout2.c(7 hunks)legacy/firmware/layout2.h(1 hunks)legacy/firmware/menu_list.c(1 hunks)legacy/firmware/messages.c(1 hunks)legacy/firmware/protect.c(2 hunks)legacy/firmware/protect.h(1 hunks)legacy/firmware/protob/messages-ethereum-eip712-onekey.options(1 hunks)legacy/firmware/version.h(1 hunks)vendor/libsol(1 hunks)
🧰 Additional context used
🪛 Buf (1.59.0)
common/protob/messages-ethereum-eip712-onekey.proto
112-112: Field named "to" should not be required.
(FIELD_NOT_REQUIRED)
113-113: Field named "value" should not be required.
(FIELD_NOT_REQUIRED)
115-115: Field named "operation" should not be required.
(FIELD_NOT_REQUIRED)
116-116: Field name "safeTxGas" should be lower_snake_case, such as "safe_tx_gas".
(FIELD_LOWER_SNAKE_CASE)
116-116: Field named "safeTxGas" should not be required.
(FIELD_NOT_REQUIRED)
117-117: Field name "baseGas" should be lower_snake_case, such as "base_gas".
(FIELD_LOWER_SNAKE_CASE)
117-117: Field named "baseGas" should not be required.
(FIELD_NOT_REQUIRED)
118-118: Field name "gasPrice" should be lower_snake_case, such as "gas_price".
(FIELD_LOWER_SNAKE_CASE)
118-118: Field named "gasPrice" should not be required.
(FIELD_NOT_REQUIRED)
119-119: Field name "gasToken" should be lower_snake_case, such as "gas_token".
(FIELD_LOWER_SNAKE_CASE)
119-119: Field named "gasToken" should not be required.
(FIELD_NOT_REQUIRED)
120-120: Field name "refundReceiver" should be lower_snake_case, such as "refund_receiver".
(FIELD_LOWER_SNAKE_CASE)
120-120: Field named "refundReceiver" should not be required.
(FIELD_NOT_REQUIRED)
121-121: Field named "nonce" should not be required.
(FIELD_NOT_REQUIRED)
122-122: Field named "chain_id" should not be required.
(FIELD_NOT_REQUIRED)
123-123: Field name "verifyingContract" should be lower_snake_case, such as "verifying_contract".
(FIELD_LOWER_SNAKE_CASE)
123-123: Field named "verifyingContract" should not be required.
(FIELD_NOT_REQUIRED)
common/protob/messages.proto
232-232: Enum value name "MessageType_EthereumGnosisSafeTxAck" should be UPPER_SNAKE_CASE, such as "MESSAGE_TYPE_ETHEREUM_GNOSIS_SAFE_TX_ACK".
(ENUM_VALUE_UPPER_SNAKE_CASE)
233-233: Enum value name "MessageType_EthereumGnosisSafeTxRequest" should be UPPER_SNAKE_CASE, such as "MESSAGE_TYPE_ETHEREUM_GNOSIS_SAFE_TX_REQUEST".
(ENUM_VALUE_UPPER_SNAKE_CASE)
🪛 Clang (14.0.6)
legacy/firmware/protect.c
[warning] 1804-1804: parameter 'input_type' is unused
(misc-unused-parameters)
[warning] 1819-1819: parameter 'input_type' is unused
(misc-unused-parameters)
[warning] 1834-1834: parameter 'input_type' is unused
(misc-unused-parameters)
[warning] 1834-1834: 2 adjacent parameters of 'navigateUp' of similar type ('int *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 1834-1834: the first parameter in the range is 'current_char'
(clang)
[note] 1835-1835: the last parameter in the range is 'symbol_index'
(clang)
[warning] 1834-1834: parameter 'current_char' is unused
(misc-unused-parameters)
[warning] 1835-1835: parameter 'symbol_index' is unused
(misc-unused-parameters)
[warning] 1835-1835: 2 adjacent parameters of 'navigateUp' of similar type ('int') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 1835-1835: the first parameter in the range is 'allow_empty'
(clang)
[note] 1836-1836: the last parameter in the range is 'counter'
(clang)
[warning] 1835-1835: parameter 'allow_empty' is unused
(misc-unused-parameters)
[warning] 1836-1836: parameter 'counter' is unused
(misc-unused-parameters)
[warning] 1839-1839: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 1844-1844: end of the original
(clang)
[note] 1844-1844: clone 1 starts here
(clang)
[warning] 1850-1850: if with identical then and else branches
(bugprone-branch-clone)
[note] 1853-1853: else branch starts here
(clang)
[warning] 1859-1859: parameter 'input_type' is unused
(misc-unused-parameters)
[warning] 1859-1859: 2 adjacent parameters of 'navigateDown' of similar type ('int *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 1859-1859: the first parameter in the range is 'current_char'
(clang)
[note] 1860-1860: the last parameter in the range is 'symbol_index'
(clang)
[warning] 1859-1859: parameter 'current_char' is unused
(misc-unused-parameters)
[warning] 1860-1860: parameter 'symbol_index' is unused
(misc-unused-parameters)
[warning] 1860-1860: 2 adjacent parameters of 'navigateDown' of similar type ('int') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 1860-1860: the first parameter in the range is 'allow_empty'
(clang)
[note] 1861-1861: the last parameter in the range is 'counter'
(clang)
[warning] 1860-1860: parameter 'allow_empty' is unused
(misc-unused-parameters)
[warning] 1861-1861: parameter 'counter' is unused
(misc-unused-parameters)
[warning] 1865-1865: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 1870-1870: end of the original
(clang)
[note] 1870-1870: clone 1 starts here
(clang)
[warning] 1876-1876: if with identical then and else branches
(bugprone-branch-clone)
[note] 1879-1879: else branch starts here
(clang)
[warning] 1885-1885: parameter 'last_char' is unused
(misc-unused-parameters)
[warning] 1885-1885: 3 adjacent parameters of 'restoreFromLastChar' of similar type ('int *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 1885-1885: the first parameter in the range is 'input_type'
(clang)
[note] 1886-1886: the last parameter in the range is 'symbol_index'
(clang)
[warning] 1885-1885: parameter 'input_type' is unused
(misc-unused-parameters)
[warning] 1886-1886: parameter 'current_char' is unused
(misc-unused-parameters)
[warning] 1886-1886: parameter 'symbol_index' is unused
(misc-unused-parameters)
[warning] 1887-1887: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 1889-1889: end of the original
(clang)
[note] 1889-1889: clone 1 starts here
(clang)
[note] 1891-1891: clone 2 starts here
(clang)
[note] 1893-1893: clone 3 starts here
(clang)
[warning] 1906-1906: declaration uses identifier '_inputPassphraseOnDevice', which is reserved in the global namespace
(bugprone-reserved-identifier)
[warning] 1906-1906: function '_inputPassphraseOnDevice' has cognitive complexity of 45 (threshold 25)
(readability-function-cognitive-complexity)
[note] 1921-1921: +1, including nesting penalty of 0, nesting level increased to 1
(clang)
[note] 1925-1925: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 1925-1925: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 1928-1928: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 1931-1931: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 1941-1941: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 1942-1942: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 1944-1944: +1, nesting level increased to 3
(clang)
[note] 1950-1950: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 1951-1951: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 1953-1953: +1, nesting level increased to 3
(clang)
[note] 1959-1959: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 1971-1971: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 1977-1977: +1, nesting level increased to 3
(clang)
[note] 1979-1979: +1
(clang)
[note] 1984-1984: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 1987-1987: +1
(clang)
[note] 1990-1990: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 1992-1992: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 1995-1995: +1
(clang)
[note] 2000-2000: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[warning] 1906-1906: parameter 'allow_empty' is unused
(misc-unused-parameters)
[warning] 1935-1935: 200 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1942-1942: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 1944-1944: end of the original
(clang)
[note] 1944-1944: clone 1 starts here
(clang)
[warning] 1947-1947: 75 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1951-1951: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 1953-1953: end of the original
(clang)
[note] 1953-1953: clone 1 starts here
(clang)
[warning] 2024-2024: switch has 7 consecutive identical branches
(bugprone-branch-clone)
[note] 2048-2048: last of these clones ends here
(clang)
[warning] 2061-2061: parameter 'allow_empty' is unused
(misc-unused-parameters)
legacy/firmware/ethereum.c
[note] 451-451: +1, nesting level increased to 2
(clang)
[note] 451-451: else branch starts here
(clang)
legacy/firmware/ethereum_approveres.h
[error] 3-3: 'stdbool.h' file not found
(clang-diagnostic-error)
legacy/firmware/ethereum_typed_data.h
[warning] 39-39: narrowing conversion from constant value 231 (0x000000E7) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 39-39: narrowing conversion from constant value 149 (0x00000095) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 39-39: narrowing conversion from constant value 162 (0x000000A2) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 39-39: narrowing conversion from constant value 149 (0x00000095) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 39-39: narrowing conversion from constant value 139 (0x0000008B) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 39-39: narrowing conversion from constant value 137 (0x00000089) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 40-40: narrowing conversion from constant value 133 (0x00000085) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 40-40: narrowing conversion from constant value 163 (0x000000A3) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 40-40: narrowing conversion from constant value 217 (0x000000D9) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 40-40: narrowing conversion from constant value 234 (0x000000EA) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 40-40: narrowing conversion from constant value 159 (0x0000009F) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 40-40: narrowing conversion from constant value 168 (0x000000A8) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 40-40: narrowing conversion from constant value 197 (0x000000C5) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 41-41: narrowing conversion from constant value 243 (0x000000F3) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 41-41: narrowing conversion from constant value 216 (0x000000D8) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 41-41: narrowing conversion from constant value 175 (0x000000AF) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 41-41: narrowing conversion from constant value 185 (0x000000B9) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 41-41: narrowing conversion from constant value 146 (0x00000092) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 49-49: narrowing conversion from constant value 187 (0x000000BB) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 49-49: narrowing conversion from constant value 131 (0x00000083) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 49-49: narrowing conversion from constant value 212 (0x000000D4) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 49-49: narrowing conversion from constant value 134 (0x00000086) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 49-49: narrowing conversion from constant value 141 (0x0000008D) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 49-49: narrowing conversion from constant value 182 (0x000000B6) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 50-50: narrowing conversion from constant value 189 (0x000000BD) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 50-50: narrowing conversion from constant value 132 (0x00000084) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 50-50: narrowing conversion from constant value 148 (0x00000094) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 50-50: narrowing conversion from constant value 253 (0x000000FD) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 50-50: narrowing conversion from constant value 215 (0x000000D7) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 51-51: narrowing conversion from constant value 213 (0x000000D5) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 52-52: narrowing conversion from constant value 173 (0x000000AD) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 52-52: narrowing conversion from constant value 254 (0x000000FE) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 52-52: narrowing conversion from constant value 148 (0x00000094) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 52-52: narrowing conversion from constant value 134 (0x00000086) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 52-52: narrowing conversion from constant value 216 (0x000000D8) of type 'int' to signed type 'char' is implementation-defined
(bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions)
[warning] 1104-1104: parameter 'is_delegate_call' is unused
(misc-unused-parameters)
[warning] 1104-1104: 3 adjacent parameters of 'layoutSafeTx' of similar type ('const int *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 1104-1104: the first parameter in the range is 'domain_hash'
(clang)
[note] 1106-1106: the last parameter in the range is 'safe_tx_hash'
(clang)
[warning] 1104-1104: parameter 'domain_hash' is unused
(misc-unused-parameters)
[warning] 1105-1105: parameter 'message_hash' is unused
(misc-unused-parameters)
[warning] 1106-1106: parameter 'safe_tx_hash' is unused
(misc-unused-parameters)
[warning] 1109-1109: variable name 'y' is too short, expected at least 3 characters
(readability-identifier-length)
[warning] 1120-1120: 67 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1121-1121: 67 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1122-1122: 67 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1131-1131: 13 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1132-1132: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 1137-1137: end of the original
(clang)
[note] 1137-1137: clone 1 starts here
(clang)
[note] 1142-1142: clone 2 starts here
(clang)
[warning] 1153-1153: parameter 'ack' is unused
(misc-unused-parameters)
[warning] 1156-1156: 8 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1159-1159: variable 'chain_id_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1165-1165: variable 'verifying_contract_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1171-1171: parameter 'ack' is unused
(misc-unused-parameters)
[warning] 1175-1175: variable 'to_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1179-1179: variable 'value_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1184-1184: variable 'data_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1188-1188: if with identical then and else branches
(bugprone-branch-clone)
[note] 1190-1190: else branch starts here
(clang)
[warning] 1194-1194: variable 'safeTxGas_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1199-1199: variable 'baseGas_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1204-1204: variable 'gasPrice_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1211-1211: variable 'gasToken_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1217-1217: variable 'refundReceiver_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1222-1222: variable 'nonce_str' is not initialized
(cppcoreguidelines-init-variables)
legacy/firmware/ethereum_onekey.c
[warning] 64-64: variable 'data_left_bytes' is non-const and globally accessible, consider making it const
(cppcoreguidelines-avoid-non-const-global-variables)
[warning] 64-64: variable 'data_left_bytes' provides global access to a non-const object; consider making the pointed-to data 'const'
(cppcoreguidelines-avoid-non-const-global-variables)
[warning] 573-573: function 'layoutTransactionSafeExecTx' has cognitive complexity of 91 (threshold 25)
(readability-function-cognitive-complexity)
[note] 591-591: +1, including nesting penalty of 0, nesting level increased to 1
(clang)
[note] 594-594: +1, including nesting penalty of 0, nesting level increased to 1
(clang)
[note] 598-598: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 608-608: +1, including nesting penalty of 0, nesting level increased to 1
(clang)
[note] 613-613: +1, nesting level increased to 1
(clang)
[note] 615-615: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 619-619: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 625-625: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 625-625: +1
(clang)
[note] 636-636: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 637-637: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 640-640: +1, nesting level increased to 4
(clang)
[note] 643-643: +1, nesting level increased to 4
(clang)
[note] 651-651: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 651-651: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 652-652: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 654-654: +1, nesting level increased to 3
(clang)
[note] 656-656: +1, nesting level increased to 3
(clang)
[note] 657-657: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 660-660: +1, nesting level increased to 3
(clang)
[note] 661-661: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 666-666: +1, nesting level increased to 1
(clang)
[note] 672-672: +1, nesting level increased to 1
(clang)
[note] 678-678: +1, nesting level increased to 1
(clang)
[note] 686-686: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 690-690: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 691-691: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 698-698: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 702-702: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 705-705: +1, nesting level increased to 4
(clang)
[note] 708-708: +1, nesting level increased to 4
(clang)
[note] 716-716: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 716-716: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 717-717: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 719-719: +1, nesting level increased to 3
(clang)
[note] 721-721: +1, nesting level increased to 3
(clang)
[note] 722-722: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 725-725: +1, nesting level increased to 3
(clang)
[note] 726-726: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 731-731: +1, nesting level increased to 1
(clang)
[note] 737-737: +1, nesting level increased to 1
(clang)
[note] 743-743: +1, nesting level increased to 1
(clang)
[warning] 574-574: 3 adjacent parameters of 'layoutTransactionSafeExecTx' of similar type ('const char *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 574-574: the first parameter in the range is 'chain_name'
(clang)
[note] 574-574: the last parameter in the range is 'signer'
(clang)
[warning] 575-575: parameter 'is_delegate_call' is unused
(misc-unused-parameters)
[warning] 575-575: 2 adjacent parameters of 'layoutTransactionSafeExecTx' of similar type ('const char *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 575-575: the first parameter in the range is 'nonce'
(clang)
[note] 576-576: the last parameter in the range is 'gas_fee'
(clang)
[warning] 577-577: 2 adjacent parameters of 'layoutTransactionSafeExecTx' of similar type ('const char *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 577-577: the first parameter in the range is 'max_priority_fee_per_gas'
(clang)
[note] 577-577: the last parameter in the range is 'chain_id_str'
(clang)
[warning] 580-580: variable name 'y' is too short, expected at least 3 characters
(readability-identifier-length)
[warning] 607-607: 13 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 608-608: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 613-613: end of the original
(clang)
[note] 666-666: clone 1 starts here
(clang)
[note] 672-672: clone 2 starts here
(clang)
[warning] 620-620: variable 'item' is not initialized
(cppcoreguidelines-init-variables)
[warning] 637-637: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 640-640: end of the original
(clang)
[note] 640-640: clone 1 starts here
(clang)
[note] 643-643: clone 2 starts here
(clang)
[warning] 652-652: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 654-654: end of the original
(clang)
[note] 654-654: clone 1 starts here
(clang)
[warning] 654-654: do not use 'else' after 'break'
(readability-else-after-return)
[warning] 656-656: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 660-660: end of the original
(clang)
[note] 660-660: clone 1 starts here
(clang)
[warning] 702-702: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 705-705: end of the original
(clang)
[note] 705-705: clone 1 starts here
(clang)
[note] 708-708: clone 2 starts here
(clang)
[warning] 717-717: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 719-719: end of the original
(clang)
[note] 719-719: clone 1 starts here
(clang)
[warning] 719-719: do not use 'else' after 'break'
(readability-else-after-return)
[warning] 721-721: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 725-725: end of the original
(clang)
[note] 725-725: clone 1 starts here
(clang)
[warning] 731-731: 5 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 731-731: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 737-737: end of the original
(clang)
[note] 737-737: clone 1 starts here
(clang)
[warning] 737-737: 6 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 753-753: parameter 'to' is unused
(misc-unused-parameters)
[warning] 754-754: 5 adjacent parameters of 'layoutEthereumConfirmApproveHash' of similar type ('const char *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 754-754: the first parameter in the range is 'max_gas_fee'
(clang)
[note] 755-755: the last parameter in the range is 'max_priority_fee_per_gas'
(clang)
[warning] 756-756: variable 'chain_name' is not initialized
(cppcoreguidelines-init-variables)
[warning] 759-759: 52 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 763-763: 30 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 764-764: 31 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 769-769: 21 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 776-776: parameter 'to' is unused
(misc-unused-parameters)
[warning] 777-777: parameter 'is_delegate_call' is unused
(misc-unused-parameters)
[warning] 778-778: 3 adjacent parameters of 'layoutEthereumConfirmExecTx' of similar type ('const char *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 778-778: the first parameter in the range is 'nonce'
(clang)
[note] 779-779: the last parameter in the range is 'max_priority_fee_per_gas'
(clang)
[warning] 780-780: variable 'chain_name' is not initialized
(cppcoreguidelines-init-variables)
[warning] 783-783: 52 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 787-787: 30 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 788-788: 31 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 793-793: 21 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 800-800: function 'layoutEthereumConfirmERC20Approve' has cognitive complexity of 51 (threshold 25)
(readability-function-cognitive-complexity)
[note] 817-817: +1, including nesting penalty of 0, nesting level increased to 1
(clang)
[note] 820-820: +1, including nesting penalty of 0, nesting level increased to 1
(clang)
[note] 825-825: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 835-835: +1, including nesting penalty of 0, nesting level increased to 1
(clang)
[note] 840-840: +1, nesting level increased to 1
(clang)
[note] 847-847: +1, nesting level increased to 1
(clang)
[note] 853-853: +1, nesting level increased to 1
(clang)
[note] 859-859: +1, nesting level increased to 1
(clang)
[note] 867-867: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 871-871: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 872-872: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 879-879: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 883-883: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 886-886: +1, nesting level increased to 4
(clang)
[note] 889-889: +1, nesting level increased to 4
(clang)
[note] 897-897: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 897-897: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 898-898: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 900-900: +1, nesting level increased to 3
(clang)
[note] 902-902: +1, nesting level increased to 3
(clang)
[note] 903-903: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 906-906: +1, nesting level increased to 3
(clang)
[note] 907-907: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 912-912: +1, nesting level increased to 1
(clang)
[note] 918-918: +1, nesting level increased to 1
(clang)
[note] 924-924: +1, nesting level increased to 1
(clang)
[warning] 801-801: 4 adjacent parameters of 'layoutEthereumConfirmERC20Approve' of similar type ('const char *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 801-801: the first parameter in the range is 'chain_name'
(clang)
[note] 802-802: the last parameter in the range is 'spender'
(clang)
[warning] 802-802: 2 adjacent parameters of 'layoutEthereumConfirmERC20Approve' of similar type ('int') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 802-802: the first parameter in the range is 'is_unlimited'
(clang)
[note] 802-802: the last parameter in the range is 'is_revoke'
(clang)
[warning] 802-802: parameter 'is_unlimited' is unused
(misc-unused-parameters)
[warning] 802-802: parameter 'is_revoke' is unused
(misc-unused-parameters)
[warning] 803-803: 3 adjacent parameters of 'layoutEthereumConfirmERC20Approve' of similar type ('const char *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 803-803: the first parameter in the range is 'overview_text'
(clang)
[note] 803-803: the last parameter in the range is 'gas_fee'
(clang)
[warning] 804-804: 2 adjacent parameters of 'layoutEthereumConfirmERC20Approve' of similar type ('const char *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 804-804: the first parameter in the range is 'max_priority_fee_per_gas'
(clang)
[note] 805-805: the last parameter in the range is 'chain_id_str'
(clang)
[warning] 808-808: variable name 'y' is too short, expected at least 3 characters
(readability-identifier-length)
[warning] 834-834: 13 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 840-840: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 847-847: end of the original
(clang)
[note] 847-847: clone 1 starts here
(clang)
[note] 853-853: clone 2 starts here
(clang)
[note] 912-912: clone 3 starts here
(clang)
[note] 918-918: clone 4 starts here
(clang)
[warning] 883-883: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 886-886: end of the original
(clang)
[note] 886-886: clone 1 starts here
(clang)
[note] 889-889: clone 2 starts here
(clang)
[warning] 898-898: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 900-900: end of the original
(clang)
[note] 900-900: clone 1 starts here
(clang)
[warning] 900-900: do not use 'else' after 'break'
(readability-else-after-return)
[warning] 902-902: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 906-906: end of the original
(clang)
[note] 906-906: clone 1 starts here
(clang)
[warning] 912-912: 5 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 918-918: 6 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[note] 1016-1016: else branch starts here
(clang)
[warning] 1245-1245: 68 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1249-1249: 16 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1253-1253: 16 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1259-1259: 36 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1271-1271: 437 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1274-1274: 16 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1284-1284: 4 adjacent parameters of 'detect_contract_action' of similar type ('int *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 1284-1284: the first parameter in the range is 'is_approve'
(clang)
[note] 1285-1285: the last parameter in the range is 'recipient'
(clang)
[warning] 1284-1284: parameter 'is_approve' is unused
(misc-unused-parameters)
[warning] 1284-1284: parameter 'is_nft_transfer' is unused
(misc-unused-parameters)
[warning] 1285-1285: parameter 'is_safe' is unused
(misc-unused-parameters)
[warning] 1285-1285: parameter 'recipient' is unused
(misc-unused-parameters)
[warning] 1286-1286: 2 adjacent parameters of 'detect_contract_action' of similar type ('char *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 1286-1286: the first parameter in the range is 'token_id'
(clang)
[note] 1286-1286: the last parameter in the range is 'token_value'
(clang)
[warning] 1298-1298: function 'ethereum_signing_handle_safe_tx' has cognitive complexity of 41 (threshold 25)
(readability-function-cognitive-complexity)
[note] 1301-1301: +1, including nesting penalty of 0, nesting level increased to 1
(clang)
[note] 1305-1305: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 1314-1314: +1, nesting level increased to 1
(clang)
[note] 1331-1331: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 1333-1333: +1, nesting level increased to 2
(clang)
[note] 1351-1351: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 1353-1353: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 1359-1359: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 1365-1365: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 1379-1379: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 1382-1382: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 1399-1399: +1, nesting level increased to 3
(clang)
[note] 1422-1422: +1, nesting level increased to 3
(clang)
[note] 1440-1440: +1, nesting level increased to 3
(clang)
[note] 1454-1454: +1, nesting level increased to 3
(clang)
[note] 1460-1460: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 1461-1461: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 1493-1493: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 1495-1495: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 1503-1503: +1, nesting level increased to 2
(clang)
[note] 1515-1515: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[warning] 1300-1300: parameter 'is_delegate_call' is unused
(misc-unused-parameters)
[warning] 1304-1304: 67 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1312-1312: 32 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1317-1317: variable 'data' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1321-1321: variable 'to_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1325-1325: variable 'value_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1330-1330: 16 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1337-1337: variable 'safe_tx_gas_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1338-1338: variable 'base_gas_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1339-1339: variable 'gas_price_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1340-1340: variable 'gas_token_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1341-1341: variable 'refund_receiver_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1362-1362: variable 'response_ptr' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1380-1380: variable 'nest_data' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1387-1387: variable 'token' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1390-1390: variable 'recipient_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1396-1396: 64 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1407-1407: variable 'from_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1411-1411: variable 'recipient_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1415-1415: variable 'token_id_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1419-1419: variable 'amount_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1429-1429: variable 'from_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1433-1433: variable 'recipient_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1437-1437: variable 'token_id_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1447-1447: variable 'spender_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1451-1451: variable 'amount_id_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1455-1455: variable 'data_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1511-1511: variable 'signatures_str' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1526-1526: parameter 'gas_price' is unused
(misc-unused-parameters)
[warning] 1526-1526: parameter 'gas_price_len' is unused
(misc-unused-parameters)
[warning] 1526-1526: parameter 'gas_limit' is unused
(misc-unused-parameters)
[warning] 1527-1527: parameter 'gas_limit_len' is unused
(misc-unused-parameters)
[warning] 1527-1527: parameter 'nonce' is unused
(misc-unused-parameters)
[warning] 1527-1527: parameter 'nonce_len' is unused
(misc-unused-parameters)
[warning] 1528-1528: parameter 'max_fee_per_gas' is unused
(misc-unused-parameters)
[warning] 1528-1528: parameter 'max_fee_per_gas_len' is unused
(misc-unused-parameters)
[warning] 1529-1529: parameter 'max_priority_fee_per_gas' is unused
(misc-unused-parameters)
[warning] 1530-1530: parameter 'max_priority_fee_per_gas_len' is unused
(misc-unused-parameters)
[warning] 1541-1541: 32 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1542-1542: 32 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1543-1543: 32 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1544-1544: 32 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1545-1545: if with identical then and else branches
(bugprone-branch-clone)
[note] 1552-1552: else branch starts here
(clang)
[warning] 1556-1556: variable 'nonce_ptr' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1557-1557: the result from calling 'memcpy' is not null-terminated
(bugprone-not-null-terminated-result)
[warning] 1581-1581: parameter 'gas_price' is unused
(misc-unused-parameters)
[warning] 1581-1581: parameter 'gas_price_len' is unused
(misc-unused-parameters)
[warning] 1581-1581: parameter 'gas_limit' is unused
(misc-unused-parameters)
[warning] 1582-1582: parameter 'gas_limit_len' is unused
(misc-unused-parameters)
[warning] 1582-1582: parameter 'nonce' is unused
(misc-unused-parameters)
[warning] 1582-1582: parameter 'nonce_len' is unused
(misc-unused-parameters)
[warning] 1583-1583: parameter 'max_fee_per_gas' is unused
(misc-unused-parameters)
[warning] 1583-1583: parameter 'max_fee_per_gas_len' is unused
(misc-unused-parameters)
[warning] 1584-1584: parameter 'max_priority_fee_per_gas' is unused
(misc-unused-parameters)
[warning] 1585-1585: parameter 'max_priority_fee_per_gas_len' is unused
(misc-unused-parameters)
[warning] 1586-1586: variable 'token' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1588-1588: variable 'approver' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1590-1590: variable 'provider_name' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1591-1591: 52 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1592-1592: 52 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1595-1595: 30 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1596-1596: 31 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1613-1613: 256 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1614-1614: variable 'token_name' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1634-1634: 64 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1644-1644: 32 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1645-1645: 32 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1646-1646: 32 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1647-1647: 32 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1648-1648: if with identical then and else branches
(bugprone-branch-clone)
[note] 1655-1655: else branch starts here
(clang)
[warning] 1659-1659: variable 'nonce_ptr' is not initialized
(cppcoreguidelines-init-variables)
[warning] 1660-1660: the result from calling 'memcpy' is not null-terminated
(bugprone-not-null-terminated-result)
[warning] 1662-1662: 21 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1665-1665: variable 'chain_name' is not initialized
(cppcoreguidelines-init-variables)
[note] 1745-1745: +1, including nesting penalty of 0, nesting level increased to 1
(clang)
[warning] 1742-1742: multiple declarations in a single statement reduces readability
(readability-isolate-declaration)
[warning] 1742-1742: 256 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1742-1742: 32 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[note] 1774-1774: +1, including nesting penalty of 0, nesting level increased to 1
(clang)
[note] 1775-1775: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 1776-1776: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 1784-1784: +1, nesting level increased to 2
(clang)
[note] 1785-1785: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[warning] 1775-1775: if with identical then and else branches
(bugprone-branch-clone)
[note] 1784-1784: else branch starts here
(clang)
[note] 1840-1840: +1, including nesting penalty of 0, nesting level increased to 1
(clang)
[note] 1846-1846: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 1852-1852: +1, including nesting penalty of 0, nesting level increased to 1
(clang)
[note] 1854-1854: +1, nesting level increased to 1
(clang)
[note] 1855-1855: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[warning] 1898-1898: multiple declarations in a single statement reduces readability
(readability-isolate-declaration)
[warning] 1898-1898: 256 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1898-1898: 32 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1944-1944: 32 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1945-1945: 32 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 1946-1946: 32 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 2535-2535: parameter 'id' is unused
(misc-unused-parameters)
[warning] 2535-2535: parameter name 'id' is too short, expected at least 3 characters
(readability-identifier-length)
[warning] 2537-2537: parameter 'hash' is unused
(misc-unused-parameters)
[warning] 2543-2543: 8 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 2552-2552: parameter 'ack' is unused
(misc-unused-parameters)
[warning] 2553-2553: parameter 'hash' is unused
(misc-unused-parameters)
[warning] 2605-2605: 2 adjacent parameters of 'ethereum_gnosis_safe_tx_sign' of similar type ('const int *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 2605-2605: the first parameter in the range is 'ack'
(clang)
[note] 2605-2605: the last parameter in the range is 'node'
(clang)
[warning] 2605-2605: parameter 'ack' is unused
(misc-unused-parameters)
[warning] 2605-2605: parameter 'node' is unused
(misc-unused-parameters)
[warning] 2606-2606: parameter 'resp' is unused
(misc-unused-parameters)
[warning] 2655-2655: 2 adjacent parameters of 'ethereum_typed_data_sign_onekey' of similar type ('const int *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 2655-2655: the first parameter in the range is 'msg'
(clang)
[note] 2656-2656: the last parameter in the range is 'node'
(clang)
[warning] 2655-2655: parameter 'msg' is unused
(misc-unused-parameters)
[warning] 2656-2656: parameter 'node' is unused
(misc-unused-parameters)
[warning] 2657-2657: parameter 'resp' is unused
(misc-unused-parameters)
[warning] 2660-2660: variable 'ack' is not initialized
(cppcoreguidelines-init-variables)
legacy/firmware/layout2.c
[warning] 3085-3085: parameter 'prefix_len' is unused
(misc-unused-parameters)
[warning] 3086-3086: 2 adjacent parameters of 'layoutInputPassphrase' of similar type ('int') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 3086-3086: the first parameter in the range is 'current_char'
(clang)
[warning] 3086-3086: parameter 'current_char' is unused
(misc-unused-parameters)
[warning] 3105-3105: 13 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 3129-3129: if with identical then and else branches
(bugprone-branch-clone)
[note] 3132-3132: else branch starts here
(clang)
[warning] 3137-3137: 7 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 4340-4340: function 'layoutTransactionSafeApproveHash' has cognitive complexity of 43 (threshold 25)
(readability-function-cognitive-complexity)
[note] 4358-4358: +1, including nesting penalty of 0, nesting level increased to 1
(clang)
[note] 4367-4367: +1, including nesting penalty of 0, nesting level increased to 1
(clang)
[note] 4373-4373: +1, nesting level increased to 1
(clang)
[note] 4380-4380: +1, nesting level increased to 1
(clang)
[note] 4388-4388: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 4392-4392: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 4393-4393: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 4405-4405: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 4408-4408: +1, nesting level increased to 3
(clang)
[note] 4411-4411: +1, nesting level increased to 3
(clang)
[note] 4418-4418: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 4418-4418: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 4419-4419: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 4421-4421: +1, nesting level increased to 3
(clang)
[note] 4423-4423: +1, nesting level increased to 3
(clang)
[note] 4424-4424: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 4427-4427: +1, nesting level increased to 3
(clang)
[note] 4428-4428: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 4433-4433: +1, nesting level increased to 1
(clang)
[note] 4439-4439: +1, nesting level increased to 1
(clang)
[note] 4445-4445: +1, nesting level increased to 1
(clang)
[note] 4451-4451: +1, nesting level increased to 1
(clang)
[warning] 4340-4340: 6 adjacent parameters of 'layoutTransactionSafeApproveHash' of similar type ('const char *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 4340-4340: the first parameter in the range is 'chain_name'
(clang)
[note] 4343-4343: the last parameter in the range is 'gas_fee'
(clang)
[warning] 4345-4345: 2 adjacent parameters of 'layoutTransactionSafeApproveHash' of similar type ('const char *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 4345-4345: the first parameter in the range is 'max_priority_fee_per_gas'
(clang)
[note] 4346-4346: the last parameter in the range is 'chain_id_str'
(clang)
[warning] 4349-4349: variable name 'y' is too short, expected at least 3 characters
(readability-identifier-length)
[warning] 4366-4366: 13 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 4367-4367: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 4373-4373: end of the original
(clang)
[note] 4433-4433: clone 1 starts here
(clang)
[warning] 4405-4405: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 4408-4408: end of the original
(clang)
[note] 4408-4408: clone 1 starts here
(clang)
[note] 4411-4411: clone 2 starts here
(clang)
[warning] 4419-4419: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 4421-4421: end of the original
(clang)
[note] 4421-4421: clone 1 starts here
(clang)
[warning] 4421-4421: do not use 'else' after 'break'
(readability-else-after-return)
[warning] 4423-4423: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 4427-4427: end of the original
(clang)
[note] 4427-4427: clone 1 starts here
(clang)
[warning] 4439-4439: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 4445-4445: end of the original
(clang)
[note] 4445-4445: clone 1 starts here
(clang)
[warning] 4445-4445: 5 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Style check
- GitHub Check: Defs check
- GitHub Check: Gen check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
♻️ Duplicate comments (1)
common/defs/evm_tokens/56.json (1)
12-12: Optional: Verify checksummed addresses for data integrity.Several addresses use lowercase format (e.g., lines 12, 24, 36, 43). While Ethereum addresses are case-insensitive, EIP-55 checksummed addresses improve validation. Consider standardizing to checksummed format.
Also applies to: 24-24, 36-36, 43-43, 54-54, 67-67, 72-72
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge base: Disabled due to data retention organization setting
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (7)
common/defs/evm_tokens/1.json(1 hunks)common/defs/evm_tokens/137.json(1 hunks)common/defs/evm_tokens/42161.json(1 hunks)common/defs/evm_tokens/56.json(1 hunks)common/defs/evm_tokens/8453.json(1 hunks)legacy/firmware/layout2.c(7 hunks)vendor/libsol(1 hunks)
🧰 Additional context used
🪛 Clang (14.0.6)
legacy/firmware/layout2.c
[warning] 3085-3085: parameter 'prefix_len' is unused
(misc-unused-parameters)
[warning] 3086-3086: 2 adjacent parameters of 'layoutInputPassphrase' of similar type ('int') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 3086-3086: the first parameter in the range is 'current_char'
(clang)
[warning] 3086-3086: parameter 'current_char' is unused
(misc-unused-parameters)
[warning] 3105-3105: 13 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 3129-3129: if with identical then and else branches
(bugprone-branch-clone)
[note] 3132-3132: else branch starts here
(clang)
[warning] 3137-3137: 7 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 4340-4340: function 'layoutTransactionSafeApproveHash' has cognitive complexity of 43 (threshold 25)
(readability-function-cognitive-complexity)
[note] 4358-4358: +1, including nesting penalty of 0, nesting level increased to 1
(clang)
[note] 4367-4367: +1, including nesting penalty of 0, nesting level increased to 1
(clang)
[note] 4373-4373: +1, nesting level increased to 1
(clang)
[note] 4379-4379: +1, nesting level increased to 1
(clang)
[note] 4387-4387: +2, including nesting penalty of 1, nesting level increased to 2
(clang)
[note] 4391-4391: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 4392-4392: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 4404-4404: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 4407-4407: +1, nesting level increased to 3
(clang)
[note] 4410-4410: +1, nesting level increased to 3
(clang)
[note] 4417-4417: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 4417-4417: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 4418-4418: +3, including nesting penalty of 2, nesting level increased to 3
(clang)
[note] 4420-4420: +1, nesting level increased to 3
(clang)
[note] 4422-4422: +1, nesting level increased to 3
(clang)
[note] 4423-4423: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 4426-4426: +1, nesting level increased to 3
(clang)
[note] 4427-4427: +4, including nesting penalty of 3, nesting level increased to 4
(clang)
[note] 4432-4432: +1, nesting level increased to 1
(clang)
[note] 4438-4438: +1, nesting level increased to 1
(clang)
[note] 4444-4444: +1, nesting level increased to 1
(clang)
[note] 4450-4450: +1, nesting level increased to 1
(clang)
[warning] 4340-4340: 6 adjacent parameters of 'layoutTransactionSafeApproveHash' of similar type ('const char *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 4340-4340: the first parameter in the range is 'chain_name'
(clang)
[note] 4343-4343: the last parameter in the range is 'gas_fee'
(clang)
[warning] 4345-4345: 2 adjacent parameters of 'layoutTransactionSafeApproveHash' of similar type ('const char *') are easily swapped by mistake
(bugprone-easily-swappable-parameters)
[note] 4345-4345: the first parameter in the range is 'max_priority_fee_per_gas'
(clang)
[note] 4346-4346: the last parameter in the range is 'chain_id_str'
(clang)
[warning] 4349-4349: variable name 'y' is too short, expected at least 3 characters
(readability-identifier-length)
[warning] 4366-4366: 13 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
[warning] 4367-4367: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 4373-4373: end of the original
(clang)
[note] 4373-4373: clone 1 starts here
(clang)
[note] 4432-4432: clone 2 starts here
(clang)
[warning] 4404-4404: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 4407-4407: end of the original
(clang)
[note] 4407-4407: clone 1 starts here
(clang)
[note] 4410-4410: clone 2 starts here
(clang)
[warning] 4418-4418: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 4420-4420: end of the original
(clang)
[note] 4420-4420: clone 1 starts here
(clang)
[warning] 4420-4420: do not use 'else' after 'break'
(readability-else-after-return)
[warning] 4422-4422: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 4426-4426: end of the original
(clang)
[note] 4426-4426: clone 1 starts here
(clang)
[warning] 4438-4438: repeated branch in conditional chain
(bugprone-branch-clone)
[note] 4444-4444: end of the original
(clang)
[note] 4444-4444: clone 1 starts here
(clang)
[warning] 4444-4444: 5 is a magic number; consider replacing it with a named constant
(cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Gen check
- GitHub Check: Style check
- GitHub Check: Defs check
🔇 Additional comments (2)
vendor/libsol (1)
1-1: Request verification of submodule commit.This is a submodule pointer update only. The actual changes live in the external
libsolrepository at the new commit hash. Please confirm:
- The new commit (
50876ee4f4eede55fb7c5103dc24957dc4c0c24d) is valid and intentional.- All changes in the updated submodule have been tested and are compatible with the current codebase.
- This submodule bump aligns with the v3.15.0 firmware version and the features mentioned in the AI summary (Gnosis Safe EIP-712, passphrase refactoring, etc.).
common/defs/evm_tokens/56.json (1)
7-305: Let me search for the actual token definition files in the codebase:File not found in repository.
The file
common/defs/evm_tokens/56.jsondoes not exist in the codebase. All verification attempts failed with "file not found" errors. The review comment cannot be processed until the correct file path is provided or the file is confirmed to be part of this PR.Likely an incorrect or invalid review comment.
Summary by CodeRabbit
New Features
Bug Fixes
Chores