Set value to 0 when sending txs/deploying new safe

This commit is contained in:
mmv 2019-11-14 10:30:07 +04:00
parent 33d8153593
commit 3b233024ba
6 changed files with 10 additions and 8 deletions

View File

@ -74,7 +74,9 @@ export const deploySafeContract = async (safeAccounts: string[], numConfirmation
const gas = await calculateGasOf(proxyFactoryData, userAccount, proxyFactoryMaster.address)
const gasPrice = await calculateGasPrice()
return proxyFactoryMaster.createProxy(safeMaster.address, gnosisSafeData, { from: userAccount, gas, gasPrice })
return proxyFactoryMaster.createProxy(safeMaster.address, gnosisSafeData, {
from: userAccount, gas, gasPrice, value: 0,
})
}
export const estimateGasForDeployingSafe = async (

View File

@ -48,7 +48,7 @@ export const estimateDataGas = (
'',
)}000000000000000000000000000000000000000000000000000000000000000001`
const payload = safe.contract.methods
.execTransaction(to, valueInWei, data, operation, txGasEstimate, 0, gasPrice, gasToken, refundReceiver, sigs)
.execTransaction(to, valueInWei, data, operation, txGasEstimate, 0, gasPrice, gasToken, refundReceiver, sigs, { value: 0 })
.encodeABI()
// eslint-disable-next-line
@ -122,7 +122,7 @@ export const calculateTxFee = async (
'0x0000000000000000000000000000000000000000',
'0x0000000000000000000000000000000000000000',
sigs,
{ from: '0xbc2BB26a6d821e69A38016f3858561a1D80d4182' },
{ from: '0xbc2BB26a6d821e69A38016f3858561a1D80d4182', value: 0 },
)
return estimate

View File

@ -33,7 +33,7 @@ export const estimateTxGasCosts = async (
'',
)}000000000000000000000000000000000000000000000000000000000000000001`
txData = await safeInstance.methods
.execTransaction(to, tx ? tx.value : 0, data, CALL, 0, 0, 0, ZERO_ADDRESS, ZERO_ADDRESS, signatures)
.execTransaction(to, tx ? tx.value : 0, data, CALL, 0, 0, 0, ZERO_ADDRESS, ZERO_ADDRESS, signatures, { value: 0 })
.encodeABI()
} else {
const txHash = await safeInstance.methods

View File

@ -37,7 +37,7 @@ export const getApprovalTransaction = async (
const web3 = getWeb3()
const contract = new web3.eth.Contract(GnosisSafeSol.abi, safeInstance.address)
return contract.methods.approveHash(txHash)
return contract.methods.approveHash(txHash, { value: 0 })
} catch (err) {
console.error(`Error while approving transaction: ${err}`)
@ -59,7 +59,7 @@ export const getExecutionTransaction = async (
const web3 = getWeb3()
const contract = new web3.eth.Contract(GnosisSafeSol.abi, safeInstance.address)
return contract.methods.execTransaction(to, valueInWei, data, operation, 0, 0, 0, ZERO_ADDRESS, ZERO_ADDRESS, sigs)
return contract.methods.execTransaction(to, valueInWei, data, operation, 0, 0, 0, ZERO_ADDRESS, ZERO_ADDRESS, sigs, { value: 0 })
} catch (err) {
console.error(`Error while creating transaction: ${err}`)

View File

@ -121,7 +121,7 @@ const createTransaction = (
showSnackbar(notificationsQueue.afterExecutionError, enqueueSnackbar, closeSnackbar)
const executeDataUsedSignatures = safeInstance.contract.methods
.execTransaction(to, valueInWei, txData, CALL, 0, 0, 0, ZERO_ADDRESS, ZERO_ADDRESS, sigs)
.execTransaction(to, valueInWei, txData, CALL, 0, 0, 0, ZERO_ADDRESS, ZERO_ADDRESS, sigs, { value: 0 })
.encodeABI()
const errMsg = await getErrorMessage(safeInstance.address, 0, executeDataUsedSignatures, from)
console.error(`Error executing the TX: ${errMsg}`)

View File

@ -145,7 +145,7 @@ const processTransaction = (
closeSnackbar(pendingExecutionKey)
showSnackbar(notificationsQueue.afterExecutionError, enqueueSnackbar, closeSnackbar)
const executeData = safeInstance.contract.methods.approveHash(txHash).encodeABI()
const executeData = safeInstance.contract.methods.approveHash(txHash, { value: 0 }).encodeABI()
const errMsg = await getErrorMessage(safeInstance.address, 0, executeData, from)
console.error(`Error executing the TX: ${errMsg}`)
}