You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a new file in the `src` folder called `CounterCore.sol`, and inherit the `Core` contract.
31
36
32
-
```solidity
33
-
// SPDX-License-Identifier: UNLICENSED
34
-
pragma solidity ^0.8.20;
37
+
```solidity
38
+
// SPDX-License-Identifier: MIT
39
+
pragma solidity ^0.8.20;
35
40
36
-
import {Core} from "modular-contracts/src/Core.sol";
41
+
import {Core} from "@thirdweb-dev/src/Core.sol";
42
+
import {BeforeIncrementCallback} from "./interface/BeforeIncrementCallback.sol";
37
43
38
-
contract CounterCore is Core {
44
+
contract CounterCore is Core {
45
+
constructor(address owner) {
46
+
_initializeOwner(owner);
47
+
}
48
+
}
39
49
40
-
constructor(address owner) {
41
-
_initializeOwner(owner);
42
-
}
50
+
```
51
+
52
+
> **Note**
53
+
> The `Core` contract is the base contract that needs to be inherited for this contract to be recognized as a core contract.
54
+
55
+
</Step>
43
56
44
-
}
45
-
```
57
+
<Steptitle="Set Get Supported Callback Function">
58
+
Implement the `getSupportedCallbackFunctions` function. The Core contract is abstract because this function is not implemented. To avoid compilation errors, declare the function with an empty body for now.
46
59
47
-
> **Note**
48
-
> The `Core` contract is the base contract that needs to be inherited for this contract to be recognized as a core contract.
Implement the `getSupportedCallbackFunctions` and `supportsInterface` functions to expose which callback functions and interfaces this core contract supports.
147
+
function increment() public {
148
+
count += 1;
149
+
}
121
150
122
-
```solidity
123
-
// SPDX-License-Identifier: UNLICENSED
124
-
pragma solidity ^0.8.20;
151
+
// 👇👇👇👇👇👇👇👇👇
125
152
126
-
import {Core} from "modular-contracts/src/Core.sol";
Implement the `getSupportedCallbackFunctions` and `supportsInterface` functions to expose which callback functions and interfaces this core contract supports.
171
+
172
+
```solidity
173
+
// SPDX-License-Identifier: MIT
174
+
pragma solidity ^0.8.20;
175
+
176
+
import {Core} from "@thirdweb-dev/src/Core.sol";
177
+
178
+
interface BeforeIncrementCallback {
179
+
function beforeIncrement(uint256 count) external returns (uint256);
0 commit comments