Skip to content

Conversation

GitGuru7
Copy link
Contributor

…ther market

Description

Resolves #

Checklist

  • I have updated the documentation to account for the changes in the code.
  • If I added new functionality, I added tests covering it.
  • If I fixed a bug, I added a test preventing this bug from silently reappearing again.
  • My contribution follows Venus contribution guidelines.

@web3rover web3rover changed the title [VEN-1193]: generic swapper contract to shift collateral from one market to ano… [VEN-1193]: Whitelist Executors Aug 12, 2025
@web3rover web3rover self-assigned this Aug 12, 2025
Comment on lines 149 to 151
if (receiver != address(0) && whitelistedExecutors[receiver]) {
return uint256(Error.NO_ERROR);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Effects should take place even if the receiver is whitelisted, e.g. even though we defer the liquidity check, we still must add the borrower to the market if it's not there yet. Otherwise the user will have a borrow in the market but we won't account for this borrow in the liquidity check.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

ensureListed(market);

if (liquidator != address(0) && whitelistedExecutors[liquidator]) {
return uint256(Error.NO_ERROR);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we still call updateVenusSupplyIndex, distributeSupplierVenus to stop accruing XVS for the supply that no longer exists?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Co-authored-by: Jesus Lanchas <[email protected]>
Copy link

Code Coverage

Package Line Rate Branch Rate Health
contracts 100% 100%
contracts.Admin 88% 41%
contracts.Comptroller 100% 90%
contracts.Comptroller.Diamond 95% 61%
contracts.Comptroller.Diamond.facets 76% 63%
contracts.Comptroller.Diamond.interfaces 100% 100%
contracts.DelegateBorrowers 100% 89%
contracts.Governance 68% 45%
contracts.InterestRateModels 74% 59%
contracts.Lens 45% 37%
contracts.Liquidator 83% 60%
contracts.Oracle 100% 100%
contracts.PegStability 88% 84%
contracts.Swap 88% 58%
contracts.Swap.interfaces 100% 100%
contracts.Swap.lib 81% 55%
contracts.Tokens 100% 100%
contracts.Tokens.Prime 96% 72%
contracts.Tokens.Prime.Interfaces 100% 100%
contracts.Tokens.Prime.libs 90% 76%
contracts.Tokens.VAI 81% 53%
contracts.Tokens.VRT 20% 9%
contracts.Tokens.VTokens 64% 47%
contracts.Tokens.VTokens.legacy 0% 0%
contracts.Tokens.VTokens.legacy.Utils 0% 0%
contracts.Tokens.XVS 19% 8%
contracts.Utils 52% 30%
contracts.VAIVault 50% 45%
contracts.VRTVault 49% 36%
contracts.XVSVault 63% 50%
contracts.external 100% 100%
contracts.lib 89% 71%
Summary 61% (3381 / 5545) 45% (1246 / 2788)

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.

4 participants