Fuel 🛠 Bringing Superior Devex to Web3 Building Dapps on Fuel – Cami Ramos<a href="https://www.youtube.com/watch?v=vIQASHOni1k" target="_blank" rel="noopener">Source</a>

Foreign Cool hey all people thanks for being right here Uh at present we're going to speak about Bringing a superior developer expertise To and the way we're doing that at gas Labs and we're going to cowl rather a lot in The subsequent half-hour so we're going to go Over type of an summary of sway the Programming language the VM and type of What makes gas such choice for uh daps after which we're going to Talk about particularly like going Through a workshop so when you have your Laptops you'll have the ability to undergo it Either in actual time or you may go Through it through the hackathon so actual Quick uh only a fast about me like I Said my title is Camila I had a type of a More conventional path to engineering I Studied pc science in school then I began my profession at PayPal the place I Was an engineer earlier than transferring on to Developer relations virtually two years After that I did devrel for net 2 for Maybe like a yr earlier than pivoting over To I've been working in crypto Full-time since April of yr and Now I'm the pinnacle of developer relations At gas labs So earlier than we begin let's simply type of Kind of get like a floor zero the place We're all underneath the identical understanding So after we speak about a tech stack I Find it best generally to attempt to map

The net to Tech stack to the net 3 Tech Stack and type of draw these Relationships so we're each clear on What it's that we're speaking about once I say sure issues so if you're Building in net 2 these type of 5 Pieces Basically are The Primitives that allow You construct just about something proper you Have apis authentication database Client-side Frameworks and file storage So now should you take that related concept and Kind of attempt to map it over to web3 it's Not a one-to-one proper as a result of there's a Different Paradigm to constructing however you Can type of map an identical map of all of The totally different items so that is again From once I was at edino the group there Did analysis this was a yr in the past Actually virtually precisely the place we Published This analysis and as you recognize Like in net 3 strikes tremendous quick so a Year in the past issues have been approach much less mature and Way extra nascent than they're now so There was a a lot larger have to Define What a working Tech stack might look Like on the time and that is what they Came up with So you see you could have your ones you Have your layer twos you could have your Development environments file storage Indexing and querying oracles identification Wallet and shopper Okay so gas Labs uh that's the

Orientation that I work at we're Building Fuel and I type of prefer to Nickname it a layer two however higher however The official time period that we use is a Modular execution layer so what that Means is that you recognize as an of it Being only a layer two and perhaps the Sense of prefer it being a roll-up or a Side chain or no matter type of totally different Types of layer twos there are it's a Execution layer that may be plugged in It's the engine that may be plugged into Any totally different L1 or to any totally different Configuration the place you may have gas as A sidechain you may have gas as a Roll-up you may have gas we don't Recommend it however you possibly can have gas Running as a monolithic L1 you possibly can Have all of those totally different Configurations and that's type of the Whole modular concept is that you simply as a Protocol developer can Define what you Want your chain to seem like and you'll Say I wish to use gas for execution or I wish to use gas for execution however I Want to make use of it as like a aspect chain or Something like that and the three Pillars that we're going to speak about Our leads so small there we Go efficiency flexibility and waste Reduction and developer expertise and The two that we're going to give attention to Today are efficiency and developer Experience simply because we don't have a

Bunch of time so for who is likely to be Like oh what's a modular execution layer What does that imply precisely So actually what it means is that Blockchains have these 4 capabilities And we have now a bunch of studying uh on our Website if you wish to type of study More about this however mainly Blockchains have 4 capabilities and when You have a mono monolithic chain the Node is careworn attempting to do all 4 Things proper so that you you could have this like Limited set of computation energy and Then it's a must to divide that by all These totally different capabilities and the thesis Of modular is that if we will separate These out we will have increased efficiency On every layer individually so if you Combine them you could have increased efficiency In basic so what gas does is it Offloads simply execution so the chain Only handles execution it doesn't fear About uh if one thing is appropriate it Doesn't fear about settlement it Doesn't fear about consensus it simply Executes all these State modifications so It'll execute all of your transactions and Then publish them again to the L1 after which The L1 is accountable for saying you recognize What order are we going to place these in Blah blah So once more the gas VM is designed to be Modular and it could actually plug in as an Execution engine for any blockchain it's

