@@ -3,6 +3,7 @@ pragma solidity 0.8.18;
3
3
4
4
import "@openzeppelin/contracts/utils/Counters.sol " ;
5
5
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol " ;
6
+ import "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol " ;
6
7
import "./MintGoldDustCompany.sol " ;
7
8
import "./MintGoldDustMemoir.sol " ;
8
9
@@ -11,7 +12,7 @@ error MGDnftUnauthorized();
11
12
error NumberOfCollaboratorsAndPercentagesNotMatch ();
12
13
error TheTotalPercentageCantBeGreaterThan100 ();
13
14
14
- abstract contract MintGoldDustNFT is Initializable {
15
+ abstract contract MintGoldDustNFT is Initializable , PausableUpgradeable {
15
16
// Add your custom code and functions here
16
17
/**
17
18
*
@@ -99,7 +100,13 @@ abstract contract MintGoldDustNFT is Initializable {
99
100
uint256 _royaltyPercent ,
100
101
uint256 _amount ,
101
102
string calldata _memoir
102
- ) public payable validPercentage (_royaltyPercent) returns (uint256 ) {
103
+ )
104
+ public
105
+ payable
106
+ validPercentage (_royaltyPercent)
107
+ whenNotPaused
108
+ returns (uint256 )
109
+ {
103
110
uint256 newTokenId = executeMintFlow (
104
111
_tokenURI,
105
112
_royaltyPercent,
@@ -118,7 +125,7 @@ abstract contract MintGoldDustNFT is Initializable {
118
125
uint256 _amount ,
119
126
address _sender ,
120
127
string calldata _memoir
121
- ) public validPercentage (_royaltyPercent) returns (uint256 ) {
128
+ ) public validPercentage (_royaltyPercent) whenNotPaused returns (uint256 ) {
122
129
uint256 newTokenId = executeMintFlow (
123
130
_tokenURI,
124
131
_royaltyPercent,
@@ -159,7 +166,7 @@ abstract contract MintGoldDustNFT is Initializable {
159
166
uint256 [] calldata _ownersPercentage ,
160
167
uint256 _amount ,
161
168
string calldata _memoir
162
- ) external returns (uint256 ) {
169
+ ) external whenNotPaused returns (uint256 ) {
163
170
if (_ownersPercentage.length != _newOwners.length + 1 ) {
164
171
revert NumberOfCollaboratorsAndPercentagesNotMatch ();
165
172
}
@@ -176,7 +183,7 @@ abstract contract MintGoldDustNFT is Initializable {
176
183
uint256 _amount ,
177
184
address _sender ,
178
185
string calldata _memoir
179
- ) external returns (uint256 ) {
186
+ ) external whenNotPaused returns (uint256 ) {
180
187
if (_ownersPercentage.length != _newOwners.length + 1 ) {
181
188
revert NumberOfCollaboratorsAndPercentagesNotMatch ();
182
189
}
@@ -243,6 +250,23 @@ abstract contract MintGoldDustNFT is Initializable {
243
250
);
244
251
}
245
252
253
+ /// @notice Pause the contract
254
+ function pauseContract () public isowner {
255
+ _pause ();
256
+ }
257
+
258
+ /// @notice Unpause the contract
259
+ function unpauseContract () public isowner {
260
+ _unpause ();
261
+ }
262
+
263
+ modifier isowner () {
264
+ if (msg .sender != mintGoldDustCompany.owner ()) {
265
+ revert MGDCompanyUnauthorized ();
266
+ }
267
+ _;
268
+ }
269
+
246
270
modifier validPercentage (uint256 percentage ) {
247
271
if (percentage > mintGoldDustCompany.maxRoyalty ()) {
248
272
revert MGDnftRoyaltyInvalidPercentage ();
0 commit comments