Name: pm-apollo-contracts
Owner: GNOSIS
Description: Contracts related to Gnosis Apollo and Olympia
Created: 2017-10-23 16:16:56.0
Updated: 2018-05-07 22:20:11.0
Pushed: 2018-05-07 22:20:15.0
Size: 183
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is a collection of contracts related to specifically to Gnosis Apollo. These contracts can be used in setting up prediction market tournaments like Olympia.
This is the Olympia token contract implementation:
0x979861df79c7408553aaf20c01cfb3f81ccf9341
0xcAb5bb0408C48780D38C452bE20E30da1A10e656
The mainnet address registry can be found:
0x6427d856450b20f6fab88be18d949faf9c4da512
0xcAb5bb0408C48780D38C452bE20E30da1A10e656
Beyond the bare minimum necessary to implement the ERC20 interface sanely, this contract also implements two other mechanics: issuing new tokens to addresses, and determining a whitelist for token transfers.
The ability to issue new tokens to addresses, or minting tokens, is restricted to the creator of the contract instance. This action can be performed with a call to the issue
function, which takes an array of recipient addresses and credits them a newly minted amount of token. The token issuance may, for example, be tied into a registration process for an event.
The creator of the contract instance is also required to specify accounts which will be administrators of this contract. The creator and these administrators are, in turn, required to specify a whitelist for token transfers. This prevents arbitrary transfers of token value from one account to another. PlayTokens can be transferred only to or from the whitelisted addresses. You may use this mechanic to ensure that users can only perform transactions with the token on authorized contracts in an event.
Same as the PlayToken, except the optional ERC20 fields name
, symbol
, and decimals
have also been specified.
A registry of mainnet addresses for tournaments which run on a testnet like Rinkeby.
A contract which stores rewards for winners, allowing them to claim the rewards by a deadline.
See this deployment guide. You will need to execute npm run migrate -- --reset --network rinkeby
with the --reset
flag.
Administrator accounts can whitelist addresses for token addresses, as discussed above in the PlayToken section. These administrator accounts may be designated during migration by supplying them comma-separated to an --admins
option:
run migrate -- --reset --network rinkeby --admins=<comma separated addresses>
They may also be provided after deployment by the deployer with the following script:
run add-admin -- --addresses=<comma separated addresses>
The deployer may also remove admins with the following script:
run remove-admin -- --addresses=<comma separated addresses>
The deployer and administrators can use the following script to allow transfers on a set of provided addresses:
run allow-transfers -- --addresses=<comma separated addresses>
They can similarly revoke arbitrary transfer capabilities with the following:
run disallow-transfers -- --addresses=<comma separated addresses>
The deployer can use the following script to have each address in a list issued PlayToken:
run issue-tokens -- --amount <units of token> --to <comma separated addresses>
The --amount
is expressed “in wei,” or in the smallest units of the token. Thus, for most tokens, which have a decimals
value of 18, one whole token would be expressed as 1e18
(scientific notation) of that token, e.g. 1e18 wei == 1 ether
.
--from
and --network
The add-admin
, remove-admin
, allow-transfers
, disallow-transfers
, and issue-tokens
tokens also support --from
, --network
, and --play-token-name
options (be sure to specify these after the first bare --
).
The --from <account>
specifies an account with which to do the transaction.
If you have deployments on multiple networks, you can specify the network you mean the script to interact with via the --network <network name>
option.
Finally, if you have happened to rename the PlayToken from OlympiaToken to something else, you can specify that name via the --play-token-name <new case-sensitive name>
option.