Skip to content

Commit

Permalink
Force PLATFORM_AIRDROP to only use platform signer
Browse files Browse the repository at this point in the history
  • Loading branch information
Vectorized committed Dec 6, 2023
1 parent f09b3dd commit f10c723
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion contracts/modules/SuperMinterV1_1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ contract SuperMinterV1_1 is ISuperMinterV1_1, EIP712 {
c.merkleRoot = bytes32(0);
c.maxMintablePerAccount = type(uint32).max;
} else if (mode == PLATFORM_AIRDROP) {
_validateSigner(c.signer);
c.signer = address(1); // We will just use the `platformSigner`.
c.merkleRoot = bytes32(0);
c.maxMintablePerAccount = type(uint32).max;
c.price = 0; // Platform airdrop mode doesn't have a price.
Expand Down Expand Up @@ -619,6 +619,7 @@ contract SuperMinterV1_1 is ISuperMinterV1_1, EIP712 {
) public onlyEditionOwnerOrAdmin(edition) {
uint256 mintId = LibOps.packId(edition, tier, scheduleNum);
MintData storage d = _getMintData(mintId);
// Note that `PLATFORM_AIRDROP` does not allow for configuration of the signer.
if (d.mode != VERIFY_SIGNATURE) revert NotConfigurable();
_validateSigner(signer);
bool usePlatformSigner = signer == address(1);
Expand Down
4 changes: 3 additions & 1 deletion tests/modules/SuperMinterV1_1.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,11 @@ contract SuperMinterV1_1Tests is TestConfigV2_1 {
c.endTime = uint32(block.timestamp + 1000);
c.maxMintablePerAccount = uint32(_random()); // Doesn't matter, will be auto set to max.
c.mode = sm.PLATFORM_AIRDROP();
c.signer = signer;
assertEq(sm.createEditionMint(c), 0);

vm.prank(c.platform);
sm.setPlatformSigner(signer);

unchecked {
ISuperMinterV1_1.PlatformAirdrop memory p;
p.edition = address(edition);
Expand Down

0 comments on commit f10c723

Please sign in to comment.