Skip to content

Commit

Permalink
Clean-up typos/incomplete sentences
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcelebi committed May 14, 2019
1 parent a8b408e commit 4e1c238
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 5 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Expand Up @@ -79,7 +79,11 @@ This is a list of contract modifications. If a contract name is not listed, it m
- `Market.sol`
- Originally located in `source/contract/reporting/Market.sol`
- Because the reporting/dispute process is replaced by a single oracle, there is a single `resolve` method. `doInitialReport` and `finalize` methods are removed. Following this, the functionality of `derivePayoutDistributionHash` as a way to verify resolution information is kept, but the `payoutDistributionHash` is removed.
- TODO
- `derivePayoutDistributionHash` is renamed to `verifyResolutionInformation`. The new method only verifies the validity of the resolution details (`invalid` flag and `payoutNumerators`)
- `approveSpenders` method does not approve any of the trading contracts except `CompleteSets` and `ClaimTradingProceeds`
- Market initialization now specifies `feeDivisor` instead of `feePerEthInAttoeth`. In Augur, `feePerEthInAttoeth` is used to calculate the `feeDivisor`, however the calculation used the number of decimals ETH-token had (18). As `augur-lite` can support arbitrary denomination tokens, this calculation is moved off-chain.
- As part of this change, `MAX_FEE_PER_ETH_IN_ATTOETH` is replaced with `MIN_FEE_DIVISOR`. Now, the `feeDivisor` could be 0 (corresponding to no fees) or has to greater than or equal to 2. A `feeDivisor` of 2 corresponds to a 50% market creator fee (this limitation is also present in Augur). As an example, a `feeDivisor` of 100 corresponds to a 1% fee, and 200 corresponds to a 0.5% fee.
- `designatedReporter` is replaced with the `oracle`. The helper methods that referenced `designatedReporter` (ie `getDesignatedReporter`) is renamed accordingly.
- `Universe.sol`
- Originally located in `source/contract/reporting/Universe.sol`
- Besides the method deletions listed under `IUniverse.sol`, all the relevant contract state variables are removed. Remaining variables are `markets` and `denominationToken` (recent addition).
Expand Down Expand Up @@ -160,7 +164,7 @@ This is a list of contract modifications. If a contract name is not listed, it m
- Per the compiler update, the events are now triggered with the `emit` keyword.
- `token/VariableSupplyToken.sol`
- Per the compiler update, the events are now triggered with the `emit` keyword.
- `Mint` and `Burn` events are replaced with `Transfer` events per the Zeppelin implementation.
- `Mint` and `Burn` events are augmented with `Transfer` events per the Zeppelin implementation.

### Contract removals

Expand Down
10 changes: 9 additions & 1 deletion README.md
Expand Up @@ -92,21 +92,24 @@ pip install -r requirements.txt

## Deployment

To deploy the contracts, you need to create an `.env` in the base directory. The specification for the `.env` file will depend on which Ethereum network you are deploying to. Review the [NetworkConfiguration file](/source/libraries/NetworkConfiguration.ts) to see all options. Or copy one of the examples below for common networks. Note the deployment address i
To deploy the contracts, you need to create an `.env` in the base directory. The specification for the `.env` file will depend on which Ethereum network you are deploying to. Review the [NetworkConfiguration file](/source/libraries/NetworkConfiguration.ts) to see all options. Or copy one of the examples below for common networks.

Sample `.env` file for Kovan:

```
KOVAN_ETHEREUM_HTTP=https://eth-kovan.alchemyapi.io/jsonrpc/<INSERT API KEY>
KOVAN_PRIVATE_KEY=<INSERT PRIVATE KEY OF ADDRESS DEPLOYING CONTRACTS>
```

Sample `.env` file for Mainnet:

```
MAINNET_ETHEREUM_HTTP=https://eth-mainnet.alchemyapi.io/jsonrpc/<INSERT API KEY>
MAINNET_PRIVATE_KEY=<INSERT PRIVATE KEY OF ADDRESS DEPLOYING CONTRACTS>
```

Now you should be able to compile contracts, build contract interfaces, and deploy contracts.

