Commit 12ab73d6 authored by Mounir Benchemled's avatar Mounir Benchemled Committed by Noah Zinsmeister

Feature/ropsten (#370)

* Refactoring AddLiquidity to make gasLimit computation more clear
parent 2431e265
......@@ -362,6 +362,7 @@ export default function AddLiquidity() {
})
const deadline = Math.ceil(Date.now() / 1000) + DEADLINE_FROM_NOW
const estimatedGasLimit = await exchangeContract.estimate.addLiquidity(
isNewExchange ? ethers.constants.Zero : liquidityTokensMin,
isNewExchange ? outputValueParsed : outputValueMax,
......@@ -371,6 +372,8 @@ export default function AddLiquidity() {
}
)
const gasLimit = calculateGasMargin(estimatedGasLimit, GAS_MARGIN)
exchangeContract
.addLiquidity(
isNewExchange ? ethers.constants.Zero : liquidityTokensMin,
......@@ -378,7 +381,7 @@ export default function AddLiquidity() {
deadline,
{
value: inputValueParsed,
gasLimit: calculateGasMargin(estimatedGasLimit, GAS_MARGIN)
gasLimit
}
)
.then(response => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment