orbland / contracts

🔮 Orb and related contracts. Auction + Harberger taxed ownership + invocations.
https://orb.land
MIT License
22 stars 5 forks source link

Purchase Orders #161

Open lekevicius opened 6 months ago

lekevicius commented 6 months ago

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:

t4t5 commented 6 months ago

Overall lgtm, but we should probably add some tests!

lekevicius commented 6 months ago

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.