```bash
yarn run build # Compiles contracts and builds contract interfaces
yarn run deploy:kovan # Deploys contracts to Kovan
Expand All @@ -118,10 +121,12 @@ You can see a full list of helper functions to run with `yarn` in [package.json]
Solidity contract deployment is handled by [`ContractDeployer.ts`](/source/libraries/ContractDeployer.ts) and the wrapper programs located in [`source/deployment`](/source/deployment). This deployment framework allows for incremental deploys of contracts to a given controller (specified via a configuration option). This allows us to deploy new contracts without touching the controller, effectively upgrading the deployed system in-place.

#### Main Code

- [`source/libraries/ContractCompiler.ts`](/source/libraries/ContractCompiler.ts) - All logic for compiling contracts, generating ABI
- [`source/libraries/ContractDeployer.ts`](/source/libraries/ContractDeployer.ts) - All logic for uploading, initializing, and whitelisting contracts, generating addresses and block number outputs.

#### Configuration

- [`source/libraries/CompilerConfiguration.ts`](/source/libraries/CompilerConfiguration.ts)
- [`source/libraries/DeployerConfiguration.ts`](/source/libraries/DeployerConfiguration.ts)
- [`source/libraries/NetworkConfiguration.ts`](/source/libraries/NetworkConfiguration.ts)
Expand All @@ -146,6 +151,7 @@ By design, AugurLite does not come packaged with an oracle system. An oracle is
One goal of AugurLite is to decouple markets from their oracles. Not every market needs to be reviewed by the Augur reporting community. And an oracle for data feeds should be designed differently from an oracle for one-off events. Therefore, markets in AugurLite simply designate an Ethereum address that has the power to resolve them. That oracle address could be a trusted third-party, a smart contract that can observe state from an oracle and pass it along to AugurLite, or something else entirely.

#### Example: OracleBridge

As an example, Veil uses a smart contract called [`OracleBridge`](https://github.com/veilco/veil-contracts/blob/master/contracts/OracleBridge.sol) to observe the result of Augur markets and resolve AugurLite markets accordingly. The `OracleBridge` address is set as the oracle for [Veil's 2020 US Presidential Election markets](https://veil.co/2020) in order to abstract away various oracle systems. Read more in [Veil's smart contracts repository](https://github.com/veilco/veil-contracts).

## Additional resources
Expand All @@ -159,10 +165,12 @@ Here is a short collection of resources and guides to better understand the Augu
## Questions and support

If you have questions, comments, or ideas, we recommend pursuing one of these channels:

- Open an issue or pull request in this repository
- Reach out to [@veil on Twitter](https://twitter.com/veil)
- Send an email to [hello@veil.co](mailto:hello@veil.co)
- Join [Veil's discord](https://discord.gg/aBfTCVU) and reach out to a Veil team member

## License

AugurLite is released under the GNU General Public License v3.0. [See License](/LICENSE).
2 changes: 1 addition & 1 deletion source/contracts/AugurLite.sol
Expand Up @@ -55,7 +55,7 @@ contract AugurLite is Controlled, IAugurLite {

function trustedTransfer(ERC20 _token, address _from, address _to, uint256 _amount) public onlyWhitelistedCallers returns (bool) {
require(_amount > 0, "Transfer amount needs to be greater than 0");
require(_token.transferFrom(_from, _to, _amount), "Tranfer failed");
require(_token.transferFrom(_from, _to, _amount), "Transfer failed");
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion source/contracts/Market.sol
Expand Up @@ -44,7 +44,7 @@ contract Market is DelegationTarget, ITyped, Initializable, Ownable, IMarket {

function initialize(IUniverse _universe, uint256 _endTime, uint256 _feeDivisor, ERC20 _denominationToken, address _oracle, address _creator, uint256 _numOutcomes, uint256 _numTicks) public onlyInGoodTimes beforeInitialized returns (bool _success) {
endInitialization();
require(MIN_OUTCOMES <= _numOutcomes && _numOutcomes <= MAX_OUTCOMES, "Invalid numTicks");
require(MIN_OUTCOMES <= _numOutcomes && _numOutcomes <= MAX_OUTCOMES, "Invalid number of outcomes");
require(_numTicks > 0, "numTicks needs to be greater than 0");
require(_oracle != NULL_ADDRESS, "Oracle cannot be the 0x0 address");
require((_numTicks >= _numOutcomes), "numTicks needs to be greater than number of outcomes");
Expand Down
3 changes: 3 additions & 0 deletions tests/solidity_test_helpers/MockVariableSupplyToken.sol
Expand Up @@ -16,6 +16,9 @@ contract MockVariableSupplyToken is MockStandardToken {
address private transferFromToValue;
uint256 private transferFromValueValue;

event Mint(address indexed target, uint256 value);
event Burn(address indexed target, uint256 value);

function setBalanceOf(uint256 _balance) public {
setBalanceOfValue = _balance;
}
Expand Down

0 comments on commit 4e1c238

Please sign in to comment.