Skip to content

DSL for prototyping and deploying native FVM actors.

Notifications You must be signed in to change notification settings

jochasinga/monet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

monet

A domain-specific language for prototyping business-logic and deal-flow contracts on Filecoin Virtual Machine.

spec

See language spec.

examples

Atomic-swapping of Alice's FIL and Bob's wrapped FIL, escrow-style.

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.

About

DSL for prototyping and deploying native FVM actors.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published