From 36926d8f3420a852972f4c342592b8329211fad1 Mon Sep 17 00:00:00 2001 From: robertu <4065233+robertu7@users.noreply.github.com> Date: Thu, 15 Aug 2024 22:51:41 +0800 Subject: [PATCH] feat(billboard): remove unused "payable" --- .gas-snapshot | 76 ++++++++++++++++++------------------ src/Billboard/Billboard.sol | 4 +- src/Billboard/IBillboard.sol | 4 +- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/.gas-snapshot b/.gas-snapshot index 047372d..52ceb47 100644 --- a/.gas-snapshot +++ b/.gas-snapshot @@ -19,9 +19,9 @@ BillboardTest:testCannotClearAuctionIfClosed() (gas: 252825) BillboardTest:testCannotClearAuctionIfNoBid() (gas: 260776) BillboardTest:testCannotGetBlockFromEpoch() (gas: 8600) BillboardTest:testCannotGetEpochFromBlock() (gas: 18393) -BillboardTest:testCannotPlaceBidIfAuctionEnded() (gas: 282918) -BillboardTest:testCannotPlaceBidIfClosed() (gas: 252721) -BillboardTest:testCannotPlaceBidIfNotWhitelisted() (gas: 465605) +BillboardTest:testCannotPlaceBidIfAuctionEnded() (gas: 282966) +BillboardTest:testCannotPlaceBidIfClosed() (gas: 252745) +BillboardTest:testCannotPlaceBidIfNotWhitelisted() (gas: 465624) BillboardTest:testCannotSafeTransferByAttacker() (gas: 221525) BillboardTest:testCannotSetBoardByAttacker() (gas: 229589) BillboardTest:testCannotSetBoardByOwner() (gas: 362030) @@ -30,36 +30,36 @@ BillboardTest:testCannotSetWhitelistByAttacker() (gas: 228664) BillboardTest:testCannotTransferByOperator() (gas: 226771) BillboardTest:testCannotTransferToZeroAddress() (gas: 222258) BillboardTest:testCannotUpgradeRegistryByAttacker() (gas: 9017) -BillboardTest:testCannotWithdrawBidIfAuctionNotEndedOrCleared(uint96) (runs: 257, μ: 632826, ~: 632826) -BillboardTest:testCannotWithdrawBidIfNotFound(uint96) (runs: 257, μ: 750322, ~: 750322) -BillboardTest:testCannotWithdrawBidIfWon(uint96) (runs: 257, μ: 1026468, ~: 1026468) -BillboardTest:testCannotWithdrawBidTwice(uint96) (runs: 257, μ: 1110954, ~: 1110954) -BillboardTest:testClearAuction(uint96) (runs: 257, μ: 731791, ~: 731791) -BillboardTest:testClearAuctionIfAlreadyCleared() (gas: 738871) -BillboardTest:testClearAuctions() (gas: 1315269) -BillboardTest:testClearLastAuction(uint96) (runs: 257, μ: 732715, ~: 732715) -BillboardTest:testClearLastAuctions() (gas: 1332571) -BillboardTest:testGetBidderBids(uint8,uint8,uint8) (runs: 256, μ: 1508516, ~: 1140480) -BillboardTest:testGetBids(uint8,uint8,uint8) (runs: 256, μ: 8284065, ~: 6311026) +BillboardTest:testCannotWithdrawBidIfAuctionNotEndedOrCleared(uint96) (runs: 256, μ: 632850, ~: 632850) +BillboardTest:testCannotWithdrawBidIfNotFound(uint96) (runs: 256, μ: 750346, ~: 750346) +BillboardTest:testCannotWithdrawBidIfWon(uint96) (runs: 256, μ: 1026516, ~: 1026516) +BillboardTest:testCannotWithdrawBidTwice(uint96) (runs: 256, μ: 1111002, ~: 1111002) +BillboardTest:testClearAuction(uint96) (runs: 256, μ: 731815, ~: 731815) +BillboardTest:testClearAuctionIfAlreadyCleared() (gas: 738895) +BillboardTest:testClearAuctions() (gas: 1315317) +BillboardTest:testClearLastAuction(uint96) (runs: 256, μ: 732739, ~: 732739) +BillboardTest:testClearLastAuctions() (gas: 1332619) +BillboardTest:testGetBidderBids(uint8,uint8,uint8) (runs: 256, μ: 1508601, ~: 1140537) +BillboardTest:testGetBids(uint8,uint8,uint8) (runs: 256, μ: 8312589, ~: 6311372) BillboardTest:testGetBlockFromEpoch() (gas: 16893) BillboardTest:testGetEpochFromBlock() (gas: 17903) BillboardTest:testGetTokenURI() (gas: 391345) BillboardTest:testMintBoard() (gas: 585666) -BillboardTest:testPlaceBid(uint96) (runs: 257, μ: 840034, ~: 840654) -BillboardTest:testPlaceBidIfBoardWhitelistDisabled() (gas: 598142) -BillboardTest:testPlaceBidWithHigherPrice(uint96) (runs: 256, μ: 1011469, ~: 1011474) -BillboardTest:testPlaceBidWithSamePrices(uint96) (runs: 257, μ: 908798, ~: 909728) -BillboardTest:testPlaceBidZeroPrice() (gas: 432681) +BillboardTest:testPlaceBid(uint96) (runs: 256, μ: 840080, ~: 840702) +BillboardTest:testPlaceBidIfBoardWhitelistDisabled() (gas: 598166) +BillboardTest:testPlaceBidWithHigherPrice(uint96) (runs: 256, μ: 1011527, ~: 1011532) +BillboardTest:testPlaceBidWithSamePrices(uint96) (runs: 256, μ: 908843, ~: 909776) +BillboardTest:testPlaceBidZeroPrice() (gas: 432705) BillboardTest:testSafeTransferByOperator() (gas: 235259) -BillboardTest:testSetBidURIs() (gas: 659810) +BillboardTest:testSetBidURIs() (gas: 659834) BillboardTest:testSetBoardByCreator() (gas: 342395) BillboardTest:testSetBoardWhitelistDisabled() (gas: 244401) BillboardTest:testSetClosed() (gas: 241110) BillboardTest:testSetWhitelist() (gas: 245426) -BillboardTest:testUpgradeRegistry() (gas: 3997817) -BillboardTest:testWithdrawBid(uint96) (runs: 257, μ: 1098918, ~: 1098918) -BillboardTest:testWithdrawBidIfClosed(uint96) (runs: 257, μ: 697012, ~: 697012) -BillboardTest:testWithdrawTax(uint96) (runs: 257, μ: 737092, ~: 737092) +BillboardTest:testUpgradeRegistry() (gas: 3924811) +BillboardTest:testWithdrawBid(uint96) (runs: 256, μ: 1098966, ~: 1098966) +BillboardTest:testWithdrawBidIfClosed(uint96) (runs: 256, μ: 697036, ~: 697036) +BillboardTest:testWithdrawTax(uint96) (runs: 256, μ: 737116, ~: 737116) CurationTest:testCannotCurateERC20CurateZeroAmount() (gas: 12194) CurationTest:testCannotCurateERC20EmptyURI() (gas: 15797) CurationTest:testCannotCurateERC20IfNotApproval() (gas: 21624) @@ -77,8 +77,8 @@ DistributionTest:testCannotClaimIfAlreadyClaimed() (gas: 284835) DistributionTest:testCannotClaimIfInsufficientBalance() (gas: 394264) DistributionTest:testCannotClaimIfInvalidProof() (gas: 245236) DistributionTest:testCannotClaimIfInvalidTreeId() (gas: 243332) -DistributionTest:testCannotDropIfInsufficientAllowance(uint256) (runs: 257, μ: 212269, ~: 212283) -DistributionTest:testCannotDropIfInsufficientBalance(uint256) (runs: 257, μ: 214708, ~: 214740) +DistributionTest:testCannotDropIfInsufficientAllowance(uint256) (runs: 256, μ: 212269, ~: 212284) +DistributionTest:testCannotDropIfInsufficientBalance(uint256) (runs: 256, μ: 214708, ~: 214740) DistributionTest:testCannotDropIfZeroAmount() (gas: 148793) DistributionTest:testCannotDropTwiceWithSameTreeId() (gas: 307260) DistributionTest:testCannotSetAdminByAdmin() (gas: 17334) @@ -91,14 +91,14 @@ DistributionTest:testSetAdmin() (gas: 20239) DistributionTest:testSweep() (gas: 253087) LogbookNFTSVGTest:testTokenURI(uint8,uint8,uint16) (runs: 256, μ: 2613180, ~: 1746428) LogbookTest:testClaim() (gas: 135608) -LogbookTest:testDonate(uint96) (runs: 257, μ: 156550, ~: 156936) -LogbookTest:testDonateWithCommission(uint96,uint96) (runs: 257, μ: 146620, ~: 140444) -LogbookTest:testFork(uint96,string) (runs: 257, μ: 452543, ~: 453928) -LogbookTest:testForkRecursively(uint8,uint96) (runs: 257, μ: 5332405, ~: 1801537) -LogbookTest:testForkWithCommission(uint96,string,uint256) (runs: 257, μ: 342132, ~: 257636) +LogbookTest:testDonate(uint96) (runs: 256, μ: 156549, ~: 156936) +LogbookTest:testDonateWithCommission(uint96,uint96) (runs: 256, μ: 146644, ~: 140444) +LogbookTest:testFork(uint96,string) (runs: 256, μ: 452537, ~: 453928) +LogbookTest:testForkRecursively(uint8,uint96) (runs: 256, μ: 5351224, ~: 1801537) +LogbookTest:testForkWithCommission(uint96,string,uint256) (runs: 256, μ: 342465, ~: 257636) LogbookTest:testMulticall() (gas: 284999) LogbookTest:testPublicSale() (gas: 207337) -LogbookTest:testPublish(string) (runs: 257, μ: 264067, ~: 263590) +LogbookTest:testPublish(string) (runs: 256, μ: 264065, ~: 263590) LogbookTest:testPublishEn1000() (gas: 243477) LogbookTest:testPublishEn140() (gas: 221241) LogbookTest:testPublishEn200() (gas: 222826) @@ -117,7 +117,7 @@ LogbookTest:testPublishZh5000() (gas: 607690) LogbookTest:testSetDescription() (gas: 140760) LogbookTest:testSetForkPrice() (gas: 153925) LogbookTest:testSetTitle() (gas: 168680) -LogbookTest:testSplitRoyalty(uint8,uint8,uint96) (runs: 257, μ: 1952649, ~: 965338) +LogbookTest:testSplitRoyalty(uint8,uint8,uint96) (runs: 256, μ: 1959072, ~: 965338) LogbookTest:testWithdraw() (gas: 7284400) SnapperTest:testCannotInitRegionByNotOwner() (gas: 11365) SnapperTest:testCannotReInitRegion() (gas: 14373) @@ -125,10 +125,10 @@ SnapperTest:testCannotTakeSnapshotBeforeInit() (gas: 15717) SnapperTest:testCannotTakeSnapshotByNotOwner() (gas: 12478) SnapperTest:testCannotTakeSnapshotWrongLastBlock() (gas: 49242) SnapperTest:testCannotTakeSnapshotWrongSnapshotBlock() (gas: 23899) -SnapperTest:testInitRegion(uint256) (runs: 257, μ: 114408, ~: 114408) +SnapperTest:testInitRegion(uint256) (runs: 256, μ: 114408, ~: 114408) SnapperTest:testTakeSnapshot() (gas: 47831) TheSpaceTest:testBatchBid() (gas: 695308) -TheSpaceTest:testBatchSetPixels(uint16,uint8) (runs: 257, μ: 371405, ~: 372904) +TheSpaceTest:testBatchSetPixels(uint16,uint8) (runs: 256, μ: 371399, ~: 372904) TheSpaceTest:testBidDefaultedToken() (gas: 413399) TheSpaceTest:testBidExistingToken() (gas: 360023) TheSpaceTest:testBidNewToken() (gas: 303729) @@ -140,7 +140,7 @@ TheSpaceTest:testCannotGetTaxWithNonExistingToken() (gas: 16379) TheSpaceTest:testCannotGetTokenURIInLogicContract() (gas: 300973) TheSpaceTest:testCannotSetColorByAttacker() (gas: 305326) TheSpaceTest:testCannotSetConfigByAttacker() (gas: 12031) -TheSpaceTest:testCannotSetPixel(uint256) (runs: 257, μ: 314857, ~: 314857) +TheSpaceTest:testCannotSetPixel(uint256) (runs: 256, μ: 314857, ~: 314857) TheSpaceTest:testCannotSetPriceByNonOwner() (gas: 305424) TheSpaceTest:testCannotSetTokenImageURIByNonACLManager() (gas: 11862) TheSpaceTest:testCannotSetTotalSupplyByAttacker() (gas: 11836) @@ -164,12 +164,12 @@ TheSpaceTest:testGetTokenURI() (gas: 333462) TheSpaceTest:testSetColor() (gas: 331348) TheSpaceTest:testSetMintTax() (gas: 271715) TheSpaceTest:testSetPixel(uint256) (runs: 256, μ: 403816, ~: 403816) -TheSpaceTest:testSetPrice(uint256) (runs: 257, μ: 304652, ~: 304652) +TheSpaceTest:testSetPrice(uint256) (runs: 256, μ: 304652, ~: 304652) TheSpaceTest:testSetPriceByOperator(uint96) (runs: 256, μ: 354785, ~: 354785) TheSpaceTest:testSetPriceTooHigh() (gas: 314504) TheSpaceTest:testSetTaxRate() (gas: 347951) TheSpaceTest:testSetTokenImageURI() (gas: 355813) -TheSpaceTest:testSetTotalSupply(uint256) (runs: 257, μ: 352202, ~: 352208) +TheSpaceTest:testSetTotalSupply(uint256) (runs: 256, μ: 352202, ~: 352208) TheSpaceTest:testSetTreasuryShare() (gas: 384288) TheSpaceTest:testSettleTax() (gas: 339465) TheSpaceTest:testTaxCalculation() (gas: 402405) diff --git a/src/Billboard/Billboard.sol b/src/Billboard/Billboard.sol index dfebb4b..5eb0a08 100644 --- a/src/Billboard/Billboard.sol +++ b/src/Billboard/Billboard.sol @@ -147,7 +147,7 @@ contract Billboard is IBillboard { uint256 tokenId_, uint256 epoch_, uint256 price_ - ) external payable isNotClosed(tokenId_) isFromWhitelist(tokenId_) { + ) external isNotClosed(tokenId_) isFromWhitelist(tokenId_) { _placeBid(tokenId_, epoch_, price_, "", "", false); } @@ -158,7 +158,7 @@ contract Billboard is IBillboard { uint256 price_, string calldata contentURI_, string calldata redirectURI_ - ) external payable isNotClosed(tokenId_) isFromWhitelist(tokenId_) { + ) external isNotClosed(tokenId_) isFromWhitelist(tokenId_) { _placeBid(tokenId_, epoch_, price_, contentURI_, redirectURI_, true); } diff --git a/src/Billboard/IBillboard.sol b/src/Billboard/IBillboard.sol index 36bf502..8ac161f 100644 --- a/src/Billboard/IBillboard.sol +++ b/src/Billboard/IBillboard.sol @@ -183,7 +183,7 @@ interface IBillboard { * @param epoch_ Epoch. * @param price_ Amount of a bid. */ - function placeBid(uint256 tokenId_, uint256 epoch_, uint256 price_) external payable; + function placeBid(uint256 tokenId_, uint256 epoch_, uint256 price_) external; /** * @notice Place bid on a board auction. @@ -200,7 +200,7 @@ interface IBillboard { uint256 price_, string calldata contentURI_, string calldata redirectURI_ - ) external payable; + ) external; /** * @notice Set the content URI and redirect URI of a board.