There is a lot of chatter around what kinds of systems could be used for in-universe trading and transacting. While I think ERC-20 tokens are generally great, the fact that they have so many established use cases already (e.g. DeFi) can make them take on a life of their own and be difficult to build for specific purposes.
This post is a short overview of a theoretical system that instead uses ERC-1155 to encourage an in-universe tiered barter system with fair distribution.
Structure
ERC-1155 contract that represents a chance at multiple “tiers” of a single object type, like a pearl:
- Broken Pearl (50%)
- Chipped Pearl (30%)
- Flawed Pearl (10%)
- Pearl (5%)
- Perfect Pearl (3%)
- Resplendent Pearl (1%)
- Pearl of X (0.5%)
- Pearl of Y (0.025%)
- Pearl of Z (0.00025%)
- etc
All names and percentages above are for illustrative purposes only.
Distribution
The contract also acts as the initial distributor. A public distribute()
function is made available which anyone can call if they pay a small bounty. The function can only be called once every n blocks (e.g. once a day). When the function is successfully called, the following happens:
- True random number generation occurs (e.g. through Chainlink VRF)
- The number is used to mint n “drops” containing different quantities of different types of pearls
- The drops are sent to randomly selected holders of Loot
- To incentivize calling
distribute()
, the person who successfully calls it and pays the bounty is always included in the list of drop recipients (although there is no guarantee on what they will receive)
Use cases
Initial use cases could be simple and grow from there:
- Bartering between pearls (e.g. trading 11 broken pearls for one pearl)
- Bartering for bags with pearls (e.g. one Pearl of X for Bag #1234)
- Trading common pearls for simple tasks (e.g. claim a land plot with a Broken Pearl, training stats)
Scaling & Proliferation
The initial distributor is a good place to start, but ideally there can be an increasing number of activities (slaying monsters, completing dungeons, participating in PvP) which can award drops. Over time, both the distribution function and and distribution list could be attached to these types of activities.
It might make sense for these activities to originate with a small curated list to start, with a plan to create methods to allow arbitrary activities in the future.
Supply
This system assumes a supply that gradually grows over time. Depending on the rate, that might be enough on its own.
Another option is introducing different types of “sinks” that allow the supply to either be returned to the distributor or be destroyed entirely. One example of a system that could do this is a chance-to-upgrade system, which would give someone a small chance to upgrade their higher tier pearls by attempting to “infuse” their lower tier ones.
Other options include slowing down the rate as time passes or giving control over the rate to the contract owner.