Skip to content

[VEN-3276]: add pause module for the guardian multisig#1

Open
kkirka wants to merge 8 commits into
mainfrom
feat/pause-module
Open

[VEN-3276]: add pause module for the guardian multisig#1
kkirka wants to merge 8 commits into
mainfrom
feat/pause-module

Conversation

@kkirka
Copy link
Copy Markdown
Contributor

@kkirka kkirka commented Jun 24, 2025

This PR introduces the Venus Pause Module, a Safe module that enables emergency pausing of Venus markets. The module supports both legacy and isolated pools, allowing authorized keepers (Tenderly actions, Hexagate/Hypernative monitors, etc.) to pause mint, borrow, and enter market actions for specified vTokens.

@chechu chechu changed the title feat: add pause module for the guardian multisig [VEN-3276]: add pause module for the guardian multisig Jun 27, 2025
Comment on lines +10 to +11
const MULTI_SEND_CALL_ONLY_CANONICAL = "0x9641d764fc13c8B624c04430C7356C1C7C8102e2";
const MULTI_SEND_CALL_ONLY_ZKSYNC = "0x0408EF011960d02349d50286D20531229BCef773";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe these contracts are backward compatible, but Safe redeployed these contracts for the different versions of the Safe wallet

For example, the version of the Guardian on Ethereum is 1.3.0. And the MultiSendCallOnly contract for that version is 0x40A2aCCbd92BCA938b02010E17A5b8929b49130D (according to the Safe page)

We have the addresses of the MultiSendCallOnly, per network (depending on the Safe version of our Guardians) here: https://github.com/VenusProtocol/vips/blob/main/src/multisig/utils.ts#L140-L229

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

According to the history they've been playing with memory safety to squeeze the top gas performance out of the contract. The contract itself is not related to Safe singleton (i.e. it doesn't call any Safe methods or expect Safe to be in a certain state), so I'd say there are no compatibility requirements – the only thing it does is it unpacks serialized txs and executes them one by one. I'd use the latest version regardless of the version of Safe since it's presumably the most gas-optimized.

hardhat: {},
bsctestnet: {
tenderlyKeeper: TENDERLY_KEEPER,
guardian: "0x70B9120deF94F377fD98AB28CbBCe477a355202A",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't see this contract deployed to testnet. Is it for development purposes?

Comment thread contracts/VenusPauseModule.sol Outdated
Comment thread contracts/VenusPauseModule.sol
Comment thread contracts/VenusPauseModule.sol
address comptroller = address(VToken(vToken).comptroller());
bytes memory data;
if (comptroller == LEGACY_POOL_COMPTROLLER) {
data = abi.encodePacked(_legacyPoolPauseActions(comptroller, vToken));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Aren't we setting CF to 0 in legacy pool?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Setting CF to zero in the Core pool on BNB chain could make accounts eligible to be liquidated (because the Liquidation Threshold concept doesn't exist). So, it would be a risky action to do it automatically

Exef
Exef previously approved these changes Jul 7, 2025
(, , uint256 liquidationThreshold) = Comptroller(comptroller).markets(vToken);
data = abi.encodePacked(
_pauseActions(comptroller, vToken),
_setCollateralFactor(comptroller, vToken, 0, liquidationThreshold)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

For readability I'd introduce ZERO_COLLATERAL_FACTOR constant

Suggested change
_setCollateralFactor(comptroller, vToken, 0, liquidationThreshold)
_setCollateralFactor(comptroller, vToken, ZERO_COLLATERAL_FACTOR, liquidationThreshold)

@kkirka kkirka force-pushed the feat/pause-module branch from c1ff47e to d450b35 Compare July 9, 2025 10:54
@github-actions
Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Health
contracts 100% 100%
Summary 100% (38 / 38) 100% (6 / 6)

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.

5 participants