Skip to content

Commit

Permalink
Fixed bug issues in bridge routing logics, as it was written for hand…
Browse files Browse the repository at this point in the history
…ling only 1 accounts, when have multiple it will brdige all 0 balance accounts
  • Loading branch information
cwang25 committed Oct 25, 2024
1 parent fec5c4f commit e3acbc8
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions src/builder/Actions.sol
Original file line number Diff line number Diff line change
Expand Up @@ -564,28 +564,30 @@ library Actions {
}
}

amountLeftToBridge -= amountToBridge;

(IQuarkWallet.QuarkOperation memory operation, Actions.Action memory action) = bridgeAsset(
BridgeAsset({
chainAccountsList: chainAccountsList,
assetSymbol: bridgeInfo.assetSymbol,
amount: amountToBridge,
// where it comes from
srcChainId: srcChainAccounts.chainId,
sender: srcAccountBalances[j].account,
// where it goes
destinationChainId: bridgeInfo.dstChainId,
recipient: bridgeInfo.recipient,
blockTimestamp: bridgeInfo.blockTimestamp
}),
payment,
bridgeInfo.useQuotecall
);

List.addAction(actions, action);
List.addQuarkOperation(quarkOperations, operation);
bridgeActionCount++;
if (amountToBridge > 0) {
amountLeftToBridge -= amountToBridge;

(IQuarkWallet.QuarkOperation memory operation, Actions.Action memory action) = bridgeAsset(
BridgeAsset({
chainAccountsList: chainAccountsList,
assetSymbol: bridgeInfo.assetSymbol,
amount: amountToBridge,
// where it comes from
srcChainId: srcChainAccounts.chainId,
sender: srcAccountBalances[j].account,
// where it goes
destinationChainId: bridgeInfo.dstChainId,
recipient: bridgeInfo.recipient,
blockTimestamp: bridgeInfo.blockTimestamp
}),
payment,
bridgeInfo.useQuotecall
);

List.addAction(actions, action);
List.addQuarkOperation(quarkOperations, operation);
bridgeActionCount++;
}
}
}

Expand Down

0 comments on commit e3acbc8

Please sign in to comment.