Kind of just like the factor to notice All proper so after we speak about gas Building the quickest module execution Layer how precisely are we doing that what What are we constructing that makes it such So the three issues that we're going to Focus on are parallel transaction Execution the sway language and the gas VM So I made this meme Laugh Um as a result of proper the vibe is how will we Stay within the proper Because all of us for one cause or one other Are like both worth aligned expertise Aligned no matter aligned with ethereum But how will we take what we all and love About ethereum and enhance it so the Thesis of gas is like how can we carry A extra protected sensible contract language how Can we carry a extra performant VM whereas Staying within the ethereum ecosystem So let's speak about what we imply by Parallel transaction execution and the way That type of what that truly means so The evm which is a digital machine for Ethereum versus the sector VM which is The gas fuels ritual machine so the evm Is single threaded and due to that It can solely course of transactions Sequentially so what meaning is it Can solely course of one transaction at a Time as soon as that one is completed and it Turns on the following one Etc so as a result of

Fuel is utxo base which we don't must Get into the weeds of what meaning But mainly it's a distinct mannequin Ethereum makes use of an account mannequin the sector VM makes use of utxo mannequin once more we have now rather a lot Of studying on our web page the place you may Kind of dive into this extra however it makes use of All of your machines cores and threads And as a result of we're utxo mannequin we have now Access to those issues known as State Access lists the place what meaning is it Looks on the transactions and it says Which ones have dependencies like first You must execute this one after which This one let's say proper out of 10 Transactions there's like these three Dependencies let's say so what the VM is Able to say is okay let's execute all of The different ones that don't have any Dependencies in parallel after which the Ones I do have dependencies you recognize Sequentially so simply based mostly off that You're in a position to get a lot increased Throughput simply off this one Improvement Right the place as an alternative of getting to do separately you now are Able to course of issues Um in parallel So if we have a look at this graph should you see The the orange like triangles on the prime You'll see that the variety of Transistors on CPUs has been growing Exponentially over time additionally identified As Moore's Law the one threaded

Performance during the last years which is The blue proper underneath that hasn't you may See prefer it was growing however it's not Increasing exponentially But what has elevated exponentially Over the years has been the variety of Cores so when you have a system that's Sequential that may solely leverage a Single core it's such as you're working it On a ten yr outdated laptop computer You wish to leverage the issues which are Increasing exponentially yr over yr And the gas VM is designed to try this It's designed to have the ability to run Transactions in parallel and this leads Like I mentioned to an unlimited enhance in Throughput if all different issues are equal So not contemplating any of the opposite Improvements simply due to this you're You're in a position to truly entry all of the Cores and all of the threads of your Machine which like I mentioned in accordance with This graph is what's been rising is What's been bettering So and it's not since you purchased a Better pc proper or a extra Performant like machine it's simply Because you're utilizing the entire Resources that in your pc are Wasted within the evm Um the opposite factor after we speak about Developer expertise is that the gas VM Uses a graphql endpoint as an alternative of a Json RPC should you've like deployed a

Contract you recognize you bought to go discover Like the RPC endpoint and also you identical to Paste that in and that's the way you deploy So with gas we have now a graphql endpoint And what meaning is that you've got a Graphql API in-built so that you may need Heard of the graph proper the graph Exists as a result of these different networks Don't have that so that you want an exterior Service or you recognize another person to Build this layer on prime of it and with The gas VM so this you guys can't see This Oh you may see right here um with the gas van This hyperlink proper right here is definitely the Endpoint to the place you deploy your Contract so should you have been to click on on this Did it open So um should you click on on this endpoint It'll take you to a graphql playground Where you may truly begin making Requests straight away and also you don't want An exterior service you don't must Write new mappings you don't must Like write the entire API that you've got To do to make use of the graph You know Okay so now I'm transferring on sorry about That uh so now transferring on to the portion Of developer expertise and we're going To speak about Sway and Fork sway is the Rest area language and Fork is the software Chain type of supervisor so We're gonna simply type of like fireplace

