Recently the CoW Grants program recieved a noteable grant proposal for working on a new version for the milkman
project.
milkman
received traction with several prominent DAOs, which is indicating demand for such products.
It also uncovered some challenges with the usability of milkman.
Thinking through this problem, below we describe an alternative design for milkman2.0 which could use some existing building blocks and could offer a completely generic default deployment that works for any arbitrary ERC20 token pair with minimal parameters required.
With different configurations, this can allow for the following use cases:
Code assessment: https://github.com/kayibal/composable-cow/pull/1
A gap analysis was made between the above repository and the use cases required for DAOs as described above in the alternate Milkman 2.0
(ie. no price checkers, dutch-auction only).
Using the code in the repository as a basis, and taking into account the below assessment, the time requirements would equate to:
cow-sdk
: 0.5 dayCurrently the staticInput
(ie. Data
struct):
Instead, given the requirements, at order mining time, we can determine:
sellToken
.To achieve this, use a custom IValueFactory
, that takes the parameters:
bytes
, consisting of abi.encode(OracleConfig)
where the OracleConfig
struct consists of:Using IValueFactory
, fill out the struct:
In the cabinet, store H(Cabinet)
. This struct would be required to be passed into offChainInput
, and subsequently be validated against the H(Cabinet)
stored in the cabinet.
The staticInput
(ie. Data
) struct could now be abbreviated to:
Given the use of the context
this way, there would be the following requirements:
This is likely only to be usable with createWithContext
(ie. not with Merkle Roots, due to the specific nature of the ctx
generated and stored in the cabinet).
It would require some modification of the watch tower, notably:
a. Through normal events emitted, the watch tower can detect that it is a dutch auction order type. No problems here.
b. There is no way to extract the parameters that were passed to IValueFactory
as the functions is view
only, and therefore unable to emit events.
c. (b) can be overcome by use of an RPC with trace
filters in order to extract the original calldata
. From this, the watch tower would then be able to process the logic required to determine the contents of the Cabinet
struct, so that this can be passed in as offChainInput
, and verified against H(Cabinet)
that is stored in the cabinet
mapping.