Skip to content

Commit

Permalink
fix usage of crossminta addr
Browse files Browse the repository at this point in the history
  • Loading branch information
matheus1lva committed Dec 22, 2023
1 parent 83b14f6 commit eb1be3c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 43 deletions.
48 changes: 20 additions & 28 deletions contracts/BucketAuction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ contract BucketAuction is IBucketAuction, ERC721M {
uint256 minimumContributionInWei,
uint64 startTimeUnixSeconds,
uint64 endTimeUnixSeconds,
address crossmintAddress,
uint64 timestampExpirySeconds
)
ERC721M(
Expand All @@ -44,8 +43,8 @@ contract BucketAuction is IBucketAuction, ERC721M {
globalWalletLimit,
cosigner,
timestampExpirySeconds,
address(0),
crossmintAddress
address(0), // mintCurrency
address(0) // crossMintAddress
)
{
_claimable = false;
Expand Down Expand Up @@ -102,15 +101,10 @@ contract BucketAuction is IBucketAuction, ERC721M {
return _userData[user];
}

function getUserDataPage(uint256 limit, uint256 offset)
external
view
returns (
User[] memory,
address[] memory,
uint256 total
)
{
function getUserDataPage(
uint256 limit,
uint256 offset
) external view returns (User[] memory, address[] memory, uint256 total) {
uint256 numUsers = _users.length();
uint256 pageSize = limit;
if (pageSize > numUsers - offset) {
Expand Down Expand Up @@ -148,10 +142,10 @@ contract BucketAuction is IBucketAuction, ERC721M {
* @param startTime set to unix timestamp for the auction start time.
* @param endTime set to unix timestamp for the auction end time.
*/
function setStartAndEndTimeUnixSeconds(uint64 startTime, uint64 endTime)
external
onlyOwner
{
function setStartAndEndTimeUnixSeconds(
uint64 startTime,
uint64 endTime
) external onlyOwner {
if (_price != 0) revert PriceHasBeenSet();
if (endTime <= startTime) revert InvalidStartAndEndTimestamp();

Expand Down Expand Up @@ -185,10 +179,9 @@ contract BucketAuction is IBucketAuction, ERC721M {
* @dev set this price in wei, not eth!
* @param minimumContributionInWei new price, set in wei
*/
function setMinimumContribution(uint256 minimumContributionInWei)
external
onlyOwner
{
function setMinimumContribution(
uint256 minimumContributionInWei
) external onlyOwner {
_minimumContributionInWei = minimumContributionInWei;
emit SetMinimumContribution(minimumContributionInWei);
}
Expand All @@ -213,10 +206,10 @@ contract BucketAuction is IBucketAuction, ERC721M {
* @param to address to mint tokens to.
* @param numberOfTokens number of tokens to mint.
*/
function _internalMint(address to, uint256 numberOfTokens)
internal
hasSupply(numberOfTokens)
{
function _internalMint(
address to,
uint256 numberOfTokens
) internal hasSupply(numberOfTokens) {
_safeMint(to, numberOfTokens);
if (!_firstTokenSent && numberOfTokens > 0) _firstTokenSent = true;
}
Expand Down Expand Up @@ -362,10 +355,9 @@ contract BucketAuction is IBucketAuction, ERC721M {
* @notice send refunds and tokens to a batch of addresses.
* @param addresses array of addresses to send tokens to.
*/
function sendTokensAndRefundBatch(address[] calldata addresses)
external
onlyOwner
{
function sendTokensAndRefundBatch(
address[] calldata addresses
) external onlyOwner {
for (uint256 i; i < addresses.length; i++) {
sendTokensAndRefund(addresses[i]);
}
Expand Down
2 changes: 0 additions & 2 deletions contracts/BucketAuctionOperatorFilterer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ contract BucketAuctionOperatorFilterer is
uint256 minimumContributionInWei,
uint64 startTimeUnixSeconds,
uint64 endTimeUnixSeconds,
address crossMintAddress,
uint64 timestampExpirySeconds
)
UpdatableOperatorFilterer(
Expand All @@ -38,7 +37,6 @@ contract BucketAuctionOperatorFilterer is
minimumContributionInWei,
startTimeUnixSeconds,
endTimeUnixSeconds,
crossMintAddress,
timestampExpirySeconds
)
{}
Expand Down
15 changes: 5 additions & 10 deletions contracts/DutchAuction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ contract DutchAuction is IDutchAuction, ERC721M {
uint256 maxMintableSupply,
uint256 globalWalletLimit,
address cosigner,
bool refundable,
address crossmintAddress
bool refundable
)
ERC721M(
collectionName,
Expand All @@ -39,7 +38,7 @@ contract DutchAuction is IDutchAuction, ERC721M {
300,
/* mintCurrency= */
address(0),
crossmintAddress
address(0)
)
{
_refundable = refundable;
Expand Down Expand Up @@ -139,13 +138,9 @@ contract DutchAuction is IDutchAuction, ERC721M {
return config.endAmountInWei;
}

function bid(uint32 qty)
external
payable
nonReentrant
hasSupply(qty)
validTime
{
function bid(
uint32 qty
) external payable nonReentrant hasSupply(qty) validTime {
uint256 price = getCurrentPriceInWei();
if (msg.value < qty * price) revert NotEnoughValue();

Expand Down
1 change: 0 additions & 1 deletion test/BucketAuction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ describe('BucketAuction', function () {
/* minimumContributionInWei= */ 100,
0, // Placeholder; startTimeUnixSeconds will be overwritten later
1, // Placeholder; endTimeUnixSeconds will be overwritten later
ethers.constants.AddressZero, // crossmint address
60, // timestamp expiry seconds
);
await ba.deployed();
Expand Down
2 changes: 0 additions & 2 deletions test/DutchAuction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ describe('DutchAuction', function () {
0,
ethers.constants.AddressZero,
/* refundable= */ true,
ethers.constants.AddressZero,
);
await da.deployed();

Expand Down Expand Up @@ -328,7 +327,6 @@ describe('DutchAuction', function () {
0,
ethers.constants.AddressZero,
/* refundable= */ false,
ethers.constants.AddressZero,
);
await da.deployed();

Expand Down

0 comments on commit eb1be3c

Please sign in to comment.