Through as a result of we solely now have uh A couple of left we have now 20 minutes Left truly so it's high-quality so we're Gonna type of velocity by means of some main Points we're not going to get into too Much element however all of those have QR Codes so you may you recognize scan them and Go into the precise specs or into the Docs and skim extra about what I'm saying So our normal library is definitely Written in Sway and the explanation why That's notable is as a result of numerous different Uh languages for blockchains are Actually not written in that language so For instance like transfer the usual Library for transfer isn't written in transfer Uh in order that's like one thing that's Really fascinating about our venture is That the usual library is definitely Written in sway Um so the usual Library can transfer quick And it's because you don't must Wait for the compiler devs so as to add Features so for instance should you're like Oh I've an concept for a library I need a Library I don't know for like tremendous Scientific Edition with like 27 decimals Let's say you may simply write that Library after which it'll simply work so that you Don't have to attend for the official Compiler group to love construct that in and Add assist for it you may simply write That Library your self so as a result of the Language is lean it's in a position to transfer a lot

More shortly As a aspect observe we have now a grants program And right here on the hackathon we have now a Booth over on the like type of in that Little nook earlier than you go into the Main stage so if there's one thing that You construct right here and also you're like ah we Kind of wish to prolong this or we we Just had an incredible expertise and we wish To construct one thing else the grants Program simply opened up perhaps a month in the past So Um it's like tremendous open for tasks There's about I wish to say like 15 to twenty tasks constructing proper now on gas Through the grants program which is Really enjoyable and since it's such an Early developer ecosystem nicely a minimum of For me what I believe is cool did it work Oh good yeah um it's like you may have Like a fairly heavy hand in like and constructing the developer Ecosystem as a result of it's so early so Imagine being like one of many first 30 Projects on ethereum that's type of the Vibe proper now the place it's like we're Still tremendous early in standing up the Ecosystem so when you have an concept you may Be like the primary X so proper now we have now The first group constructing in Oracle on Fuel which like you recognize by a later Stage venture like they've already completed That so any concept that you've got it's very Likely that you simply're type of the primary

Person that's constructing this out within the Fuel ecosystem so simply to know and we Support by means of grants and we're Building out this accelerator program to Connect groups with VC funding if that's Something that they wish to pursue to Connect them with like authorized and Marketing in the event that they wish to like pursue Kind of turning this into an actual firm Or should you're identical to I simply wish to Build some cool and get a grant to Support it that's additionally like a choice That we have now Okay so the opposite factor about having a Standard Library so like solidity for Example doesn't have a normal Library So you recognize should you've ever tried to love Do an erc20 or erc721 what individuals Typically do is that they go have a look at like a Bunch of massive like or you recognize The massive type of orgs and see how they've Done it after which they attempt to deduce and Kind of like piece collectively what the Best method to do it's so with sway you Have this like single supply of For sure issues as an alternative of getting to Compare the the code at like seven Different orgs wrote to have like a Custom erc720 implementation or Something like that The different factor that we have now that's Really cool and type of the overarching Uh Thesis or concept round that is like

Everyone who's written in Rust loves Rust such as you you've by no means met somebody Who writes and rests and so they're like I'm going again to love no matter Everyone's like rust like I really like It and there's a cause why proper you Have this like built-in kind security you Have this compiler time uh stuff the place Like yells at you at compile time it Won't even allow you to deploy one thing that Has these points so that you type of harness That in an adversarial setting like Blockchain the place you're coping with Real cash you're coping with actual Assets you wish to be in a language in An setting the place one thing is saying Hey on line 36 like you could have XYZ we're Not even gonna allow you to construct this Contract a lot much less deploy it till you Address it so these are the following few Things I'm going to speak about is sort Of how we do this so the very first thing are These issues known as generics in some Types so generics should you've ever written Like in C plus C plus plus or one thing Like that you recognize you can type of Like Define a however not Define The kind straight away you may simply say Like for any kind after which in a while you Can truly use like int or like string Or no matter it's so let's simply say for Example Edition you may write a operate Called add after which use a generic kind Because you're saying I would wish to

Reuse this Logic for each ins and floats So as an alternative of rewriting the operate Twice you may simply use this generic kind So you can mainly reuse logic Without having to rewrite code after which The second portion of that is some sorts Which is type of like unions the place it's Like one or the opposite so let's say you Have this enum known as end result proper and You might have in a end result you possibly can Either have like a profitable or a not Successful these are that will be a sum Type so if you put these issues these Two issues collectively it means that you can I want you possibly can be Um okay So should you can think about these two issues Together the place like you may Define the Types later and you've got these subtypes Where it's one or the opposite what occurs Is that you simply don't must in solidity You must rewrite this for each Single kind you wished to to apply it to That's the very first thing after which should you Wanted to have related logic the place You're like one or the opposite You wouldn't have the ability to do it within the Same approach and I've an instance up right here So perhaps when it's working we will come Back to it and also you guys can see okay the Other factor is specific error dealing with So should you guys know in solidity the EC Recover operate do you guys know that One okay do you guys know what's going to what

