Skip to content

Commit

Permalink
remove partner contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanio committed Oct 11, 2023
1 parent 05ab64f commit 2224731
Show file tree
Hide file tree
Showing 41 changed files with 511 additions and 2,496 deletions.
2 changes: 1 addition & 1 deletion docs/BringYourOwnTokenContract.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Bring Your Own Token Contract

Token creators who would like to use their own token contract functionality can inherit `ERC721SeaDrop`, or for Owner and Administrator roles `ERC721PartnerSeaDrop`. There are also several extensions in `src/extensions` such as Burnable and RandomOffset.
Token creators who would like to use their own token contract functionality can inherit `ERC721SeaDrop`. There are also several extensions in `src/extensions` such as Burnable and RandomOffset.

SeaDrop tokens use ERC721A for efficient multiple-quantity mint, along with additional tracking metadata like number of tokens minted by address used for enforcing wallet limits. Please do not override or modify any SeaDrop-related functionality on the token like `getMintStats()` to remain compatible and secure with SeaDrop.

Expand Down
28 changes: 0 additions & 28 deletions docs/SeaDropTokenDeployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ An example script to deploy a token contract is located at [DeployAndConfigureEx

`ERC721SeaDrop` contains only an Owner role (assigned to the deployer of the contract) that has authorization for all methods.

To split responsibilities with an Administrator role who can set fee parameters, use [`ERC721PartnerSeaDrop`](#erc721partnerseadrop).

1. Deploy `src/ERC721SeaDrop.sol` with constructor args `string name, string symbol, address[] allowedSeaDrop`
1. e.g. `forge create --rpc-url ${RPC_URL} src/ERC721SeaDrop.sol:ERC721SeaDrop --constructor-args "TokenTest1" "TEST1" \[${SEADROP_ADDRESS}\] --private-key ${PK} --etherscan-api-key ${ETHERSCAN_API_KEY} --verify`
1. Set the token max supply with `token.setMaxSupply()`
Expand All @@ -24,32 +22,6 @@ To split responsibilities with an Administrator role who can set fee parameters,
1. Set the drop URI with `token.updateDropURI()`
1. See [Format of Drop URI](#format-of-drop-uri)

### ERC721PartnerSeaDrop

`ERC721PartnerSeaDrop` is a token contract designed to split responsibilities between an Owner and Administrator.

1. Deploy `src/ERC721PartnerSeaDrop.sol` with constructor args `string name, string symbol, address administrator, address[] allowedSeaDrop`
1. e.g. `forge create --rpc-url ${RPC_URL} src/ERC721PartnerSeaDrop.sol:ERC721PartnerSeaDrop --constructor-args "TokenTest1" "TEST1" ${ADMIN_ADDRESS} \[${SEADROP_ADDRESS}\] --private-key ${PK} --etherscan-api-key ${ETHERSCAN_API_KEY} --verify`
1. Required to be sent by token Owner:
1. Set the token max supply with `token.setMaxSupply()`
1. Set the creator payout address with `token.updateCreatorPayoutAddress()`
1. Set the contract URI with `token.setContractURI()`
1. Set the base URI with `token.setBaseURI()`
1. Can be sent by token Owner or Administrator:
1. Optionally:
1. Set the provenance hash for random metadata reveals with `token.setProvenanceHash()`
1. Must be set before first token is minted
1. Instructions for generating the provenance hash [here](./ProvenanceHash.md)
1. Set an allow list drop stage with `token.updateAllowList()`
1. See [Format of Allow List URI](#format-of-drop-uri)
1. Set a token gated drop stage with `token.updateTokenGatedDrop()`
1. Administrator must first initialize with feeBps
1. Set a public drop stage with `token.updatePublicDrop()`
1. Administrator must first initialize with feeBps with `token.updatePublicDrop()`
1. If `restrictFeeRecipients` is set to true, Administrator must set allowed fee recipients with `token.updateAllowedFeeRecipient()`
1. Set the drop URI with `token.updateDropURI()`
1. See [Format of Drop URI](#format-of-drop-uri)

## Specifications

### Format of Drop URI
Expand Down
2 changes: 0 additions & 2 deletions script/DeployAndConfigureExampleToken.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ contract DeployAndConfigureExampleToken is Script {
address[] memory allowedSeadrop = new address[](1);
allowedSeadrop[0] = seadrop;

// This example uses ERC721SeaDrop. For separate Owner and
// Administrator privileges, use ERC721PartnerSeaDrop.
ERC721SeaDrop token = new ERC721SeaDrop(
"My Example Token",
"ExTKN",
Expand Down
15 changes: 9 additions & 6 deletions src-upgradeable/src/ERC721ContractMetadataUpgradeable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@ contract ERC721ContractMetadataUpgradeable is
* @param fromTokenId The start token id.
* @param toTokenId The end token id.
*/
function emitBatchMetadataUpdate(uint256 fromTokenId, uint256 toTokenId)
external
{
function emitBatchMetadataUpdate(
uint256 fromTokenId,
uint256 toTokenId
) external {
// Ensure the sender is only the owner or contract itself.
_onlyOwnerOrSelf();

Expand All @@ -133,7 +134,7 @@ contract ERC721ContractMetadataUpgradeable is
_onlyOwnerOrSelf();

// Ensure the max supply does not exceed the maximum value of uint64.
if (newMaxSupply > 2**64 - 1) {
if (newMaxSupply > 2 ** 64 - 1) {
revert CannotExceedMaxSupplyOfUint64(newMaxSupply);
}

Expand Down Expand Up @@ -270,7 +271,7 @@ contract ERC721ContractMetadataUpgradeable is
* @return royaltyAmount The royalty payment amount for _salePrice.
*/
function royaltyInfo(
uint256, /* _tokenId */
uint256 /* _tokenId */,
uint256 _salePrice
) external view returns (address receiver, uint256 royaltyAmount) {
// Put the royalty info on the stack for more efficient access.
Expand All @@ -291,7 +292,9 @@ contract ERC721ContractMetadataUpgradeable is
*
* @param interfaceId The interface id to check against.
*/
function supportsInterface(bytes4 interfaceId)
function supportsInterface(
bytes4 interfaceId
)
public
view
virtual
Expand Down
Loading

0 comments on commit 2224731

Please sign in to comment.