Skip to content

Commit

Permalink
Add missing import and rename module
Browse files Browse the repository at this point in the history
  • Loading branch information
cxkoda committed Jul 14, 2022
1 parent c824d60 commit 0bf8b3c
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 20 deletions.
18 changes: 13 additions & 5 deletions contracts/sales/presets/ArbitraryPriceRefundSeller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;

import "../sellers/FixedSupplyRefund.sol";
import "../sellers/FixedSupplyTxLimitRefund.sol";
import "../sellers/FixedPrice.sol";
import "../sellers/SellableCallbacker.sol";
import "../../utils/OwnerPausable.sol";

abstract contract ArbitraryPriceRefundSeller is
FixedSupplyRefund,
FixedSupplyTxLimitRefund,
SellableCallbacker,
OwnerPausable
{
Expand All @@ -19,7 +19,11 @@ abstract contract ArbitraryPriceRefundSeller is
}

constructor(Config memory cfg, ISellable sellable)
FixedSupplyRefund(cfg.totalInventory, cfg.maxPerTx, cfg.maxPerAddress)
FixedSupplyTxLimitRefund(
cfg.totalInventory,
cfg.maxPerTx,
cfg.maxPerAddress
)
SellableCallbacker(sellable)
{} // solhint-disable-line no-empty-blocks

Expand All @@ -43,14 +47,18 @@ abstract contract ArbitraryPriceRefundSeller is
)
internal
virtual
override(FixedSupplyRefund)
override(FixedSupplyTxLimitRefund)
returns (
address,
uint64,
uint256
)
{
(to, num, cost) = FixedSupplyRefund._beforePurchase(to, num, cost);
(to, num, cost) = FixedSupplyTxLimitRefund._beforePurchase(
to,
num,
cost
);
return (to, num, cost);
}
}
20 changes: 14 additions & 6 deletions contracts/sales/presets/FixedPriceRefundSeller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;

import "../sellers/FixedSupplyRefund.sol";
import "../sellers/FixedSupplyTxLimitRefund.sol";
import "../sellers/FixedPrice.sol";
import "../sellers/SellableCallbacker.sol";
import "../../utils/OwnerPausable.sol";

contract FixedPriceRefundSeller is
FixedSupplyRefund,
FixedSupplyTxLimitRefund,
FixedPrice,
SellableCallbacker,
OwnerPausable
Expand All @@ -21,7 +21,11 @@ contract FixedPriceRefundSeller is
}

constructor(Config memory cfg, ISellable sellable)
FixedSupplyRefund(cfg.totalInventory, cfg.maxPerTx, cfg.maxPerAddress)
FixedSupplyTxLimitRefund(
cfg.totalInventory,
cfg.maxPerTx,
cfg.maxPerAddress
)
FixedPrice(cfg.price)
SellableCallbacker(sellable)
{} // solhint-disable-line no-empty-blocks
Expand All @@ -39,22 +43,26 @@ contract FixedPriceRefundSeller is
)
internal
virtual
override(FixedSupplyRefund, InternalCostSeller)
override(FixedSupplyTxLimitRefund, InternalCostSeller)
returns (
address,
uint64,
uint256
)
{
(to, num, cost) = FixedSupplyRefund._beforePurchase(to, num, cost);
(to, num, cost) = FixedSupplyTxLimitRefund._beforePurchase(
to,
num,
cost
);
return (to, num, cost);
}

function _afterPurchase(
address to,
uint64 num,
uint256 cost
) internal virtual override(FixedSupplyRefund, Seller) {
) internal virtual override(FixedSupplyTxLimitRefund, Seller) {
CappedRefund._afterPurchase(to, num, cost);
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/sales/presets/FreeOwnerAirdropper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;

import "../sellers/FixedSupplyRefund.sol";
import "../sellers/FixedSupplyTxLimitRefund.sol";
import "../sellers/FixedPrice.sol";
import "../sellers/SellableCallbacker.sol";
import "../../utils/OwnerPausable.sol";
Expand Down
22 changes: 15 additions & 7 deletions contracts/sales/presets/LinearDutchAuctionRefundSeller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// Copyright (c) 2021 the ethier authors (github.com/divergencetech/ethier)
pragma solidity >=0.8.0 <0.9.0;

import "../sellers/FixedSupplyRefund.sol";
import "../sellers/FixedSupplyTxLimitRefund.sol";
import "../sellers/LinearDutchAuction.sol";
import "../sellers/SellableCallbacker.sol";
import "../../utils/OwnerPausable.sol";

contract LinearDutchAuctionRefundSeller is
FixedSupplyRefund,
FixedSupplyTxLimitRefund,
LinearDutchAuction,
SellableCallbacker,
OwnerPausable
Expand All @@ -25,7 +25,11 @@ contract LinearDutchAuctionRefundSeller is
uint256 expectedReserve,
ISellable sellable
)
FixedSupplyRefund(cfg.totalInventory, cfg.maxPerTx, cfg.maxPerAddress)
FixedSupplyTxLimitRefund(
cfg.totalInventory,
cfg.maxPerTx,
cfg.maxPerAddress
)
LinearDutchAuction(config, expectedReserve)
SellableCallbacker(sellable)
{} // solhint-disable-line no-empty-blocks
Expand Down Expand Up @@ -53,14 +57,18 @@ contract LinearDutchAuctionRefundSeller is
)
internal
virtual
override(FixedSupplyRefund, InternalCostSeller)
override(FixedSupplyTxLimitRefund, InternalCostSeller)
returns (
address,
uint64,
uint256
)
{
(to, num, cost) = FixedSupplyRefund._beforePurchase(to, num, cost);
(to, num, cost) = FixedSupplyTxLimitRefund._beforePurchase(
to,
num,
cost
);
(to, num, cost) = InternalCostSeller._beforePurchase(to, num, cost);
return (to, num, cost);
}
Expand All @@ -69,8 +77,8 @@ contract LinearDutchAuctionRefundSeller is
address to,
uint64 num,
uint256 cost
) internal virtual override(FixedSupplyRefund, Seller) {
FixedSupplyRefund._afterPurchase(to, num, cost);
) internal virtual override(FixedSupplyTxLimitRefund, Seller) {
FixedSupplyTxLimitRefund._afterPurchase(to, num, cost);
}

function purchase(address to, uint64 num) external payable whenNotPaused {
Expand Down
1 change: 1 addition & 0 deletions contracts/sales/sellers/CappedRefund.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
pragma solidity >=0.8.0 <0.9.0;

import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/utils/Context.sol";
import "./Seller.sol";

/// @notice Abstract seller module that modifies the requested number of tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ import "./TxLimit.sol";
/// @notice This composes the functionality of three modules providing a
/// capping of the requested number of items base on a total supply and limits
/// per transaction and purchaser.
abstract contract FixedSupplyRefund is FixedSupply, TxLimit, CappedRefund {
abstract contract FixedSupplyTxLimitRefund is
FixedSupply,
TxLimit,
CappedRefund
{
constructor(
uint64 totalInventory_,
uint64 maxPerTx_,
Expand Down
1 change: 1 addition & 0 deletions contracts/sales/sellers/LinearDutchAuction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
pragma solidity >=0.8.0 <0.9.0;

import "./Seller.sol";
import "./InternalCostSeller.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";

/**
Expand Down

0 comments on commit 0bf8b3c

Please sign in to comment.