You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Possible Bug The method encodeSignRequest in TransactionManager now returns EncodedTxData instead of NearEthTxData. Ensure that all dependent components and systems correctly handle the new return type, especially focusing on the new evmData structure which includes chainId, data, and hash.
Refactoring Needed The removal of RecoveryData and addition of hash in various methods could lead to potential issues if not handled properly across all usages. Review all usages of these methods to ensure that they are updated to work with the new structure and that there are no remnants of the old RecoveryData usage that could cause runtime errors.
Validate the chainId to prevent cross-chain replay attacks
To ensure the integrity and security of the transaction, it's important to validate the chainId before using it in the evmData. This can prevent issues related to cross-chain replay attacks.
Why: Validating the chainId is crucial for preventing cross-chain replay attacks, which is a significant security concern. This suggestion addresses a major security issue.
9
Error handling
Add error handling for the requestRouter function to manage exceptions
Consider adding error handling for the asynchronous operation this.requestRouter(signRequest, usePaymaster) to manage potential failures or exceptions gracefully.
Why: Adding error handling improves the robustness of the code by ensuring that potential failures in the asynchronous operation are managed gracefully. This is important for maintaining application stability.
8
Possible bug
Check for null or undefined hash values before usage
It's a good practice to ensure that the hash value is not null or undefined before using it in the transaction payload to avoid potential runtime errors.
-hash,+hash: hash ?? throw new Error("Hash value is missing"),
Suggestion importance[1-10]: 7
Why: Ensuring that the hash value is not null or undefined before usage helps prevent potential runtime errors, improving the reliability of the code.
7
Maintainability
Refactor repeated Ethereum signing logic into a separate function
To improve the readability and maintainability of the code, consider refactoring the repeated logic for handling different Ethereum signing methods into a separate function.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Eliminate recovery in place of hash and add chainId.
PR Type
Enhancement, Bug fix
Description
safeMessageTxData
function and eliminated the use ofRecoveryData
insrc/lib/safe-message.ts
.encodeSignRequest
method insrc/tx-manager.ts
to returnEncodedTxData
and removedRecoveryData
logic.EncodedTxData
interface insrc/types.ts
to includechainId
,data
, andhash
inevmData
.Changes walkthrough 📝
safe-message.ts
Remove `safeMessageTxData` and `RecoveryData` usage
src/lib/safe-message.ts
safeMessageTxData
function.RecoveryData
andtoPayload
.tx-manager.ts
Update `encodeSignRequest` and remove `RecoveryData`
src/tx-manager.ts
encodeSignRequest
to returnEncodedTxData
.requestRouter
to includehash
.RecoveryData
and related logic.types.ts
Add `EncodedTxData` interface with `evmData` details
src/types.ts
EncodedTxData
interface.chainId
,data
, andhash
inevmData
.