Skip to content

Instantly share code, notes, and snippets.

@mightybyte
Created March 15, 2019 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mightybyte/4877093d23deb5c7a0ece74a3f86c05c to your computer and use it in GitHub Desktop.
Save mightybyte/4877093d23deb5c7a0ece74a3f86c05c to your computer and use it in GitHub Desktop.
Pact shared with pact-web.
;;
;; Hi Doug, please find your favorite smart contract below.
;;
;; Best,
;; Robert
(define-keyset 'admin-keyset (read-keyset "admin-keyset"))
;; Define the module.
(module verificationDoug 'admin-keyset
@doc "Little example to show off the usefulness of formal verification."
(defun absBugDoug:integer (num:integer)
@doc "Ensure positive result"
;; This property fails: Would you have caught that with unit tests?
@model [(property (>= result 0))]
(if (= (- (* (- num 6) (+ num 11)) (* 42 num)) (* (* 64 7) 52270780833))
(- 1)
(abs num)
)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment