From 05573407a5a45604abc170369318383a1b7da34e Mon Sep 17 00:00:00 2001 From: mmv Date: Fri, 31 May 2019 22:32:25 +0400 Subject: [PATCH] get a substring of last 40 chars when getting proxy from storage --- src/components/Stepper/OpenPaper/index.jsx | 2 +- src/routes/load/components/DetailsForm/index.jsx | 9 +++++++-- src/theme/mui.js | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/components/Stepper/OpenPaper/index.jsx b/src/components/Stepper/OpenPaper/index.jsx index 191a8b05..db57fa27 100644 --- a/src/components/Stepper/OpenPaper/index.jsx +++ b/src/components/Stepper/OpenPaper/index.jsx @@ -41,7 +41,7 @@ const OpenPaper = ({ {children} - { controls } + {controls} ) } diff --git a/src/routes/load/components/DetailsForm/index.jsx b/src/routes/load/components/DetailsForm/index.jsx index 9879dd4e..bae8b8a9 100644 --- a/src/routes/load/components/DetailsForm/index.jsx +++ b/src/routes/load/components/DetailsForm/index.jsx @@ -1,6 +1,5 @@ // @flow import * as React from 'react' -import contract from 'truffle-contract' import { withStyles } from '@material-ui/core/styles' import Field from '~/components/forms/Field' import { @@ -63,7 +62,13 @@ export const safeFieldsValidation = async (values: Object) => { // check mastercopy const proxyAddressFromStorage = await web3.eth.getStorageAt(safeAddress, 0) - const checksummedProxyAddress = web3.utils.toChecksumAddress(proxyAddressFromStorage) + // https://www.reddit.com/r/ethereum/comments/6l3da1/how_long_are_ethereum_addresses/ + // ganache returns plain address + // rinkeby returns 0x0000000000000+{40 address charachers} + // address comes last so we just get last 40 charachers (1byte = 2hex chars) + const checksummedProxyAddress = web3.utils.toChecksumAddress( + `0x${proxyAddressFromStorage.substr(proxyAddressFromStorage.length - 40)}`, + ) const safeMaster = await getSafeMasterContract() const masterCopy = safeMaster.address diff --git a/src/theme/mui.js b/src/theme/mui.js index 5db892fe..5455e662 100644 --- a/src/theme/mui.js +++ b/src/theme/mui.js @@ -116,6 +116,7 @@ export default createMuiTheme({ order: 0, marginTop: '0px', backgroundColor: '#EAE9EF', + zIndex: 1, // for firefox }, }, MuiInput: {