Skip to main content

MagicNumber

题目源码

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;

contract MagicNum {

address public solver;

constructor() public {}

function setSolver(address _solver) public {
solver = _solver;
}

/*
____________/\\\_______/\\\\\\\\\_____
__________/\\\\\_____/\\\///////\\\___
________/\\\/\\\____\///______\//\\\__
______/\\\/\/\\\______________/\\\/___
____/\\\/__\/\\\___________/\\\//_____
__/\\\\\\\\\\\\\\\\_____/\\\//________
_\///////////\\\//____/\\\/___________
___________\/\\\_____/\\\\\\\\\\\\\\\_
___________\///_____\///////////////__
*/
}

题目要求

这道题目需要你用汇编编写一个微型合约部署到链上,合约要求whatIsTheMeaningOfLife()要求返回一个正确的数字,合约的runtime opcodes最多只能有 10 个操作码

题目分析

直接参考社区大神的解法吧: Ethernaut Lvl 19 MagicNumber Walkthrough