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

Simplified Inventory #318

Open
1 of 4 tasks
zomglings opened this issue Jul 27, 2023 · 0 comments
Open
1 of 4 tasks

Simplified Inventory #318

zomglings opened this issue Jul 27, 2023 · 0 comments
Assignees

Comments

@zomglings
Copy link
Collaborator

zomglings commented Jul 27, 2023

We contributed the first version of our Inventory contract to Game7 DAO: https://github.com/G7DAO/contracts

Since its release this March, it has been adopted for production use by multiple projects. Based on this usage, we have come to understand that:

  1. The default implementation of the Inventory should be a standalone contract and not an EIP2535 facet. DELEGATECALL proxies are complex, somewhat difficult to deploy, and undesirable from a decentralization point of view.
  2. Using Terminus as the default method of access control adds conceptual complexity to understanding how the Inventory works. The default access control mechanism should just be onlyOwner for a great getting started experience. We will also implement Terminus access control as the production-grade option.
  3. Slot types are unnecessarily complex and confusing to users. They are not strictly necessary -- a slot's type is implicitly defined by the tokens that can be equipped in that slot. Any additional semantics must be an extension to the core Inventory system.
  4. The terms unequippable and nonunequipable are terrible and confusing because of the negatives. We should follow the recommendation of Diniz Sa (from OP Games/Arcadians) and call persistent the slots from which items cannot be unequipped.

The age-old wisdom of PEP20 contains these lessons:

...
Simple is better than complex.
...
Readability counts.
...
There should be one-- and preferably only one --obvious way to do it.
...
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

This issue tracks the following changes:

Each of the implementations should remove slot types and should name nonunequippable slots as "persistent".

@zomglings zomglings self-assigned this Jul 27, 2023
@zomglings zomglings changed the title Minimal Inventory Improved Inventory Jul 27, 2023
@zomglings zomglings changed the title Improved Inventory Simplified Inventory Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant