WIP: Fix safe creation, though there is still errors when we try to fetch it

This commit is contained in:
mmv 2019-03-07 18:47:42 +04:00
parent 7dff751e1e
commit ea0b5f58c5
5 changed files with 29 additions and 28 deletions

View File

@ -128,7 +128,7 @@
"react-loadable": "^5.3.1",
"react-router-dom": "^4.2.2",
"recompose": "^0.30.0",
"web3": "1.0.0-beta.48"
"web3": "1.0.0-beta.37"
},
"jest": {
"verbose": true,

View File

@ -49,7 +49,7 @@ export const maxValue = (max: number) => (value: string) => {
export const ok = () => undefined
export const mustBeEthereumAddress = (address: Field) => {
const isAddress: boolean = getWeb3().isAddress(address)
const isAddress: boolean = getWeb3().utils.isAddress(address)
return isAddress ? undefined : 'Address should be a valid Ethereum address'
}

View File

@ -60,14 +60,15 @@ export const getSafeMasterContract = async () => {
return safeMaster
}
export const deploySafeContract = async (
safeAccounts: string[],
numConfirmations: number,
userAccount: string,
) => {
export const deploySafeContract = async (safeAccounts: string[], numConfirmations: number, userAccount: string) => {
console.log(safeMaster)
const gnosisSafeData = await safeMaster.setup(safeAccounts, numConfirmations, 0, '0x').encodeABI()
const proxyFactoryData = proxyFactoryMaster.createProxy(safeMaster.address, gnosisSafeData).encodeABI()
const gnosisSafeData = await safeMaster.contract.methods
.setup(safeAccounts, numConfirmations, '0x0000000000000000000000000000000000000000', '0x')
.encodeABI()
console.log('got safe data')
const proxyFactoryData = proxyFactoryMaster.contract.methods
.createProxy(safeMaster.address, gnosisSafeData)
.encodeABI()
const gas = await calculateGasOf(proxyFactoryData, userAccount, proxyFactoryMaster.address)
const gasPrice = await calculateGasPrice()

View File

@ -56,7 +56,7 @@ const getAccountFrom: Function = async (web3Provider): Promise<string | null> =>
const getNetworkIdFrom = async (web3Provider) => {
const networkId = await web3Provider.eth.net.getId()
console.log(networkId)
return networkId
}

View File

@ -16628,24 +16628,6 @@ web3@1.0.0-beta.37:
web3-shh "1.0.0-beta.37"
web3-utils "1.0.0-beta.37"
web3@1.0.0-beta.48, web3@^1.0.0-beta.36:
version "1.0.0-beta.48"
resolved "https://registry.yarnpkg.com/web3/-/web3-1.0.0-beta.48.tgz#66a3d29cdb40a0d2015cd7e5af081defaa2ec270"
integrity sha512-/HfIaRQVScZv0iy6fnEZCsXQbbOmtEB08sa2YaCkRo8nqUQo1C+55VC5sXqjrwKaDs9Xf9qxVTiUUeTbKD+KYg==
dependencies:
"@babel/runtime" "^7.3.1"
"@types/node" "^10.12.18"
web3-bzz "1.0.0-beta.48"
web3-core "1.0.0-beta.48"
web3-core-helpers "1.0.0-beta.48"
web3-core-method "1.0.0-beta.48"
web3-eth "1.0.0-beta.48"
web3-eth-personal "1.0.0-beta.48"
web3-net "1.0.0-beta.48"
web3-providers "1.0.0-beta.48"
web3-shh "1.0.0-beta.48"
web3-utils "1.0.0-beta.48"
web3@^0.16.0:
version "0.16.0"
resolved "https://registry.yarnpkg.com/web3/-/web3-0.16.0.tgz#a4554175cd462943035b1f1d39432f741c6b6019"
@ -16678,6 +16660,24 @@ web3@^0.20.1:
xhr2-cookies "^1.1.0"
xmlhttprequest "*"
web3@^1.0.0-beta.36:
version "1.0.0-beta.48"
resolved "https://registry.yarnpkg.com/web3/-/web3-1.0.0-beta.48.tgz#66a3d29cdb40a0d2015cd7e5af081defaa2ec270"
integrity sha512-/HfIaRQVScZv0iy6fnEZCsXQbbOmtEB08sa2YaCkRo8nqUQo1C+55VC5sXqjrwKaDs9Xf9qxVTiUUeTbKD+KYg==
dependencies:
"@babel/runtime" "^7.3.1"
"@types/node" "^10.12.18"
web3-bzz "1.0.0-beta.48"
web3-core "1.0.0-beta.48"
web3-core-helpers "1.0.0-beta.48"
web3-core-method "1.0.0-beta.48"
web3-eth "1.0.0-beta.48"
web3-eth-personal "1.0.0-beta.48"
web3-net "1.0.0-beta.48"
web3-providers "1.0.0-beta.48"
web3-shh "1.0.0-beta.48"
web3-utils "1.0.0-beta.48"
webidl-conversions@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-2.0.1.tgz#3bf8258f7d318c7443c36f2e169402a1a6703506"