It will return if a signature is invalid It returns a zero simply returns zero it Returns zero handle so what it's a must to Do as a developer when this occurs is That it's a must to go in and it's a must to Check for the zero like it's a must to Remember say it's a must to say like if Zero like no matter do do that to deal with The error and what does that imply proper Like you possibly can overlook you possibly can not know Or you possibly can identical to straight up I don't know simply not deal with that case Just not even out of not remembering you Could simply not do it Um so what meaning is that you simply would possibly Have this like variant path the place you're Not truly dealing with an error case that Could be very problematic and in sway we Have specific error dealing with so You can't see it once more however like with the Results that I used to be speaking about within the Last slide we're speaking about Successful or like non-successful you Can truly wrap the return of issues So as an alternative of uh should you simply attempt to Like run this code and it returns Nothing and also you don't deal with the error Sway will inform you that you simply're not Handling the error first at compile time It received't allow you to construct your contract It'll say you haven't completed it after which Two it forces you to name this technique Dot unwrap on it to truly see what The error is to truly like entry you

Know to entry one stage in So in solidity it's a must to manually Remember in sway it's completed on the Language stage on the compiler stage it Won't allow you to construct it received't allow you to Deploy except you truly deal with all The errors explicitly so once more like what Does this result in say for code higher Applications for finish customers The different one is kind inference oh did It work a glitched over right here no okay Type inference with the identical kind system As rust so mainly it could actually infer the Type so regardless that you're writing in Rust which is sort of a language the place You're pondering of sorts on a regular basis You can simply say let's for instance let Answer equals 42 and the kind can be Inferred so that you don't must say like You know let like int or float or Whatever it'll simply infer what's on the Other aspect of the equal signal The factor that I believe is basically cool is This idea of namespace storage entry So you recognize for instance in solidity you Might have like a storage variable let's Say known as depend and you then may need An area variable known as like CNT or Account underscore or one thing like That like a nomenclature the place it's Similar since you they're associated in Some approach in your code and that's why you Name them like that however they do Different issues one entry to storage

And one doesn't and sway not solely do you Have to outline the kind of storage Access {that a} operate has within the precise Function definition itself so that you say Read or write or each or simply write or Just learn And in order that's the very first thing you could have To Define if you outline the operate And then two if you're truly Wanting to entry storage the best way that It's completed is storage Dot after which the Name of the variable and so what does That imply two issues is one if you're Writing for you as a developer who's Writing and any developer that's maybe Using a library that you simply wrote It's Explicitly clear what kind of entry to Storage these capabilities have however quantity Two is you'll by no means type of have this Error of such as you by chance entry Storage otherwise you entry storage in a approach That has unintended results since you Didn't essentially know you have been Accessing storage we're identical to attempting To reference a variable that you simply would possibly Not have identified was truly in storage So with sway it's tremendous specific the place If you wish to entry storage you could have To use the storage key phrase and if for Example you didn't Define that kind of Access on that operate and it received't Even let the developer do this it'll Just at compile time it'll simply not work It labored very nice yay

I believe you guys can see this massive now Okay Um that is what I used to be speaking about for Generics and Sun sorts so should you see This uh end result once I'm speaking about Explicit error dealing with So that is the end result I'm speaking about When I'm speaking about uh specific error Handling you are able to do this unwrap technique On end result to truly entry what was it Was it okay or was it error in order that's What I used to be referencing earlier after which This is the express error dealing with That's type of what I imply once I say it Forces you to name this technique unwrapped To truly see the error okay we're Going to hurry by means of this oh so this Is what I meant once I say entry uh so Here you're truly saying this Function increment has each learn and Write axis whereas this storage solely has Read entry to storage Okay exhaustive sample matching so a Match assertion to exhaustively Enumerate all doable instances and the Compiler will inform you should you miss a Case so mainly as an alternative of getting to Like once more manually keep in mind to do a Bunch of if else's like if it's true if It's no it's not true if it's seven if It's ten if it's 24 if it's like 100 you Have to manually keep in mind to love write All these if else branches however with sway You have exhaustive sample matching

