-
Notifications
You must be signed in to change notification settings - Fork 38
Contract Optimization Opportunities
At the moment all requests (Deposits, Withdraws and Limit Orders) are index by a mapping(uint => BatchObject)
. However, this can be reduced to something like mapping(uint4 => BatchObject)
by purging all old (finalized slots). This will require special consideration not to overflow a backlog of non-finalized PendingBatches.
rather than passing (uint8, uint8, uint16, uint128, uint128)
then cropping and packing this into uint256
why not just pass the packed version directly into the function.
Possible examples in specific functions
- placeSellOrder
-
buyToken != sellToken
is not fatal. Could be handled by the driver (via simply not passing such orders to the solver). -
ensure requested tokens are registered. It wouldn't hurt to lift this validation, but then one would still need to ensure the requested
tokenID
does not exceed theMAX_TOKENS
. This would cause IndexError complications in the external services.
- deposit
- reject deposit amounts of zero.