npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gnosis.pm/pm-apollo-contracts

v1.4.1

Published

A collection of contracts for Gnosis Apollo

Downloads

7

Readme

Gnosis Apollo Contracts

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:

  • Rinkeby:
    • Address: 0x979861df79c7408553aaf20c01cfb3f81ccf9341
    • Creator: 0xcAb5bb0408C48780D38C452bE20E30da1A10e656

The mainnet address registry can be found:

  • Rinkeby:
    • Address: 0x6427d856450b20f6fab88be18d949faf9c4da512
    • Creator: 0xcAb5bb0408C48780D38C452bE20E30da1A10e656

Contracts Overview

PlayToken

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.

OlympiaToken

Same as the PlayToken, except the optional ERC20 fields name, symbol, and decimals have also been specified.

AddressRegistry

A registry of mainnet addresses for tournaments which run on a testnet like Rinkeby.

RewardClaimHandler

A contract which stores rewards for winners, allowing them to claim the rewards by a deadline.

Operations Overview

Redeploying the Contracts

See this deployment guide. You will need to execute npm run migrate -- --reset --network rinkeby with the --reset flag.

Designating Admins

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:

npm run migrate -- --reset --network rinkeby --admins=<comma separated addresses>

They may also be provided after deployment by the deployer with the following script:

npm run add-admin -- --addresses=<comma separated addresses>

The deployer may also remove admins with the following script:

npm run remove-admin -- --addresses=<comma separated addresses>

Transfer Whitelist Management

The deployer and administrators can use the following script to allow transfers on a set of provided addresses:

npm run allow-transfers -- --addresses=<comma separated addresses>

They can similarly revoke arbitrary transfer capabilities with the following:

npm run disallow-transfers -- --addresses=<comma separated addresses>

Issue tokens

The deployer can use the following script to have each address in a list issued PlayToken:

npm 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.