Skip to content

Commit

Permalink
Do not send tip if feeRecipient is zero
Browse files Browse the repository at this point in the history
Some ERC20 tokens reject transfers in this case.

TODO: add the tip to the refund instead, so that the celo gas address is
always left empty after creditGasFees.
  • Loading branch information
karlb committed Jan 9, 2024
1 parent 5c74935 commit 42fad5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/fee_currencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func CreditFees(
return fmt.Errorf("call transfer base fee: %w", err)
}

if tipTxFee.Cmp(common.Big0) == 1 {
if feeRecipient != common.ZeroAddress && tipTxFee.Cmp(common.Big0) == 1 {
transfer2Data, err := abi.Pack("transfer", feeRecipient, tipTxFee)
if err != nil {
return fmt.Errorf("pack transfer tip: %w", err)
Expand Down

0 comments on commit 42fad5e

Please sign in to comment.