@@ -48,7 +48,7 @@ contract SuccinctTitan1GPU is
4848 address public override usdc;
4949
5050 /// @inheritdoc ISuccinctTitanGPU
51- uint256 public override price ;
51+ uint256 public override mintPrice ;
5252
5353 /// @inheritdoc ISuccinctTitanGPU
5454 uint256 public override initialSupply;
@@ -85,18 +85,18 @@ contract SuccinctTitan1GPU is
8585 /// @param _usdc USDC token address.
8686 /// @param _baseTokenURI Initial base URI.
8787 /// @param _initialSupply Sale cap (e.g. 5000).
88- /// @param _price Price per token in USDC base units (e.g. 5000e6).
88+ /// @param _mintPrice Price per token in USDC base units (e.g. 5000e6).
8989 function initialize (
9090 address _owner ,
9191 address _usdc ,
9292 string memory _baseTokenURI ,
9393 uint256 _initialSupply ,
94- uint256 _price
94+ uint256 _mintPrice
9595 ) external initializer {
9696 if (_owner == address (0 )) revert ZeroAddress ();
9797 if (_usdc == address (0 )) revert ZeroAddress ();
9898 if (_initialSupply == 0 ) revert ZeroAmount ();
99- if (_price == 0 ) revert ZeroAmount ();
99+ if (_mintPrice == 0 ) revert ZeroAmount ();
100100
101101 __UUPSUpgradeable_init ();
102102 __Ownable_init (_owner);
@@ -107,9 +107,7 @@ contract SuccinctTitan1GPU is
107107 usdc = _usdc;
108108 baseURI = _baseTokenURI;
109109 initialSupply = _initialSupply;
110- price = _price;
111-
112- currentStage = Stage.NONE;
110+ mintPrice = _mintPrice;
113111
114112 // Start paused, owner must begin Stage 1 explicitly.
115113 _pause ();
@@ -140,7 +138,7 @@ contract SuccinctTitan1GPU is
140138 /// @inheritdoc ISuccinctTitanGPU
141139 function stage1Mint (uint256 _amount ) external override nonReentrant whenNotPaused {
142140 // Transfer funds for all of the tokens being minted.
143- IERC20 (usdc).safeTransferFrom (msg .sender , address (this ), price * _amount);
141+ IERC20 (usdc).safeTransferFrom (msg .sender , address (this ), mintPrice * _amount);
144142
145143 _stage1Mint (msg .sender , _amount);
146144 }
@@ -154,7 +152,7 @@ contract SuccinctTitan1GPU is
154152 bytes32 _s
155153 ) external override {
156154 // Transfer funds for all of the tokens being minted.
157- uint256 value = price * _amount;
155+ uint256 value = mintPrice * _amount;
158156 IERC20Permit (usdc).permit (msg .sender , address (this ), value, _deadline, _v, _r, _s);
159157 IERC20 (usdc).safeTransferFrom (msg .sender , address (this ), value);
160158
@@ -164,7 +162,7 @@ contract SuccinctTitan1GPU is
164162 /// @inheritdoc ISuccinctTitanGPU
165163 function stage2Mint () external override nonReentrant whenNotPaused {
166164 // Transfer funds for the token being minted.
167- IERC20 (usdc).safeTransferFrom (msg .sender , address (this ), price );
165+ IERC20 (usdc).safeTransferFrom (msg .sender , address (this ), mintPrice );
168166
169167 _stage2Mint (msg .sender );
170168 }
@@ -175,7 +173,7 @@ contract SuccinctTitan1GPU is
175173 override
176174 {
177175 // Transfer funds for the token being minted.
178- uint256 value = price ;
176+ uint256 value = mintPrice ;
179177 IERC20Permit (usdc).permit (msg .sender , address (this ), value, _deadline, _v, _r, _s);
180178 IERC20 (usdc).safeTransferFrom (msg .sender , address (this ), value);
181179
@@ -278,11 +276,6 @@ contract SuccinctTitan1GPU is
278276 if (totalSupply + 1 > initialSupply) revert SoldOut ();
279277
280278 _mintLoop (_minter, 1 , Stage.STAGE2);
281-
282- // Auto-pause when cap reached.
283- if (totalSupply == initialSupply && ! paused ()) {
284- _pause ();
285- }
286279 }
287280
288281 /// @dev Mint `_amount` tokens to `_to` for `_stage`.
@@ -297,6 +290,11 @@ contract SuccinctTitan1GPU is
297290 }
298291 emit Mint (_to, tokenId, _stage);
299292 }
293+
294+ // Auto-pause when cap reached.
295+ if (totalSupply == initialSupply && ! paused ()) {
296+ _pause ();
297+ }
300298 }
301299
302300 /// @dev Prevents transfers after minting (soulbound).
0 commit comments