1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5983],{3905:(t,e,r)=>{r.d(e,{Zo:()=>p,kt:()=>h});var a=r(7294);function n(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,a)}return r}function c(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?o(Object(r),!0).forEach((function(e){n(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function i(t,e){if(null==t)return{};var r,a,n=function(t,e){if(null==t)return{};var r,a,n={},o=Object.keys(t);for(a=0;a<o.length;a++)r=o[a],e.indexOf(r)>=0||(n[r]=t[r]);return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(a=0;a<o.length;a++)r=o[a],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}var s=a.createContext({}),l=function(t){var e=a.useContext(s),r=e;return t&&(r="function"==typeof t?t(e):c(c({},e),t)),r},p=function(t){var e=l(t.components);return a.createElement(s.Provider,{value:e},t.children)},m="mdxType",u={inlineCode:"code",wrapper:function(t){var e=t.children;return a.createElement(a.Fragment,{},e)}},d=a.forwardRef((function(t,e){var r=t.components,n=t.mdxType,o=t.originalType,s=t.parentName,p=i(t,["components","mdxType","originalType","parentName"]),m=l(r),d=n,h=m["".concat(s,".").concat(d)]||m[d]||u[d]||o;return r?a.createElement(h,c(c({ref:e},p),{},{components:r})):a.createElement(h,c({ref:e},p))}));function h(t,e){var r=arguments,n=e&&e.mdxType;if("string"==typeof t||n){var o=r.length,c=new Array(o);c[0]=d;var i={};for(var s in e)hasOwnProperty.call(e,s)&&(i[s]=e[s]);i.originalType=t,i[m]="string"==typeof t?t:n,c[1]=i;for(var l=2;l<o;l++)c[l]=r[l];return a.createElement.apply(null,c)}return a.createElement.apply(null,r)}d.displayName="MDXCreateElement"},8388:(t,e,r)=>{r.r(e),r.d(e,{assets:()=>p,contentTitle:()=>s,default:()=>h,frontMatter:()=>i,metadata:()=>l,toc:()=>m});var a=r(7462),n=r(3366),o=(r(7294),r(3905)),c=["components"],i={title:"What is a Smart Contract?"},s=void 0,l={unversionedId:"develop/contracts/whatisacontract",id:"develop/contracts/whatisacontract",title:"What is a Smart Contract?",description:"Smart contracts are simple programs that live on an Elastos network. As any modern application, smart contracts store data and expose methods to interact with them.",source:"@site/../docs/3.develop/contracts/whatisacontract.md",sourceDirName:"3.develop/contracts",slug:"/develop/contracts/whatisacontract",permalink:"/develop/contracts/whatisacontract",draft:!1,editUrl:"https://github.com/elastos/Elastos.Wiki/edit/master/website/../docs/3.develop/contracts/whatisacontract.md",tags:[],version:"current",lastUpdatedBy:"racollette",lastUpdatedAt:1677682984,formattedLastUpdatedAt:"Mar 1, 2023",frontMatter:{title:"What is a Smart Contract?"},sidebar:"developSidebar",previous:{title:"Examples & Tutorials",permalink:"/tutorials/welcome"},next:{title:"Deploy using Remix",permalink:"/develop/contracts/remix"}},p={},m=[{value:"Programming Languages",id:"programming-languages",level:2}],u={toc:m},d="wrapper";function h(t){var e=t.components,r=(0,n.Z)(t,c);return(0,o.kt)(d,(0,a.Z)({},u,r,{components:e,mdxType:"MDXLayout"}),(0,o.kt)("p",null,"Smart contracts are simple programs that live on an Elastos network. As any modern application, smart contracts store data and expose methods to interact with them."),(0,o.kt)("p",null,"They are written in human-readable languages, then compiled and deployed to an account where everyone can interact with them."),(0,o.kt)("p",null,"Do not worry if you don't know how smart-contract blockchains work. As a developer, it is sufficient to understand that smart-contracts:"),(0,o.kt)("ol",null,(0,o.kt)("li",{parentName:"ol"},"Have ",(0,o.kt)("strong",{parentName:"li"},"limited")," computational resources."),(0,o.kt)("li",{parentName:"ol"},"Interact with other contracts in an ",(0,o.kt)("strong",{parentName:"li"},"asynchronous")," way."),(0,o.kt)("li",{parentName:"ol"},"Deal with ",(0,o.kt)("strong",{parentName:"li"},"real money"),", for which security must be a top concern.")),(0,o.kt)("admonition",{title:"HTTP Requests and Smart Contracts",type:"info"},(0,o.kt)("p",{parentName:"admonition"},"Smart contracts ",(0,o.kt)("strong",{parentName:"p"},"cannot perform HTTP requests"),", meaning they can't retrieve data from outside an Elastos blockchain. However, they can receive data from any outside source. If needed, you can set up a server to regularly feed them data (this is in short how oracles work).")),(0,o.kt)("hr",null),(0,o.kt)("h2",{id:"programming-languages"},"Programming Languages"),(0,o.kt)("p",null,"Smart contracts on the Elastos Smart Chain (ESC) are written in ",(0,o.kt)("a",{parentName:"p",href:"https://docs.soliditylang.org/en/v0.8.17/"},"Solidity"),"."))}h.isMDXComponent=!0}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.