@@ -223,10 +223,12 @@ func (k Keeper) PayGasInERC20AndUpdateCctx(
223
223
)
224
224
gasObtained := amounts [2 ]
225
225
226
+ // FIXME: investigate small mismatches between gasObtained and outTxGasFee
227
+ // https://github.com/zeta-chain/node/issues/1303
226
228
// check if the final gas received after swap matches the gas fee defined
227
229
// if not there might be issues with the pool liquidity and it is safer from an accounting perspective to return an error
228
- if gasObtained .Cmp (outTxGasFee .BigInt ()) != 0 {
229
- return cosmoserrors .Wrapf (types .ErrInvalidGasAmount , "gas obtained for burn (%s) not equal to gas fee(%s)" , gasObtained , outTxGasFee )
230
+ if gasObtained .Cmp (outTxGasFee .BigInt ()) == - 1 {
231
+ return cosmoserrors .Wrapf (types .ErrInvalidGasAmount , "gas obtained for burn (%s) is lower than gas fee(%s)" , gasObtained , outTxGasFee )
230
232
}
231
233
232
234
// burn the gas ZRC20
@@ -333,6 +335,9 @@ func (k Keeper) PayGasInZetaAndUpdateCctx(
333
335
"zetaAmountIn" , amounts [0 ],
334
336
"zrc20AmountOut" , amounts [1 ],
335
337
)
338
+
339
+ // FIXME: investigate small mismatches between amounts[1] and outTxGasFee
340
+ // https://github.com/zeta-chain/node/issues/1303
336
341
err = k .fungibleKeeper .CallZRC20Burn (ctx , types .ModuleAddressEVM , gasZRC20 , amounts [1 ], noEthereumTxEvent )
337
342
if err != nil {
338
343
return cosmoserrors .Wrap (err , "PayGasInZetaAndUpdateCctx: unable to CallZRC20Burn" )
0 commit comments