{"id":15917778,"url":"https://github.com/mrchico/smarter-contract-lang","last_synced_at":"2025-10-14T16:59:32.472Z","repository":{"id":80714501,"uuid":"94982363","full_name":"MrChico/Smarter-contract-lang","owner":"MrChico","description":null,"archived":false,"fork":false,"pushed_at":"2017-08-04T12:36:00.000Z","size":213,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-08T22:13:34.935Z","etag":null,"topics":["blockchain","dependent-types","ethereum","functional-programming","type-theory"],"latest_commit_sha":null,"homepage":null,"language":"Idris","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MrChico.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-21T08:39:48.000Z","updated_at":"2018-11-27T18:45:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"9572f9a2-b329-487c-a108-30ec9235807c","html_url":"https://github.com/MrChico/Smarter-contract-lang","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MrChico/Smarter-contract-lang","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrChico%2FSmarter-contract-lang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrChico%2FSmarter-contract-lang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrChico%2FSmarter-contract-lang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrChico%2FSmarter-contract-lang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrChico","download_url":"https://codeload.github.com/MrChico/Smarter-contract-lang/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrChico%2FSmarter-contract-lang/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019610,"owners_count":26086760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","dependent-types","ethereum","functional-programming","type-theory"],"created_at":"2024-10-06T18:20:59.398Z","updated_at":"2025-10-14T16:59:32.449Z","avatar_url":"https://github.com/MrChico.png","language":"Idris","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart contract programming language group - initial survey\n## Contract examples\n### Multisig\nFor sending arbitrary transactions, good example of basic handling of cryptography\n\n### Transferable token\nUbiquitous. Minimal example of handling ownership, which is what blockchains are all about. Can we formally prove that \"the total amount of tokens is constant\" from our example?\n\n### Registry\nWidespread, more handling of ownership.\n\n### Sealed auction\nWidespread and critical to get right, look at ICOs and ENS.\n\n### State channel\nCome in many different forms, but a toy state channel that just handles signature verification and keeps one hash of a state should suffice, with as simple of a challenge mechanism as possible.\n\n### Quadratic voting\nFor a set of preapproved actors.\n\n## Desiderata\n- Intuitive, the behavior of the code matches the intent of the programmer\n\n- Easy to reason about the state of a contract\n  (Metric : Complexity of proofs)\n- Intuitive handling of cryptographic functions\n  (Metric : Number of coders crying on Stack Exchange)\n- Easy to handle ownership, since this is probably the most common use of stateful contracts on a blockchain\n  (Metric : Complexity of proofs regarding ownership)\n- Correct by construction code, type checking of the code assures that it satisfies its intended properties\n  (Metric : Proof theoretic strength of the type system)\n- Compositionality\n  (Metric : Largest individual part making up a composed system, smaller is better)\n\n## Tools \u0026 Paradigms\nI believe the most important thing to achieve all of the points above is a safe, theoretically sound type system.\nBy safe, I mean a language in which, as far as is possible, \"well-typed programs cannot go wrong\". The intent of the programmer should be reflected as closely as possible in the type declaration of a function. Instances of `throw` (or when `return false` is used for the same purpose) in Solidity should correspond to a failure of type check.\n\nDepending on the structure of the type system, some type checking may need to be done at execution time. In that case, there should be a keyword `unsafe` that disables this to increase performance.\n\nKeeping track of state can be done with monads or using linear types. Inspiration can be taken from Krishnaswami's 'Integrating Linear and Dependent Types', https://www.cl.cam.ac.uk/~nk480/dlnl-paper.pdf; handling pointers is not all that different from handling ownership.\n\nThe specifics of how new types are introduced varies greatly with the design of the type system. At the very least, I would like to see function, sum and product types. The type system should be closely related to, or a direct implementation of a well studied type system such as the Calculus of Inductive Constructions, (Intensional or Extensional) Martin Löf Type Theory, λP2 or ιλP2.\n\nCryptographic functionality can be included as primitve types. For example, in a state channel, one could update the state only if `msg : ECVerify(person, previousstate)` type checks.\n\nCompositionality can be achieved by having functions as first class citizens.\n\n## Misc\nThe property of termination arises naturally for some type systems and not for others. The two roads of ensuring termination come from a complex type system or conservative expressiveness. I don't think guaranteed termination should be actively pursued, but I am happy if it ends up being a property of our system.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrchico%2Fsmarter-contract-lang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrchico%2Fsmarter-contract-lang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrchico%2Fsmarter-contract-lang/lists"}