Skip to content

Commit

Permalink
fix: add amount to msg value for repay (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
gidonkatten authored Jul 16, 2024
1 parent b4ba570 commit 2551022
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/metal-jobs-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@folks-finance/xchain-sdk": patch
---

add amount to msg value for repay
4 changes: 3 additions & 1 deletion src/chains/evm/spoke/modules/folks-evm-loan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ export const prepare = {
}

// get adapter fees
const msgValue = await bridgeRouter.read.getSendFee([messageToSend]);
const adapterFees = await bridgeRouter.read.getSendFee([messageToSend]);
const value = spokeTokenData.token.type === TokenType.NATIVE ? amount : BigInt(0);
const msgValue = adapterFees + value;

// get gas limits
const gasLimit = await spokeToken.estimateGas.repay(
Expand Down

0 comments on commit 2551022

Please sign in to comment.