Commit 95008950 authored by Chi Kei Chan's avatar Chi Kei Chan

Audit tx detail ranges

parent ac87a161
...@@ -502,9 +502,9 @@ class AddLiquidity extends Component { ...@@ -502,9 +502,9 @@ class AddLiquidity extends Component {
<img src={DropupBlue} /> <img src={DropupBlue} />
</div> </div>
<div> <div>
<div>You are adding between {b(`${minOutput.toFixed(5)} - ${maxOutput.toFixed(5)} ${label}`)} + {b(`${BN(inputValue).toFixed(5)} ETH`)} into the liquidity pool.</div> <div>You are adding between {b(`${+minOutput.toFixed(7)} - ${+maxOutput.toFixed(7)} ${label}`)} + {b(`${+BN(inputValue).toFixed(7)} ETH`)} into the liquidity pool.</div>
<div className="pool__last-summary-text"> <div className="pool__last-summary-text">
You will receive between {b(`${minPercentage.toFixed(5)}%`)} and {b(`${maxPercentage.toFixed(5)}%`)} of the {`${label}/ETH`} pool tokens. You will receive between {b(`${+minPercentage.toFixed(5)}%`)} and {b(`${+maxPercentage.toFixed(5)}%`)} of the {`${label}/ETH`} pool tokens.
</div> </div>
</div> </div>
</div> </div>
......
...@@ -586,13 +586,13 @@ class Send extends Component { ...@@ -586,13 +586,13 @@ class Send extends Component {
if (lastEditedField === INPUT) { if (lastEditedField === INPUT) {
switch(type) { switch(type) {
case 'ETH_TO_TOKEN': case 'ETH_TO_TOKEN':
minOutput = BN(outputValue).multipliedBy(1 - ALLOWED_SLIPPAGE).toFixed(5) minOutput = BN(outputValue).multipliedBy(1 - ALLOWED_SLIPPAGE).toFixed(7);
break; break;
case 'TOKEN_TO_ETH': case 'TOKEN_TO_ETH':
minOutput = BN(outputValue).multipliedBy(1 - ALLOWED_SLIPPAGE).toFixed(5); minOutput = BN(outputValue).multipliedBy(1 - ALLOWED_SLIPPAGE).toFixed(7);
break; break;
case 'TOKEN_TO_TOKEN': case 'TOKEN_TO_TOKEN':
minOutput = BN(outputValue).multipliedBy(1 - TOKEN_ALLOWED_SLIPPAGE).toFixed(5); minOutput = BN(outputValue).multipliedBy(1 - TOKEN_ALLOWED_SLIPPAGE).toFixed(7);
break; break;
default: default:
break; break;
...@@ -602,13 +602,13 @@ class Send extends Component { ...@@ -602,13 +602,13 @@ class Send extends Component {
if (lastEditedField === OUTPUT) { if (lastEditedField === OUTPUT) {
switch (type) { switch (type) {
case 'ETH_TO_TOKEN': case 'ETH_TO_TOKEN':
maxInput = BN(inputValue).multipliedBy(1 + ALLOWED_SLIPPAGE).toFixed(5); maxInput = BN(inputValue).multipliedBy(1 + ALLOWED_SLIPPAGE).toFixed(7);
break; break;
case 'TOKEN_TO_ETH': case 'TOKEN_TO_ETH':
maxInput = BN(inputValue).multipliedBy(1 + ALLOWED_SLIPPAGE).toFixed(5); maxInput = BN(inputValue).multipliedBy(1 + ALLOWED_SLIPPAGE).toFixed(7);
break; break;
case 'TOKEN_TO_TOKEN': case 'TOKEN_TO_TOKEN':
maxInput = BN(inputValue).multipliedBy(1 + TOKEN_ALLOWED_SLIPPAGE).toFixed(5); maxInput = BN(inputValue).multipliedBy(1 + TOKEN_ALLOWED_SLIPPAGE).toFixed(7);
break; break;
default: default:
break; break;
...@@ -620,10 +620,10 @@ class Send extends Component { ...@@ -620,10 +620,10 @@ class Send extends Component {
description = ( description = (
<div> <div>
<div> <div>
You are selling {b(`${inputValue} ${inputLabel}`)}. You are selling {b(`${+inputValue} ${inputLabel}`)}.
</div> </div>
<div className="send__last-summary-text"> <div className="send__last-summary-text">
<span className="swap__highlight-text">{recipient.slice(0, 6)}</span> will receive between {b(`${minOutput} ${outputLabel}`)} and {b(`${outputValue} ${outputLabel}`)}. {b(`${recipient.slice(0, 6)}...${recipient.slice(-4)}`)} will receive between {b(`${+minOutput} ${outputLabel}`)} and {b(`${+outputValue} ${outputLabel}`)}.
</div> </div>
</div> </div>
); );
...@@ -631,10 +631,10 @@ class Send extends Component { ...@@ -631,10 +631,10 @@ class Send extends Component {
description = ( description = (
<div> <div>
<div> <div>
You are selling between {b(`${inputValue} ${inputLabel}`)} to {b(`${maxInput} ${inputLabel}`)}. You are selling between {b(`${+inputValue} ${inputLabel}`)} to {b(`${+maxInput} ${inputLabel}`)}.
</div> </div>
<div className="send__last-summary-text"> <div className="send__last-summary-text">
<span className="swap__highlight-text">{recipient.slice(0, 6)}</span> will receive {b(`${outputValue} ${outputLabel}`)}. {b(`${recipient.slice(0, 6)}...${recipient.slice(-4)}`)} will receive {b(`${+outputValue} ${outputLabel}`)}.
</div> </div>
</div> </div>
); );
......
...@@ -539,12 +539,8 @@ class Swap extends Component { ...@@ -539,12 +539,8 @@ class Swap extends Component {
const { const {
inputValue, inputValue,
inputCurrency, inputCurrency,
inputError,
outputValue, outputValue,
outputCurrency, outputCurrency,
outputError,
showSummaryModal,
inputAmountB,
lastEditedField, lastEditedField,
} = this.state; } = this.state;
const { selectors, account } = this.props; const { selectors, account } = this.props;
...@@ -571,13 +567,13 @@ class Swap extends Component { ...@@ -571,13 +567,13 @@ class Swap extends Component {
if (lastEditedField === INPUT) { if (lastEditedField === INPUT) {
switch(type) { switch(type) {
case 'ETH_TO_TOKEN': case 'ETH_TO_TOKEN':
minOutput = BN(outputValue).multipliedBy(1 - ALLOWED_SLIPPAGE).toFixed(5) minOutput = BN(outputValue).multipliedBy(1 - ALLOWED_SLIPPAGE).toFixed(7).trim();
break; break;
case 'TOKEN_TO_ETH': case 'TOKEN_TO_ETH':
minOutput = BN(outputValue).multipliedBy(1 - ALLOWED_SLIPPAGE).toFixed(5); minOutput = BN(outputValue).multipliedBy(1 - ALLOWED_SLIPPAGE).toFixed(7);
break; break;
case 'TOKEN_TO_TOKEN': case 'TOKEN_TO_TOKEN':
minOutput = BN(outputValue).multipliedBy(1 - TOKEN_ALLOWED_SLIPPAGE).toFixed(5); minOutput = BN(outputValue).multipliedBy(1 - TOKEN_ALLOWED_SLIPPAGE).toFixed(7);
break; break;
default: default:
break; break;
...@@ -587,13 +583,13 @@ class Swap extends Component { ...@@ -587,13 +583,13 @@ class Swap extends Component {
if (lastEditedField === OUTPUT) { if (lastEditedField === OUTPUT) {
switch (type) { switch (type) {
case 'ETH_TO_TOKEN': case 'ETH_TO_TOKEN':
maxInput = BN(inputValue).multipliedBy(1 + ALLOWED_SLIPPAGE).toFixed(5); maxInput = BN(inputValue).multipliedBy(1 + ALLOWED_SLIPPAGE).toFixed(7).trim();
break; break;
case 'TOKEN_TO_ETH': case 'TOKEN_TO_ETH':
maxInput = BN(inputValue).multipliedBy(1 + ALLOWED_SLIPPAGE).toFixed(5); maxInput = BN(inputValue).multipliedBy(1 + ALLOWED_SLIPPAGE).toFixed(7);
break; break;
case 'TOKEN_TO_TOKEN': case 'TOKEN_TO_TOKEN':
maxInput = BN(inputValue).multipliedBy(1 + TOKEN_ALLOWED_SLIPPAGE).toFixed(5); maxInput = BN(inputValue).multipliedBy(1 + TOKEN_ALLOWED_SLIPPAGE).toFixed(7);
break; break;
default: default:
break; break;
...@@ -605,10 +601,10 @@ class Swap extends Component { ...@@ -605,10 +601,10 @@ class Swap extends Component {
description = ( description = (
<div> <div>
<div> <div>
You are selling {b(`${inputValue} ${inputLabel}`)}. You are selling {b(`${+inputValue} ${inputLabel}`)}.
</div> </div>
<div className="send__last-summary-text"> <div className="send__last-summary-text">
You will receive between {b(`${minOutput} ${outputLabel}`)} and {b(`${outputValue} ${outputLabel}`)}. You will receive between {b(`${+minOutput} ${outputLabel}`)} and {b(`${+outputValue} ${outputLabel}`)}.
</div> </div>
</div> </div>
); );
...@@ -616,10 +612,10 @@ class Swap extends Component { ...@@ -616,10 +612,10 @@ class Swap extends Component {
description = ( description = (
<div> <div>
<div> <div>
You are selling between {b(`${inputValue} ${inputLabel}`)} to {b(`${maxInput} ${inputLabel}`)}. You are selling between {b(`${+inputValue} ${inputLabel}`)} to {b(`${+maxInput} ${inputLabel}`)}.
</div> </div>
<div className="send__last-summary-text"> <div className="send__last-summary-text">
You will receive {b(`${outputValue} ${outputLabel}`)}. You will receive {b(`${+outputValue} ${outputLabel}`)}.
</div> </div>
</div> </div>
); );
......
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