#533 Checksum addresses request (#538)

* Sets the default safe address to checksum version

* Sets the default safe address to checksum version
This commit is contained in:
Agustin Pane 2020-02-06 10:40:25 -03:00 committed by GitHub
parent 2f456258e4
commit 16b3dc0f2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 720 additions and 25 deletions

View File

@ -13,6 +13,7 @@ import Layout from '../components/Layout'
import { getNamesFrom, getOwnersFrom } from '~/routes/open/utils/safeDataExtractor' import { getNamesFrom, getOwnersFrom } from '~/routes/open/utils/safeDataExtractor'
import { FIELD_LOAD_NAME, FIELD_LOAD_ADDRESS } from '../components/fields' import { FIELD_LOAD_NAME, FIELD_LOAD_ADDRESS } from '../components/fields'
import { getGnosisSafeInstanceAt } from '~/logic/contracts/safeContracts' import { getGnosisSafeInstanceAt } from '~/logic/contracts/safeContracts'
import { getWeb3 } from '~/logic/wallets/getWeb3'
type Props = SelectorProps & Actions type Props = SelectorProps & Actions
@ -37,8 +38,12 @@ class Load extends React.Component<Props> {
onLoadSafeSubmit = async (values: Object) => { onLoadSafeSubmit = async (values: Object) => {
try { try {
const { addSafe } = this.props const { addSafe } = this.props
const web3 = getWeb3()
const safeName = values[FIELD_LOAD_NAME] const safeName = values[FIELD_LOAD_NAME]
const safeAddress = values[FIELD_LOAD_ADDRESS] let safeAddress = values[FIELD_LOAD_ADDRESS]
if (safeAddress) {
safeAddress = web3.utils.toChecksumAddress(safeAddress)
}
const ownerNames = getNamesFrom(values) const ownerNames = getNamesFrom(values)
const gnosisSafe = await getGnosisSafeInstanceAt(safeAddress) const gnosisSafe = await getGnosisSafeInstanceAt(safeAddress)

738
yarn.lock

File diff suppressed because it is too large Load Diff