Which is that this match assertion which you Can look in our docs however mainly it'll Tell you that should you miss a doable Path so once more how do you write extra protected Applications how do you make it safer For your customers to be utilizing it and never be Kind of on the will or the whim of like A developer ensuring that they cross All their T's and dotted all their eyes You use one thing like sway okay Re-entrancy that is essentially the most thrilling Feature that we have now arising so that you Guys all know what re-entrancy is okay Uh so I received't use this Um so right here's this checklist that I discovered or Actually John discovered which is like this List that's maintained of all of the Re-entrancy assaults at present and you'll See the final one was September thirtieth and That's solely as a result of I screenshotted this Around that point there may need been Another one since then Um however with sway on the compiler stage It'll name out when you have a possible Re-entrancy vulnerability so it'll say On line 36 you could have you recognize a possible Re-entracy vulnerability please handle It so everyone knows what it means however I'll Kind of simply go over it for perhaps individuals Who don't know you may need the case Where it's like you could have a operate Where let's say on line 27 you're you're Sending some cash after which on line 28 You're flipping some Boolean to let the

Program know that the cash has been Sent proper in order that's how you possibly can be One approach that you possibly can be weak to Re-entracencies as a result of somebody might Just hold calling some operate that Keeps attending to that first line of the Execution of that operate the place it simply Keeps sending the cash again and again But by no means truly makes it to that line Where it flips the Boolean to true or False or one thing like that in order that's Something that the compiler will name Out and once more it received't allow you to construct Your contract it received't allow you to deploy Your contract till you handle this so With sway this checklist ought to be zero this Re-entrancy assault won't ever occur in Sway Period Um so okay Fork is the gas orchestrator It's the equal of boundary cargo Npm so it's what does all of the payments Manage dependencies deploy format exams The language server So I type of made this map to type of Show like a part of the the draw of gas Is not solely all of the issues we simply Talked about however it type of unifies half Of the developer ecosystem and the Developer tooling in order that as an alternative of Having to depend on this like type of Fragmented ecosystem proper the place one Team constructed Foundry one group construct coronary heart Had one tree one group constructed the evm one

Team constructed solidity one group you recognize That's like all of those totally different Things that you simply type of must make Them work collectively as a developer you Have to work with like versioning you Have to be sure that every thing's Talking to one another that nicely we Feel we're like let's simply construct Everything in-house and be sure that Everything's at all times maintained as much as Date so for builders and that's what I'm going to indicate you right here you don't Have to fret about putting in ethers Installing wagme putting in Foundry Using onerous hat copying and pasting your API like all these totally different items to Make it work Oh okay now let's simply Speed Run uh Writing a Dap on area are you able to guys see My desktop proper right here okay cool Um so that is following The developer fast begin which I'll Pull up right here simply so you may see you go To gas.community you hit learn the docs Developer fast begin so we're going to Follow this so should you don't uh you recognize If we don't get by means of it or no matter This is how you are able to do it so we're Literally gonna speedrun this child so You simply have to put in the remainder software Chain set up the gas software chain and Then I'm simply going to go forward I Already put in that clearly so I'm Just going to start out so I exploit warp as a

Terminal by the best way should you don't use it You ought to test it out it's cool Warp Yeah it's actually cool for lots of Different causes uh so what I'm gonna Do is I'm gonna make a brand new Uh thingamabob a brand new thingy then I'm Gonna make a brand new venture so the best way you Do it's Fork new after which I wish to Call it one thing I'm going to name this One counter How about now are you able to see my vs code Though Okay I'm gonna zoom in Okay cool so now We did Fork new after which the title of the Thing I simply known as the counter so if You open this we have now a predominant file this Is the place we're going to be including all of Our code so on this factor we're simply Going to Define a easy contract the place There's a counter operate to increment And then a counter operate to seize the Current worth So I'm going to go right here and simply copy This And then we will speak about all of it proper Okay so the very first thing that we're going To do is Define our ABI now should you have been Building an actual uh like quote unquote Kind of actual venture the best way you'll Do that is you'll Define your ABI in A separate file as a result of the thought is then Another developer might use this library

