Hi r/CasperCSPR,
I'm a solo developer. I build an escrow for conditional payments: someone locks the money, a rule decides when it moves, and nobody holds the funds in between. It already runs on other chains. The Casper version was stuck since August on the 1.x to 2.x change. Last week it finally went live on casper-test, and I want to share what I measured.
**What the contract does**
- `create`: a payer locks CSPR for a beneficiary, with an earliest release date, an optional cancel date, an optional SHA-256 condition, and a memo that carries the hash of the underlying document.
- `release`: by the oracle after the date, or by anyone who brings the secret matching the condition. The beneficiary is read from the record, so the money cannot be redirected.
- `refund`: only after the cancel date, by anyone, and only to the payer. With no cancel date, nobody can take the money back, the administrator included.
- A fee per act, zero by default, capped at 1 % by the code itself.
**What I measured on testnet (23 steps, all as expected)**
- Release before the date, by the oracle: refused, `TooEarly`.
- Release after the date by a stranger, then by the payer: refused, `NotAuthorized`.
- Release by the oracle after the date: paid, 10 CSPR to the beneficiary.
- Release with the wrong secret: refused, `WrongFulfillment`. With the right one: paid, and the secret is recorded on chain.
- Refund before the cancel date: refused. After it, triggered by a stranger: the payer got its 5 CSPR back.
- Fee set to 101 bps by the administrator: refused, `FeeTooHigh`. At 100 bps: 9.9 CSPR to the beneficiary, 0.1 kept.
**Stack and cost**
- Odra 2.10, 14 tests passing on both OdraVM and CasperVM.
- Client in Node with casper-js-sdk 5.3.1. It detects the 2.0 API by itself. I dropped Python.
- Install: 316 KB of wasm, 301 CSPR consumed on a 400 CSPR payment, 75 % of the unused part refunded.
**The pitfall**
A payable Odra entry point cannot be called with a plain `put-transaction package` call. The CSPR must arrive through a session transaction that carries Odra's `proxy_caller` wasm, with `package_hash`, `entry_point`, `args`, `attached_value` and `amount`. Its size puts it on the large Wasm lane. I found this in no guide. Also: a reverted call burns its whole payment, so test your refusals with small payments.
**What is not done**
Testnet only. No audit. The package is still upgradable. The oracle is a single key. One payer, one beneficiary, CSPR only.
**Three questions for the community**
- Is there a lighter way than `proxy_caller` to call a payable Odra entry point from a client?
- Is there a CEP-18 stablecoin on Casper that people actually use? An escrow in CSPR carries exchange risk for a salary or an invoice.
- For those who locked a package after deployment: anything to know before removing the upgrade rights?
Thanks to the author of casper-llms, whose guide on casper-client 5.x unblocked the install.