contracts
contracts copied to clipboard
Purchase Orders
Purchase Orders aim to solve potential ruggability of Orbs.
Problem: Orb could get abandoned at any point, even if there’s a pledge. If you purchase the Orb before its cooldown expires, then you might never get to ask a question (or claim the pledge, as it goes to the last invoker), despite paying for the Orb.
Solution: replacing immediate purchases with purchase orders while Orb is charging, holding these funds until Orb is invokable, and then executing the purchase. If the pledge is claimed, or Orb does not become invokable until an expiration date, then the order is cancelled, and funds are returned to the purchasers.
Additional mechanics:
- Purchase Order can only be made if Keeper has enough funds to cover ownership until Orb is charged.
- Subsequent purchase orders are more expense (each time price increases 1.2x), with the difference between last and current price going to the previous purchaser as compensation.
- Instant purchases are still always allowed. UI will warn users about risks.
- Changing price, relinquishing Orb or withdrawing funds is not permitted for the Keeper if there is a Purchase Order.
- Foreclosure finalizes the Purchase Order, instead of running re-allocation.
- Pledge claim cancels the Purchase Order.
- Order can also be manually canceled after 2 invocation periods since it was made, if Orb is still not invokable.
Overall lgtm, but we should probably add some tests!
There are no tests for the entire new system yet, will work on that once we feature-freeze. Not ideal, but main branch won't be merged until we have full test coverage.