Skip to content

Commit f6dced9

Browse files
Krishang NadgaudaKrishang Nadgauda
authored andcommitted
fix forge build warnings
1 parent fb8c4b3 commit f6dced9

File tree

9 files changed

+29
-31
lines changed

9 files changed

+29
-31
lines changed

src/test/Pack.t.sol

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ contract PackTest is BaseTest {
209209
Unit tests: `createPack`
210210
//////////////////////////////////////////////////////////////*/
211211

212-
function test_interface() public {
212+
function test_interface() public view {
213213
console2.logBytes4(type(IERC20).interfaceId);
214214
console2.logBytes4(type(IERC721).interfaceId);
215215
console2.logBytes4(type(IERC1155).interfaceId);
@@ -572,9 +572,7 @@ contract PackTest is BaseTest {
572572

573573
vm.startPrank(address(tokenOwner));
574574
vm.expectRevert("0 amt");
575-
(, uint256 totalSupply) = pack.createPack(invalidContent, rewardUnits, packUri, 0, 1, recipient);
576-
577-
// assertEq(totalSupply, 10);
575+
pack.createPack(invalidContent, rewardUnits, packUri, 0, 1, recipient);
578576
}
579577

580578
/**
@@ -1019,9 +1017,9 @@ contract PackTest is BaseTest {
10191017
}
10201018
}
10211019

1022-
function checkBalances(ITokenBundle.Token[] memory rewardUnits, address recipient)
1020+
function checkBalances(ITokenBundle.Token[] memory rewardUnits, address)
10231021
internal
1024-
view
1022+
pure
10251023
returns (
10261024
uint256 nativeTokenAmount,
10271025
uint256 erc20Amount,

src/test/sdk/base/ERC20Base.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ contract BaseERC20BaseTest is BaseUtilTest {
218218

219219
function test_revert_permit_ExpiredDeadline() public {
220220
uint256 amount = 5 ether;
221-
uint256 wrongPrivateKey = 2345;
221+
// uint256 wrongPrivateKey = 2345;
222222

223223
// mint amount to recipient
224224
vm.prank(deployer);

src/test/sdk/base/ERC20DropVote.t.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ contract BaseERC20DropVoteTest is BaseUtilTest {
103103
conditions[0].pricePerToken = 1 ether;
104104
conditions[0].currency = address(erc20);
105105

106-
uint256 totalPrice = (conditions[0].pricePerToken * _quantity) / 1 ether;
106+
// uint256 totalPrice = (conditions[0].pricePerToken * _quantity) / 1 ether;
107107

108108
vm.prank(signer);
109109
base.setClaimConditions(conditions[0], false);

src/test/sdk/extension/SignatureMintERC20.t.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ contract MySigMint20 is SignatureMintERC20 {
1313
condition = _condition;
1414
}
1515

16-
function _canSignMintRequest(address _signer) internal view override returns (bool) {
16+
function _canSignMintRequest(address) internal view override returns (bool) {
1717
return condition;
1818
}
1919

@@ -72,7 +72,7 @@ contract ExtensionSignatureMintERC20 is DSTest, Test {
7272
_signature = signMintRequest(_mintrequest, privateKey);
7373
}
7474

75-
function signMintRequest(MySigMint20.MintRequest memory _request, uint256 privateKey)
75+
function signMintRequest(MySigMint20.MintRequest memory _request, uint256 _privateKey)
7676
internal
7777
returns (bytes memory)
7878
{
@@ -90,7 +90,7 @@ contract ExtensionSignatureMintERC20 is DSTest, Test {
9090
bytes32 structHash = keccak256(encodedRequest);
9191
bytes32 typedDataHash = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
9292

93-
(uint8 v, bytes32 r, bytes32 s) = vm.sign(privateKey, typedDataHash);
93+
(uint8 v, bytes32 r, bytes32 s) = vm.sign(_privateKey, typedDataHash);
9494
bytes memory sig = abi.encodePacked(r, s, v);
9595

9696
return sig;

src/test/sdk/extension/SignatureMintERC721.t.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ contract MySigMint721 is SignatureMintERC721 {
1313
condition = _condition;
1414
}
1515

16-
function _canSignMintRequest(address _signer) internal view override returns (bool) {
16+
function _canSignMintRequest(address) internal view override returns (bool) {
1717
return condition;
1818
}
1919

@@ -75,7 +75,7 @@ contract ExtensionSignatureMintERC721 is DSTest, Test {
7575
_signature = signMintRequest(_mintrequest, privateKey);
7676
}
7777

78-
function signMintRequest(MySigMint721.MintRequest memory _request, uint256 privateKey)
78+
function signMintRequest(MySigMint721.MintRequest memory _request, uint256 _privateKey)
7979
internal
8080
returns (bytes memory)
8181
{
@@ -96,7 +96,7 @@ contract ExtensionSignatureMintERC721 is DSTest, Test {
9696
bytes32 structHash = keccak256(encodedRequest);
9797
bytes32 typedDataHash = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
9898

99-
(uint8 v, bytes32 r, bytes32 s) = vm.sign(privateKey, typedDataHash);
99+
(uint8 v, bytes32 r, bytes32 s) = vm.sign(_privateKey, typedDataHash);
100100
bytes memory sig = abi.encodePacked(r, s, v);
101101

102102
return sig;

src/test/sdk/extension/TokenBundle.t.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,11 @@ contract ExtensionTokenBundle is DSTest, Test {
270270
assertEq(bundleContent.length + 1, tokenCountOfBundle);
271271

272272
for (uint256 i = 0; i < tokenCountOfBundle - 1; i += 1) {
273-
ITokenBundle.Token memory tokenOfBundle = ext.getTokenOfBundle(0, i);
274-
assertEq(bundleContent[i].assetContract, tokenOfBundle.assetContract);
275-
assertEq(uint256(bundleContent[i].tokenType), uint256(tokenOfBundle.tokenType));
276-
assertEq(bundleContent[i].tokenId, tokenOfBundle.tokenId);
277-
assertEq(bundleContent[i].totalAmount, tokenOfBundle.totalAmount);
273+
ITokenBundle.Token memory tokenOfBundle_ = ext.getTokenOfBundle(0, i);
274+
assertEq(bundleContent[i].assetContract, tokenOfBundle_.assetContract);
275+
assertEq(uint256(bundleContent[i].tokenType), uint256(tokenOfBundle_.tokenType));
276+
assertEq(bundleContent[i].tokenId, tokenOfBundle_.tokenId);
277+
assertEq(bundleContent[i].totalAmount, tokenOfBundle_.totalAmount);
278278
}
279279

280280
ITokenBundle.Token memory tokenOfBundle = ext.getTokenOfBundle(0, tokenCountOfBundle - 1);

src/test/token/TokenERC1155.t.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,8 @@ contract TokenERC1155Test is BaseTest {
594594
vm.prank(deployerSigner);
595595
tokenContract.setPrimarySaleRecipient(_primarySaleRecipient);
596596

597-
address recipient = tokenContract.primarySaleRecipient();
598-
assertEq(recipient, _primarySaleRecipient);
597+
address recipient_ = tokenContract.primarySaleRecipient();
598+
assertEq(recipient_, _primarySaleRecipient);
599599
}
600600

601601
function test_revert_setPrimarySaleRecipient_NotAuthorized() public {
@@ -635,8 +635,8 @@ contract TokenERC1155Test is BaseTest {
635635
vm.prank(deployerSigner);
636636
tokenContract.setPlatformFeeInfo(_platformFeeRecipient, _platformFeeBps);
637637

638-
(address recipient, uint16 bps) = tokenContract.getPlatformFeeInfo();
639-
assertEq(_platformFeeRecipient, recipient);
638+
(address recipient_, uint16 bps) = tokenContract.getPlatformFeeInfo();
639+
assertEq(_platformFeeRecipient, recipient_);
640640
assertEq(_platformFeeBps, bps);
641641
}
642642

src/test/token/TokenERC20.t.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ contract TokenERC20Test is BaseTest {
312312
vm.prank(deployerSigner);
313313
tokenContract.setPrimarySaleRecipient(_primarySaleRecipient);
314314

315-
address recipient = tokenContract.primarySaleRecipient();
316-
assertEq(recipient, _primarySaleRecipient);
315+
address recipient_ = tokenContract.primarySaleRecipient();
316+
assertEq(recipient_, _primarySaleRecipient);
317317
}
318318

319319
function test_revert_setPrimarySaleRecipient_NotAuthorized() public {
@@ -353,8 +353,8 @@ contract TokenERC20Test is BaseTest {
353353
vm.prank(deployerSigner);
354354
tokenContract.setPlatformFeeInfo(_platformFeeRecipient, _platformFeeBps);
355355

356-
(address recipient, uint16 bps) = tokenContract.getPlatformFeeInfo();
357-
assertEq(_platformFeeRecipient, recipient);
356+
(address recipient_, uint16 bps) = tokenContract.getPlatformFeeInfo();
357+
assertEq(_platformFeeRecipient, recipient_);
358358
assertEq(_platformFeeBps, bps);
359359
}
360360

src/test/token/TokenERC721.t.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,8 @@ contract TokenERC721Test is BaseTest {
547547
vm.prank(deployerSigner);
548548
tokenContract.setPrimarySaleRecipient(_primarySaleRecipient);
549549

550-
address recipient = tokenContract.primarySaleRecipient();
551-
assertEq(recipient, _primarySaleRecipient);
550+
address recipient_ = tokenContract.primarySaleRecipient();
551+
assertEq(recipient_, _primarySaleRecipient);
552552
}
553553

554554
function test_revert_setPrimarySaleRecipient_NotAuthorized() public {
@@ -588,8 +588,8 @@ contract TokenERC721Test is BaseTest {
588588
vm.prank(deployerSigner);
589589
tokenContract.setPlatformFeeInfo(_platformFeeRecipient, _platformFeeBps);
590590

591-
(address recipient, uint16 bps) = tokenContract.getPlatformFeeInfo();
592-
assertEq(_platformFeeRecipient, recipient);
591+
(address recipient_, uint16 bps) = tokenContract.getPlatformFeeInfo();
592+
assertEq(_platformFeeRecipient, recipient_);
593593
assertEq(_platformFeeBps, bps);
594594
}
595595

0 commit comments

Comments
 (0)