Offline swap in Plasma ===== ### Regular step 1. Alice makes StateUpdate to swap ETC with DAI offline. 2. Alice goes offline 3. Bob swaps 1. and his DAI. So, Bob makes 2 StateUpdate. (a). ETH(Alice|Bob) (b). DAI(Bob|Alice) 4. 1.'s deprecate condition is Alice can withdraw (b) or Alice has already spent (b). ### Problem If a user who makes offline swap SU(let say coin A) attempts exit its SU after swap happens, current coin A owner(Bob) should withdraw coin B from Deposit Contract to Online Swap Contract. And Bob should show the transaction which deprecate the order state. Then swap happens in Online Swap Contract. By this attestation, Bob can deprecate the order state. So, Offline swap contract's extra exit period should be londer than Online swap. Whenever maker attemts exit, taker or later owner should do this process. It would take much gas. Jan 20 2020 update ```python= def order(maker, c_token, c_amount, min_block_number, max_block_number, tx) := Range(min_block_number, max_block_number).any(b -> SU(b, c_token).any(c_su -> Equal(c_su.3.address, $swapAddress) and IsSameAmount(c_su.1, c_amount) and Equal(c_su.3.0, maker) and Equal(tx.3.address, $swapAddress) and Equal(tx.3.0, c_su.3.1) and Equal(tx.3.1, maker) and ( Withdraw(c_su) or Tx(c_su.0, c_su.1, c_su.2).any(tx -> IsValidSignature(tx, maker) ) ) and IsValidSignature(tx, c_su.3.1) ) ) ``` ```python= def swap(new_owner, prev_owner, c_token, c_range, block_number, tx) := SU(block_number, c_token, c_range).any(c_su -> assert(c_su.address, self.address) and assert(c_su.3.0, prev_owner) and assert(c_su.3.1, new_owner) and IncludedAt(c_su, c_su.0, c_su.1, c_su.2) and SignedBy(tx, new_owner) and IncludedTx(c_su.2, tx).any(included_tx -> SignedBy(included_tx, new_owner)) ) ```