From e33d9fd9bbfa77846dc7b2de0ceebbf69efac8c6 Mon Sep 17 00:00:00 2001 From: Fernando Date: Tue, 7 Apr 2020 18:45:42 -0300 Subject: [PATCH] (Fix) Change the order of the upgrade methods lookup (#740) * fix: change the order of the upgrade methods lookup The `isUpgradeTransaction` method was looking for the methods in an wrong order (#599). The proper order was set in #610, but `isUpgradeTransaction` wasn't updated. * fix: contract upgrade version lookup --- src/logic/tokens/utils/tokenHelpers.js | 6 +++--- .../Transactions/TxsTable/ExpandedTx/TxDescription/utils.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/logic/tokens/utils/tokenHelpers.js b/src/logic/tokens/utils/tokenHelpers.js index 9b6529c2..c12d3287 100644 --- a/src/logic/tokens/utils/tokenHelpers.js +++ b/src/logic/tokens/utils/tokenHelpers.js @@ -62,10 +62,10 @@ export const isTokenTransfer = (data: string, value: number): boolean => export const isMultisendTransaction = (data: string, value: number): boolean => !!data && data.substring(0, 10) === '0x8d80ff0a' && value === 0 -// f08a0323 - setFallbackHandler (308, 8) -// 7de7edef - changeMasterCopy (550, 8) +// 7de7edef - changeMasterCopy (308, 8) +// f08a0323 - setFallbackHandler (550, 8) export const isUpgradeTransaction = (data: string) => - !!data && data.substr(308, 8) === 'f08a0323' && data.substr(550, 8) === '7de7edef' + !!data && data.substr(308, 8) === '7de7edef' && data.substr(550, 8) === 'f08a0323' export const isERC721Contract = async (contractAddress: string): boolean => { const ERC721Token = await getStandardTokenContract() diff --git a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/utils.js b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/utils.js index 7b0bb75a..111e62d0 100644 --- a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/utils.js +++ b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/utils.js @@ -18,7 +18,7 @@ type DecodedTxData = { } const getSafeVersion = (data: string) => { - const contractAddress = data.substr(582, 40).toLowerCase() + const contractAddress = data.substr(340, 40).toLowerCase() return ( {