CINXE.COM

Cadence

<!doctype html> <html lang="en" dir="ltr" class="plugin-pages plugin-id-default" data-has-hydrated="false"> <head> <meta charset="UTF-8"> <meta name="generator" content="Docusaurus v3.0.0"> <title data-rh="true">Hello from Cadence | Cadence</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:url" content="https://cadence-lang.org/"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docusaurus_tag" content="default"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docsearch:docusaurus_tag" content="default"><meta data-rh="true" property="og:title" content="Hello from Cadence | Cadence"><meta data-rh="true" name="description" content="Cadence is a resource-oriented programming language that introduces new features to smart contract programming that help developers ensure that their code is safe, secure, clear, and approachable."><meta data-rh="true" property="og:description" content="Cadence is a resource-oriented programming language that introduces new features to smart contract programming that help developers ensure that their code is safe, secure, clear, and approachable."><link data-rh="true" rel="icon" href="/favicon.ico"><link data-rh="true" rel="canonical" href="https://cadence-lang.org/"><link data-rh="true" rel="alternate" href="https://cadence-lang.org/" hreflang="en"><link data-rh="true" rel="alternate" href="https://cadence-lang.org/" hreflang="x-default"><script data-rh="true">function insertBanner(){var n=document.createElement("div");n.id="__docusaurus-base-url-issue-banner-container";n.innerHTML='\n<div id="__docusaurus-base-url-issue-banner" style="border: thick solid red; background-color: rgb(255, 230, 179); margin: 20px; padding: 20px; font-size: 20px;">\n <p style="font-weight: bold; font-size: 30px;">Your Docusaurus site did not load properly.</p>\n <p>A very common reason is a wrong site <a href="https://docusaurus.io/docs/docusaurus.config.js/#baseUrl" style="font-weight: bold;">baseUrl configuration</a>.</p>\n <p>Current configured baseUrl = <span style="font-weight: bold; color: red;">/</span> (default value)</p>\n <p>We suggest trying baseUrl = <span id="__docusaurus-base-url-issue-banner-suggestion-container" style="font-weight: bold; color: green;"></span></p>\n</div>\n',document.body.prepend(n);var e=document.getElementById("__docusaurus-base-url-issue-banner-suggestion-container"),s=window.location.pathname,o="/"===s.substr(-1)?s:s+"/";e.innerHTML=o}document.addEventListener("DOMContentLoaded",(function(){void 0===window.docusaurus&&insertBanner()}))</script><link rel="preconnect" href="https://www.google-analytics.com"> <link rel="preconnect" href="https://www.googletagmanager.com"> <script async src="https://www.googletagmanager.com/gtag/js?id=G-5654FKLB20"></script> <script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-5654FKLB20",{anonymize_ip:!0})</script> <link rel="search" type="application/opensearchdescription+xml" title="Cadence" href="/opensearch.xml"> <script src="/hotjar.js" async></script><link rel="stylesheet" href="/assets/css/styles.b4b06054.css"> <script src="/assets/js/runtime~main.34e4d8c3.js" defer="defer"></script> <script src="/assets/js/main.689fbc1a.js" defer="defer"></script> </head> <body class="navigation-with-keyboard"> <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{const c=new URLSearchParams(window.location.search).entries();for(var[t,e]of c)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/logo.svg" alt="Cadence" class="themedComponent_mlkZ themedComponent--light_NVdE"><img src="/img/logo.svg" alt="Cadence" class="themedComponent_mlkZ themedComponent--dark_xIcU"></div></a></div><div class="navbar__items navbar__items--right"><a class="navbar__item navbar__link" href="/learn">Learn</a><a class="navbar__item navbar__link" href="/docs/solidity-to-cadence">Solidity Guide</a><a href="https://play.flow.com/" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Playground<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><a class="navbar__item navbar__link" href="/community">Community</a><a href="https://flow.com/flow-responsible-disclosure/" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">Security<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><a class="navbar__item navbar__link" href="/docs/">Documentation</a><a class="navbar__item navbar__link" href="/docs/">1.0</a><a href="https://github.com/onflow/cadence" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-github-link" aria-label="GitHub repository"></a><a href="https://discord.com/invite/J6fFnh2xx6" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link header-discord-link" aria-label="Discord project"></a><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type="button" disabled="" title="Switch between dark and light mode (currently light mode)" aria-label="Switch between dark and light mode (currently light mode)" aria-live="polite"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_pyhR"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_wfgR"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div><div class="navbarSearchContainer_Bca1"><button type="button" class="DocSearch DocSearch-Button" aria-label="Search"><span class="DocSearch-Button-Container"><svg width="20" height="20" class="DocSearch-Search-Icon" viewBox="0 0 20 20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round"></path></svg><span class="DocSearch-Button-Placeholder">Search</span></span><span class="DocSearch-Button-Keys"></span></button></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><main><div class="content-wrapper"><div class="feature"><div><svg id="Layer_1" data-name="Layer 1" viewBox="0 0 600 120" width="18em" height="4em" xmlns="http://www.w3.org/2000/svg" class="logo"><title>Cadence</title><defs id="defs1"><style id="style1">.cls-1,.cls-2{fill:#2a1e3c;stroke-width:0}.cls-2{fill:#00db80}</style></defs><g id="g1" transform="matrix(.58252 0 0 .57988 -7.573 -9.585)"><g id="g7" transform="translate(-72 -80)"><path class="cls-1" d="M811.86 176h21.47c3.07 0 5.52 2.55 5.4 5.62l-.76 19.51h.39c2.36-9.03 6.38-15.71 12.07-20.03s13.65-6.48 23.85-6.48c11.12 0 19.76 3.14 25.92 9.42 6.15 6.28 9.23 15.38 9.23 27.29v61.65h-27.09v-55.56c0-4.71-.72-8.47-2.16-11.29-1.44-2.81-3.63-4.91-6.58-6.28-2.94-1.37-6.58-2.06-10.9-2.06-4.71 0-8.87 1.05-12.47 3.14-3.6 2.1-6.38 5.2-8.35 9.33-1.96 4.12-2.94 9.13-2.94 15.02v47.71h-27.09V176Z" id="path1"></path><path class="cls-1" d="M986.42 241.77c-.22.58-.44 1.14-.7 1.67-1.51 3.08-3.73 5.4-6.68 6.97-2.95 1.57-6.32 2.36-10.11 2.36-4.19 0-7.76-1.08-10.7-3.24-2.94-2.16-5.2-5.37-6.77-9.62-1.57-4.25-2.36-9.39-2.36-15.41s.82-11.35 2.45-15.61c1.64-4.25 3.99-7.43 7.07-9.52 3.07-2.09 6.77-3.14 11.09-3.14 3.53 0 6.64.79 9.33 2.36 2.68 1.57 4.78 3.96 6.28 7.17.57 1.21 1.03 2.52 1.38 3.92h24.94c-.75-5.95-2.37-11.16-4.92-15.6-3.6-6.28-8.64-11.09-15.12-14.43-6.48-3.34-14.17-5.01-23.07-5.01-9.42 0-17.57 2-24.44 5.99-6.87 3.99-12.27 9.75-16.2 17.28-3.93 7.53-5.89 16.46-5.89 26.8s1.83 18.88 5.5 26.41c3.66 7.53 9 13.29 16 17.28 7 3.99 14.95 5.99 23.85 5.99 8.9 0 16.92-1.64 23.66-4.91 6.74-3.27 11.91-8.08 15.51-14.43 2.21-3.91 3.74-8.33 4.59-13.25h-24.7z" id="path2"></path><path class="cls-1" d="M450.16 235.24c-.43 1.15-.93 2.25-1.51 3.29-2.23 3.99-5.3 7.1-9.23 9.33-3.93 2.23-8.64 3.34-14.14 3.34-6.42 0-12.14-1.64-17.18-4.91-5.04-3.27-8.87-8.11-11.49-14.53-2.62-6.41-3.93-14.14-3.93-23.17 0-9.03 1.31-16.75 3.93-23.17 2.62-6.41 6.38-11.32 11.29-14.73 4.91-3.4 10.7-5.1 17.38-5.1 4.84 0 9.33 1.08 13.45 3.24 4.12 2.16 7.36 5.37 9.72 9.62.96 1.74 1.72 3.62 2.29 5.63h26.72c-.87-7.13-3.05-13.49-6.53-19.08-4.65-7.46-11-13.15-19.04-17.08-8.05-3.93-17.37-5.89-27.98-5.89-12.44 0-23.26 2.55-32.49 7.66-9.23 5.1-16.36 12.7-21.4 22.78-5.04 10.08-7.56 22.12-7.56 36.13 0 14.01 2.48 25.82 7.46 35.83 4.97 10.01 12.11 17.57 21.4 22.68 9.29 5.1 20.09 7.66 32.39 7.66 10.6 0 19.99-1.96 28.17-5.89 8.18-3.93 14.59-9.59 19.24-16.98 3.12-4.96 5.17-10.52 6.19-16.64h-27.16z" id="path3"></path><path class="cls-1" d="M773.72 241.77c-.49 2.44-1.26 4.47-2.3 6.09-1.44 2.23-3.5 3.8-6.18 4.71-2.68.92-5.99 1.37-9.92 1.37-4.32 0-8.12-.95-11.39-2.85-3.27-1.9-5.73-4.97-7.36-9.23-1.29-3.34-2.06-7.44-2.33-12.27h63.88v-8.44c0-10.21-1.74-18.81-5.2-25.82-3.47-7-8.38-12.2-14.72-15.61-6.35-3.4-13.97-5.1-22.87-5.1-10.08 0-18.72 1.93-25.92 5.79-7.2 3.86-12.73 9.65-16.59 17.38-3.86 7.72-5.79 16.95-5.79 27.68s1.87 19.14 5.6 26.41c3.73 7.26 9.23 12.83 16.49 16.69 7.26 3.86 15.8 5.79 25.62 5.79 8.77 0 16.39-1.44 22.87-4.32 6.48-2.88 11.49-6.94 15.02-12.17 3.06-4.53 4.84-9.9 5.35-16.1h-24.25zm-30.18-43.88c3.14-1.9 7.07-2.85 11.78-2.85 4.19 0 7.66.66 10.41 1.96 2.75 1.31 4.84 3.24 6.28 5.79 1.44 2.55 2.16 5.99 2.16 10.31v1.37h-39.32c.39-2.61.93-4.95 1.63-6.97 1.57-4.52 3.93-7.72 7.07-9.62z" id="path4"></path><path class="cls-1" d="M1109.8 195.34c-3.47-7-8.38-12.2-14.72-15.61-6.35-3.4-13.97-5.1-22.87-5.1-10.08 0-18.72 1.93-25.92 5.79-7.2 3.86-12.73 9.65-16.59 17.38-3.86 7.72-5.79 16.95-5.79 27.68s1.87 19.14 5.59 26.41c3.73 7.26 9.23 12.83 16.49 16.69 7.26 3.86 15.81 5.79 25.62 5.79 8.77 0 16.39-1.44 22.87-4.32 6.48-2.88 11.49-6.94 15.02-12.17 3.06-4.53 4.84-9.9 5.35-16.1h-24.25c-.49 2.44-1.26 4.47-2.3 6.09-1.44 2.23-3.5 3.8-6.18 4.71-2.68.92-5.99 1.37-9.91 1.37-4.32 0-8.12-.95-11.39-2.85-3.27-1.9-5.73-4.97-7.36-9.23-1.29-3.34-2.06-7.44-2.33-12.27h63.88v-8.44c0-10.21-1.74-18.81-5.2-25.82zm-18.75 19.14h-39.32c.39-2.61.93-4.95 1.63-6.97 1.57-4.52 3.93-7.72 7.07-9.62 3.14-1.9 7.07-2.85 11.78-2.85 4.19 0 7.66.66 10.41 1.96 2.75 1.31 4.84 3.24 6.28 5.79 1.44 2.55 2.16 5.99 2.16 10.31v1.37z" id="path5"></path><path class="cls-1" d="M556.83 174.62v15.9h-.2c-1.44-3.4-3.41-6.31-5.89-8.74-2.49-2.42-5.63-4.22-9.42-5.4-3.8-1.18-8.18-1.77-13.15-1.77-8.77 0-16.36 1.96-22.78 5.89-6.41 3.93-11.39 9.62-14.92 17.08-3.53 7.46-5.3 16.1-5.3 25.92 0 10.47 1.67 19.54 5.01 27.19 3.34 7.66 8.18 13.52 14.53 17.57 6.35 4.06 13.84 6.09 22.48 6.09 2.25 0 4.38-.16 6.4-.45h.03c10.37 0 23.09-9.13 23.09-9.13v8.21l.14-.07v.07h27.09v-98.36h-27.09zm-34.65 74.8c-3.21-2.22-5.69-5.56-7.46-10.01-1.77-4.45-2.65-9.68-2.65-15.71 0-5.63.91-10.57 2.75-14.82 1.83-4.25 4.42-7.43 7.76-9.52s7.17-3.14 11.49-3.14 8.25.98 11.78 2.95c3.53 1.96 6.25 4.78 8.15 8.44 1.9 3.67 2.85 7.98 2.85 12.96v4.91c0 5.5-.95 10.31-2.85 14.43-1.9 4.12-4.65 7.3-8.25 9.52-3.6 2.23-7.76 3.34-12.47 3.34-4.19 0-7.89-1.11-11.09-3.34z" id="path6"></path><path class="cls-1" d="M687.48 137.32h-21.69v53.21h-.2c-1.44-3.4-3.41-6.31-5.89-8.74-2.49-2.42-5.63-4.22-9.42-5.4-3.8-1.18-8.18-1.77-13.15-1.77-8.77 0-16.36 1.96-22.78 5.89-6.41 3.93-11.39 9.62-14.92 17.08-3.53 7.46-5.3 16.1-5.3 25.92 0 10.47 1.67 19.54 5.01 27.19 3.34 7.66 8.18 13.52 14.53 17.57 6.35 4.06 13.84 6.09 22.48 6.09 2.25 0 4.38-.16 6.4-.45h.02c10.37 0 23.09-9.13 23.09-9.13v8.21l.15-.07v.08h27.09V142.74c0-2.99-2.42-5.41-5.41-5.41zm-56.34 112.11c-3.21-2.22-5.69-5.56-7.46-10.01-1.77-4.45-2.65-9.68-2.65-15.71 0-5.63.91-10.57 2.75-14.82 1.83-4.25 4.42-7.43 7.76-9.52s7.17-3.14 11.48-3.14c4.31 0 8.25.98 11.78 2.95 3.53 1.96 6.25 4.78 8.15 8.44 1.9 3.67 2.85 7.98 2.85 12.96v4.91c0 5.5-.95 10.31-2.85 14.43-1.9 4.12-4.65 7.3-8.25 9.52-3.6 2.23-7.76 3.34-12.47 3.34-4.19 0-7.89-1.11-11.09-3.34z" id="path7"></path></g><g id="g10" transform="translate(-72 -80)"><path class="cls-2" d="M202.63 162.39h22.47c.52-.07.95.26 1.02.76l-.03 20.39c.14 1.12-.25 2.33-1.06 3.28l-44.37 44.65c-.83.87-1.95 1.38-3.07 1.42l-21.12.03c-.54.02-.94-.38-.92-.91l.05-22.38c.04-1.01.49-2.03 1.26-2.83l42.87-42.83c.76-.89 1.82-1.47 2.9-1.59z" id="path8"></path><path class="cls-2" d="M207.29 263.5c-1.55 1.52-3.54 2.37-5.44 2.34l-75.4-.1c-2.26-.03-3.84-1.63-3.82-3.89v-73.54c0-1.89.9-3.85 2.46-5.37l25.6-25.27h-46.15l-16.88 16.75c-1.65 1.61-2.63 3.73-2.66 5.74l.02 116.77c-.03 1.91.61 3.54 1.74 4.69 1.13 1.15 2.75 1.82 4.68 1.83l117.65.02c2.02 0 4.16-.93 5.81-2.54l15.92-16.35v-42.43z" id="path9"></path><path class="cls-2" d="M285.62 96.53H167.77c-1.97 0-4.02.92-5.63 2.54l-29.64 30.38h120.99c3.32.05 5.63 2.48 5.62 5.9l-.37 121.25 30.53-29.84c1.6-1.61 2.55-3.73 2.58-5.74V103.06c.06-3.83-2.5-6.51-6.22-6.52z" id="path10"></path></g></g></svg><h2>Forge the future of decentralized apps.<br>Unleash <strong>utility</strong>, <strong>composability</strong>,<br>and <strong>safety</strong> in smart contracts.</h2><a class="cta" href="/learn">Get started <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 20 20" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg></a></div><div style="max-width:30rem"><pre class="code" style="color:#ccc;background:#2d2d2d;font-family:Consolas, Monaco, &#x27;Andale Mono&#x27;, &#x27;Ubuntu Mono&#x27;, monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;padding:1em;margin:.5em 0;overflow:auto"><code style="color:#ccc;background:none;font-family:Consolas, Monaco, &#x27;Andale Mono&#x27;, &#x27;Ubuntu Mono&#x27;, monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;float:left;padding-right:10px"><span class="react-syntax-highlighter-line-number">1 </span><span class="react-syntax-highlighter-line-number">2 </span><span class="react-syntax-highlighter-line-number">3 </span><span class="react-syntax-highlighter-line-number">4 </span><span class="react-syntax-highlighter-line-number">5 </span><span class="react-syntax-highlighter-line-number">6 </span><span class="react-syntax-highlighter-line-number">7 </span><span class="react-syntax-highlighter-line-number">8 </span><span class="react-syntax-highlighter-line-number">9 </span><span class="react-syntax-highlighter-line-number">10 </span><span class="react-syntax-highlighter-line-number">11 </span><span class="react-syntax-highlighter-line-number">12 </span><span class="react-syntax-highlighter-line-number">13 </span><span class="react-syntax-highlighter-line-number">14 </span><span class="react-syntax-highlighter-line-number">15 </span><span class="react-syntax-highlighter-line-number">16 </span><span class="react-syntax-highlighter-line-number">17 </span></code><code class="language-cadence" style="color:#ccc;background:none;font-family:Consolas, Monaco, &#x27;Andale Mono&#x27;, &#x27;Ubuntu Mono&#x27;, monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none">access(all) resource NFT { access(all) fun greet(): String { return &quot;I&#x27;m NFT #&quot; .concat(self.uuid.toString()) } } access(all) fun main(): String { let nft &lt;- create NFT() let greeting = nft.greet() destroy nft return greeting }</code></pre></div></div><div style="max-width:58rem;margin-top:-1rem"><p>Together, we are working to build a programming language to empower everyone to push the boundaries of smart contracts and on-chain logic.</p><p>Announced in 2020, the Cadence programming language introduced a new paradigm of resource-oriented programming. By leveraging the power of resources, Cadence brings exciting new ideas to the world of smart contracts. Cadence makes it easy to write maximally on-chain smart contracts that are secure by design. Our goals for Cadence are to enable ambitious developers to make daring &amp; complex ideas possible while making them easy, fun &amp; developer-friendly, as well as safe and secure.</p><p>Join us in shaping the future of blockchain, one line of code at a time. Get started today!</p></div><div class="arrow"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 20 20" aria-hidden="true" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M14.707 10.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 12.586V5a1 1 0 012 0v7.586l2.293-2.293a1 1 0 011.414 0z" clip-rule="evenodd"></path></svg></div></div><div class="features"><div class="content-wrapper"><div class="feature"><div><h3><svg stroke="currentColor" fill="currentColor" stroke-width="0" version="1" viewBox="0 0 48 48" enable-background="new 0 0 48 48" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path fill="#424242" d="M24,4c-5.5,0-10,4.5-10,10v4h4v-4c0-3.3,2.7-6,6-6s6,2.7,6,6v4h4v-4C34,8.5,29.5,4,24,4z"></path><path fill="#FB8C00" d="M36,44H12c-2.2,0-4-1.8-4-4V22c0-2.2,1.8-4,4-4h24c2.2,0,4,1.8,4,4v18C40,42.2,38.2,44,36,44z"></path><circle fill="#C76E00" cx="24" cy="31" r="3"></circle></svg> Safety by design</h3><p>Cadence provides security and safety guarantees that greatly simplify the development of secure smart contracts.</p><p>As smart contracts often deal with valuable assets, Cadence provides the <a href="https://cadence-lang.org/docs/language/resources">resource-oriented programming paradigm</a>, which guarantees that assets can only exist in one location at a time, cannot be copied, and cannot be accidentally lost or deleted.</p><p>Cadence includes several language features that prevent entire classes of bugs via a strong static type system, <a href="https://cadence-lang.org/docs/language/functions#function-preconditions-and-postconditions">design by contract</a>, and <a href="https://cadence-lang.org/docs/language/capabilities">capability-based access control</a>.</p><p>These security and safety features allow smart contract developers to focus on the business logic of their contract, instead of preventing security footguns and attacks.</p></div><div><div></div></div></div><div class="feature alternate"><div><h3><svg stroke="currentColor" fill="currentColor" stroke-width="0" version="1" viewBox="0 0 48 48" enable-background="new 0 0 48 48" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><polygon fill="#CFD8DC" points="39.4,23 38.6,19 26,21.6 26,8 22,8 22,20.3 8.1,11.3 5.9,14.7 21.1,24.5 9.4,39.8 12.6,42.2 23.9,27.4 32.3,40.1 35.7,37.9 27.3,25.4"></polygon><circle fill="#3F51B5" cx="24" cy="24" r="7"></circle><g fill="#00BCD4"><circle cx="24" cy="8" r="5"></circle><circle cx="39" cy="21" r="5"></circle><circle cx="7" cy="13" r="5"></circle><circle cx="11" cy="41" r="5"></circle><circle cx="34" cy="39" r="5"></circle></g></svg>Built for permissionless composability</h3><p><a href="https://cadence-lang.org/docs/language/resources">Resources</a> are stored directly in users&#x27; accounts, and can flow freely between contracts. They can be passed as arguments to functions, returned from functions, or even combined in arbitrary data structures. This makes implementing business logic easier and promotes the reuse of existing logic.</p><p><a href="https://cadence-lang.org/docs/language/interfaces">Interfaces</a> enable interoperability of contracts and resources allowing developers to integrate their applications into existing experiences easily.</p><p>In addition, the <a href="https://cadence-lang.org/docs/language/attachments">attachments</a> feature of Cadence allows developers to extend existing types with new functionality and data, without requiring the original author of the type to plan or account for the intended behavior.</p></div><div><div></div></div></div><div class="feature"><div><h3><svg stroke="currentColor" fill="currentColor" stroke-width="0" version="1" viewBox="0 0 48 48" enable-background="new 0 0 48 48" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><circle fill="#FFF59D" cx="24" cy="22" r="20"></circle><path fill="#FBC02D" d="M37,22c0-7.7-6.6-13.8-14.5-12.9c-6,0.7-10.8,5.5-11.4,11.5c-0.5,4.6,1.4,8.7,4.6,11.3 c1.4,1.2,2.3,2.9,2.3,4.8V37h12v-0.1c0-1.8,0.8-3.6,2.2-4.8C35.1,29.7,37,26.1,37,22z"></path><path fill="#FFF59D" d="M30.6,20.2l-3-2c-0.3-0.2-0.8-0.2-1.1,0L24,19.8l-2.4-1.6c-0.3-0.2-0.8-0.2-1.1,0l-3,2 c-0.2,0.2-0.4,0.4-0.4,0.7s0,0.6,0.2,0.8l3.8,4.7V37h2V26c0-0.2-0.1-0.4-0.2-0.6l-3.3-4.1l1.5-1l2.4,1.6c0.3,0.2,0.8,0.2,1.1,0 l2.4-1.6l1.5,1l-3.3,4.1C25.1,25.6,25,25.8,25,26v11h2V26.4l3.8-4.7c0.2-0.2,0.3-0.5,0.2-0.8S30.8,20.3,30.6,20.2z"></path><circle fill="#5C6BC0" cx="24" cy="44" r="3"></circle><path fill="#9FA8DA" d="M26,45h-4c-2.2,0-4-1.8-4-4v-5h12v5C30,43.2,28.2,45,26,45z"></path><g fill="#5C6BC0"><path d="M30,41l-11.6,1.6c0.3,0.7,0.9,1.4,1.6,1.8l9.4-1.3C29.8,42.5,30,41.8,30,41z"></path><polygon points="18,38.7 18,40.7 30,39 30,37"></polygon></g></svg> Easy to learn, build and ship</h3><p>Cadence&#x27;s syntax is inspired by popular modern general-purpose programming languages like Swift, Kotlin, and Rust, so developers will find the syntax and the semantics familiar. Practical tooling, <a href="https://cadence-lang.org/docs/language">documentation</a>, and examples enable developers to start creating programs quickly and effectively.</p></div><div><div></div></div></div><div class="feature alternate"><div><h3><svg stroke="currentColor" fill="currentColor" stroke-width="0" version="1" viewBox="0 0 48 48" enable-background="new 0 0 48 48" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><g fill="#8BC34A"><path d="M34,44H14c-1.1,0-2-0.9-2-2V8c0-1.1,0.9-2,2-2h20c1.1,0,2,0.9,2,2v34C36,43.1,35.1,44,34,44z"></path><path d="M28,13h-8c-0.6,0-1-0.4-1-1V5c0-0.6,0.4-1,1-1h8c0.6,0,1,0.4,1,1v7C29,12.6,28.6,13,28,13z"></path></g><polygon fill="#FFEB3B" points="30,24 24.5,24 26.7,13 18,26 23.5,26 21.3,37"></polygon></svg>Powerful transactions for mainstream experiences</h3><p>In Cadence, a transaction has a lot more flexibility and the power to perform multiple operations with a single transaction, as opposed to multiple, separate smart contract calls like in other languages. It allows complex, multi-step interactions to be one-click user experiences.</p><p>Developers can easily batch multiple transactions, turning complicated user journeys into a few clicks. For example, imagine approving and completing the listing of an NFT from a new collection in the same transaction, or adding and sending funds with just one approval.</p></div><div><div></div></div></div><div class="feature"><div><h3>馃О Best-in-class tooling</h3><p>Cadence comes with great IDE support. Use your favorite editor, like <a href="https://marketplace.visualstudio.com/items?itemName=onflow.cadence">Visual Studio Code</a>, Vim or Emacs, to get diagnostics, code completion, refactoring support, and more.</p><p>To further enhance the developer experience, there is also a native testing framework, which allows developers to write unit &amp; integration tests using Cadence.</p></div><div><div></div></div></div></div></div></main></div><footer class="footer"><div class="container container-fluid"><div class="row footer__links"><div class="col footer__col"><div class="footer__title">Got suggestions for this site? </div><ul class="footer__items clean-list"><li class="footer__item"><a href="https://github.com/onflow/cadence-lang.org" target="_blank" rel="noopener noreferrer" class="footer__link-item">It&#x27;s open-source!<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div></div><div class="footer__bottom text--center"><div class="footer__copyright">The source code of this site is licensed under the Apache License, Version 2.0. Content is licensed under the Creative Commons Attribution 4.0 International License.</div></div></div></footer></div> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10