-
Notifications
You must be signed in to change notification settings - Fork 0
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
CometRepay #45
CometRepay #45
Conversation
369bceb
to
0aa9ee4
Compare
3f2fbbd
to
e5127ad
Compare
IQuarkWallet.QuarkOperation[] memory quarkOperations = | ||
new IQuarkWallet.QuarkOperation[](chainAccountsList.length); | ||
|
||
bool useQuotecall = false; // TODO: calculate an actual value for useQuoteCall |
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.
Trying to think what would be a use case for quotecall in repay.
I guess is when user has 10USDC, and comet has -10USDC, 1ETH.
So user trigger repayMax?
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.
Yeah repay works kind of like transfer in the sense that tokens are leaving the quark wallet. So the conditions for useQuoteCall
would be the same I think
if (Strings.stringEqIgnoreCase(transferActionContext.assetSymbol, paymentTokenSymbol)) { | ||
paymentTokenCost += transferActionContext.amount; | ||
if (Strings.stringEqIgnoreCase(nonBridgeAction.actionType, Actions.ACTION_TYPE_BORROW)) { | ||
continue; |
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.
Why we don't have to worry about the cost for BORROW and WITHDRAW 🤔 ?
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.
because borrowing and/or withdrawing an asset increases your balance of that asset, whereas supplying and/or repaying that asset decreases your balance of that asset
address constant COMET_1 = address(0xc3); | ||
|
||
address constant LINK_1 = address(0xfeed01); |
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.
iirc XXX_# the # means the chain id.
To prevent future confusion, probably it's better to use the actual addresses for those that are marked with the actual chain Id like 1 as mainnet?
e5127ad
to
1e5cb1d
Compare
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.
LGTM
IQuarkWallet.QuarkOperation[] memory quarkOperations = | ||
new IQuarkWallet.QuarkOperation[](chainAccountsList.length); | ||
|
||
bool useQuotecall = false; // TODO: calculate an actual value for useQuoteCall |
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.
Yeah repay works kind of like transfer in the sense that tokens are leaving the quark wallet. So the conditions for useQuoteCall
would be the same I think
No description provided.