This repository contains a collection of Cyberconnect middlewares to apply a discount on an essence in different ways. CollectPaidMw.sol is used as the base for writing these new middlewares.
The interfaces and bytecodes of all the contracts are available. You can use them to deploy your own contract using deploy.js.
To compile and deploy the contracts you can clone the
original
cybercontracts
repo, and copy your desired .sol
file under
essence
directory. Next, follow the
deployment
guide to compile and deploy.
Middleware | Address |
---|---|
Early Bird | 0x998A7331529EDe43fdB3CabA7f85F265eE63B636 |
First N | 0x8B08012f7fab8FaDD7c3c6d686ABA3e73Cf9262D |
Hot Essence | 0x09bccAF5769A44DfbA3BD7610d693f604764f9Cf |
Upgrade | 0x36f797cf56a9b772470658eb02F25507081e7bF9 |
Discount applies for the early bird collectors. A target block in future is set as the end of early bird discount.
- Increasing the hype of an essence
- Selling more in less time
uint256 targetBlock
indicates a block in the future after
which the discount is disabled.
uint256 discount
sets discount percentage. Must be less
than or equal to Constants._MAX_BPS
. Zero means no
discount.
A discount is applied for the first N collectors of the essence.
- Selling tickets to an event
- Promoting a profile by making users check for such an essence more often
uint256 firstN
indicates how many first collectors
receive a discount.
uint256 discount
sets discount percentage. Must be less
than or equal to Constants._MAX_BPS
. Zero means no
discount.
Discount applies on the essence when it's not in trend any more (i.e. after a target block has passed.)
- Selling trading signals
- Selling a music album
uint256 targetBlock
indicates the block at which the
discount starts to apply.
uint256 discount
sets discount percentage. Must be less
than or equal to Constants._MAX_BPS
. Zero means no
discount.
Discount applies on the essence only if the collector has already collected a specified essence (e.g. an essence containing an older version of a software)
- App upgrades
- Loyalty programs
uint256 previousEssenceId
indicates the ID of the essence
which should have been already collected in order to get
a discount.
uint256 upgradeDiscount
sets discount percentage. Must be less
than or equal to Constants._MAX_BPS
. Zero means no
discount.