-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from ourzora/add_getters_mint_limit
Add upgrade script and set mint limit
- Loading branch information
Showing
22 changed files
with
1,218 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
{ | ||
"FIXED_PRICE_SALE_STRATEGY": "0x6ae87b1D0909e8DC03F7b9c240e22CD5131Ed4Ee", | ||
"MERKLE_MINT_SALE_STRATEGY": "0xAF9f59A6a437c2d72ca60569A8508Ccbddd6f219", | ||
"CREATOR_1155_IMPL": "0xD0561AEF1D5cd30a1779f01B41B3436027177d9A", | ||
"1155_IMPL": "0xD0561AEF1D5cd30a1779f01B41B3436027177d9A", | ||
"FACTORY_IMPL": "0xB897dC4D2cBE136908798d53563b66a13B6f2eB1", | ||
"FACTORY_PROXY": "0x784A410B891EE92612102521281a3e222a6E326D" | ||
"FACTORY_PROXY": "0x784A410B891EE92612102521281a3e222a6E326D", | ||
"MINT_FEE_AMOUNT": "777000000000000", | ||
"MINT_FEE_RECIPIENT": "0xd1d1d4e36117ab794ec5d4c78cbd3a8904e691d0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
{ | ||
"FIXED_PRICE_SALE_STRATEGY": "0x5857bC4EafFB91B6227C6e232bf4a4AEf97F78aB", | ||
"MERKLE_MINT_SALE_STRATEGY": "0x8a2872Ad6082373c7090EDB15d46dfC7647AC7bE", | ||
"CREATOR_1155_IMPL": "0x828b7D5116f1d65889Ba8498075a023e9A5729a2", | ||
"FACTORY_IMPL": "0xDE4E2e44ef77CFe0EBc7D14B090e99264670892d", | ||
"FACTORY_PROXY": "0x8732b4bCa198509bB9c40f9a24638Be1eaB7D30c" | ||
"FIXED_PRICE_SALE_STRATEGY": "0x10f7d171fbf4ac14a3250e9313D97b2Dfe30EcfD", | ||
"MERKLE_MINT_SALE_STRATEGY": "0x91724462892148fb0bAcD300d7503A80baB32aA5", | ||
"1155_IMPL": "0x828b7D5116f1d65889Ba8498075a023e9A5729a2", | ||
"FACTORY_IMPL": "0xb532480c7251F6f4E868cfA032C9921BF7ab2078", | ||
"FACTORY_PROXY": "0x8732b4bCa198509bB9c40f9a24638Be1eaB7D30c", | ||
"MINT_FEE_AMOUNT": "777000000000000", | ||
"MINT_FEE_RECIPIENT": "0xDC498668B5e6CC518fD58A2ADBF614Fd3A13D3a0" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@zoralabs/zora-creator-contracts", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"repository": "[email protected]:ourzora/creator-contracts.git", | ||
"author": "Iain <[email protected]>", | ||
"license": "MIT", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.17; | ||
|
||
import {IERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/interfaces/IERC165Upgradeable.sol"; | ||
|
||
interface ILimitedMintPerAddress is IERC165Upgradeable { | ||
error UserExceedsMintLimit(address user, uint256 limit, uint256 requestedAmount); | ||
|
||
function getMintedPerWallet(address token, uint256 tokenId, address wallet) external view returns (uint256); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.17; | ||
|
||
import {ILimitedMintPerAddress} from "../../interfaces/ILimitedMintPerAddress.sol"; | ||
|
||
contract LimitedMintPerAddress is ILimitedMintPerAddress { | ||
/// @notice Storage for slot to check user mints | ||
/// @notice target contract -> tokenId -> minter user -> numberMinted | ||
/// @dev No gap or stroage interface since this is used within non-upgradeable contracts | ||
mapping(address => mapping(uint256 => mapping(address => uint256))) internal mintedPerAddress; | ||
|
||
function getMintedPerWallet(address tokenContract, uint256 tokenId, address wallet) external view returns (uint256) { | ||
return mintedPerAddress[tokenContract][tokenId][wallet]; | ||
} | ||
|
||
function _requireMintNotOverLimitAndUpdate(uint256 limit, uint256 numRequestedMint, address tokenContract, uint256 tokenId, address wallet) internal { | ||
mintedPerAddress[tokenContract][tokenId][wallet] += numRequestedMint; | ||
if (mintedPerAddress[tokenContract][tokenId][wallet] > limit) { | ||
revert UserExceedsMintLimit(wallet, limit, mintedPerAddress[tokenContract][tokenId][wallet]); | ||
} | ||
} | ||
|
||
function supportsInterface(bytes4 interfaceId) public pure virtual override returns (bool) { | ||
return interfaceId == type(ILimitedMintPerAddress).interfaceId; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/minters/SaleCommandHelper.sol → src/minters/utils/SaleCommandHelper.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.