Ran
|
Jobs
1
|
Files
22
|
Run time
1s
|
Badge
README BADGES
|
push
github
Add task to create orders for the settlement contract (#51) Adds a task that creates orders on behalf of the settlement contract. The task recovers balances for the input tokens and has the settlement contract create partially fillable limit orders selling the recovered balance in a call to `settle` through pre-signatures. The user calls the script with parameters that are familiar from either the `withdraw` or `dump` task (`toToken`,`minValue`,`leftover`,`receiver`,`maxFeePercent`,`slippageBps`,`validity`,`dryRun`). Most of the behavior is inherited from the existing scripts. For example, it's possible to specify an origin to sell tokens with a Safe multisig transaction. Notably missing: the script doesn't set allowances: it cannot be used _as is_ to sell arbitrary tokens but it assumes the required allowances to already be present. I did this because this PR is already long to review and the approval component is easy to separate from the existing logic compared to the rest of this PR, ### How to review This PR is published with two commits: the first copies the content of `withdraw.ts` into `selfSell.ts`. The second modifies that file to achieve what we want to do. I believe it's easier to just check the second commit for changes, since the majority of the changes are trivial except for a few key changes (switching from transferring to creating orders, how the costs are computed, and submitting the orders to the API). The commit is [here](https://github.com/cowprotocol/contracts/commit/373afd97c). ### Test Plan Try out the script with a few parameters. You can simulate the output by creating the transaction from a [solver safe](https://app.safe.global/transactions/queue?safe=gor:0xA03be496e67Ec29bC62F01a428683D7F9c204930). <details> <summary> Example execution </summary> (The fee is high because I already withdrew most of the balance and I had to make do with what wa... (continued)
160 of 172 branches covered (93.02%)
Branch coverage included in aggregate %.
364 of 366 relevant lines covered (99.45%)
37.8 hits per line
ID | Job ID | Ran | Files | Coverage | |
---|---|---|---|---|---|
1 | 5090697765.1 | 22 |
97.4 |
GitHub Action Run |
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
---|