-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproblem10.txt
42 lines (27 loc) · 915 Bytes
/
problem10.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
// The system will deploy `Called` for you
// The interface you are going to write will be use to call contract `Called`.
contract Called {
bool public called = false;
function setCalled() external {
called = true;
}
function getCalled() external view returns (bool) {
return called;
}
}
// TODO 1: write an interface named `ICalled`, implement the two functions which is in contract `Called`.
contract answer10 {
Called public calledContract;
constructor() {
calledContract = new Called();
}
function setCalled() external {
// TODO 2: Finish this function by using `ICalled` to call `setCalled()` in contract `Called`.
}
// --------------Below are judging functions-------------------
function checkAns() external view returns (bool) {
return ICalled(address(calledContract)).getCalled();
}
}