=> {
const owners = names.map((name, index) => makeOwner({ name, address: addresses[index] }))
return List(owners)
diff --git a/src/routes/safe/components/Apps/confirmTransactions.tsx b/src/routes/safe/components/Apps/confirmTransactions.tsx
index b1afcf8d..f5ad686c 100644
--- a/src/routes/safe/components/Apps/confirmTransactions.tsx
+++ b/src/routes/safe/components/Apps/confirmTransactions.tsx
@@ -54,6 +54,10 @@ const IconText = styled.div`
margin-right: 4px;
}
`
+const StyledTextBox = styled(TextBox)`
+ max-width: 444px;
+`
+
const isTxValid = (t: SafeAppTx): boolean => {
if (!['string', 'number'].includes(typeof t.value)) {
return false
@@ -111,7 +115,7 @@ const confirmTransactions = (
Data (hex encoded)*
- {tx.data}
+ {tx.data}
diff --git a/src/routes/safe/components/Apps/index.tsx b/src/routes/safe/components/Apps/index.tsx
index b4039f88..949e37f2 100644
--- a/src/routes/safe/components/Apps/index.tsx
+++ b/src/routes/safe/components/Apps/index.tsx
@@ -21,7 +21,7 @@ import {
} from 'src/routes/safe/store/selectors'
import { loadFromStorage, saveToStorage } from 'src/utils/storage'
import { isSameHref } from 'src/utils/url'
-import { SafeApp } from './types'
+import { SafeApp, StoredSafeApp } from './types'
const APPS_STORAGE_KEY = 'APPS_STORAGE_KEY'
const APPS_LEGAL_DISCLAIMER_STORAGE_KEY = 'APPS_LEGAL_DISCLAIMER_STORAGE_KEY'
@@ -195,7 +195,7 @@ function Apps({ closeModal, closeSnackbar, enqueueSnackbar, openModal }) {
setAppList(copyAppList)
// update storage list
- const persistedAppList = (await loadFromStorage(APPS_STORAGE_KEY)) || []
+ const persistedAppList = (await loadFromStorage(APPS_STORAGE_KEY)) || []
let storageApp = persistedAppList.find((a) => a.url === app.url)
if (!storageApp) {
@@ -303,7 +303,7 @@ function Apps({ closeModal, closeSnackbar, enqueueSnackbar, openModal }) {
// recover apps from storage:
// * third-party apps added by the user
// * disabled status for both static and third-party apps
- const persistedAppList = (await loadFromStorage(APPS_STORAGE_KEY)) || []
+ const persistedAppList = (await loadFromStorage(APPS_STORAGE_KEY)) || []
const list = [...persistedAppList]
staticAppsList.forEach((staticApp) => {
diff --git a/src/routes/safe/components/Apps/types.d.ts b/src/routes/safe/components/Apps/types.d.ts
index 635ba78f..8a8ead9b 100644
--- a/src/routes/safe/components/Apps/types.d.ts
+++ b/src/routes/safe/components/Apps/types.d.ts
@@ -6,3 +6,8 @@ export type SafeApp = {
disabled?: boolean
error: boolean
}
+
+export type StoredSafeApp = {
+ url: string
+ disabled?: boolean
+}
diff --git a/src/routes/safe/components/Apps/utils.ts b/src/routes/safe/components/Apps/utils.ts
index b39862da..d6611f87 100644
--- a/src/routes/safe/components/Apps/utils.ts
+++ b/src/routes/safe/components/Apps/utils.ts
@@ -18,12 +18,9 @@ export const staticAppsList: Array<{ url: string; disabled: boolean }> = [
// request
{ url: `${process.env.REACT_APP_IPFS_GATEWAY}/QmQapdJP6zERqpDKKPECNeMDDgwmGUqbKk1PjHpYj8gfDJ`, disabled: false },
// Aave
- // { url: `${process.env.REACT_APP_IPFS_GATEWAY}/QmUfgEqdJ5kVjWTQofnDmvxdhDLBAaejiHkhQhfw6aYvBg`, disabled: false },
+ { url: `${process.env.REACT_APP_IPFS_GATEWAY}/QmfHFQHCSyaSL8Aq4eWZeB3buy4neiUCPchob2pYdV9gJT`, disabled: false },
{ url: `${gnosisAppsUrl}/compound`, disabled: false },
{ url: `${gnosisAppsUrl}/tx-builder`, disabled: false },
- { url: `${gnosisAppsUrl}/pool-together`, disabled: false },
- { url: `${gnosisAppsUrl}/open-zeppelin`, disabled: false },
- { url: `${gnosisAppsUrl}/synthetix`, disabled: false },
]
export const getAppInfoFromOrigin = (origin) => {
diff --git a/src/routes/safe/store/actions/fetchSafe.ts b/src/routes/safe/store/actions/fetchSafe.ts
index b04ff711..ea1b18d0 100644
--- a/src/routes/safe/store/actions/fetchSafe.ts
+++ b/src/routes/safe/store/actions/fetchSafe.ts
@@ -13,6 +13,7 @@ import updateSafe from 'src/routes/safe/store/actions/updateSafe'
import { makeOwner } from 'src/routes/safe/store/models/owner'
import { checksumAddress } from 'src/utils/checksumAddress'
+import { SafeOwner } from '../models/safe'
import addSafeModules from './addSafeModules'
const buildOwnersFrom = (
@@ -52,7 +53,7 @@ export const buildSafe = async (safeAdd, safeName, latestMasterContractVersion?:
const threshold = Number(thresholdStr)
const nonce = Number(nonceStr)
- const owners = List(buildOwnersFrom(remoteOwners, localSafe))
+ const owners = List(buildOwnersFrom(remoteOwners, localSafe))
const needsUpdate = safeNeedsUpdate(currentVersion, latestMasterContractVersion)
const featuresEnabled = enabledFeatures(currentVersion)
diff --git a/src/routes/safe/store/actions/transactions/utils/transactionHelpers.ts b/src/routes/safe/store/actions/transactions/utils/transactionHelpers.ts
index b5b7db88..ba8de692 100644
--- a/src/routes/safe/store/actions/transactions/utils/transactionHelpers.ts
+++ b/src/routes/safe/store/actions/transactions/utils/transactionHelpers.ts
@@ -253,7 +253,20 @@ export const buildTx = async ({
const refundParams = await getRefundParams(tx, getERC20DecimalsAndSymbol)
const decodedParams = getDecodedParams(tx)
const confirmations = getConfirmations(tx)
- const { decimals = 18, symbol = 'ETH' } = isSendERC20Tx ? await getERC20DecimalsAndSymbol(tx.to) : {}
+
+ let tokenDecimals = 18
+ let tokenSymbol = 'ETH'
+ try {
+ if (isSendERC20Tx) {
+ const { decimals, symbol } = await getERC20DecimalsAndSymbol(tx.to)
+ tokenDecimals = decimals
+ tokenSymbol = symbol
+ } else if (isSendERC721Tx) {
+ tokenSymbol = await getERC721Symbol(tx.to)
+ }
+ } catch (err) {
+ console.log(`Failed to retrieve token data from ${tx.to}`)
+ }
const txToStore = makeTransaction({
baseGas: tx.baseGas,
@@ -263,7 +276,7 @@ export const buildTx = async ({
creationTx: tx.creationTx,
customTx: isCustomTx,
data: tx.data ? tx.data : EMPTY_DATA,
- decimals,
+ decimals: tokenDecimals,
decodedParams,
executionDate: tx.executionDate,
executionTxHash: tx.transactionHash,
@@ -286,7 +299,7 @@ export const buildTx = async ({
safeTxGas: tx.safeTxGas,
safeTxHash: tx.safeTxHash,
submissionDate: tx.submissionDate,
- symbol: isSendERC721Tx ? await getERC721Symbol(tx.to) : symbol,
+ symbol: tokenSymbol,
upgradeTx: isUpgradeTx,
value: tx.value.toString(),
})
diff --git a/src/routes/safe/store/middleware/notificationsMiddleware.ts b/src/routes/safe/store/middleware/notificationsMiddleware.ts
index a28d76c7..48b752ae 100644
--- a/src/routes/safe/store/middleware/notificationsMiddleware.ts
+++ b/src/routes/safe/store/middleware/notificationsMiddleware.ts
@@ -38,7 +38,7 @@ const sendAwaitingTransactionNotification = async (
return
}
- let lastTimeUserLoggedInForSafes = (await loadFromStorage(LAST_TIME_USED_LOGGED_IN_ID)) || []
+ let lastTimeUserLoggedInForSafes = (await loadFromStorage>(LAST_TIME_USED_LOGGED_IN_ID)) || {}
const lastTimeUserLoggedIn =
lastTimeUserLoggedInForSafes && lastTimeUserLoggedInForSafes[safeAddress]
? lastTimeUserLoggedInForSafes[safeAddress]
diff --git a/src/routes/safe/store/models/safe.ts b/src/routes/safe/store/models/safe.ts
index 22f4c918..e69d3cd6 100644
--- a/src/routes/safe/store/models/safe.ts
+++ b/src/routes/safe/store/models/safe.ts
@@ -1,5 +1,10 @@
import { List, Map, Record, RecordOf, Set } from 'immutable'
+export type SafeOwner = {
+ name: string
+ address: string
+}
+
export type SafeRecordProps = {
name: string
address: string
@@ -24,7 +29,7 @@ const makeSafe = Record({
name: '',
address: '',
threshold: 0,
- ethBalance: 0,
+ ethBalance: '0',
owners: List([]),
modules: Set(),
activeTokens: Set(),
diff --git a/src/routes/safe/store/reducer/safe.ts b/src/routes/safe/store/reducer/safe.ts
index 1996d2dc..6beb56c3 100644
--- a/src/routes/safe/store/reducer/safe.ts
+++ b/src/routes/safe/store/reducer/safe.ts
@@ -17,6 +17,7 @@ import { checksumAddress } from 'src/utils/checksumAddress'
import { ADD_SAFE_MODULES } from '../actions/addSafeModules'
export const SAFE_REDUCER_ID = 'safes'
+export const DEFAULT_SAFE_INITIAL_STATE = 'NOT_ASKED'
export const buildSafe = (storedSafe) => {
const names = storedSafe.owners.map((owner) => owner.name)
@@ -140,7 +141,7 @@ export default handleActions(
state.set('latestMasterContractVersion', action.payload),
},
Map({
- defaultSafe: undefined,
+ defaultSafe: DEFAULT_SAFE_INITIAL_STATE,
safes: Map(),
latestMasterContractVersion: '',
}),
diff --git a/src/utils/storage/index.ts b/src/utils/storage/index.ts
index 127db6f7..bf0e8fce 100644
--- a/src/utils/storage/index.ts
+++ b/src/utils/storage/index.ts
@@ -10,7 +10,7 @@ export const storage = new ImmortalStorage(stores)
const PREFIX = `v2_${getNetwork()}`
-export const loadFromStorage = async (key) => {
+export const loadFromStorage = async (key: string): Promise => {
try {
const stringifiedValue = await storage.get(`${PREFIX}__${key}`)
if (stringifiedValue === null || stringifiedValue === undefined) {
@@ -24,7 +24,10 @@ export const loadFromStorage = async (key) => {
}
}
-export const saveToStorage = async (key, value) => {
+export const saveToStorage = async (
+ key: string,
+ value: Record | boolean | string | number | Array,
+): Promise => {
try {
const stringifiedValue = JSON.stringify(value)
await storage.set(`${PREFIX}__${key}`, stringifiedValue)
@@ -33,7 +36,7 @@ export const saveToStorage = async (key, value) => {
}
}
-export const removeFromStorage = async (key) => {
+export const removeFromStorage = async (key: string): Promise => {
try {
await storage.remove(`${PREFIX}__${key}`)
} catch (err) {
diff --git a/yarn.lock b/yarn.lock
index 0bc94691..5195d5ec 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2396,7 +2396,7 @@
"@restless/sanitizers" "^0.2.4"
reactive-properties "^0.1.11"
-"@walletconnect/client@^1.0.11":
+"@walletconnect/client@^1.0.5":
version "1.0.11"
resolved "https://registry.yarnpkg.com/@walletconnect/client/-/client-1.0.11.tgz#ee58d2662e433cb67c5d2157c1b4525f864ab6ec"
integrity sha512-NVMDRUuLMqRPmzR7xjVfRcuXegvrCTtzuVyU8iYEnriZ3fFZcFj3PWVzN44RvLYQ4yUxWzeUkXIVRmmecOLMbQ==
@@ -2415,7 +2415,7 @@
"@walletconnect/types" "^1.0.11"
"@walletconnect/utils" "^1.0.11"
-"@walletconnect/http-connection@^1.0.11":
+"@walletconnect/http-connection@^1.0.5":
version "1.0.11"
resolved "https://registry.yarnpkg.com/@walletconnect/http-connection/-/http-connection-1.0.11.tgz#3c00ab02b4e6f4ffa1aa346b19569e585609dfa2"
integrity sha512-kT9tKfp0KfKO+WkufSEi2Ppcgni2LB1Qly66uV3xZEwqouY+8Fs7Rf/BQ9o8KmosnP9WxBjgO+S4OMDWNLHCdA==
@@ -2438,7 +2438,7 @@
resolved "https://registry.yarnpkg.com/@walletconnect/mobile-registry/-/mobile-registry-1.0.11.tgz#55a060fb113524e75ed675fce1ab50bb6c5aa1ce"
integrity sha512-E78BfSr4RNSUPl/4Qpfg4bPO+QynMqUj55X20S41z1aGIYhXNM33sUVWGkbxO5rHuHYLB9Z5O/ob0sENKCXAfA==
-"@walletconnect/qrcode-modal@^1.0.11":
+"@walletconnect/qrcode-modal@^1.0.5":
version "1.0.11"
resolved "https://registry.yarnpkg.com/@walletconnect/qrcode-modal/-/qrcode-modal-1.0.11.tgz#5b34d583c034aed74307350797c66ddce6193744"
integrity sha512-GsSQ/E3ixBEiQz3EOFypW2FCFIS6G37crpJunkLhefi9w2/CMeQ5bk4SIFKyGsAv6uEtwAcPVh7tNkoiGEsb2A==
@@ -2457,7 +2457,7 @@
"@walletconnect/types" "^1.0.11"
ws "7.3.0"
-"@walletconnect/types@^1.0.11":
+"@walletconnect/types@^1.0.11", "@walletconnect/types@^1.0.5":
version "1.0.11"
resolved "https://registry.yarnpkg.com/@walletconnect/types/-/types-1.0.11.tgz#6dd23eb3a8dd2824f76cc2c54217ecca8229d0a2"
integrity sha512-ysIQI6DsMELQAAt5zk2ZMKKyOwgk+XP4KeOhmDk+sIQskBugFl0ARl5iQZzGz9pcrHdlg1Fi7ucGw3UaExqIVA==
@@ -2472,16 +2472,15 @@
enc-utils "2.1.0"
js-sha3 "0.8.0"
-"@walletconnect/web3-provider@^1.0.0-beta.47":
- version "1.0.11"
- resolved "https://registry.yarnpkg.com/@walletconnect/web3-provider/-/web3-provider-1.0.11.tgz#462d84808379f5ec8747e46de217286d61837620"
- integrity sha512-ppzYwfrVtl5j8zMOPl07v5w+Gb0ptspQm3TGUqVVClaIdXt96uCBBPxwi5bZa4pSXVKgJvI9EbKzaqUS8kVsyQ==
+"@walletconnect/web3-provider@^1.0.5":
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/@walletconnect/web3-provider/-/web3-provider-1.0.5.tgz#c7e3d1a1449b3f1fd6125e3fabd361394dd1ecdd"
+ integrity sha512-oxrkE1kMZl7mlno7lmupLZS+slDC83nZh5UbE4B2Gr0aOTfT1lqyQMkvSXYOcl0fjR+p0x6iJ4sh0nvhV6Loug==
dependencies:
- "@walletconnect/client" "^1.0.11"
- "@walletconnect/http-connection" "^1.0.11"
- "@walletconnect/qrcode-modal" "^1.0.11"
- "@walletconnect/types" "^1.0.11"
- "@walletconnect/utils" "^1.0.11"
+ "@walletconnect/client" "^1.0.5"
+ "@walletconnect/http-connection" "^1.0.5"
+ "@walletconnect/qrcode-modal" "^1.0.5"
+ "@walletconnect/types" "^1.0.5"
web3-provider-engine "15.0.7"
"@web3-js/scrypt-shim@^0.1.0":
@@ -4083,20 +4082,20 @@ bn.js@^5.1.1, bn.js@^5.1.2:
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.1.2.tgz#c9686902d3c9a27729f43ab10f9d79c2004da7b0"
integrity sha512-40rZaf3bUNKTVYu9sIeeEGOg7g14Yvnj9kH7b50EiwX0Q7A6umbvfI5tvHaOERH0XigqKkfLkFQxzb4e6CIXnA==
-bnc-onboard@1.9.4:
- version "1.9.4"
- resolved "https://registry.yarnpkg.com/bnc-onboard/-/bnc-onboard-1.9.4.tgz#c70c41652234009708e3a2334ab064a3a4c008c3"
- integrity sha512-mtecvcE/I4+6fydWXVZrrw1OD/UaiR36IojyIeXqxEg6tI/6pu0DsJhszWF5FeN83dg1qOy24eo4rTNh8WKItQ==
+bnc-onboard@1.10.0:
+ version "1.10.0"
+ resolved "https://registry.yarnpkg.com/bnc-onboard/-/bnc-onboard-1.10.0.tgz#f1c2797b10060808a20b46fa072c57a466bb5f6a"
+ integrity sha512-d/Xj1RxoDOL3IN7bdD0ZENjSkbMXcvn+cWLLOi/7XbI+H+elDZS/knAnYLa99j54Mu+odTSXuBy94EwvXbey0w==
dependencies:
"@ledgerhq/hw-app-eth" "^5.7.0"
"@ledgerhq/hw-transport-u2f" "^5.7.0"
"@portis/web3" "^2.0.0-beta.42"
"@toruslabs/torus-embed" "^1.3.0"
"@unilogin/provider" "^0.5.21"
- "@walletconnect/web3-provider" "^1.0.0-beta.47"
+ "@walletconnect/web3-provider" "^1.0.5"
authereum "^0.0.4-beta.157"
bignumber.js "^9.0.0"
- bnc-sdk "^2.1.3"
+ bnc-sdk "^2.1.4"
bowser "^2.5.2"
ethereumjs-tx "^2.1.2"
ethereumjs-util "^6.2.0"
@@ -4109,7 +4108,7 @@ bnc-onboard@1.9.4:
walletlink "^2.0.2"
web3-provider-engine "^15.0.4"
-bnc-sdk@^2.1.3:
+bnc-sdk@^2.1.4:
version "2.1.4"
resolved "https://registry.yarnpkg.com/bnc-sdk/-/bnc-sdk-2.1.4.tgz#23267198f5a48e800d9c2406f6d04a767cab5643"
integrity sha512-aU7DYweE+6tfTvZE7NOOfQsieU2Zyrav6o/xwuLt+uKGvrkblIeg1aqBW1yAQBEg4LCHEygX6TwZk8VznDAh3g==
@@ -17263,9 +17262,9 @@ web3-provider-engine@^15.0.4:
xhr "^2.2.0"
xtend "^4.0.1"
-"web3-provider-engine@git+https://github.com/trufflesuite/provider-engine.git#web3-one":
+"web3-provider-engine@https://github.com/trufflesuite/provider-engine#web3-one":
version "14.0.6"
- resolved "git+https://github.com/trufflesuite/provider-engine.git#9694f5b4e5500651bd2ff689df8529bb5cf6b96f"
+ resolved "https://github.com/trufflesuite/provider-engine#9694f5b4e5500651bd2ff689df8529bb5cf6b96f"
dependencies:
async "^2.5.0"
backoff "^2.5.0"
@@ -17627,6 +17626,7 @@ websocket@^1.0.31:
dependencies:
debug "^2.2.0"
es5-ext "^0.10.50"
+ gulp "^4.0.2"
nan "^2.14.0"
typedarray-to-buffer "^3.1.5"
yaeti "^0.0.6"