Skip to content

Commit

Permalink
Fix: uncaught exception in ApprovalEditor (#2674)
Browse files Browse the repository at this point in the history
  • Loading branch information
katspaugh authored Oct 23, 2023
1 parent 0c1896f commit 77f8862
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/services/exceptions/ErrorCodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ enum ErrorCodes {
_806 = '806: Failed to remove module',
_807 = '807: Failed to remove guard',
_808 = '808: Failed to get transaction origin',
_809 = '809: Failed decoding transaction',

_900 = '900: Error loading Safe App',
_901 = '901: Error processing Safe Apps SDK request',
Expand Down
14 changes: 10 additions & 4 deletions src/utils/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,16 @@ export const decodeMultiSendTxs = (encodedMultiSendData: string): BaseTransactio
)}`

// Decode operation, to, value, dataLength
const [, txTo, txValue, txDataBytesLength] = ethers.utils.defaultAbiCoder.decode(
['uint8', 'address', 'uint256', 'uint256'],
ethers.utils.hexZeroPad(txDataEncoded, 32 * 4),
)
let txTo, txValue, txDataBytesLength
try {
;[, txTo, txValue, txDataBytesLength] = ethers.utils.defaultAbiCoder.decode(
['uint8', 'address', 'uint256', 'uint256'],
ethers.utils.hexZeroPad(txDataEncoded, 32 * 4),
)
} catch (e) {
logError(Errors._809, e)
continue
}

// Each byte is represented by two characters
const dataLength = Number(txDataBytesLength) * 2
Expand Down

0 comments on commit 77f8862

Please sign in to comment.