Set value to 0 when sending txs/deploying new safe
This commit is contained in:
parent
33d8153593
commit
3b233024ba
|
@ -74,7 +74,9 @@ export const deploySafeContract = async (safeAccounts: string[], numConfirmation
|
||||||
const gas = await calculateGasOf(proxyFactoryData, userAccount, proxyFactoryMaster.address)
|
const gas = await calculateGasOf(proxyFactoryData, userAccount, proxyFactoryMaster.address)
|
||||||
const gasPrice = await calculateGasPrice()
|
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 (
|
export const estimateGasForDeployingSafe = async (
|
||||||
|
|
|
@ -48,7 +48,7 @@ export const estimateDataGas = (
|
||||||
'',
|
'',
|
||||||
)}000000000000000000000000000000000000000000000000000000000000000001`
|
)}000000000000000000000000000000000000000000000000000000000000000001`
|
||||||
const payload = safe.contract.methods
|
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()
|
.encodeABI()
|
||||||
|
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
|
@ -122,7 +122,7 @@ export const calculateTxFee = async (
|
||||||
'0x0000000000000000000000000000000000000000',
|
'0x0000000000000000000000000000000000000000',
|
||||||
'0x0000000000000000000000000000000000000000',
|
'0x0000000000000000000000000000000000000000',
|
||||||
sigs,
|
sigs,
|
||||||
{ from: '0xbc2BB26a6d821e69A38016f3858561a1D80d4182' },
|
{ from: '0xbc2BB26a6d821e69A38016f3858561a1D80d4182', value: 0 },
|
||||||
)
|
)
|
||||||
|
|
||||||
return estimate
|
return estimate
|
||||||
|
|
|
@ -33,7 +33,7 @@ export const estimateTxGasCosts = async (
|
||||||
'',
|
'',
|
||||||
)}000000000000000000000000000000000000000000000000000000000000000001`
|
)}000000000000000000000000000000000000000000000000000000000000000001`
|
||||||
txData = await safeInstance.methods
|
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()
|
.encodeABI()
|
||||||
} else {
|
} else {
|
||||||
const txHash = await safeInstance.methods
|
const txHash = await safeInstance.methods
|
||||||
|
|
|
@ -37,7 +37,7 @@ export const getApprovalTransaction = async (
|
||||||
const web3 = getWeb3()
|
const web3 = getWeb3()
|
||||||
const contract = new web3.eth.Contract(GnosisSafeSol.abi, safeInstance.address)
|
const contract = new web3.eth.Contract(GnosisSafeSol.abi, safeInstance.address)
|
||||||
|
|
||||||
return contract.methods.approveHash(txHash)
|
return contract.methods.approveHash(txHash, { value: 0 })
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error(`Error while approving transaction: ${err}`)
|
console.error(`Error while approving transaction: ${err}`)
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ export const getExecutionTransaction = async (
|
||||||
const web3 = getWeb3()
|
const web3 = getWeb3()
|
||||||
const contract = new web3.eth.Contract(GnosisSafeSol.abi, safeInstance.address)
|
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) {
|
} catch (err) {
|
||||||
console.error(`Error while creating transaction: ${err}`)
|
console.error(`Error while creating transaction: ${err}`)
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,7 @@ const createTransaction = (
|
||||||
showSnackbar(notificationsQueue.afterExecutionError, enqueueSnackbar, closeSnackbar)
|
showSnackbar(notificationsQueue.afterExecutionError, enqueueSnackbar, closeSnackbar)
|
||||||
|
|
||||||
const executeDataUsedSignatures = safeInstance.contract.methods
|
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()
|
.encodeABI()
|
||||||
const errMsg = await getErrorMessage(safeInstance.address, 0, executeDataUsedSignatures, from)
|
const errMsg = await getErrorMessage(safeInstance.address, 0, executeDataUsedSignatures, from)
|
||||||
console.error(`Error executing the TX: ${errMsg}`)
|
console.error(`Error executing the TX: ${errMsg}`)
|
||||||
|
|
|
@ -145,7 +145,7 @@ const processTransaction = (
|
||||||
closeSnackbar(pendingExecutionKey)
|
closeSnackbar(pendingExecutionKey)
|
||||||
showSnackbar(notificationsQueue.afterExecutionError, enqueueSnackbar, closeSnackbar)
|
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)
|
const errMsg = await getErrorMessage(safeInstance.address, 0, executeData, from)
|
||||||
console.error(`Error executing the TX: ${errMsg}`)
|
console.error(`Error executing the TX: ${errMsg}`)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue