Skip to content

Gas fee not deducted from tip when source asset is same as target asset #42

@lumtis

Description

@lumtis

In the following code in router.sol:

// Check if source and target ZRC20 are the same
 if (intentInfo.zrc20 == settlementInfo.targetZRC20) {
    // No swap needed, use original amounts
    settlementInfo.amountWithTipOut = intentInfo.amountWithTip;
    settlementInfo.tipAfterSwap = wantedTip;
} else {

When the intentInfo.zrc20 == settlementInfo.targetZRC2 is true () happen for Ethereum, swap is not called from the swap module because no routing of asset is necessary.
However, the purpose of the swap module is also to acquire the gas necessary to perform the withdraw to the connected chain and deduct it from the tip.
Since this one is missing, if the swap call is skipped, the tx will liekly fail because the router contract will not have the necessary funds to cover the withdraw fee.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions