(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
This commit is contained in:
Fernando 2020-04-07 18:45:42 -03:00 committed by GitHub
parent 0441ce2ec7
commit e33d9fd9bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -62,10 +62,10 @@ export const isTokenTransfer = (data: string, value: number): boolean =>
export const isMultisendTransaction = (data: string, value: number): boolean => export const isMultisendTransaction = (data: string, value: number): boolean =>
!!data && data.substring(0, 10) === '0x8d80ff0a' && value === 0 !!data && data.substring(0, 10) === '0x8d80ff0a' && value === 0
// f08a0323 - setFallbackHandler (308, 8) // 7de7edef - changeMasterCopy (308, 8)
// 7de7edef - changeMasterCopy (550, 8) // f08a0323 - setFallbackHandler (550, 8)
export const isUpgradeTransaction = (data: string) => 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 => { export const isERC721Contract = async (contractAddress: string): boolean => {
const ERC721Token = await getStandardTokenContract() const ERC721Token = await getStandardTokenContract()

View File

@ -18,7 +18,7 @@ type DecodedTxData = {
} }
const getSafeVersion = (data: string) => { const getSafeVersion = (data: string) => {
const contractAddress = data.substr(582, 40).toLowerCase() const contractAddress = data.substr(340, 40).toLowerCase()
return ( return (
{ {