https://github.com/jochasinga/monet
DSL for prototyping and deploying native FVM actors.
https://github.com/jochasinga/monet
Last synced: 5 months ago
JSON representation
DSL for prototyping and deploying native FVM actors.
- Host: GitHub
- URL: https://github.com/jochasinga/monet
- Owner: jochasinga
- Created: 2023-10-20T17:57:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-08T21:16:36.000Z (over 2 years ago)
- Last Synced: 2024-10-18T15:18:55.265Z (over 1 year ago)
- Language: Scheme
- Size: 46.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# monet
A domain-specific language for prototyping business-logic and deal-flow contracts on [Filecoin Virtual Machine](https://fvm.filecoin.io/).
## spec
See [language spec](SPEC.md).
## examples
Atomic-swapping of Alice's FIL and Bob's wrapped FIL, escrow-style.
```lisp
When
[Case
(Deposit
(Address "f1ginx5tebjahoqd4m5kdz3p5hqzhf54qhuwbf6ba")
(Address "f1ginx5tebjahoqd4m5kdz3p5hqzhf54qhuwbf6ba")
(Token "" "") ; Empty name and tick means native FIL.
(MulValue
(Constant (1_000_000 + 0xaf))
(ConstantParam "Amount of FIL")
)
)
(When
[Case
(Deposit
(Address "f1ginx5tebzahoqd4m5kdz3p5hbzhf54qhuwbf6ba")
(Address "f1ginx5tebzahoqd4m5kdz3p5hbzhf54qhuwbf6ba")
(Token "wFIL" "Wrapped FIL")
(ConstantParam "Amount of wFIL")
)
(Pay
(Address "f1ginx5tebjahoqd4m5kdz3p5hqzhf54qhuwbf6ba")
(Address "f1ginx5tebzahoqd4m5kdz3p5hbzhf54qhuwbf6ba")
(Token "" "")
(MulValue
(Constant 1_000_000)
(ConstantParam "Amount of FIL")
)
(Pay
(Address "f1ginx5tebzahoqd4m5kdz3p5hbzhf54qhuwbf6ba")
(Address "f1ginx5tebjahoqd4m5kdz3p5hqzhf54qhuwbf6ba")
(Token "wFIL" "Wrapped FIL")
(ConstantParam "Amount of wFIL")
Close
)
)
]
(TimeParam "wFILmaturityDate")
Close
)
]
(TimeParam "FILMaturityDate")
Close
```
The contract is written in s-expressions defining what happen synchronously, and conditionally as events are satisfied.