How to avoid funds from being stuck on an intermediate contract Carry-value pattern (including fees management)