<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Franklin Schrans on Medium]]></title>
        <description><![CDATA[Stories by Franklin Schrans on Medium]]></description>
        <link>https://medium.com/@fschrans?source=rss-8c4288fa8017------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*WuysVklX0bYbyifXyhwBGw.png</url>
            <title>Stories by Franklin Schrans on Medium</title>
            <link>https://medium.com/@fschrans?source=rss-8c4288fa8017------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 15:20:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fschrans/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Flint: A New Language for Safe Smart Contracts on Ethereum]]></title>
            <link>https://medium.com/@fschrans/flint-a-new-language-for-safe-smart-contracts-on-ethereum-a5672137a5c7?source=rss-8c4288fa8017------2</link>
            <guid isPermaLink="false">https://medium.com/p/a5672137a5c7</guid>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[blockchain-development]]></category>
            <category><![CDATA[programming-languages]]></category>
            <dc:creator><![CDATA[Franklin Schrans]]></dc:creator>
            <pubDate>Sun, 15 Apr 2018 15:53:00 GMT</pubDate>
            <atom:updated>2018-05-04T17:51:32.886Z</atom:updated>
            <content:encoded><![CDATA[<h3>Background</h3><p>Ethereum smart contracts (or DApps) have been the target of numerous attacks (<a href="https://pdaian.com/blog/chasing-the-dao-attackers-wake/">TheDAO</a>, <a href="http://paritytech.io/the-multi-sig-hack-a-postmortem/">Parity</a>, <a href="https://www.kingoftheether.com/postmortem.html">KingOfTheEtherThrone</a>, etc.), resulting in millions of dollars worth of Ether being locked or stolen. Vulnerabilities are often due to simple programmer errors, such as forgetting to write a keyword in a function signature. Static and dynamic analysis tools (Manticore, Mythril, Oyente, etc.) have been developed for Solidity—currently the most widely used language for writing smart contracts for Ethereum. These tools try to find <em>some</em> vulnerabilities before the contracts are deployed and cannot be updated.</p><h3>Flint</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cIzB_z21zaqIg6zavlLjnQ.png" /></figure><p>Flint is a new statically-typed programming language for writing <em>inherently safer</em> smart contracts. Flint features a variety of novel <em>contract-oriented</em> features, such as <em>caller capabilities, immutability by default, </em>and <em>Asset types</em>, which help developers write smart contracts. The <a href="https://github.com/franklinsch/flint">project</a> is currently under active development. The short introductory paper <a href="https://www.doc.ic.ac.uk/~fs2014/flint.pdf"><em>Writing Safe Smart Contracts in Flint</em></a>, gives a high-level overview of Flint and its motivations, and has been awarded the ACM SRC 1st Prize at <a href="https://twitter.com/franklinschrans/status/984457238982127619">&lt;Programming&gt; 2018</a>.</p><h3>Compiler and Documentation</h3><p>The Flint compiler is under development and is <a href="https://github.com/franklinsch/flint">open-source on GitHub</a>. Documentation and instructions on how to get started with Flint is available in <a href="https://docs.flintlang.org/">The Flint Programming Language Guide</a>.</p><h3>Language Overview</h3><p>The <a href="https://docs.flintlang.org/">Flint Programming Language Guide</a> gives a high-level overview of the language, and helps getting started with smart contract development in Flint.</p><h4>Caller Capabilities</h4><p><a href="https://docs.flintlang.org/caller-capabilities"><strong>Caller capabilities</strong></a><strong> </strong>require programmers to think about who should be able to call the contract’s sensitive functions. Capabilities are checked statically for internal calls (unlike Solidity modifiers), and at runtime for calls originating from external contracts.</p><p>Example:</p><pre>// State declaration<br>contract Bank {<br>  var manager: Address<br>}</pre><pre>// Functions are declared in caller capability blocks,<br>// which specify which users are allowed to call them.</pre><pre>Bank :: (manager) {<br>  <br>  // Only `manager` of the Bank can call `clear`.</pre><pre>  func clear(address: Address) {<br>    // body<br>  }<br>}</pre><h4>Immutability by default</h4><p><strong>Restricting writes to state</strong> in functions helps programmers more easily reason about the smart contract. A function which writes to the contract’s state needs to be annotated with the mutating keyword.</p><p>Example:</p><pre>Bank :: (any) {<br>  mutating func incrementCount() {<br>    // count is a state property<br>    count += 1<br>  }<br> <br>  func getCount() -&gt; Int {<br>    return count<br>  }<br> <br>  func decrementCount() {<br>    // error: Use of mutating statement in a nonmutating function<br>    // count -= 1<br>  }<br>}</pre><h4>Asset types</h4><p><a href="https://docs.flintlang.org/assets"><strong>Assets</strong></a>, such as Ether, are often at the center of smart contracts. Flint puts assets at the forefront through the special <em>Asset</em> trait.</p><p>Flint’s Asset type ensure a contract’s state always truthfully represents its Ether value, preventing attacks such as TheDAO.</p><p>A restricted set of atomic operations can be performed on Assets. It is impossible to create, duplicate, or lose Assets (such as Ether) in unprivileged code. This prevents attacks relating to double-spending and re-entrancy.</p><p>Example use:</p><pre>Bank :: account &lt;- (balances.keys) {<br>  @payable<br>  mutating func deposit(implicit value: inout Wei) {<br>    // Omitting the next line would cause a compiler warning:<br>    // the value received should be recorded.           </pre><pre>    balances[address].transfer(&amp;value)<br>  }<br>}</pre><pre> mutating func withdraw() {<br>   // balances[account] is automatically <br>   // set to 0 before transferring.</pre><pre>   send(account, &amp;balances[account])<br> }<br>}</pre><p>The Asset feature is still in development. The <a href="https://github.com/franklinsch/flint/blob/master/proposals/0001-asset-trait.md">FIP-0001: Introduce the Asset trait</a> proposal includes more details.</p><h4>Safer semantics</h4><p>In the spirit of reducing vulnerabilities relating to unexpected language semantics, such as wrap-arounds due to integer overflows, Flint aims to provide safer operations. For instance, arithmetic operations on Int are safe by default: an overflow/underflow causes the Ethereum transaction to be reverted.</p><h3>What’s next</h3><p>On top of finishing the implementation of the compiler, the long terms goals for Flint include:</p><ol><li><strong>Gas estimation</strong>: provide estimates about the gas execution cost of a function. Gas upper bounds are emitted as part of the contract’s interface, making it possible to obtain the estimation of a call to an external Flint function.</li><li><strong>Formalization</strong>: specify well-defined semantics for the language.</li><li><strong>The Flint Package Manager</strong>: create a package manager which runs as a Flint smart contract on Ethereum. It would store contract APIs as well as safety and gas cost information of dependencies.</li><li><strong>Tooling</strong>: build novel tools around smart contract development, such as new ways of simulating and visualizing different transaction orderings.</li></ol><p>The Flint Programming Language is developed by <a href="https://twitter.com/franklinschrans">Franklin Schrans</a>, Sophia Drossopoulou, and Susan Eisenbach from <a href="https://www.imperial.ac.uk/">Imperial College London</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5672137a5c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>