Skip to content

Commit 0435454

Browse files
author
jagdeep sidhu
committed
min amount 1 sys + language updates
1 parent 675ac4c commit 0435454

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/wizard/Step1FastSwap.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,16 @@ class Step1FS extends Component {
184184
validateNewInput.buttonValMsg1 = this.props.t("step1FSInputMissing");
185185
valid = false;
186186
} else {
187+
const minamount = web3.utils.toBN(web3.utils.toWei('1', 'ether'));
187188
amount = web3.utils.toWei(userInput.amount.toString(), 'ether');
188189
if(web3.utils.toBN(amount).gt(web3.utils.toBN(web3.utils.toWei(this.state.NEVMBALANCE, 'ether')))) {
189190
validateNewInput.buttonVal1 = false;
190191
validateNewInput.buttonValMsg1 = this.props.t("step1FSInsufficientBalanceNEVM");
191192
valid = false;
193+
} else if(web3.utils.toBN(amount).lt(minamount)) {
194+
validateNewInput.buttonVal1 = false;
195+
validateNewInput.buttonValMsg1 = this.props.t("step1FSMinAmount");
196+
valid = false;
192197
}
193198
if (!web3.utils.isAddress(userInput.destinationAddress)) {
194199
validateNewInput.buttonVal1 = false;
@@ -241,11 +246,16 @@ class Step1FS extends Component {
241246
validateNewInput.buttonValMsg2 = this.props.t("step1FSInputMissing");
242247
valid = false;
243248
} else {
249+
const minamount = web3.utils.toBN(web3.utils.toWei('1', 'ether'));
244250
amount = web3.utils.toWei(userInput.amount.toString(), 'ether');
245251
if(web3.utils.toBN(amount).gt(web3.utils.toBN(web3.utils.toWei(this.state.SYSBALANCE, 'ether')))) {
246252
validateNewInput.buttonVal2 = false;
247253
validateNewInput.buttonValMsg2 = this.props.t("step1FSInsufficientBalanceSYS");
248254
valid = false;
255+
} else if(web3.utils.toBN(amount).lt(minamount)) {
256+
validateNewInput.buttonVal2 = false;
257+
validateNewInput.buttonValMsg2 = this.props.t("step1FSMinAmount");
258+
valid = false;
249259
}
250260
try {
251261
sjs.utils.bitcoinjs.address.toOutputScript(userInput.destinationAddress, CONFIGURATION.SysNetwork)

src/wizard/i18n.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ i18n.use(LanguageDetector).init({
6868
'step1FSDescription': 'This provides a quick way to bridge Syscoin across between the UTXO and the NEVM chains. To use FastSwap please fill out the amount, and destination address to the chain you are moving to. For example if you are coming from SYS (UTXO) to go to the NEVM, this would be your NEVM address, and vice versa. Once you have filled these fields out click on either the <b>Send UTXO(SYS)</b> or <b>Send NEVM(SYS)</b> buttons depending on your desired destination (Sending coins on UTXO means you are moving to NEVM and sending coins on NEVM means you are moving to UTXO). Once you have done that you may initiate or view an existing swap by clicking on the <b>Initiate or Check Swap</b> button.',
6969
'step1FSWrongTx': 'Could not find Swap, try a different Transaction ID',
7070
'step1FSEnterTx': 'Enter the Transaction ID of the Syscoin Transaction where the Syscoin were sent to one of the designated addresses in the description above',
71-
'step1FSSendNEVM': 'Send SYS(NEVM)',
72-
'step1FSSendUTXO': 'Send SYS(UTXO)',
71+
'step1FSSendNEVM': 'Swap SYS(NEVM) to SYS(UTXO)',
72+
'step1FSSendUTXO': 'Swap SYS(UTXO) to SYS(NEVM)',
7373
'step1FSEnterAmount': 'Enter Amount',
7474
'step1FSEnterDestination': 'Enter Destination Address',
7575
'step1FSMissingTxid': 'Missing Transaction ID',
@@ -80,6 +80,7 @@ i18n.use(LanguageDetector).init({
8080
'step1FSStatusUnknown': 'Uknown state',
8181
'step1FSInsufficientBalanceNEVM': 'Insufficient NEVM balance',
8282
'step1FSInsufficientBalanceSYS': 'Insufficient SYS balance',
83+
'step1FSMinAmount': 'Amount too little, minimum amount is 1 SYS',
8384
'step1FSNoSettings': 'Could not download FastSwap settings from server',
8485
'step2ESHead': '<em className="step">Step 2:</em> Build a Syscoin Mint transaction',
8586
'step2ESDescription': 'Please enter the Transaction ID from your NEVM burn transaction below if it is not already auto-filled.<br/> Click Generate to create the raw unsigned transaction before proceeding to the next step. Note to ensure that the burn transaction on NEVM was adequately settled, you will have to wait atleast 1 confirmation before you are able to proceed with this step and create the mint transaction on Syscoin.',
@@ -217,6 +218,7 @@ i18n.use(LanguageDetector).init({
217218
'step1FSStatusUnknown': 'Uknown state',
218219
'step1FSInsufficientBalanceNEVM': 'Insufficient NEVM balance',
219220
'step1FSInsufficientBalanceSYS': 'Insufficient SYS balance',
221+
'step1FSMinAmount': 'Amount too little, minimum amount is 1 SYS',
220222
'step1FSNoSettings': 'Could not download FastSwap settings from server',
221223
'step2ESHead': '<em className="step">Step 2:</em> Build a Syscoin Mint transaction',
222224
'step2ESDescription': 'Please enter the Transaction ID from your NEVM burn transaction below if it is not already auto-filled.<br/> Click Generate to create the raw unsigned transaction before proceeding to the next step. Note to ensure that the burn transaction on NEVM was adequately settled, you will have to wait atleast 1 confirmation before you are able to proceed with this step and create the mint transaction on Syscoin.',
@@ -354,6 +356,7 @@ i18n.use(LanguageDetector).init({
354356
'step1FSStatusUnknown': 'Uknown state',
355357
'step1FSInsufficientBalanceNEVM': 'Insufficient NEVM balance',
356358
'step1FSInsufficientBalanceSYS': 'Insufficient SYS balance',
359+
'step1FSMinAmount': 'Amount too little, minimum amount is 1 SYS',
357360
'step1FSNoSettings': 'Could not download FastSwap settings from server',
358361
'step2ESHead': '<em className="step">Step 2:</em> Build a Syscoin Mint transaction',
359362
'step2ESDescription': 'Please enter the Transaction ID from your NEVM burn transaction below if it is not already auto-filled.<br/> Click Generate to create the raw unsigned transaction before proceeding to the next step. Note to ensure that the burn transaction on NEVM was adequately settled, you will have to wait atleast 1 confirmation before you are able to proceed with this step and create the mint transaction on Syscoin.',

0 commit comments

Comments
 (0)