And say like you recognize if I constructed a Library for like I mentioned like scientific Math or one thing I might simply Define This API after which you possibly can use my API And Define your capabilities however we're simply Going to do it multi function as a result of uh Time But let me Just copy this entire factor truly And then we'll speak about it Delete Copy Okay there cool so the very first thing that We're doing is each sway contract Starts with defining what kind of file This is as a result of you may have a contract You can have a library which is what I Was speaking about the place you'll simply Define your API in one other file that Would be a library you may have a script So that is we're defining a contract so You'll see it was cool I actually like This I'm a visible particular person is that this the Storage variables are type of grouped Together on this object like you recognize Syntax should you're coming like from JavaScript which is very nice as a result of Then you possibly can have like one other one Another one and so they're all collectively Visually so you may simply scroll to the Top and be like what are my storage Variables Then we outlined our ABI that are simply Two capabilities increment and depend so

Here you see there's truly no Function physique that's what you'll Implement in your precise contract however Like I mentioned we're doing it on the identical File only for simplicity's sake so Here's the place we're implementing counter So we Implement uh this one which's simply Count which simply Returns the worth of Counter which begins at zero This is the equal of this by the Way So that is shorthand we don't want the Word return and you then don't want the Semicolon And then right here increment does the identical Thing it accesses the counter variable In storage takes the present worth and Adds one So we're going to go to terminal Fork construct make certain oops Fork construct Make positive it builds nice So now the following factor that we're going To do is we're going to construct a entrance End for this so there's truly an element Here to check to write down exams however we're Just not going to try this as a result of we Don't have time uh Uh then we're going to deploy our Contract I have already got take a look at cash I'm Just going to go forward and do that So right here should you guys can see it says Fork Deploy hyphen hyphen URL and it's that Graphql endpoint that I used to be speaking to

You about as a result of once more like I mentioned That's the place you truly deploy so it's Not a Json RPC endpoint Uh so this this half that we're speaking About Oh it's high-quality it simply was creating a brand new File Um so this half that we're gonna go Through is like type of janky proper now Because So Fuel and sway usually only a very Early like we simply did take a look at web perhaps a Month in the past so there's nonetheless a bunch of Parts which are in growth the pockets Part is a kind of issues so that you sort Of have to do that manually for now however In the close to future you'll have Um like a browser extension pockets like Everything else I'm gonna do Fork pockets List to indicate me all of my pockets Addresses which I solely have one so it Says Please present the handle of the Wallet you wish to signal with I'm going To go it in it's going to provide me this Transaction I am going again right here Fork pockets Sign go that in after which index 0 Because Here this handle is index 0. proper right here The zero that's the place that zero is Coming from and the trail do my password And then it provides me again a signature Then I give that again right here Okay I do know that was rather a lot however it received't Be like this eternally you then copy your

Contract ID I'm simply going to place it Um I'm gonna put it right here So I don't lose it Don't have a look at my notes then Um yeah okay cool So now let's return right here we now it's uh Deployed to the take a look at web we have now our Contract ID so now let's go forward and Build a entrance finish for it so this type of Shows you ways to take a look at it on the Block Explorer which we're not going to do now We're going to create a react venture in The similar folder so we're going to CD out One so we're within the massive folder after which We're going to stick this during which Creates a you recognize react venture for us And then after this masses we're simply Going to put in two issues one is fuels It's the umbrella bundle that features All the principle instruments pockets contract Providers extra after which the gas chain Which generates your apis for you So I'm going to go forward and replica this While that masses Okay we're working like one minute over Time however I misplaced a couple of minutes so it's Fine I really feel like I can go over a number of Minutes yeah okay cool So now we're going to enter the entrance End that was simply created we're going to Install the 2 issues that it desires Which are listed right here Cool

