diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 00000000..9bb0cd5d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,49 @@ +--- +name: Bug report +about: Create a report to fix a bug +--- + + + +### Title/Description + + +### Environment + - Browser: + - Safe: + - Wallet: + - App Version: + - Environment: + + - dev (rinkeby) + - staging (rinkeby) + - production (mainnet) + - PR # + +### Steps to reproduce + + +### Expected result + + +### Obtained result + + +### Screenshots + diff --git a/package.json b/package.json index 57c2f25f..3650b7d4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "safe-react", - "version": "1.6.0", + "version": "1.6.3", "description": "Allowing crypto users manage funds in a safer way", "homepage": "https://github.com/gnosis/safe-react#readme", "bugs": { @@ -43,6 +43,7 @@ "@toruslabs/torus-embed": "0.2.10", "@walletconnect/web3-provider": "^1.0.0-beta.37", "@welldone-software/why-did-you-render": "3.4.1", + "authereum": "0.0.4-beta.68", "axios": "0.19.0", "bignumber.js": "9.0.0", "connected-react-router": "6.6.1", @@ -158,4 +159,4 @@ "webpack-dev-server": "3.9.0", "webpack-manifest-plugin": "2.2.0" } -} \ No newline at end of file +} diff --git a/src/components/ConnectButton/index.jsx b/src/components/ConnectButton/index.jsx index f9197009..fd0ffaf0 100644 --- a/src/components/ConnectButton/index.jsx +++ b/src/components/ConnectButton/index.jsx @@ -5,6 +5,7 @@ import Torus from '@toruslabs/torus-embed' import WalletConnectProvider from '@walletconnect/web3-provider' import Fortmatic from 'fortmatic' import Portis from '@portis/web3' +import Authereum from 'authereum' import Button from '~/components/layout/Button' import { fetchProvider, removeProvider } from '~/logic/wallets/store/actions' import { getNetwork } from '~/config' @@ -46,6 +47,10 @@ export const web3Connect = new Web3Connect.Core({ showTorusButton: true, }, }, + authereum: { + package: Authereum, + options: {}, + }, }, }) diff --git a/src/components/Sidebar/LegalLinks.jsx b/src/components/Sidebar/LegalLinks.jsx new file mode 100644 index 00000000..e69de29b diff --git a/src/logic/wallets/getWeb3.js b/src/logic/wallets/getWeb3.js index dea07326..260a74b4 100644 --- a/src/logic/wallets/getWeb3.js +++ b/src/logic/wallets/getWeb3.js @@ -25,6 +25,7 @@ export const WALLET_PROVIDER = { WALLETCONNECT: 'WALLETCONNECT', OPERA: 'OPERA', DAPPER: 'DAPPER', + AUTHEREUM: 'AUTHEREUM', } export const INJECTED_PROVIDERS = [ @@ -119,6 +120,10 @@ const getProviderName: Function = (web3Provider): string => { name = WALLET_PROVIDER.WALLETCONNECT } + if (web3Provider.currentProvider.isAuthereum) { + name = WALLET_PROVIDER.AUTHEREUM + } + return name } diff --git a/src/routes/safe/container/selector.js b/src/routes/safe/container/selector.js index 9ae8d4a9..e18c5c35 100644 --- a/src/routes/safe/container/selector.js +++ b/src/routes/safe/container/selector.js @@ -1,6 +1,10 @@ // @flow import { List, Map } from 'immutable' -import { createSelector, createStructuredSelector, type Selector } from 'reselect' +import { + createSelector, + createStructuredSelector, + type Selector, +} from 'reselect' import { safeSelector, safeActiveTokensSelector, @@ -12,16 +16,29 @@ import { type RouterProps, type SafeSelectorProps, } from '~/routes/safe/store/selectors' -import { providerNameSelector, userAccountSelector, networkSelector } from '~/logic/wallets/store/selectors' +import { + providerNameSelector, + userAccountSelector, + networkSelector, +} from '~/logic/wallets/store/selectors' import { type Safe } from '~/routes/safe/store/models/safe' import { type GlobalState } from '~/store' import { isUserOwner } from '~/logic/wallets/ethAddresses' -import { orderedTokenListSelector, tokensSelector } from '~/logic/tokens/store/selectors' +import { + orderedTokenListSelector, + tokensSelector, +} from '~/logic/tokens/store/selectors' import { type Token } from '~/logic/tokens/store/model/token' -import { type Transaction, type TransactionStatus } from '~/routes/safe/store/models/transaction' +import { + type Transaction, + type TransactionStatus, +} from '~/routes/safe/store/models/transaction' import { safeParamAddressSelector } from '../store/selectors' import { getEthAsToken } from '~/logic/tokens/utils/tokenHelpers' -import { currencyValuesListSelector, currentCurrencySelector } from '~/logic/currencyValues/store/selectors' +import { + currencyValuesListSelector, + currentCurrencySelector, +} from '~/logic/currencyValues/store/selectors' import type { BalanceCurrencyType } from '~/logic/currencyValues/store/model/currencyValues' import type { IncomingTransaction } from '~/routes/safe/store/models/incomingTransaction' import type { AddressBook } from '~/logic/addressBook/model/addressBook' @@ -43,7 +60,11 @@ export type SelectorProps = { addressBook: AddressBook, } -const getTxStatus = (tx: Transaction, userAddress: string, safe: Safe): TransactionStatus => { +const getTxStatus = ( + tx: Transaction, + userAddress: string, + safe: Safe, +): TransactionStatus => { let txStatus if (tx.executionTxHash) { txStatus = 'success' @@ -56,37 +77,54 @@ const getTxStatus = (tx: Transaction, userAddress: string, safe: Safe): Transact } else if (!tx.confirmations.size) { txStatus = 'pending' } else { - const userConfirmed = tx.confirmations.filter((conf) => conf.owner.address === userAddress).size === 1 + const userConfirmed = tx.confirmations.filter((conf) => conf.owner.address === userAddress) + .size === 1 const userIsSafeOwner = safe.owners.filter((owner) => owner.address === userAddress).size === 1 - txStatus = !userConfirmed && userIsSafeOwner ? 'awaiting_your_confirmation' : 'awaiting_confirmations' + txStatus = !userConfirmed && userIsSafeOwner + ? 'awaiting_your_confirmation' + : 'awaiting_confirmations' } return txStatus } -export const grantedSelector: Selector = createSelector( +export const grantedSelector: Selector< + GlobalState, + RouterProps, + boolean +> = createSelector( userAccountSelector, safeSelector, (userAccount: string, safe: Safe | typeof undefined): boolean => isUserOwner(safe, userAccount), ) -const safeEthAsTokenSelector: Selector = createSelector( - safeSelector, - (safe: Safe) => { - if (!safe) { - return undefined - } +const safeEthAsTokenSelector: Selector< + GlobalState, + RouterProps, + ?Token +> = createSelector(safeSelector, (safe: Safe) => { + if (!safe) { + return undefined + } - return getEthAsToken(safe.ethBalance) - }, -) + return getEthAsToken(safe.ethBalance) +}) -export const extendedSafeTokensSelector: Selector> = createSelector( +export const extendedSafeTokensSelector: Selector< + GlobalState, + RouterProps, + List +> = createSelector( safeActiveTokensSelector, safeBalancesSelector, tokensSelector, safeEthAsTokenSelector, - (safeTokens: List, balances: Map, tokensList: Map, ethAsToken: Token) => { + ( + safeTokens: List, + balances: Map, + tokensList: Map, + ethAsToken: Token, + ) => { const extendedTokens = Map().withMutations((map) => { safeTokens.forEach((tokenAddress: string) => { const baseToken = tokensList.get(tokenAddress) @@ -106,7 +144,11 @@ export const extendedSafeTokensSelector: Selector> = createSelector( +const extendedTransactionsSelector: Selector< + GlobalState, + RouterProps, + List +> = createSelector( safeSelector, userAccountSelector, safeTransactionsSelector, @@ -123,7 +165,10 @@ const extendedTransactionsSelector: Selector