Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contracts/sales/FixedPriceSeller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ abstract contract FixedPriceSeller is Seller {
uint256 public price;

/// @notice Sets the per-item price.
function setPrice(uint256 _price) public onlyOwner {
function setPrice(uint256 _price) public onlyRole(DEFAULT_STEERING_ROLE) {
price = _price;
}

Expand Down
7 changes: 5 additions & 2 deletions contracts/sales/LinearDutchAuction.sol
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ abstract contract LinearDutchAuction is Seller {
function setAuctionConfig(
DutchAuctionConfig memory config,
uint256 expectedReserve
) public onlyOwner {
) public onlyRole(DEFAULT_STEERING_ROLE) {
// Underflow might occur is size/num decreases is too large.
unchecked {
require(
Expand All @@ -98,7 +98,10 @@ abstract contract LinearDutchAuction is Seller {
@dev The auction can be toggle on and off with this function, without the
cost of having to update the entire config.
*/
function setAuctionStartPoint(uint256 startPoint) public onlyOwner {
function setAuctionStartPoint(uint256 startPoint)
public
onlyRole(DEFAULT_STEERING_ROLE)
{
dutchAuctionConfig.startPoint = startPoint;
}

Expand Down
16 changes: 11 additions & 5 deletions contracts/sales/Seller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pragma solidity >=0.8.0 <0.9.0;

import "../utils/Monotonic.sol";
import "../utils/OwnerPausable.sol";
import "../utils/AccessControlPausable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Context.sol";
Expand All @@ -15,7 +15,7 @@ import "@openzeppelin/contracts/utils/Strings.sol";
- Enforce per-wallet / per-transaction limits
- Calculate required cost, forwarding to a beneficiary, and refunding extra
*/
abstract contract Seller is OwnerPausable, ReentrancyGuard {
abstract contract Seller is AccessControlPausable, ReentrancyGuard {
using Address for address payable;
using Monotonic for Monotonic.Increaser;
using Strings for uint256;
Expand Down Expand Up @@ -53,7 +53,10 @@ abstract contract Seller is OwnerPausable, ReentrancyGuard {
SellerConfig public sellerConfig;

/// @notice Sets the seller config.
function setSellerConfig(SellerConfig memory config) public onlyOwner {
function setSellerConfig(SellerConfig memory config)
public
onlyRole(DEFAULT_STEERING_ROLE)
{
require(
config.totalInventory >= config.freeQuota,
"Seller: excessive free quota"
Expand Down Expand Up @@ -85,7 +88,10 @@ abstract contract Seller is OwnerPausable, ReentrancyGuard {
address payable public beneficiary;

/// @notice Sets the recipient of revenues.
function setBeneficiary(address payable _beneficiary) public onlyOwner {
function setBeneficiary(address payable _beneficiary)
public
onlyRole(DEFAULT_STEERING_ROLE)
{
beneficiary = _beneficiary;
}

Expand Down Expand Up @@ -179,7 +185,7 @@ abstract contract Seller is OwnerPausable, ReentrancyGuard {
*/
function purchaseFreeOfCharge(address to, uint256 n)
public
onlyOwner
onlyRole(DEFAULT_STEERING_ROLE)
whenNotPaused
{
/**
Expand Down
4 changes: 2 additions & 2 deletions contracts/utils/AccessControlPausable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import {AccessControlEnumerable} from "./AccessControlEnumerable.sol";
/// STEERING role.
contract AccessControlPausable is AccessControlEnumerable, Pausable {
/// @notice Pauses the contract.
function pause() public onlyRole(DEFAULT_STEERING_ROLE) {
function pause() public virtual onlyRole(DEFAULT_STEERING_ROLE) {
Pausable._pause();
}

/// @notice Unpauses the contract.
function unpause() public onlyRole(DEFAULT_STEERING_ROLE) {
function unpause() public virtual onlyRole(DEFAULT_STEERING_ROLE) {
Pausable._unpause();
}
}