Skip to content

Conversation

@Debugger022
Copy link
Contributor

@Debugger022 Debugger022 commented Sep 5, 2025

This VIP updates the contracts to include the flashloan feature and enables them for the core markets on both testnet and mainnet with initial parameters.

@Debugger022 Debugger022 marked this pull request as ready for review October 14, 2025 08:50
Copy link
Contributor

@GitGuru7 GitGuru7 left a comment

Choose a reason for hiding this comment

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

we can now change the base to main, as emode branch is already merged.

Copy link
Contributor

@chechu chechu left a comment

Choose a reason for hiding this comment

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

simulations/vip-555/utils/bsctestnet-cut-params.json LGTM

@Debugger022 Debugger022 changed the base branch from vip/ven-3361 to main October 14, 2025 19:57
Copy link
Contributor

Choose a reason for hiding this comment

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

I would move this file to the same folder of the first VIP. I don't think we'll enable the flash loan fees on mainnet, so we won't need this VIP on mainnet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this would break other tests. Why don't we accept an optional parameter in the checkCorePoolComptroller function, so each test can provide a different account wallet (using ACCOUNT as a fallback)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines 90 to 92
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Debugger022
Copy link
Contributor Author

Debugger022 commented Oct 15, 2025

Copy link
Contributor

Choose a reason for hiding this comment

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

testnet-addendum VIP, including its facet-cut-params, LGTM.

Copy link
Contributor

@Exef Exef left a comment

Choose a reason for hiding this comment

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

Testnet part of VIPs LGTM

@Debugger022
Copy link
Contributor Author

export const NETWORK_ADDRESSES = {
bscmainnet: {
DEFAULT_PROPOSER_ADDRESS: "0x97a32D4506F6A35De68e0680859cDF41D077a9a9",
DEFAULT_PROPOSER_ADDRESS: "0x34221485302f6f2029660a000908b5fcabb9bc6e",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did we change this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The previous proposer lacks sufficient voting power.

(timelock: string) => ({
target: bscmainnet.ACCESS_CONTROL_MANAGER,
signature: "giveCallPermission(address,string,address)",
params: [UNITROLLER, "setFlashLoanPaused(bool)", timelock],
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 also grant the guardian pause permission to ensure a quick response in case of any mishap? What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

});

it("flash loans should be enabled for all core markets", async () => {
for (const market of CORE_MARKETS) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Instead of hardcoding all market, I would prefer to get all the markets using this getAllMarkets().

Copy link
Contributor Author

Choose a reason for hiding this comment

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

getAllMarkets() includes the non-upgradeable VBNB. We used the same pattern in the testnet VIP, so I prefer it for the mainnet as well.

lens: NEW_COMPTROLLER_LENS, // NEW_COMPTROLLER_LENS
});
});
});
Copy link
Contributor

Choose a reason for hiding this comment

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

There should be some storage checks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

const marketContract = await ethers.getContractAt(VTOKEN_ABI, market.address);
expect(await marketContract.isFlashLoanEnabled()).to.equal(true);
}
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we simulate a dummy flash loan transaction.

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 don't think it is required here.

{
target: UNITROLLER,
signature: "diamondCut((address,uint8,bytes4[])[])",
params: [params],
Copy link
Contributor

Choose a reason for hiding this comment

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

anyway to generate this params ?

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, we have a facet-cut-params-generator script in the Venus protocol.

bscmainnet.NORMAL_TIMELOCK,
bscmainnet.FAST_TRACK_TIMELOCK,
bscmainnet.CRITICAL_TIMELOCK,
bscmainnet.GUARDIAN,
Copy link
Contributor

Choose a reason for hiding this comment

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

let's use GUARDIAN2 ?
CleanShot 2025-11-07 at 18 28 03@2x

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The bscmainnet.GUARDIAN is the Guardian 2 address itself:

GUARDIAN: "0x1C2CAc6ec528c20800B2fe734820D87b581eAA6B",

params: [NEW_VBEP20_DELEGATE_IMPL, false, "0x"],
};
}),
...[bscmainnet.NORMAL_TIMELOCK, bscmainnet.FAST_TRACK_TIMELOCK, bscmainnet.CRITICAL_TIMELOCK].map(
Copy link
Contributor

Choose a reason for hiding this comment

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

let's add GUARDIAN2 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.

signature: "giveCallPermission(address,string,address)",
params: [UNITROLLER, "setFlashLoanPaused(bool)", timelock],
})),
...[bscmainnet.NORMAL_TIMELOCK, bscmainnet.FAST_TRACK_TIMELOCK, bscmainnet.CRITICAL_TIMELOCK].map(
Copy link
Contributor

Choose a reason for hiding this comment

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

same, GUARDIAN2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added 08a46c6

const meta = {
version: "v2",
title: "VIP-557: Flash loan feature for all markets on BSC Mainnet",
description: "Upgrade contracts and enable flash loans on BSC Mainnet.",
Copy link
Contributor

Choose a reason for hiding this comment

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

curious, usually when we release a new feature, do we attach some doc here ? or maybe we should have detailed explanation ?

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, for new features, we usually add a detailed description in the proposal metadata and link to relevant documentation.

@fred-venus
Copy link
Contributor

rest lgtm

@fred-venus
Copy link
Contributor

@fred-venus
Copy link
Contributor

@fred-venus fred-venus merged commit 357ad01 into main Nov 19, 2025
2 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.

6 participants