ANocturnalGuy / proxy-api

Use const declarations for variables that are never reassigned JS-0242
Anti-pattern
Minor
4 occurrences in this check
'response' is never reassigned. Use 'const' instead
 97
 98                try {
 99                    await Model.findOneAndUpdate({_id: data[i]._id}, {used: true}, {new: true})
100                    let response = await web3.eth.sendSignedTransaction('0x' + signedTx.serialize().toString('hex'))101                    if(response.transactionHash == null) {
102                        console.error('trascation not minded')
103                    }
'response' is never reassigned. Use 'const' instead
237
238    console.log('log->signedTx', signedTx)
239    try {
240        let response = await web3.eth.sendSignedTransaction('0x' + signedTx.serialize().toString('hex'))241        if(response.transactionHash == null) {
242            res.status(500).json({ message: `Transaction not mined` })
243        }
'response' is never reassigned. Use 'const' instead
181                console.log('log->signedTx', signedTx)
182
183                try {
184                    let response = await web3.eth.sendSignedTransaction('0x' + signedTx.serialize().toString('hex'))185                    if(response.transactionHash == null) {
186                        res.status(500).json({ message: `Transaction  not mined` })
187                    }
'flag' is never reassigned. Use 'const' instead
 58        }
 59    } else {
 60        console.log('log->sell action')
 61        let flag = true; 62        for(let i=0; i < receipt.logs.length; i++) {
 63            const log = receipt.logs[i]
 64            console.log('log->log', log)