Skip to content

Conversation

@web3rover
Copy link
Contributor

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.

@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Health
contracts 100% 100%
contracts.Undertaker 0% 0%
Summary 0% (0 / 55) 0% (0 / 26)

@web3rover web3rover marked this pull request as ready for review September 29, 2025 13:43
@web3rover web3rover requested a review from chechu September 29, 2025 13:43
@web3rover web3rover self-assigned this Sep 29, 2025
@chechu chechu changed the title Undertaker Contract [VPD-154]: Undertaker Contract Sep 29, 2025
@Debugger022 Debugger022 self-requested a review October 7, 2025 12:06
Comment on lines +114 to +120
expiries[market] = Expiry({
toBePausedAfterTimestamp: toBePausedAfterTimestamp,
canUnlist: canUnlist,
toBeUnlistedMinTotalSupplyUSD: toBeUnlistedMinTotalSupplyUSD,
pauseTimestamp: 0,
unlistTimestamp: 0
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Is overwriting an existing entry allowed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes.

function exchangeRateStored() external view returns (uint256);
}

interface IComptroller {
Copy link
Contributor

Choose a reason for hiding this comment

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

There are many functions not being used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's fine to keep them as other PRs of this repo might be using them. At the end all PRs will be merged so we will end up having these functions.

@web3rover web3rover requested a review from Debugger022 October 8, 2025 11:24

if (expiry.toBePausedAfterTimestamp != 0 && block.timestamp < expiry.toBePausedAfterTimestamp) {
return false;
}
Copy link
Contributor

@fred-venus fred-venus Oct 28, 2025

Choose a reason for hiding this comment

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

This means for a market that already has a scheduled paused time we won't pause it even if it meets the pausing criteria ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes right.

comptroller.actionPaused(market, IComptroller.Action.ENTER_MARKET)
) {
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

may i ask what's the rationale behind, if let's say only MINT action is paused, shouldn't we continue and pause the rest actions as well ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are assuming there won't be cases where just the MINT is paused. If that's the case then this market will be handled manually for pausing other actions.


(, uint256 collateralFactorMantissa, ) = comptroller.markets(market);
if (collateralFactorMantissa == 0) {
return false;
Copy link
Contributor

Choose a reason for hiding this comment

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

also if CF = 0, will it have any impact on the pause ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here also we are assuming if a market is not paused then it's unlikely to make CF as 0.

IComptroller(comptroller).setMarketSupplyCaps(markets, caps);

IComptroller(comptroller).unlistMarket(market);

Copy link
Contributor

Choose a reason for hiding this comment

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

may i ask what will happen for those remaining funding inside this market ? They got stuck forever ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We check if the total deposit is below toBeUnlistedMinTotalSupplyUSD so a very small amount is stuck. Which I think is acceptable.

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