Hacker News new | ask | show | jobs
by buckie 3121 days ago
If we're listing smart contract languages, Pact is worth looking at. Check the demo contracts in the web editor for `Hello World`: kadena.io/try-pact

  ;; Simulate message data specifying an administrator keyset. 
  ;; In production use 'mockAdminKey' would be an ED25519 hex-encoded public key.
  (env-data { "admin-keyset": ["mockAdminKey"] })

  ;; Simulate that we've signed this transaction with the keyset.
  ;; In pact, signatures are pre-validated and represented in the
  ;; environment as a list of public keys.
  (env-keys ["mockAdminKey"])

  ;; Define the module.
  (module helloWorld 'admin-keyset
    "A smart contract to greet the world."
    (defun hello (name)
      "Do the hello-world dance"
      (format "Hello {}!" [name]))
  )

  ;; and say hello!
  (hello "world")