Skip to content

Commit

Permalink
Update to ILevel.name() removal
Browse files Browse the repository at this point in the history
  • Loading branch information
eternauta1337 committed Sep 26, 2024
1 parent 4b59c42 commit 66d06e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 2 additions & 5 deletions packages/ethernaut-zeronaut/src/tasks/get-campaign.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,9 @@ require('../scopes/zeronaut')
// Get each level's details
for (let i = 0; i < campaign.levels.length; i++) {
const levelId = campaign.levels[i]
const levelData = await contract.getLevel(levelId)
const levelAddress = levelData.addr
const level = await getLevelContract(hre, levelAddress)
const solved = await contract.isLevelSolved(levelId, playerAddress)
const levelName = hre.ethers.decodeBytes32String(await level.name())
str += `\n [${i + 1}] "${levelName}" ${solved ? '✅' : ''}`
const levelName = hre.ethers.decodeBytes32String(levelId)
str += `\n [${i + 1}] "${levelName}" ${solved ? '✅' : ''}`
}

return output.resultBox(str)
Expand Down
3 changes: 1 addition & 2 deletions packages/ethernaut-zeronaut/src/tasks/get-level.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,14 @@ require('../scopes/zeronaut')
const level = await getLevelContract(hre, levelAddress)

// Query the level details
const levelName = await level.name()
const levelInstructions = await level.instructions()

// Check if the level is completed
const solved = await contract.isLevelSolved(id, playerAddress)

// Display the level details
let str = ''
str += ` name: ${hre.ethers.decodeBytes32String(levelName)}`
str += ` name: ${name}`
str += `\n solved: ${solved}`
str += `\n instructions: ${levelInstructions}`

Expand Down

0 comments on commit 66d06e5

Please sign in to comment.