[VEN-3276]: add pause module for the guardian multisig#1
Conversation
| const MULTI_SEND_CALL_ONLY_CANONICAL = "0x9641d764fc13c8B624c04430C7356C1C7C8102e2"; | ||
| const MULTI_SEND_CALL_ONLY_ZKSYNC = "0x0408EF011960d02349d50286D20531229BCef773"; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
I don't see this contract deployed to testnet. Is it for development purposes?
| address comptroller = address(VToken(vToken).comptroller()); | ||
| bytes memory data; | ||
| if (comptroller == LEGACY_POOL_COMPTROLLER) { | ||
| data = abi.encodePacked(_legacyPoolPauseActions(comptroller, vToken)); |
There was a problem hiding this comment.
Aren't we setting CF to 0 in legacy pool?
There was a problem hiding this comment.
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
| (, , uint256 liquidationThreshold) = Comptroller(comptroller).markets(vToken); | ||
| data = abi.encodePacked( | ||
| _pauseActions(comptroller, vToken), | ||
| _setCollateralFactor(comptroller, vToken, 0, liquidationThreshold) |
There was a problem hiding this comment.
For readability I'd introduce ZERO_COLLATERAL_FACTOR constant
| _setCollateralFactor(comptroller, vToken, 0, liquidationThreshold) | |
| _setCollateralFactor(comptroller, vToken, ZERO_COLLATERAL_FACTOR, liquidationThreshold) |
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.