Skip to content
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

Merged
merged 4 commits into from
Jul 12, 2024
Merged

CometRepay #45

merged 4 commits into from
Jul 12, 2024

Conversation

scott-silver
Copy link
Contributor

No description provided.

src/builder/Actions.sol Outdated Show resolved Hide resolved
src/builder/QuarkBuilder.sol Show resolved Hide resolved
IQuarkWallet.QuarkOperation[] memory quarkOperations =
new IQuarkWallet.QuarkOperation[](chainAccountsList.length);

bool useQuotecall = false; // TODO: calculate an actual value for useQuoteCall
Copy link
Contributor

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?

Copy link
Contributor

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;
Copy link
Contributor

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 🤔 ?

Copy link
Contributor Author

@scott-silver scott-silver Jul 12, 2024

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

Comment on lines 17 to 19
address constant COMET_1 = address(0xc3);

address constant LINK_1 = address(0xfeed01);
Copy link
Contributor

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?

@scott-silver scott-silver changed the base branch from silver/borrow to main July 12, 2024 20:07
Copy link
Contributor

@kevincheng96 kevincheng96 left a 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
Copy link
Contributor

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

@scott-silver scott-silver merged commit 528e5d5 into main Jul 12, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants