---
# System prepended metadata

title: Untitled

---

**CropJoin Collateral and Rewards in End Process**

* `End.skim` (cancel cdp debt):
    * Performs `vat.grab(ilk, urn, address(this), address(vow), -int256(wad), -int256(art))`
    * Results in moving gems to End (address(this) above).
    * Similarly to `Dog.grab` and `ProxyManagerClipper.kick`'s call to `Cropper.onLiquidation`, `CropJoin.stake` shares can potentially be moved to `End` using `Cropper.tack`.
    * If we would have tacked all the skims then later on, in `cash` stage, dai holders will be able to also get rewards in exchange to dai.
    * However the vault holder does not have an incentive to do the `tack` to `End`, and there is no system contract doing it, so it will need to be done by a system keeper from offchain before the waiting period ends. 
    * If only part of the skims are tacked the `END` will not have enough shares and some exit attempts will fail in `cash` stage.


* `End.free` (remove collateral from the caller's CDP):
    * Performs `vat.grab(ilk, msg.sender, msg.sender, address(vow), -int256(ink), `0);
    * Here gems are free but remain in the vault owner's possession.
    * No need to tack since `stake` is always considered as both free gem (`gem`) and locked gem (`ink`). 


* `End.cash` (exchange some dai from your bag for gems from a specific ilk):
    * Performs `vat.flux(ilk, address(this), msg.sender, rmul(wad, fix[ilk]));
    * Can be followed by `tack` to also get `stake` (reward rights).
    * The `tack` will work only if all `skim`ed vaults  were followed by `tack`.



**Cropper and Proxy Actions Considerations**
* `Cropper.quit` (used before `End.free` since it works on non-proxied vaults):
    * Conceptually requires a `tack`, but since the freed gems will most likely be `Vat.flux`ed back to the caller's `urp` (so they can be `Cropper.exit`ed) there would probably be a `tack` in the opposite direction right away (making both redundant).
    * Hence `tack` is not put as part of `Cropper.quit`, but can still be called permissionlessly.


* `DssProxyActionsEndCropper.freeGem` (frees the position through the end contract and exits the collateral):
    * Does not `tack` caller's funds because of the considerations detailed above.
    * Does not `tack` following calling `skim` since it does not have motivation to do so.

* `DssProxyActionsEndCropper.cashGem` (exchange dai for gems and exit them):
    * Does not `tack` from End since there is no guarantee all End's gems were also `tack`ed to it following `skim` operations.
    * Instead uses `flee`, as in any case rewards could have been drained right before the `skim` calls.
    * Because of the above `cashGem` exits directly to `msg.sender` as it is not expected to get rewards (so no need to follow the paradigm that rewards are moved to the ds-proxy).


