IMinterModule
contracts/core/interfaces/IMinterModule.sol
(opens in a new tab)
This interface is specific for the minter modules used by sound.xyz.
If you are building contracts to interact with the minter modules, this may be of convenience.
If you are building your own minters, it is not mandatory implement this interface.
Inherits:
Structs
BaseData
struct BaseData {
// The start unix timestamp of the mint.
uint32 startTime;
// The end unix timestamp of the mint.
uint32 endTime;
// The affiliate fee in basis points.
uint16 affiliateFeeBPS;
// Whether the mint is paused.
bool mintPaused;
}
Used for internal storage of data pertaining to mints.
Write Functions
setEditionMintPaused
function setEditionMintPaused(
address edition,
uint128 mintId,
bool paused
) external
Sets the paused status for (edition
, mintId
).
Calling conditions:
- The caller must be the edition's owner or admin.
Params: | |
---|---|
edition | The edition address. |
mintId | The mint ID, a global incrementing identifier used within the minter |
paused | Whether the mint is paused. |
setTimeRange
function setTimeRange(
address edition,
uint128 mintId,
uint32 startTime,
uint32 endTime
) external
Sets the time range for an edition mint.
Calling conditions:
- The caller must be the edition's owner or admin.
Params: | |
---|---|
edition | The edition address. |
mintId | The mint ID, a global incrementing identifier used within the minter |
startTime | The start time of the mint. |
endTime | The end time of the mint. |
setAffiliateFee
function setAffiliateFee(
address edition,
uint128 mintId,
uint16 affiliateFeeBPS
) external
Sets the affiliate fee for (edition
, mintId
).
Calling conditions:
- The caller must be the edition's owner or admin.
Params: | |
---|---|
edition | The edition address. |
mintId | The mint ID, a global incrementing identifier used within the minter |
affiliateFeeBPS | The affiliate fee in basis points. |
withdrawForAffiliate
function withdrawForAffiliate(address affiliate) external
Withdraws all the accrued fees for affiliate
.
Params: | |
---|---|
affiliate | The affiliate's address. |
withdrawForPlatform
function withdrawForPlatform() external
Withdraws all the accrued fees for the platform.
Read-only Functions
affiliateFeesAccrued
function affiliateFeesAccrued(address affiliate) external view returns (uint128)
The total fees accrued for affiliate
.
Params: | |
---|---|
affiliate | The affiliate's address. |
platformFeesAccrued
function platformFeesAccrued() external view returns (uint128)
The total fees accrued for the platform.
isAffiliated
function isAffiliated(
address edition,
uint128 mintId,
address affiliate
) external view returns (bool)
Whether affiliate
is affiliated for (edition
, mintId
).
Params: | |
---|---|
edition | The edition's address. |
mintId | The mint ID. |
affiliate | The affiliate's address. |
totalPrice
function totalPrice(
address edition,
uint128 mintId,
address minter,
uint32 quantity
) external view returns (uint128)
The total price for quantity
tokens for (edition
, mintId
).
Params: | |
---|---|
edition | The edition's address. |
mintId | The mint ID. |
mintId | The minter's address. |
quantity | The number of tokens to mint. |
nextMintId
function nextMintId() external view returns (uint128)
The next mint ID. A mint ID is assigned sequentially starting from (0, 1, 2, ...), and is shared amongst all editions connected to the minter contract.
moduleInterfaceId
function moduleInterfaceId() external view returns (bytes4)
The interface ID of the minter.
feeRegistry
function feeRegistry() external view returns (ISoundFeeRegistry)
The fee registry. Used for handling platform fees.
Events
MintConfigCreated
event MintConfigCreated(
address indexed edition,
address indexed creator,
uint128 mintId,
uint32 startTime,
uint32 endTime,
uint16 affiliateFeeBPS
)
Emitted when the mint instance for an edition
is created.
Params: | |
---|---|
edition | The edition address. |
mintId | The mint ID, a global incrementing identifier used within the minter |
startTime | The start time of the mint. |
endTime | The end time of the mint. |
affiliateFeeBPS | The affiliate fee in basis points. |
MintPausedSet
event MintPausedSet(address indexed edition, uint128 mintId, bool paused)
Emitted when the paused
status of edition
is updated.
Params: | |
---|---|
edition | The edition address. |
mintId | The mint ID, to distinguish between multiple mints for the same edition. |
paused | The new paused status. |
TimeRangeSet
event TimeRangeSet(address indexed edition, uint128 indexed mintId, uint32 startTime, uint32 endTime)
Emitted when the paused
status of edition
is updated.
Params: | |
---|---|
edition | The edition address. |
mintId | The mint ID, to distinguish between multiple mints for the same edition. |
startTime | The start time of the mint. |
endTime | The end time of the mint. |
AffiliateFeeSet
Emitted when the affiliateFeeBPS
is updated.
event AffiliateFeeSet(address indexed edition, uint128 indexed mintId, uint16 bps)
Params: | |
---|---|
edition | The edition address. |
mintId | The mint ID, to distinguish between multiple mints for the same edition. |
bps | The affiliate fee basis points. |
Minted
Emitted when a mint happens.
event Minted(
address indexed edition,
uint128 indexed mintId,
address indexed buyer,
uint32 fromTokenId,
uint32 quantity,
uint128 requiredEtherValue,
uint128 platformFee,
uint128 affiliateFee,
address affiliate,
bool affiliated
)
Params: | |
---|---|
edition | The edition address. |
mintId | The mint ID, to distinguish between multiple mints for the same edition. |
buyer | The buyer address. |
fromTokenId | The first token ID of the batch. |
quantity | The size of the batch. |
requiredEtherValue | Total amount of Ether required for payment. |
platformFee | The cut paid to the platform. |
affiliateFee | The cut paid to the affiliate. |
affiliate | The affiliate's address. |
affiliated | Whether the affiliate is affiliated. |
Errors
Underpaid
error Underpaid(uint256 paid, uint256 required)
The Ether value paid is below the value required.
Params: | |
---|---|
paid | The amount sent to the contract. |
required | The amount required to mint. |
ExceedsAvailableSupply
error ExceedsAvailableSupply(uint32 available)
The number minted has exceeded the max mintable amount.
Params: | |
---|---|
available | The number of tokens remaining available for mint. |
MintNotOpen
error MintNotOpen(uint256 blockTimestamp, uint32 startTime, uint32 endTime)
The mint is not opened.
Params: | |
---|---|
blockTimestamp | The current block timestamp. |
startTime | The start time of the mint. |
endTime | The end time of the mint. |
MintPaused
error MintPaused()
The mint is paused. error MintPaused();
InvalidTimeRange
error InvalidTimeRange()
The startTime
is not less than the endTime
.
Unauthorized
error Unauthorized()
Unauthorized caller error Unauthorized();
InvalidAffiliateFeeBPS
error InvalidAffiliateFeeBPS()
The affiliate fee numerator must not exceed MAX_BPS
.
FeeRegistryIsZeroAddress
error FeeRegistryIsZeroAddress()
Fee registry cannot be the zero address.