As this repo is a fork of the Augur V1 contract code, available here, we'd like to enumarate high-level changes made to the codebase. We'll also list file-by-file changes made to the smart contracts.
- AugurLite removes all on-chain trading logic. AugurLite simply acts as an escrow layer, converting money into transferable share tokens and back.
- As part of this change, all trading contracts except
ClaimTradingProceeds
andCompleteSets
have been removed. - Because there is no on-chain trading, controller contracts like
TradingEscapeHatch
has been removed.
- As part of this change, all trading contracts except
- AugurLite is oracle agnostic. That means there is no reporting or dispute process at the base protocol. During market creation, an “oracle” address is specified. This “oracle” can resolve a market upon expiration, and the result is final. Without a reporting/dispute process:
- There’s no need for a native token (ie REP in Augur).
- There’s no need for a concept like
ReportingParticipants
orDisputeCrowdsourcers
. There is a single address (“oracle”), that can resolve markets (with a single “resolve” call), and all the resolution details are stored on the market. - There are no reporting fees. This means creating markets on AugurLite does not require validity or no-show bonds, and is much cheaper. Users only pay market creator fees that are deducted when users sell complete sets or claim trading proceeds.
- There are no fee windows or fee tokens. The single “oracle” address has the final say on the resolution of the market.
- There’s no concept of forking. There’s a single genesis universe which contains all markets and all share tokens. This universe keeps track of open interest across markets.
- AugurLite markets can you use any ERC-20 compliant token as denomination tokens, not just CASH. Unlike Augur, the denomination token is specified at the Universe level. What this means is, every market created within a Universe will have the same denomination token. Following this change, all the open interest tracking at the Universe level is removed.
- Augur contracts were written in Solidity version 0.4.20. AugurLite contracts are updated to use the most recent stable version of version 0.4.xx: 0.4.26.
- Following all the changes above, the deployment and testing scripts are much simpler and more streamlined.
While the origin Augur V1 codebase is massive, the main changes were made to following 5 contracts:
- source/contracts/reporting/Mailbox.sol
- source/contracts/reporting/Market.sol
- source/contracts/reporting/Universe.sol
- source/contracts/trading/ClaimTradingProceeds.sol
- source/contracts/trading/CompleteSets.sol
- Smart contracts are updated to use pragma version 0.4.26.
- Indentation for Typescript and Solidity files are updated to 2 spaces.
- Deployment scripts are simplified with the removal of trading and reporting contracts.
- Network configuration are updated to accept a denomination token to be used in the creation of the genesis universe.
- Python tests are updated to account for removed functionality. When needed, market and universe tests were updated to use modified functionality (ie
doInitialReport
+finalize
vs.resolve
). - The Docker integration are removed to simplify the surface area of changes/testing.
- The repo will be published on NPM as
augur-lite
for easily importing ABIs and contract addresses. - Folder structure is flattened to bring
reporting/
andtrading/
contracts to the root level. - Contract
require()
statements are updated to have explicit error messages.
Solidity smart contracts reside in source/contracts
. Specifically:
source/contracts/
: Contracts for managing universes, creating/managing markets, issuing and closing out complete sets of shares, and for traders to claim proceeds after markets are resolvedsource/contracts/factories
: Constructors for universes, markets, share tokens etc.source/contracts/libraries
: Libraries (ie SafeMath) or utility contracts (ie MarketValidator) used elsewhere in the source code.
This is a list of contract modifications. If a contract name is not listed, it means there hasn't been any changes (except indentation and compiler update).
- /
AugurLite.sol
- This was originally the
Augur.sol
file. TokenType
enum was pruned to only includeShareToken
, as the rest of the tokens are removed.- The following events were removed, as well as the methods that triggered them (ie
InitialReportSubmitted
event was emitted bylogInitialReportSubmitted
, this method was also removed)InitialReportSubmitted
,DisputeCrowdsourcerCreated
,DisputeCrowdsourcerContribution
,DisputeCrowdsourcerCompleted
,InitialReporterRedeemed
,DisputeCrowdsourcerRedeemed
,ReportingParticipantDisavowed
,MarketParticipantsDisavowed
,FeeWindowRedeemed
,MarketMigrated
,UniverseForked
,OrderCanceled
,OrderCreated
,OrderFilled
,FeeWindowCreated
,InitialReporterTransferred
,EscapeHatchChanged
- The following events were added/modified:
UniverseCreated
was modified to also emit the denomination token of the universe.MarketFinalized
was renamed toMarketResolved
, andlogMarketFinalized
method was renamed tologMarketResolved
. - Per the compiler update, the events are now triggered with the
emit
keyword. - With the removal of disputes from the base protocol, the code related to
DisputeCrowdsourcers
was removed. - With the removal of forking from the base protocol:
createGenesisUniverse
was merged with thecreateUniverse
method. The method now accepts thedenominationToken
that the created universe will support as an argument.createChildUniverse
was removed.
- This was originally the
IAugurLite.sol
- This was originally named
IAugur.sol
. logMarketFinalized
method was renamed tologMarketResolved
.- Methods that were deleted from
AugurLite.sol
were removed.
- This was originally named
IMarket.sol
- Originally located in
source/contract/reporting/IMarket.sol
- Because there is no concept of forks, fee windows/tokens or REP, the following methods were removed:
getFeeWindow
,getForkingMarket
,getReputationToken
,isContainerForReportingParticipant
,designatedReporterWasCorrect
,designatedReporterShowed
,finalizeFork
. - Because the reporting/dispute process is replaced by a single oracle, there is a single
resolve
method.doInitialReport
andfinalize
methods are removed. Following this, these methods were removed:derivePayoutDistributionHash
,getWinningPayoutDistributionHash
,getWinningPayoutNumerator
,getFinalizationTime
,isFinalized
. - Some of the above methods were replaced with:
getPayoutNumerator
,getResolutionTime
,getOracle
,isResolved
- Originally located in
IUniverse.sol
- Because there is no concept of disputes, forks, fee windows/tokens or REP, the following methods were removed:
fork
,getParentUniverse
,createChildUniverse
,getChildUniverse
,getReputationToken
,getForkingMarket
,getForkEndTime
,getForkReputationGoal
,getParentPayoutDistributionHash
,getDisputeRoundDurationInSeconds
,getOrCreateFeeWindowByTimestamp
,getOrCreateCurrentFeeWindow
,getOrCreateNextFeeWindow
,getRepMarketCapInAttoeth
,getTargetRepMarketCapInAttoeth
,getOrCacheValidityBond
,getOrCacheDesignatedReportStake
,getOrCacheDesignatedReportNoShowBond
,getOrCacheReportingFeeDivisor
,getDisputeThresholdForFork
,getInitialReportMinValue
,calculateFloatingValue
,getOrCacheMarketCreationCost
,getCurrentFeeWindow
,getOrCreateFeeWindowBefore
,isParentOf
,updateTentativeWinningChildUniverse
,isContainerForFeeWindow
,isContainerForReportingParticipant
,isContainerForFeeToken
,addMarketTo
,removeMarketFrom
,getWinningChildUniverse
,isForking
- Because we don't track universe-wide open interest, the following methods were removed:
decrementOpenInterest
,decrementOpenInterestFromMarket
,incrementOpenInterest
,incrementOpenInterestFromMarket
,getOpenInterestInAttoEth
. getDenominationToken
was added, as now the universe stores the denomination token.initialize
method was modified to acceptdenominationToken
as a param.
- Because there is no concept of disputes, forks, fee windows/tokens or REP, the following methods were removed:
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
andfinalize
methods are removed. Following this, the functionality ofderivePayoutDistributionHash
as a way to verify resolution information is kept, but thepayoutDistributionHash
is removed. derivePayoutDistributionHash
is renamed toverifyResolutionInformation
. The new method only verifies the validity of the resolution details (invalid
flag andpayoutNumerators
)approveSpenders
method does not approve any of the trading contracts exceptCompleteSets
andClaimTradingProceeds
- Market initialization now specifies
feeDivisor
instead offeePerEthInAttoeth
. In Augur,feePerEthInAttoeth
is used to calculate thefeeDivisor
, however the calculation used the number of decimals ETH-token had (18). Asaugur-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 withMIN_FEE_DIVISOR
. Now, thefeeDivisor
could be 0 (corresponding to no fees) or has to greater than or equal to 2. AfeeDivisor
of 2 corresponds to a 50% market creator fee (this limitation is also present in Augur). As an example, afeeDivisor
of 100 corresponds to a 1% fee, and 200 corresponds to a 0.5% fee.
- As part of this change,
designatedReporter
is replaced with theoracle
. The helper methods that referenceddesignatedReporter
(iegetDesignatedReporter
) is renamed accordingly.
- Originally located in
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 aremarkets
anddenominationToken
(recent addition). initialize
method was modified to acceptdenominationToken
as a param.getAugur
method call was renamed togetAugurLite
.- Market creation doesn't involve reputation token transfer, as there is no reputation token.
- Originally located in
ClaimTradingProceeds.sol
- Originally located in
source/contract/trading/ClaimTradingProceeds.sol
IClaimingTradingProceeds.sol
import was removed as it was empty.- Changed
ICash
to genericERC20
library. - Because there are no reporter fees,
calculateReporterFee
is removed, anddivideUpWinnings
only callscalculateCreatorFee
for fees. logTradingProceedsClaimed
uses the balance of the sender for the market denomination token, instead of their ETH balance.
- Originally located in
CompleteSets.sol
- Originally located in
source/contract/trading/CompleteSets.sol
getAugur
method call was renamed togetAugurLite
.publicBuyCompleteSetsWithCash
andpublicSellCompleteSetsWithCash
were removed as there is no concept ofCASH
.buyCompleteSets
was updated to not increment universe open interest, as that is not tracked any more.sellCompleteSets
doesn't deal withreporterFee
, and only takescreatorFee
into account. It returns a success boolean, instead ofcreatorFee
andreporterFee
.
- Originally located in
- factories/
MarketFactory.sol
- Changed
ICash
to genericERC20
library. - Removed the requirement for the reputation token transfer as it isn't used.
designatedReporterAddress
is renamed tooracle
.
- Changed
UniverseFactory.sol
createUniverse
method now only acceptsdenominationToken
as an argument. The concepts ofparentUniverse
andparentPayoutDistributionHash
are removed, as there's no concept of forking or children-parent universes.
- /
Controlled.sol
- Per the compiler update, the contract was updated to use
constructor
.
- Per the compiler update, the contract was updated to use
Controller.sol
- It was updated to use the new
IAugurLite
interface. getAugur
method was renamed togetAugurLite
.
- It was updated to use the new
IController.sol
- It was updated to use the new
IAugurLite
interface. getAugur
method was renamed togetAugurLite
.
- It was updated to use the new
- ITime.sol
- Removed Initializable import, as it's not used.
TimeControlled.sol
- Per the compiler update, the contract was updated to use
constructor
. - Removed the concept of the foundation network. This led to the removal of the
ContractExists
library. getAugur
method call was renamed togetAugurLite
.
- Per the compiler update, the contract was updated to use
IMailbox.sol
- Originally located in
source/contracts/reporting/IMailbox.sol
depositEther
method was removed.
- Originally located in
Mailbox.sol
- Originally located in
source/contracts/reporting/Mailbox.sol
depositEther
andwithdrawEther
methods were removed.CASH
usage is removed.getAugur
method call was renamed togetAugurLite
.
- Originally located in
ICompleteSets.sol
- Originally located in
source/contracts/trading/ICompleteSets.sol
sellCompleteSets
returns a success boolean, instead ofcreatorFee
andreporterFee
.
- Originally located in
IShareToken.sol
- Originally located in
source/contracts/trading/IShareToken.sol
trustedOrderTransfer
,trustedFillOrderTransfer
, andtrustedCancelOrderTransfer
methods were removed.
- Originally located in
ShareToken.sol
- Originally located in
source/contracts/trading/ShareToken.sol
trustedOrderTransfer
,trustedFillOrderTransfer
, andtrustedCancelOrderTransfer
methods were removed.getAugur
method call was renamed togetAugurLite
.
- Originally located in
- libraries/
Delegator.sol
- Per the compiler update, the contract was updated to use
constructor
.
- Per the compiler update, the contract was updated to use
MarketValidator.sol
getAugur
method call was renamed togetAugurLite
.
Ownable.sol
- Per the compiler update, the contract was updated to use
constructor
.
- Per the compiler update, the contract was updated to use
math/SafeMathInt256.sol
- Removed
fxpMul
andfxpDiv
methods div()
method usesrequire
rather thanassert
to save gas in case of a failure
- Removed
math/SafeMathUint256.sol
- Removed
fxpMul
andfxpDiv
methods div()
method usesrequire
rather thanassert
to save gas in case of a failure
- Removed
token/BasicToken.sol
- Per the compiler update, the events are now triggered with the
emit
keyword.
- Per the compiler update, the events are now triggered with the
token/StandardToken.sol
- Per the compiler update, the events are now triggered with the
emit
keyword.
- Per the compiler update, the events are now triggered with the
token/VariableSupplyToken.sol
- Per the compiler update, the events are now triggered with the
emit
keyword. Mint
andBurn
events are augmented withTransfer
events per the Zeppelin implementation.
- Per the compiler update, the events are now triggered with the
This is the list of contracts that have been removed. Majority of the deletions are due to removal of functionality, as AugurLite doesn’t have on-chain trading, a reporting/dispute process, validity/no-show bonds, or a native token (ie REP in Augur).
- Reporting contracts
- factories/
- DisputeCrowdSourcerFactory
- FeeTokenFactory
- FeeWindowFactory
- InitialReporterFactory
- ReputationTokenFactory
- legacy_reputation/
- BasicToken
- ERC20
- ERC20Basic
- Initializable
- LegacyRepToken
- OwnablePausable
- PausableToken
- SafeMath
- StandardToken
- reporting/
- BaseReportingParticipant
- DisputeCrowdsourcer
- FeeToken
- FeeWindow
- IDisputeCrowdsourcer
- IFeeToken
- IFeeWindow
- IInitialReporter
- InitialReporter
- IReportingParticipant
- IRepPriceOracle
- IReputationToken
- Reporting
- RepPriceOracle
- ReputationToken
- /
- LegacyReputationToken
- TestNetReputationToken
- factories/
- Trading contracts
- external/
- EscapeHatchController
- OrdersFinder
- trading/
- CancelOrder
- Cash
- CreateOrder
- FillOrder
- ICancelOrder
- ICash
- ICreateOrder
- IFillOrder
- IOrders
- IOrdersFetcher
- ITrade
- ITradingEscapeHatch
- Order
- Orders
- OrdersFetcher
- Trade
- TradingEscapeHatch
- libraries/
- CashAutoConverter
- external/
- Utility/library contracts
- libraries/
- collections/Map
- ContractExists
- factories/
- MapFactory
- libraries/
While augur-lite
doesn’t introduce any new contracts in production (ie Ethereum mainnet), we’ve built a test network denomination token contract to make testing simpler. The new contract can be found at source/contracts root directory and is called TestNetDenominationToken
. The contract behaves like WETH, where you can exchange your testnet ETH 1-to-1 for TestNetDenominationToken
. To repeat, this contract is not deployed on Ethereum mainnet.