2017-10-18 06:17:42 +00:00
|
|
|
![MiniMe Token](readme-header.png)
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2023-09-19 10:10:13 +00:00
|
|
|
[![Github Actions][gha-badge]][gha] [![Codecov][codecov-badge]][codecov] [![Foundry][foundry-badge]][foundry]
|
|
|
|
|
|
|
|
[gha]: https://github.com/vacp2p/minime/actions
|
|
|
|
[gha-badge]: https://github.com/vacp2p/minime/actions/workflows/ci.yml/badge.svg
|
|
|
|
[codecov]: https://codecov.io/gh/vacp2p/minime
|
|
|
|
[codecov-badge]: https://codecov.io/gh/vacp2p/minime/graph/badge.svg
|
|
|
|
[foundry]: https://getfoundry.sh/
|
|
|
|
[foundry-badge]: https://img.shields.io/badge/Built%20with-Foundry-FFDB1C.svg
|
2017-10-21 07:10:44 +00:00
|
|
|
|
2016-11-15 14:49:48 +00:00
|
|
|
The MiniMeToken contract is a standard ERC20 token with extra functionality:
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2016-11-13 01:07:25 +00:00
|
|
|
### The token is easy to clone!
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2023-09-12 15:08:59 +00:00
|
|
|
Anybody can create a new clone token from any token using this contract with an initial distribution identical to the
|
|
|
|
original token at a specified block. The address calling the `createCloneToken` function will become the token
|
|
|
|
controller and the token's default settings can be specified in the function call.
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2016-11-13 01:07:25 +00:00
|
|
|
function createCloneToken(
|
|
|
|
string _cloneTokenName,
|
|
|
|
uint8 _cloneDecimalUnits,
|
|
|
|
string _cloneTokenSymbol,
|
|
|
|
uint _snapshotBlock,
|
|
|
|
bool _isConstant
|
|
|
|
) returns(address) {
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2017-01-11 12:20:47 +00:00
|
|
|
Once the clone token is created, it acts as a completely independent token, with it's own unique functionalities.
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2016-11-13 01:07:25 +00:00
|
|
|
### Balance history is registered and available to be queried
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2023-09-12 15:08:59 +00:00
|
|
|
All MiniMe Tokens maintain a history of the balance changes that occur during each block. Two calls are introduced to
|
|
|
|
read the totalSupply and the balance of any address at any block in the past.
|
2016-11-08 13:12:24 +00:00
|
|
|
|
|
|
|
function totalSupplyAt(uint _blockNumber) constant returns(uint)
|
|
|
|
|
|
|
|
function balanceOfAt(address _holder, uint _blockNumber) constant returns (uint)
|
|
|
|
|
2016-11-13 01:07:25 +00:00
|
|
|
### Optional token controller
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2023-09-12 15:08:59 +00:00
|
|
|
The controller of the contract can generate/destroy/transfer tokens at its own discretion. The controller can be a
|
|
|
|
regular account, but the intention is for the controller to be another contract that imposes transparent rules on the
|
|
|
|
token's issuance and functionality. The Token Controller is not required for the MiniMe token to function, if there is
|
|
|
|
no reason to generate/destroy/transfer tokens, the token controller can be set to 0x0 and this functionality will be
|
|
|
|
disabled.
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2023-09-12 15:08:59 +00:00
|
|
|
For example, a Token Creation contract can be set as the controller of the MiniMe Token and at the end of the token
|
|
|
|
creation period, the controller can be transferred to the 0x0 address, to guarantee that no new tokens will be created.
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2016-11-13 01:07:25 +00:00
|
|
|
To create and destroy tokens, these two functions are introduced:
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2016-11-16 08:48:03 +00:00
|
|
|
function generateTokens(address _holder, uint _value) onlyController
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2016-11-16 08:48:03 +00:00
|
|
|
function destroyTokens(address _holder, uint _value) onlyController
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2016-11-13 01:07:25 +00:00
|
|
|
### The Token's Controller can freeze transfers.
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2023-09-12 15:08:59 +00:00
|
|
|
If transfersEnabled == false, tokens cannot be transferred by the users, however they can still be created, destroyed,
|
|
|
|
and transferred by the controller. The controller can also toggle this flag.
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2016-11-15 14:49:48 +00:00
|
|
|
// Allows tokens to be transferred if true or frozen if false
|
2017-01-11 12:20:47 +00:00
|
|
|
function enableTransfers(bool _transfersEnabled) onlyController
|
2016-11-08 13:12:24 +00:00
|
|
|
|
|
|
|
## Applications
|
|
|
|
|
2023-09-12 15:08:59 +00:00
|
|
|
If this token contract is used as the base token, then clones of itself can be easily generated at any given block
|
|
|
|
number, this allows for incredibly powerful functionality, effectively the ability for anyone to give extra features to
|
|
|
|
the token holders without having to migrate to a new contract. Some of the applications that the MiniMe token contract
|
|
|
|
can be used for are:
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2016-11-13 01:07:25 +00:00
|
|
|
1. Generating a voting token that is burned when you vote.
|
2016-11-16 08:48:03 +00:00
|
|
|
2. Generating a discount "coupon" that is redeemed when you use it.
|
2016-11-13 01:07:25 +00:00
|
|
|
3. Generating a token for a "spinoff" DAO.
|
2016-11-16 08:48:03 +00:00
|
|
|
4. Generating a token that can be used to give explicit support to an action or a campaign, like polling.
|
2016-11-13 01:07:25 +00:00
|
|
|
5. Generating a token to enable the token holders to collect daily, monthly or yearly payments.
|
2016-11-16 08:48:03 +00:00
|
|
|
6. Generating a token to limit participation in a token sale or similar event to holders of a specific token.
|
2016-11-13 05:59:54 +00:00
|
|
|
7. Generating token that allows a central party complete control to transfer/generate/destroy tokens at will.
|
2016-11-13 01:07:25 +00:00
|
|
|
8. Lots of other applications including all the applications the standard ERC 20 token can be used for.
|
2016-11-08 13:12:24 +00:00
|
|
|
|
2023-09-12 15:08:59 +00:00
|
|
|
All these applications and more are enabled by the MiniMe Token Contract. The most amazing part being that anyone that
|
|
|
|
wants to add these features can, in a permissionless yet safe manner without affecting the parent token's intended
|
|
|
|
functionality.
|
2017-01-11 12:20:47 +00:00
|
|
|
|
|
|
|
# How to deploy a campaign
|
|
|
|
|
|
|
|
1. Deploy the MinimeTokenFactory
|
|
|
|
2. Deploy the MinimeToken
|
2017-07-14 05:42:15 +00:00
|
|
|
3. Deploy the campaign
|
2017-01-11 12:20:47 +00:00
|
|
|
4. Assign the controller of the MinimeToken to the campaign.
|