Sound Protocol
Module Contracts
Minters
FixedPriceSignatureMinter

FixedPriceSignatureMinter

contracts/modules/FixedPriceSignatureMinter.sol (opens in a new tab)

A minter that enables permissioned mints via ECDSA signatures.

Inherits:

Structs

MintInfo

struct MintInfo {
    // Start timestamp of sale (in seconds since unix epoch).
    uint32 startTime;
    // End timestamp of sale (in seconds since unix epoch).
    uint32 endTime;
    // The affiliate fee in basis points.
    uint16 affiliateFeeBPS;
    // Whether the mint is paused.
    bool mintPaused;
    // Sale price in ETH for minting a single token.
    uint96 price;
    // The maximum number of tokens that can be minted.
    uint32 maxMintable;
    // The maximum number of tokens that can be minted by an account.
    uint32 maxMintablePerAccount;
    // The total number of tokens minted.
    uint32 totalMinted;
    // The address of the signer.
    address signer;
}

Holds information pertaining to a mint.

This struct is intended for off-chain queries, and can be retrieved via the mintInfo function.

Write Functions

createEditionMint

function createEditionMint(
    address edition,
    uint96 price,
    uint32 startTime,
    uint32 cutoffTime,
    uint32 endTime,
    uint16 affiliateFeeBPS,
    uint32 maxMintableLower,
    uint32 maxMintableUpper,
    uint32 maxMintablePerAccount_
    ) external returns (uint128 mintId)

Initializes a range edition mint instance.

Calling conditions:

  • The caller must be the owner or an adminstrator (via the ADMIN_ROLE) of the edition contract.
Params:
editionAddress of the song edition contract we are minting for.
priceSale price in ETH for minting a single token in edition.
startTimeStart timestamp of sale (in seconds since unix epoch).
cutoffTimeThe timestamp (in seconds since unix epoch) after which the max amount of tokens mintable will drop from maxMintableUpper to maxMintableLower.
endTimeEnd timestamp of sale (in seconds since unix epoch).
affiliateFeeBPSThe affiliate fee in basis points.
maxMintableLowerThe lower limit of the maximum number of tokens that can be minted.
maxMintableUpperThe upper limit of the maximum number of tokens that can be minted.
maxMintablePerAccount_The maximum number of tokens that can be minted by an account.

setMaxMintableRange

function setMaxMintableRange(
    address edition,
    uint128 mintId,
    uint32 maxMintableLower,
    uint32 maxMintableUpper
) external

Sets the max mintable range.

Calling conditions:

  • The caller must be the owner or an adminstrator (via the ADMIN_ROLE) of the edition contract.
Params:
editionAddress of the song edition contract we are minting for.
maxMintableLowerThe lower limit of the maximum number of tokens that can be minted.
maxMintableUpperThe upper limit of the maximum number of tokens that can be minted.

mint

function mint(
    address edition,
    uint128 mintId,
    uint32 quantity,
    address affiliate
) external payable

Mints tokens for a given edition.

Params:
editionAddress of the song edition contract we are minting for.
quantityToken quantity to mint in song edition.

setPrice

function setPrice(
    address edition,
    uint128 mintId,
    uint96 price
) external

Sets the price for (edition, mintId).

Calling conditions:

  • The caller must be the owner or an adminstrator (via the ADMIN_ROLE) of the edition contract.
Params:
editionAddress of the song edition contract we are minting for.
mintIdThe mint ID.
priceSale price in ETH for minting a single token in edition.

setMaxMintablePerAccount

function setMaxMintablePerAccount(
    address edition,
    uint128 mintId,
    uint32 maxMintablePerAccount
) external

Sets the maxMintablePerAccount for (edition, mintId).

Calling conditions:

  • The caller must be the owner or an adminstrator (via the ADMIN_ROLE) of the edition contract.
Params:
editionAddress of the song edition contract we are minting for.
mintIdThe mint ID.
maxMintablePerAccountThe maximum number of tokens that can be minted by an account.

Read-only Functions

mintInfo

function mintInfo(
    address edition,
    uint128 mintId
) external view returns (MintInfo memory)

Returns MintInfo instance containing the full minter parameter set.

Params:
editionThe edition to get the mint instance for.
mintIdThe ID of the mint instance.

supportsInterface

IERC165-supportsInterface

function supportsInterface(bytes4 interfaceId) public view virtual returns (bool)

Returns true if this contract implements the interface defined by interfaceId.

See the corresponding EIP section (opens in a new tab) to learn more about how these ids are created.

Params:
interfaceIdThe 4 byte interface ID.
Supported Interface IDs:
IERC1650x01ffc9a7
IMinterModule0x37c74bd8
IFixedPriceSignatureMinter0xa61bd96f

Events

RangeEditionMintCreated

event RangeEditionMintCreated(
    address indexed edition,
    uint128 indexed mintId,
    uint96 price,
    uint32 startTime,
    uint32 cutoffTime,
    uint32 endTime,
    uint16 affiliateFeeBPS,
    uint32 maxMintableLower,
    uint32 maxMintableUpper,
    uint32 maxMintablePerAccount
)

Emitted when a range edition is created.

Params:
editionAddress of the song edition contract we are minting for.
mintIdThe mint ID.
priceSale price in ETH for minting a single token in edition.
startTimeStart timestamp of sale (in seconds since unix epoch).
cutoffTimeThe timestamp (in seconds since unix epoch) after which the max amount of tokens mintable will drop from maxMintableUpper to maxMintableLower.
endTimeEnd timestamp of sale (in seconds since unix epoch).
affiliateFeeBPSThe affiliate fee in basis points.
maxMintableLowerThe lower limit of the maximum number of tokens that can be minted.
maxMintableUpperThe upper limit of the maximum number of tokens that can be minted.

MaxMintableRangeSet

event MaxMintableRangeSet(
    address indexed edition,
    uint128 indexed mintId,
    uint32 maxMintableLower,
    uint32 maxMintableUpper
)

Emitted when the max mintable range is updated.

Params:
editionAddress of the song edition contract we are minting for.
mintIdThe mint ID.
maxMintableLowerThe lower limit of the maximum number of tokens that can be minted.
maxMintableUpperThe upper limit of the maximum number of tokens that can be minted.

PriceSet

event PriceSet(
    address indexed edition,
    uint128 indexed mintId,
    uint96 price
)

Emitted when the price is changed for (edition, mintId).

Params:
editionAddress of the song edition contract we are minting for.
mintIdThe mint ID.
priceSale price in ETH for minting a single token in edition.

MaxMintablePerAccountSet

event MaxMintablePerAccountSet(
    address indexed edition,
    uint128 indexed mintId,
    uint32 maxMintablePerAccount
)

Emitted when the maxMintablePerAccount is changed for (edition, mintId).

Params:
editionAddress of the song edition contract we are minting for.
mintIdThe mint ID.
maxMintablePerAccountThe maximum number of tokens that can be minted per account.

Errors

InvalidMaxMintableRange

error InvalidMaxMintableRange()

The maxMintableLower must not be greater than maxMintableUpper.

ExceedsMaxPerAccount

error ExceedsMaxPerAccount()

The number of tokens minted has exceeded the number allowed for each account.

MaxMintablePerAccountIsZero

error MaxMintablePerAccountIsZero()

The max mintable per account cannot be zero.