Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

starting on 1155s #7

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Conversation

campionfellin
Copy link

Description

Please include a summary of the change and which issue is fixed.
Fixes HIGHLIGHT-

Starts on large 1155-based project

Proposed Changes:

  • Change 1
  • Change 2

Signed-off-by: Campion Fellin <[email protected]>
Signed-off-by: Campion Fellin <[email protected]>
Signed-off-by: Campion Fellin <[email protected]>
Signed-off-by: Campion Fellin <[email protected]>
Signed-off-by: Campion Fellin <[email protected]>
Signed-off-by: Campion Fellin <[email protected]>
_mint(recipient, tempSupply, 1, "");

_startTokenIds.push(tempSupply);
_startTokenIdToSeedDetails[tempSupply] = SeedDetails(blockhash(block.number - 1), block.timestamp);
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question I would have here is -

Can you go more in depth on SeedDetails and how that hooks up to the art generation off-chain? If I pass in a bytes32 seed to mintSeedToOneRecipient then would this line be like -

_startTokenIdToSeedDetails[tempSupply] = SeedDetails(seed, block.timestamp);

@campionfellin
Copy link
Author

Alright - this should be a good starting point to the conversation. Couple other questions -

I see the onlyMinter modifier, which is great. I see the main minter you have MintManager.sol . Should I add a function there? I see it already has both gating and erc20 support!

Comment on lines 97 to 101
function processRecipientMintWithHash(uint256 tokenId, bytes32 inputHash) external {
collectionSeedInputs[msg.sender].push(
UserInputHash(uint176(tokenId), inputHash)
);
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Newly added function, called from ERC1155YungWkndBase during mintSeedToOneRecipient function.

/**
* @notice Get a token's seed input
*/
function getCuratedHash(uint256 tokenId, address collection) public view returns (bytes32 memory) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function first checks for user input-ed hashes, and then if not found, constructs it from the seed input details

* @notice Registers a minter
* @param minter New minter
*/
function registerMinter(address minter) external onlyOwner {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the contracts be self-owned? In this case, you will want to consider who can register and unregister valid minters. A valid approach is to let each owner optionally kick your EOA out of minting privileges (but that would hinder functionality for their collection)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the contracts (for now) will be centrally owned by my app/EOAs.

Artists can control their art and payout details, etc. But the minter/minting mechanic will more or less be the same for every project.

Copy link
Collaborator

@beshup beshup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd strongly consider using a factory to deploy collections. We used to use a factory with CREATE2 but moved off it for other product-related reasons (that don't apply here). Advantages:

  • Your backend can know a contract's address before the deploy tx completes
  • Your factory can handle optional deploy config like adding files to your collection's FileSystem for example (for collections that are "in-chain"), and updating data on your renderer contract
  • Using a minimal proxy will result in cheaper deploys + each instance of a collection won't need to be "verified as proxy" on block explorers, eg. Etherscan automatically displays the implementation's interface if the contract is a minimal proxy (https://eips.ethereum.org/EIPS/eip-1167)


for (uint256 i = 0; i < fileStorageAddressesLength; i++) {
contents = string(
abi.encodePacked(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This contract has actually been updated to be more efficient. Overall, this repository is lagging a little behind but this should be the only part that affects your branch. More to come on this later, but expect main to be updated with a newer OnchainFileStorage contract next week

Signed-off-by: Campion Fellin <[email protected]>
Signed-off-by: Campion Fellin <[email protected]>
Signed-off-by: Campion Fellin <[email protected]>
Signed-off-by: Campion Fellin <[email protected]>
Signed-off-by: Campion Fellin <[email protected]>
Signed-off-by: Campion Fellin <[email protected]>
Signed-off-by: Campion Fellin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants