-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Add partner fees #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
} else { | ||
calls.push( | ||
MoneyMarketService.encodeBorrow( | ||
{ asset: vaultAddress, amount: amount, interestRateMode: 2n, referralCode: 0, onBehalfOf: from }, | ||
moneyMarketConfig.lendingPool, | ||
), | ||
); | ||
if (fee && feeAmount) { | ||
calls.push(Erc20Service.encodeTansfer(vaultAddress, fee?.address, feeAmount)) | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to remove the fee from amount sent to user
calls.push(Erc20Service.encodeApprove(intent.inputToken, intentsContract, intent.inputAmount)); | ||
// user has to send input amount + fee amount to the intent contract | ||
const totalInputAmount = intent.inputAmount + feeAmount; | ||
calls.push(Erc20Service.encodeApprove(intent.inputToken, intentsContract, totalInputAmount)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though we add this here, each createIntent in each spoke takes the Intent amount as input
@@ -49,6 +64,8 @@ export class EvmSolverService { | |||
`hub asset not found for spoke chain token (intent.outputToken): ${createIntentParams.outputToken}`, | |||
); | |||
|
|||
const [feeData, feeAmount] = EvmSolverService.createIntentFeeData(fee, createIntentParams.inputAmount); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might have been the wrong place to place this, Most services do not use this a outer function so fee data is not propagate properly via ex createAndSubmitIntent
@R0bi7 is attempting to deploy a commit to the ICON Foundation PRO team on Vercel, but is not a member of this team. To resolve this issue, you can:
To read more about collaboration on Vercel, click here. |
*/ | ||
public static async createIntent<R extends boolean = false>( | ||
public static async createIntentDeposit<R extends boolean = false>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just questioning if this function is needed at all currently
WIP: of adding partner fees