Okay now the following factor that we're going To do is we're going to generate our Types and this will get completed robotically With the sunshine with the packages that we Just put in in order that's how we're Installing them as a result of we wish to be Able to run this command that may Automatically generate sorts so if let's Say you replace your contract such as you're Building your entrance finish you're like I Want so as to add one other operate or like Whatever I wish to replace my contract You go make that contract you redeploy It after which by working this command It'll regenerate your sorts Automatically with out you having to love Verify your contract copy the API paste It in your entrance finish it'll simply get completed And imported uh robotically so I'm Going to repeat this however with out this Okay after which right here I'm going to vary The title as a result of right here I known as it Counter as an alternative of counter contract so Uh this there can be a observe on this in The fast begin however it's just like the title Of this so counter And then if we run this You'll see efficiently generated 4 Typings completed Cool so now what we're going to do is We're going to create so that is one other Part of the factor that I'm saying is Janky that you simply received't must do So we're going to create this file

Called create pockets.js which mainly Makes us that you simply create a pockets in Your entrance finish so you may signal these Transactions Just going to repeat this Paste it in save after which simply run node Create pockets.js And then I'm going to repeat this as a result of I'm going to want this Close your eyes Okay Great so now let's go to our entrance finish Project supply app.tsx and we're going To paste within the code from right here Nice okay are you able to guys see this could I Make it larger smaller It's high-quality okay I'm simply gonna fast repair This I simply has the incorrect so that is Counter contract that's simply the title of The venture from the short begin right here we Just name it counter so we're going to Update that very same factor right here replace that Quick Fix Okay cool so let's discuss Through what this appears like actually Quick so right here on the prime we have now our Contract Factory and right here what we're Going to do is we're going to stick in Our contract ID and our pockets secret so Our contract ID is this primary one which We received after we deployed the contract Our pockets secret is the non-public key From the uh pockets that we generated in The entrance finish so I'm going to stick that In right here

Great uh the opposite factor I'm going to do Is I'm going to go get some tokens so This doesn't fails from the tap so I'm simply going to kind in faucet I'm Going to get some cash actual fast Great see how briskly that was by the best way Um Great so now we have now this So this is rather like a easy depend Thing proper right here we have now a button Here we have now a button the place are you butt In right here however anyway after we click on it on The entrance finish it calls this operate Called increment which is outlined right here And that is the way you truly work together With your contract so await Contract.capabilities.increment and we all know It's increment as a result of it's outlined as Increment right here so if this have been known as Like apple that's what it might be Called there Uh transaction parameters we're passing The fuel worth to 1 as a result of it could actually't be Zero after which we're doing Dot name So that's how we like truly work together With the contract so that you see you don't Have to put in wag me otherwise you don't have To set up ethers.js you don't must Install like exterior dependencies to be Able to get your contract and your entrance End to speak to one another it's all constructed In and unified within the tooling that's Created by Fuel apps uh after which right here we Want to so keep in mind we have now two

Functions one which increments and one That simply will get the present depend so We've known as increment now we wish to Get the present depend so right here await Contract.capabilities.depend which is that this One proper if the title was one thing else It could be one thing else however it's Called depend in order that's how we reference It dot get So now let's save this Let's run this Okay and that was it so that you see proper Like the factor that I type of wished to Highlight is should you've ever developed Apps for ethereum I used to be actually simply Let me see if I can open it up I used to be Literally simply attempting to write down one thing For the evm the opposite day and identical to I couldn't even get the compiler Versioning to love work with the factor I Was attempting to write down and I received actually Annoyed and I identical to gave up kinda But like with gas the factor that I Really actually like about it's that you simply Have this like approach approach higher developer Experience and also you don't must deal With like puzzling puzzle becoming all The totally different items to work like we Just did so this slide let me simply present You like final final two seconds so this This slide we changed this entire factor Right like we didn't want to make use of onerous Hat or truffle or Foundry or brownie or Anchor we didn't want to make use of web3js or

Ethers or anchor And then we didn't have to make use of the graph Um like we simply eliminated three like key Kind of items that it's a must to often Finagle with to get one thing to work And all of it simply was built-in instantly Uh final thing I wish to say Is listed here are some sources in order for you To test it out extra the primary hyperlink or The first QR code is one thing known as Awesome gas which is mainly this Resource the place you will discover all of the Articles podcasts tweets like all of the Best stuff about gas publicly after which The second one is the gas ebook which is The developer useful resource with the short Start with with the sdks and All the totally different stuff that you possibly can Want And lastly thanks my title is Cami Emily proper right here is from the compiler Team if you wish to discuss to her about Compiler stuff and sway stuff and like I Said we have now a sales space on the entrance and Yes thanks