抱歉,您的浏览器无法访问本站
本页面需要浏览器支持(启用)JavaScript
了解详情 >

1. 题目

To complete this challenge, become the owner

源码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pragma solidity ^0.4.21;

contract AssumeOwnershipChallenge {
address owner;
bool public isComplete;

function AssumeOwmershipChallenge() public {
owner = msg.sender;
}

function authenticate() public {
require(msg.sender == owner);

isComplete = true;
}
}

2. 分析

构造器拼写错误,AssumeOwmershipChallenge可供任何人调用。

3.解题

先调用AssumeOwmershipChallenge函数,再调用authenticate函数

![image-20240412143811623](Assume ownership/image-20240412143811623.png)

解题成功~

评论



政策 · 统计 | 本站使用 Volantis 主题设计