-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use modified solmd to generate docs instead
- Loading branch information
Showing
71 changed files
with
3,485 additions
and
261 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
* [Campaign](#campaign) | ||
* [Accessors](#campaign-accessors) | ||
* [Events](#campaign-events) | ||
* [CampaignFunding(*address* indexed `sender`, *uint256* `funding`)](#campaignfundingaddress-indexed-sender-uint256-funding) | ||
* [CampaignRefund(*address* indexed `sender`, *uint256* `refund`)](#campaignrefundaddress-indexed-sender-uint256-refund) | ||
* [MarketCreation(*address* indexed `market`)](#marketcreationaddress-indexed-market) | ||
* [MarketClosing()](#marketclosing) | ||
* [FeeWithdrawal(*address* indexed `receiver`, *uint256* `fees`)](#feewithdrawaladdress-indexed-receiver-uint256-fees) | ||
* [Functions](#campaign-functions) | ||
* [withdrawFees()](#withdrawfees) | ||
* [refund()](#refund) | ||
* [createMarket()](#createmarket) | ||
* [closeMarket()](#closemarket) | ||
* [fund(*uint256* `amount`)](#funduint256-amount) | ||
|
||
# Campaign | ||
|
||
### Campaign contract - Allows to crowdfund a market | ||
|
||
- **Author**: Stefan George - <stefan@gnosis.pm> | ||
- **Constructor**: Campaign(*address* `_eventContract`, *address* `_marketFactory`, *address* `_marketMaker`, *uint24* `_fee`, *uint256* `_funding`, *uint256* `_deadline`) | ||
- This contract does **not** have a fallback function. | ||
|
||
## Campaign Accessors | ||
|
||
* *address* marketFactory() `06ae7095` | ||
* *address* marketMaker() `1f21f9af` | ||
* *uint256* finalBalance() `2129e25a` | ||
* *uint256* deadline() `29dcb0cf` | ||
* *uint256* contributions(*address*) `42e94c90` | ||
* *address* market() `80f55605` | ||
* *uint8* stage() `c040e6b8` | ||
* *uint256* funding() `cb4c86b7` | ||
* *uint24* fee() `ddca3f43` | ||
* *address* eventContract() `e274fd24` | ||
* *uint24* FEE_RANGE() `fbde47f6` | ||
|
||
## Campaign Events | ||
|
||
### CampaignFunding(*address* indexed `sender`, *uint256* `funding`) | ||
|
||
**Signature hash**: `9e85601c404591b54325b6512021f8145643571c59865b7ab29ed9e0664cb17f` | ||
|
||
### CampaignRefund(*address* indexed `sender`, *uint256* `refund`) | ||
|
||
**Signature hash**: `d53235e384e83b261994d71b101de6c22402415c0c0d313f064a90e91039e2a9` | ||
|
||
### MarketCreation(*address* indexed `market`) | ||
|
||
**Signature hash**: `d50a500cb3b7c976a045df06de01ca42c942e1a2c43ac27d96bfa7ece3138a99` | ||
|
||
### MarketClosing() | ||
|
||
**Signature hash**: `e7d85885f81486e8f4c99e50e056745493861b8b5d4f973dcf0c3c0f74a25e07` | ||
|
||
### FeeWithdrawal(*address* indexed `receiver`, *uint256* `fees`) | ||
|
||
**Signature hash**: `ee33a3a9cb48e4ff209f8b1c67c4632f1dbbf55aeff8e6f17d957ade7a6fb17c` | ||
|
||
## Campaign Functions | ||
|
||
### withdrawFees() | ||
|
||
- **State mutability**: `nonpayable` | ||
- **Signature hash**: `476343ee` | ||
|
||
Allows to withdraw fees from campaign contract to contributor | ||
|
||
#### Outputs | ||
|
||
| type | name | description | | ||
| --------- | ------ | ----------- | | ||
| *uint256* | `fees` | Fee amount | | ||
|
||
### refund() | ||
|
||
- **State mutability**: `nonpayable` | ||
- **Signature hash**: `590e1ae3` | ||
|
||
Withdraws refund amount | ||
|
||
#### Outputs | ||
|
||
| type | name | description | | ||
| --------- | -------------- | ------------- | | ||
| *uint256* | `refundAmount` | Refund amount | | ||
|
||
### createMarket() | ||
|
||
- **State mutability**: `nonpayable` | ||
- **Signature hash**: `aea0e35f` | ||
|
||
Allows to create market after successful funding | ||
|
||
#### Outputs | ||
|
||
| type | description | | ||
| --------- | -------------- | | ||
| *address* | Market address | | ||
|
||
### closeMarket() | ||
|
||
- **State mutability**: `nonpayable` | ||
- **Signature hash**: `c511ed5e` | ||
|
||
Allows to withdraw fees from market contract to campaign contract | ||
|
||
### fund(*uint256* `amount`) | ||
|
||
- **State mutability**: `nonpayable` | ||
- **Signature hash**: `ca1d209d` | ||
|
||
Allows to contribute to required market funding | ||
|
||
#### Inputs | ||
|
||
| type | name | description | | ||
| --------- | -------- | --------------------------- | | ||
| *uint256* | `amount` | Amount of collateral tokens | |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
* [CampaignFactory](#campaignfactory) | ||
* [Events](#campaignfactory-events) | ||
* [CampaignCreation(*address* indexed `creator`, *address* `campaign`, *address* `eventContract`, *address* `marketFactory`, *address* `marketMaker`, *uint24* `fee`, *uint256* `funding`, *uint256* `deadline`)](#campaigncreationaddress-indexed-creator-address-campaign-address-eventcontract-address-marketfactory-address-marketmaker-uint24-fee-uint256-funding-uint256-deadline) | ||
* [Functions](#campaignfactory-functions) | ||
* [createCampaign(*address* `eventContract`, *address* `marketFactory`, *address* `marketMaker`, *uint24* `fee`, *uint256* `funding`, *uint256* `deadline`)](#createcampaignaddress-eventcontract-address-marketfactory-address-marketmaker-uint24-fee-uint256-funding-uint256-deadline) | ||
|
||
# CampaignFactory | ||
|
||
### Campaign factory contract - Allows to create campaign contracts | ||
|
||
- **Author**: Stefan George - <stefan@gnosis.pm> | ||
- **Constructor**: CampaignFactory() | ||
- This contract does **not** have a fallback function. | ||
|
||
## CampaignFactory Events | ||
|
||
### CampaignCreation(*address* indexed `creator`, *address* `campaign`, *address* `eventContract`, *address* `marketFactory`, *address* `marketMaker`, *uint24* `fee`, *uint256* `funding`, *uint256* `deadline`) | ||
|
||
**Signature hash**: `7a9fd19b658538a67209802dd9011d6e3ce04586fe93c87096d2bc40ed850866` | ||
|
||
## CampaignFactory Functions | ||
|
||
### createCampaign(*address* `eventContract`, *address* `marketFactory`, *address* `marketMaker`, *uint24* `fee`, *uint256* `funding`, *uint256* `deadline`) | ||
|
||
- **State mutability**: `nonpayable` | ||
- **Signature hash**: `7d1ef569` | ||
|
||
Creates a new campaign contract | ||
|
||
#### Inputs | ||
|
||
| type | name | description | | ||
| --------- | --------------- | -------------------------- | | ||
| *address* | `eventContract` | Event contract | | ||
| *address* | `marketFactory` | Market factory contract | | ||
| *address* | `marketMaker` | Market maker contract | | ||
| *uint24* | `fee` | Market fee | | ||
| *uint256* | `funding` | Initial funding for market | | ||
| *uint256* | `deadline` | Campaign deadline | | ||
|
||
#### Outputs | ||
|
||
| type | name | description | | ||
| --------- | ---------- | --------------- | | ||
| *address* | `campaign` | Market contract | |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,161 @@ | ||
* [CategoricalEvent](#categoricalevent) | ||
* [Accessors](#categoricalevent-accessors) | ||
* [Events](#categoricalevent-events) | ||
* [OutcomeTokenCreation(*address* `outcomeToken`, *uint8* `index`)](#outcometokencreationaddress-outcometoken-uint8-index) | ||
* [OutcomeTokenSetIssuance(*address* indexed `buyer`, *uint256* `collateralTokenCount`)](#outcometokensetissuanceaddress-indexed-buyer-uint256-collateraltokencount) | ||
* [OutcomeTokenSetRevocation(*address* indexed `seller`, *uint256* `outcomeTokenCount`)](#outcometokensetrevocationaddress-indexed-seller-uint256-outcometokencount) | ||
* [OutcomeAssignment(*int256* `outcome`)](#outcomeassignmentint256-outcome) | ||
* [WinningsRedemption(*address* indexed `receiver`, *uint256* `winnings`)](#winningsredemptionaddress-indexed-receiver-uint256-winnings) | ||
* [Functions](#categoricalevent-functions) | ||
* [setOutcome()](#setoutcome) | ||
* [buyAllOutcomes(*uint256* `collateralTokenCount`)](#buyalloutcomesuint256-collateraltokencount) | ||
* [getOutcomeTokenDistribution(*address* `owner`)](#getoutcometokendistributionaddress-owner) | ||
* [sellAllOutcomes(*uint256* `outcomeTokenCount`)](#sellalloutcomesuint256-outcometokencount) | ||
* [getOutcomeCount()](#getoutcomecount) | ||
* [redeemWinnings()](#redeemwinnings) | ||
* [getEventHash()](#geteventhash) | ||
* [getOutcomeTokens()](#getoutcometokens) | ||
|
||
# CategoricalEvent | ||
|
||
### Categorical event contract - Categorical events resolve to an outcome from a set of outcomes | ||
|
||
- **Author**: Stefan George - <stefan@gnosis.pm> | ||
- **Constructor**: CategoricalEvent(*address* `_collateralToken`, *address* `_oracle`, *uint8* `outcomeCount`) | ||
- This contract does **not** have a fallback function. | ||
|
||
## CategoricalEvent Accessors | ||
|
||
* *int256* outcome() `27793f87` | ||
* *address* oracle() `7dc0d1d0` | ||
* *address* outcomeTokens(*uint256*) `8abe59ea` | ||
* *address* collateralToken() `b2016bd4` | ||
* *bool* isOutcomeSet() `ccdf68f3` | ||
|
||
## CategoricalEvent Events | ||
|
||
### OutcomeTokenCreation(*address* `outcomeToken`, *uint8* `index`) | ||
|
||
**Signature hash**: `ad24776dc347085865b6988e249c191fc22d9b31cf54cb62233c3c16be1736ee` | ||
|
||
### OutcomeTokenSetIssuance(*address* indexed `buyer`, *uint256* `collateralTokenCount`) | ||
|
||
**Signature hash**: `ad2a02292986148558019ae4abf172732228e32e131a91d3fa7e0cada61932c0` | ||
|
||
### OutcomeTokenSetRevocation(*address* indexed `seller`, *uint256* `outcomeTokenCount`) | ||
|
||
**Signature hash**: `7ac9271efd660c24459c447459e46f7366d2b4a692e572f108619d0d7273fcc5` | ||
|
||
### OutcomeAssignment(*int256* `outcome`) | ||
|
||
**Signature hash**: `b1aaa9f4484acc283375c8e495a44766e4026170797dc9280b4ae2ab5632fb71` | ||
|
||
### WinningsRedemption(*address* indexed `receiver`, *uint256* `winnings`) | ||
|
||
**Signature hash**: `2fe921bb50a459800ae7eae7c0124e9e875094a539eb7dc5b3f728017347e0fb` | ||
|
||
## CategoricalEvent Functions | ||
|
||
### setOutcome() | ||
|
||
- **State mutability**: `nonpayable` | ||
- **Signature hash**: `0537665d` | ||
|
||
Sets winning event outcome | ||
|
||
### buyAllOutcomes(*uint256* `collateralTokenCount`) | ||
|
||
- **State mutability**: `nonpayable` | ||
- **Signature hash**: `28da850b` | ||
|
||
Buys equal number of tokens of all outcomes, exchanging collateral tokens and sets of outcome tokens 1:1 | ||
|
||
#### Inputs | ||
|
||
| type | name | description | | ||
| --------- | ---------------------- | --------------------------- | | ||
| *uint256* | `collateralTokenCount` | Number of collateral tokens | | ||
|
||
### getOutcomeTokenDistribution(*address* `owner`) | ||
|
||
- **State mutability**: `view` | ||
- **Signature hash**: `69c19d4c` | ||
|
||
Returns the amount of outcome tokens held by owner | ||
|
||
#### Inputs | ||
|
||
| type | name | | ||
| --------- | ------- | | ||
| *address* | `owner` | | ||
|
||
#### Outputs | ||
|
||
| type | name | description | | ||
| ----------- | -------------------------- | -------------------------- | | ||
| *uint256[]* | `outcomeTokenDistribution` | Outcome token distribution | | ||
|
||
### sellAllOutcomes(*uint256* `outcomeTokenCount`) | ||
|
||
- **State mutability**: `nonpayable` | ||
- **Signature hash**: `6fb1edcd` | ||
|
||
Sells equal number of tokens of all outcomes, exchanging collateral tokens and sets of outcome tokens 1:1 | ||
|
||
#### Inputs | ||
|
||
| type | name | description | | ||
| --------- | ------------------- | ------------------------ | | ||
| *uint256* | `outcomeTokenCount` | Number of outcome tokens | | ||
|
||
### getOutcomeCount() | ||
|
||
- **State mutability**: `view` | ||
- **Signature hash**: `7dc8f086` | ||
|
||
Returns outcome count | ||
|
||
#### Outputs | ||
|
||
| type | description | | ||
| ------- | ------------- | | ||
| *uint8* | Outcome count | | ||
|
||
### redeemWinnings() | ||
|
||
- **State mutability**: `nonpayable` | ||
- **Signature hash**: `ad0b2bec` | ||
|
||
Exchanges sender's winning outcome tokens for collateral tokens | ||
|
||
#### Outputs | ||
|
||
| type | name | description | | ||
| --------- | ---------- | ----------------- | | ||
| *uint256* | `winnings` | Sender's winnings | | ||
|
||
### getEventHash() | ||
|
||
- **State mutability**: `view` | ||
- **Signature hash**: `e96e5950` | ||
|
||
Calculates and returns event hash | ||
|
||
#### Outputs | ||
|
||
| type | description | | ||
| --------- | ----------- | | ||
| *bytes32* | Event hash | | ||
|
||
### getOutcomeTokens() | ||
|
||
- **State mutability**: `view` | ||
- **Signature hash**: `f21a1468` | ||
|
||
Returns outcome tokens array | ||
|
||
#### Outputs | ||
|
||
| type | description | | ||
| ----------- | -------------- | | ||
| *address[]* | Outcome tokens | |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.