Skip to content

Commit

Permalink
🐞 Remove support for V1 cauldrons
Browse files Browse the repository at this point in the history
  • Loading branch information
0xCalibur committed Dec 11, 2023
1 parent 871f24d commit 623dab1
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tasks/utils/toolkit.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,25 @@ const getCauldron = (config, name) => {

if (!item) {
console.log(`Cauldron ${name} doesn't exist `);

const cauldronsV1 = config.cauldrons.filter(cauldron => cauldron.version < 2);
if (cauldronsV1.length > 0) {
console.log("Unsupported cauldrons (version < 2):")
for (const cauldron of cauldronsV1) {
console.log(`- ${cauldron.key}`);
}
console.log("");

}

console.log("Available cauldrons:");
config.cauldrons = config.cauldrons.filter(cauldron => cauldron.version >= 2);

for (const cauldron of config.cauldrons) {
console.log(`- ${cauldron.key}`);
}


process.exit(1);
}

Expand All @@ -42,7 +57,7 @@ const getCauldron = (config, name) => {
const printCauldronInformation = (cauldron, extra) => {
const p = new Table({
columns: [
{ name: 'info', alignment: 'right', color: "cyan"},
{ name: 'info', alignment: 'right', color: "cyan" },
{ name: 'value', alignment: 'left' }
],
});
Expand Down Expand Up @@ -78,6 +93,12 @@ const printCauldronInformation = (cauldron, extra) => {

const getCauldronInformation = async (hre, config, cauldronName) => {
let cauldronConfig = getCauldron(config, cauldronName);

if (cauldronConfig.version < 2) {
console.log(`Cauldrons version prior to v2 are not supported`);
process.exit(1);

}
const cauldron = await hre.getContractAt("ICauldronV2", cauldronConfig.value);
const bentoBox = await hre.getContractAt("IBentoBoxV1", await cauldron.bentoBox());
const mim = await hre.getContractAt("IStrictERC20", await cauldron.magicInternetMoney());
Expand Down

0 comments on commit 623dab1

Please sign in to comment.