Function registerMarket(ERC20 payoutToken_, ERC20 quoteToken_)
Intended behavior.
Allows the whitelisted auctioneer contracts to register a new market.
Each market gets a unique
marketId
.
Negative behavior.
shouldn’t allow to rewrite existing market - every new market will have new unique marketId, therefore, it is not possible to overwrite an existing one.
shouldn’t allow to untrusted contract to register the market - there is a check that
msg.sender
should be whitelisted contract address, however the market can be created by anyone(eg.BondFixedExpirySDA
) so what’s the point of whitelisting in the first place? - markets can be created only using trusted SDA contacts.The market counter should increase whenever a new market has been created, so that no two markets can be overwritten.
Preconditions.
Assumes that
msg.sender
has been whitelisted beforehand (in this case that the aggregator calls)Assumes that the
payoutToken
andquoteTokens
are not 0 and are not equal (team said this is intended behavior)
Postconditions.
the new market should get a new unique
marketId
valuecorresponding
IBondAuctioneer
address should be saved formarketId
insidemarketsToAuctioneers
mapping
Inputs.
caller controls ERC20 payoutToken* and ERC20 quoteToken* addresses. Should check that addresses are not 0 and are not equal
Examine all function calls the function makes.
There are no function calls here.