// Overview & Links //
This contract enables removing individual items for your bag of Loot, without needing to lock or transfer your Loot token.
Its based on this idea:
View contract on Rinkeby:
To use it you’ll need Loot on Rinkeby, which you can get from here:
Example item on OpenSea: https://testnets.opensea.io/assets/0x171737c02531ec152c8e9969357acb47155ce5c7/104866579506273748567843570589163227334742321847896356339298006527369361515687
// Implementation Notes //
The contract is currently set up to spawn new instances of all 8 of the items within a bag of Loot as ERC1155s when the claim
function is called. claim
is only available to active owners of Loot. Every time this is called, the bag must wait a number of blocks before it is considered “replenished” at which point it can be used again. The number of blocks increases each time the function is called.
See a breakdown of the proposed growth rate in Google Sheets: Loot (Spawned) Growth over Time - Google Sheets
These items are minted to the current owners of the original Loot bag, allowing them to add them to their collection, gift them, list them for sale on OpenSea, or use them to fund and add new members in an item-based DAO.
There are 2 public methods to make it easy to determine if a bag is replenished and may be withdrawn from: isReplenished(bagId)
which returns a simple true or false, and nextReplenishBlock(bagId)
which returns the block number after which the bag may be withdrawn from next.
In this version there are 2 owner-only methods which allow for updating the rate of growth. This is based on a suggestion by @metas in discord. These functions are included in the contract with the intent to transfer governance of the growth rate to the community, ideally via Loot DAO where a community-governed multi-sig is already being set up.
// Request for Feedback //
- Naming: When items generated by this contract appear elsewhere (ilke OpenSea), they should have a distinct name that make it clear to viewers how the item was generated. For now I’m using “Loot (Spawned)” but want to defer to the community on how we should name this contract.
What should we call the contract and the items it generates?
- ERC1155 vs ERC721: This contract uses ERC1155 as a way to optimize gas fees on withdrawal, and allow for aggregated item pages on marketplaces like OpenSea. There is less support for ERC1155 across the rest of the ecosystem at the moment than ERC721. If the contract needs to be ERC721-based, it will likely require modifying the claim function to only mint 1 item at a time to avoid prohibitively expensive gas fees.
Are there any reasons we should switch to ERC721, or will ERC1155 be ok?
- Initial Growth Rate: The contract’s formula is currently designed to create 1,000,000 individual items in a little over a year (if 100% of the bags run the claim function as often as they can). Each claim makes the time required to replenish increase, so there will possibly be many items being created in the first couple weeks before it slows down.
Is there an alternative approach to the formula that we should use instead?
- Governance: In case we need to change some of the variables in the growth formula in the future, the contract currently includes admin-only functions that allow modification.
Should these admin functions be kept in? If so, should Loot DAO be asked to control governance of the growth rate?
Please leave your feedback about these questions and any other suggestions in the replies. Thanks!