{"id":"-AWep7dLSXo","title":"Your First Daml Contract: Intro to Canton's New Unified Docs + DPM","description":"New to building on Canton? This is where you start.\n\nIn this video, I walk through Canton's new unified developer documentation and show you how to write your first Daml Smart Contract from scratch using DPM (Daml package manager). By the end, you'll have a working contract, know how to build it into a DAR file, and run your first tests, all from the command line.\n\nWhat's covered:\n- Tour of the new Canton unified developer docs\n- Installing and using DPM (dpm new, dpm build, dpm test)\n- Writing your first Daml template (signatories, observers, and choices)\n- Running Daml Script tests locally\n\nResources:\nCanton Unified Docs: https://docs.canton.network/\nDPM: https://docs.canton.network/sdks-tools/cli-tools/dpm#dpm-daml-package-manager\nDeveloper Hub: https://github.com/canton-network-devs/Canton-Developer-Hub","channel_name":"Canton Foundation","published_at":"2026-06-02T17:02:09.000Z","thumbnail_url":"https://i2.ytimg.com/vi/-AWep7dLSXo/hqdefault.jpg","transcript_text":"Hey everybody, welcome to this video and in this particular video we will be writing our first Tamil smart contract and build and test it using DPM which is the Tamil package manager. Now if you're somebody who is just getting started on Canton network by building your first project, the first place you should come to is docs.canton.network. It is an official documentation to build on top of the network as well as find all the tools and SDKs. Now, if you are the first person here, you should go to the app development category where you will find different modules available that takes you the entire life cycle from 0 to 100 about building on Canton. If you're currently sitting in a Ethereum hackathon thinking about building your first Canton project, model 2 is specifically for you. So you can compare the different nuances of Ethereum versus Canton, whether it's the privacy model or whether it's the different paradigm or nuances in a smart contract language. In this particular module, you can go through the entire page to build your first project. But in this video, we will be writing our first Tamil smart contract and use DPM to build and test it. Now you must be thinking what is this DPM that this guy is talking about. So now to talk more about DPM. DPM is actually DAML package manager. It's our CLI tool that we use to build and test our DAML smart contract. But it also allows you to interact with your smart contract to play around with it. It has all the tools and the resources available to inspect your smart contract and basically do everything possible as as a CLI including having different components to have different features. So I feel like this is something that we should get started by and write the first Tamil contract and you know what it's time to go to the actual demo it let's come back to the VS code window that we have set up okay so now we will just install it now for me DPM is already installed so it might just come back install uh the latest version of DAML SDK but I feel like I already have the DL SDK with the latest version if not then hey you can never be super updated it all the time. Am I right? So, let's wait for it to get installed and come back when it is done. So, it's still getting installed as you would see it. Latest SDK version of for DAML is 3.4.11 and it's downloading the whole SDK and you know it's at 445 pretty fast, right? So, it's getting installed and let's wait till it get installed. I think it's a good time to take a transaction like and it's installed. Now it says please add DPM to your path. And after that successfully, you'll be able to use DPM. But since I already have it in my path, I don't think I should need to do that again. I'll just type DPM version. So when you say DPM /v, it gives you the version of DPM available in your system here. But if you want to check specifically what version of TAML SDK does it use, we will use TPM version. And when you type this command, it gives you the DAML SDK available. And is in the green, it shows you the active version that you'll be using in your YAML file. When you're creating a project here is 3.4.11. So we super updated and that's a good thing to go. So now you would ask me what to do now. So let's explore what DPM does. So when you type DPM, it gives you a list of all the commands available. So I would say never a good time to explore a command now, right? So DPM commands have installation the meta commands. Then you have the DPM SDK. So you build a certain TL file into a DAR which you use to upload on devet test net. Then there is a sandbox command available. a canton console committing to a remote participant and you can do a sandbox environment clean just clean a package uh code generation Java compiler JavaScript compiler is also there so no matter who you are there is a place for you all already when you are trying to develop it my personal favorite is damc it is compiler and ID backend for daml programming language so it is a good place to be and it basically decouples everything and you know what let's talk about it when we you even use it. The one that we would be using is new. So, dam DPM new gives you a list of templates that you can use to start your first project scaffolding, you know. So, let's go. We will sort of go all the way down. I want to clear this hole just to get the mess out. We will say DPM new list. So when we type dpm new list, it gives you a list of all the available templates already available right. So it has Tamil intro choices, compose, constraint, Tamil scripts and whatn not. Empty skeleton to get started, finance life cycle, pay of modeling, settlement, upgrades, multi package, quick start, finance, kickstart, Java script, skeleton so much, right? So but since we are making a demo, we will do everything from the scratch, right? So we will be creating a sample smart contract simplest ever Ellis and Bob the classic demo names like you know John Doe but Ellis and Bob for DAL just make a normal invoicing plan DL smart contracts where you can either pay accept or debate you know a certain invoice with each other and we'll add some testing use cases and then we will use DAL build and DL test to see how it all works together so but we need to get started how do we do that we will use the DPM new. Now we will add the name of the project that we want to create in this target folder here is let's just say demo uh J. Uh my name is Jatin my short form is J. And then we will specify which template do we want to use but since it's a demo I just want to do everything from scratch. Well I know my way around DAML right. So we will use the empty skeleton and voila we have a new project of dam demoj. It already gives you all the files needed attributes get ignore and ignore everything. The main file that we need here is daml dot the yl file. It specifies the dpm sdk version the name source version of the dpm. It gives you all the scripts available. Now it's actually a good thing because now you don't need to worry about you know version mismatch and whatn not and that's why I use this particular feature and I would advise you to do the same. So let's again clear the terminal. It gives us a good room to breathe. Let's zoom out so we can look at the code and we will create a new file in this. Let's come to the main fger here. We will uh you know not this one but here we'll create another subfolder called as Tamil because that's a source and inside the Tamil folder we'll create like invoice dot TAML and now we have a new Tamil file generated and we need to start coding. So if you really want an extension that helps you basically code better in DAML you can even go to the extension type DAML like this and I'm pretty sure it will give you this one. So this is a DAL by digital asset uh holdings LLC. It helps you to trust more and like build better in Tamil. But you also have a uh like de AI coder by the tenzo. I would say this is also pretty much good like an AI powered dam smart contract assistant and this is also something that you can try. Then we have one from lime chain like a daml formatter. You can also use this if you want to start coding in daml right this is not something let's try out this one but uh yeah we have more so as you would see we already have some extensions available but in our case I am just going to uninstall it all I want to show everything on the at scratch as possible so you know what no shortcut for us normal raw code in front of you me you typing out the code right now. Okay. So let's get started. Module. Uh so we start a DAL code by in specifying a module invoice where if you start learning DAML you will realize a lot of it is lesser than loops and functions and logics and more of about defining the axis of things or like access control logic. So that's why DAML might feel a really good space for you if you're coming from a very complex solid rest background and it is a really good language if you ask me you know. So let's import now. So as you would see we already have module invoice where now we will start the whole DAL smart contract. So now we need to say daml script or we need to import daml script here because well it's very important and these are the major two things that we need to be done. And now our main thing is going to be to squeeze the logic the use case into actual DAML access way. But how that looks like is you know what let's get started anyway. So in DAML instead of functions and whatnot we have templates. So instead of calling smart contracts we call templates right? So we start by thing called as templates. Template would be invoice. Uh nice thank you. And invoice is the template in this case. Now inside the template you need to define the parameters. So our invoice will have multiple parameters. Who is the buyer? Who is the seller? How much of the amount? And uh well is it paid or not? Right? So we need to define all that in as a parameter of invoice. So let's describe the parameter. And you might feel like I'm typing English but to be honest dam it genuinely is pretty good. So let's get started. So template invoice with now we have to describe the parameter. So let's just say we have a seller. We have a buyer. We need to specify amount. We need to define if it is paid or unpaid or maybe the description the description of the invoice like it should be an invoice for construction. So we can just define invoice description, paid amount, buyer, seller. I think that's pretty much enough of parameters that we can get started, right? So now we need to get started with. So a seller would be a party. So if you don't know what a party is, so party is basically the Canton's version of an address, but in a UTXO style. So instead of addresses on canton you get a party ID to well interact with the blockchain. So a seller will be one party buyer will be a totally one party amount will be in decimal. Similarly uh paid would be more of like a condition h like yes or no. So we will define it as a boolean. description would be a text. Yep, I think that's pretty much it. So now we have our first template already ready. As you would see, we have template of invoice with the parameters of seller, buyer, amount, paid bullion of a paid like logic and a description about it. So this defines our first template parameter and just defining of the template. Now it does not end here. Now we need to define where that means that now we have defined like all this like buyer seller and what not. But we need to define who has what access and this access control this is known as proof of stakeholders. This gives Tamil a specific age to actually provide the best access possible and privacy on the smart contract level. So let's define signator. So signatory should be the seller uh because seller is selling the whole thing. Uh then buyer should be the observer right. So yeah we need to keep keep the buyer as an observer or I guess that's it. Server would be buyer. So now we have defined access control of what's the parameter of an invoice what will do what and how much access. The signaries are basically the admins in a way where they are the ones that needs to sign for an action to take place where observers are the one who are allowed to see the change of the the state of the smart contract. the things get emitted, the events get emitted, how things actually get executed and the and the basically everything that leads into the whole smart contract, you need to be an observer to do it. Observer, signary, everything in between. But if you're not everything in between, you can't see anything. And that's what makes Canton's privacy model special. So you're basically seeing the whole proof of stakeholder mechanism in real time, right? So let's move ahead. Now in template we everything is defined. Now it's a time to make sure that nobody gives a negative or a zero invoice, right? We can use insure um insure amount insure amount should be more than I guess 0.0. So this basically what what it does here is that it ensures that whatever invoice amount that uh you declare here should be more than zero. So this basically protects our invoice from all the people who want to create like a negative or a zero invoice. We definitely want a positive numerical as an invoice. Even if I want to get an invoice of 1 cent, it should be 1 cent. An invoice of $0 doesn't make sense, right? Um even 0 CC doesn't make sense. But yeah, this is the first structure. So congratulations. We are able to not only code the whole thing but we are also able to define what a template looks like, how signature and observer looks like and even how we would define parameter inside it. Right? Isn't that cool? Now we need to move ahead into the next part of a Tamil smart contract which is the functions. Wait smart contracts like solidity has function. So what's the daml version of that? We have something called as choices. So choices is something that you define inside the template that acts as a function. You can define logic, you can define loops, you can basically define how something should react in a way uh using the choice. So we will write our first choice here inside the whole uh template, right? So let's get started. Choice, right? So now choice is basically what functions are for in DAL. Now we need to okay uh just want to make sure it's inside the template. Uh so now choice would be that um a buyer needs to pay the invoice that the seller is uh putting out there and uh it should basically just come back with a receipt once they pay with it. So yeah, I mean so let's do two things. We will be adding two choices. Either a buyer can pay an invoice uh or can dispute uh with it. Right? So if there is a dispute within the whole thing, then there should be a way to dispute or raise a concern or if it it's called good, it needs to be a pay. So what I'm going to do here is define a choice or a functionality of paying it and then we will just move forward to define the dispute. Right? So I would say choice pay contract uh ID of receipt. I would say that is pretty much it. So we need uh the pay once you pay basically then it should have received that uh you have already paid with the contract ID. I think that basically makes sense. So that should be how the flow looks like. And as you move ahead about like code. Now we need to define the controller who is the buyer. Now you would ask me Jatan what is a controller? Now we have a signary and obser what is the controller? So this particular choice has to be controlled by the buyer because buyer is the one who is actually deciding that if they are paid using the invoice or they need to pay the invoice right in any condition like that buyer is the one that needs to put the final word here. So we need to define the controller as the buyer to be able to control this whole thing. Right? But what would they do? Uh nope. Do not recommend me this description. We will now type do. H jeez. Uh yeah. But okay, Jan, this is Isn't this pure English? Well, I told you DL was simpler, right? You didn't believe me in the first place. Now, controller is the buyer. Now, what should this choice do? Now, here is a chance to define the logic inside this function of what would this function do in the first place? Now if I am okay to pay then it should create a receipt then I'm done with the payment right so what we will do is create a receipt it should create a receipt with again when whenever we say with we have to define the parameters that we want to be inside of it right so once a receipt is generated we would want to have of course the seller you want to have the buyer we want to have the amount I guess uh we also want to have if it is paid so if it is paid uh I think it should be defined you know received if it is paid you know what I mean it's any paid so we need that so you know what we can go with description so if it is already paid we don't need to define the boolean right yes or no because it is already paid so who is the seller who is the buyer how much was the amount and what is the description like what is the invite is for that would do it. Uh okay. Now we have officially paid the Tamil export in the room. So now another choice is dispute the whole thing. It should also come with contract ID and dispute it. Invoice should be the return. Yeah, invoice should be the return. So for example, if somebody is disputing your your invoice in the first place, then I think it should return with smart contract ID and the disputed invoice, right? So here the controller needs to be the seller in a in a way. Um but anyway, I think we don't need to define that because it is a dispute, right? So we just need to define what the disputed invoice should have as a parameter I guess but at the same time we need a reason why it got dispute in the first place. So I think the best would be uh to have a reason into this whole thing. So we need to have a reason that would be a text here. So we need to have a reason of why it got uh like you know disputed in the first place. And now we define who is the controller here. Controller is again the buyer because buyer is the one who is actually putting the dispute. So controller has to be the buyer. Now when the buyer is the controller, they are basically giving you a reason and uh and after the reason all you are doing is just come back with a dispute uh invoice back to the seller and that is what we need to define right. seller, buyer, pretty much the same thing. Uh, of course, the description of the invoice and amount in the invoice. Uh, I think the reason that we will define when we want to dispute it, that should also be a part of it. But that said, now we have officially wrote a proper dam smart contract code. And uh, I mean, pardon me if I'm looking like this like this because I'm talking to you guys and I'm also writing the code at the same place, right? So it got to be the human interaction here. But coming on to the whole thing. So what did we learn in the end people? We have wrote so much code right. We have a module. We have an import demo script. We defined our first template which was the invoice with the parameters and we defined the access controls. We ensured that it should be more than zero. Of course it should not be negative or zero. We defined our first choice which is a functionality that if I'm okay with the pay then here is the pay you will get a receipt of the pay but if I want to dispute the invoice then I should have a reason and you are just giving me seller buyer description amount and reason back right uh this is definitely not the whole DAL smart contract but you would see how you would define a choice and a template and everything up now I'm going to complete the rest of the smart contract so you know we don't need to waste time here like And like this the whole smart contract is complete. To be honest, it took me like almost close to five more minutes to do this. But well, it's a demo. Now what we have done rest is defined a template structure of what the receipt would look like. We have defined a template structure of what would anuted invoice would look like everything else. Then what we have done is so when you write a DAL smart contract you need to define some test scripts in the DAL smart contracts accord against which you can test if everything works right or not right for example we have a new testing flow here that you would see the testing flow says that you will identify the script if the parties Alice and Bob right then you would define the whole seller should do this this this define the services in Q1 then you have a receipt ID that should be submitted by the buyer and received ID should be queried and buyer should have a receipt ID that which is verified and if it is not found that means it is not right and sincerely we also add one more submit must fail so I mean to be honest an amount should not be a bad invoice I don't want to have like a negative invoice for example something like minus $100 doesn't make sense so even though we have insure using the insure amount but you know it doesn't hurt to add a stress testing in terms Right. So I would say we have a pretty good Tamil smart contract here. So what we would do is we need to take our terminal all the way up here. So because we are done with the Tamil script now we need to use the DPM to take it next in the action. So let's get started on this one. Basically now we need to CD into the target file. So our target uh project is inside the demo. It is known as demo j where our whole daml file exist. So let's go to cd demo j and yep we are at a good place. So the first thing that we do is to try out dpm build. So what dpm build does is convert your whole damage smart contract into a dar file. Um yeah I mean it basically does that. So the dart file will be used to push onto the ledger using an API call with your ledger API to be able to deploy on top of devet test net mainet. Right? So we'll click on dpm build and let this whole smart contract convert into an actual d file. So as you would see it ran smoothly uh just here and here warnings but well we are the coders we don't care about the warnings do we right? But what to think about is created the DAR file here. So we will go to TAML. We'll go to list and then as you would see here we have a DAR file that we can use to upload on the ledger. But uh that is the least of our issues right now. Come back to it. Uh happily completed with the Tamil belt. Now we need to test if the whole thing is good. If there are issues against the Tamil contract or not. we have returned some test scripts that will help us identify that. So for that again pure to keep it pretty simple we'll use DPM test. So DPM test basically use all the test scripts that we have written to create test. You can get a test summary here right. Internal templates three defined two exercised internal templates choices five defined one exercised and why one out of five is because we have only written scripts for the pay not for the disputed not for the archived only for the pay because it's a demo. But you can write write more complex testing scripts to give better testing and debugging experience. And overall we have 100% 100% 100% external test. Um so we have passed this whole thing with the flying colors. Now DPM test DPM built you have a DAR file you have a DL smart contract which is totally built and this is why I love DPM because it makes building on top of content much more easier in a lot of ways. You can actually use the the rest of one of the commands that we were talking about is dpm command known as dpm le which is basically a compiler and ID back end for your daml language. So we will use dpm and I'm just going to show you what happens dam. So when we type this you need a command dpm daml lacag and now you need to invoke the compiler but uh okay so we need to define the path where your dar file is installed to be able to use this you know but uh let's see it in action right why hesitate since you're already this far um and uh let's see it in action and damc so now one of the things that I love about damc is inspect tar. So what inspect tar does is basically just decouples your tar file. It gives you every dependencies, every package, but most of all it gives you your package hex string. Not the name, not the version. Your package hex is your identity on the canton ledger. And instead of going around in the binary or trying to fetch it from the ledger, you can use this. You can route the path of your DAR profile and get it. So let's see that in action as the last thing that we do on this one. Right. So we have DPM DAL lac inspect DAR. Now we need to give the root for the DAR. So dar is currently available in daml uh slash test uh my bad test slash we have the name of the dar file here we will just going to copy the path and uh well I am really messy but that's what makes me authentic uh in a in a Okay. Um, yes. So, we are since we're already inside the target folder, we don't need to give like the whole path, but we can give this particular path of TAML / test /demoj uh of this path. And I hope this works. Nice. So as you would say it gives us a good uh a lot of things here but it gives you the hex string of almost everything that works you know dar archive contains the following packages. It gives you all the following packages in this one. So you might not know what to make sense of this one but you can just copy paste it into any AI model and ask it to simplify it for you. So it might give you like a temp table format or something of the available packages the hex strings and whatnot you can store it for future references but this is a very like you know useful program if you're working on top of canon and we will clear everything up as always I'll put this whole thing on my GitHub if you want to use it the link will be in the reply of this demo but thank you so much for basically working with me on this demo and to understand how DPM works. TPM is an amazing tool that can be used as the best experience to develop on top of tanton. So, make sure that you try it, build it, and if you build anything, tag me on Discord or X and let me know how I can help you. So, till then, bye-bye.","transcript_synced_at":"2026-10-26T03:51:09.503Z","segments":[{"start_seconds":7,"text":"Hey everybody, welcome to this video and in this particular video we will be writing our first Tamil smart contract","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=7s"},{"start_seconds":13,"text":"and build and test it using DPM which is the Tamil package manager. Now if you're somebody who is just getting started on","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=13s"},{"start_seconds":21,"text":"Canton network by building your first project, the first place you should come to is docs.canton.network.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=21s"},{"start_seconds":28,"text":"It is an official documentation to build on top of the network as well as find all the tools and SDKs. Now, if you are","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=28s"},{"start_seconds":36,"text":"the first person here, you should go to the app development category where you will find different modules available that takes you the entire life cycle from 0 to 100 about building on Canton.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=36s"},{"start_seconds":46,"text":"If you're currently sitting in a Ethereum hackathon thinking about building your first Canton project, model 2 is specifically for you. So you","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=46s"},{"start_seconds":54,"text":"can compare the different nuances of Ethereum versus Canton, whether it's the privacy model or whether it's the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=54s"},{"start_seconds":61,"text":"different paradigm or nuances in a smart contract language. In this particular module, you can go through the entire page to build your first project. But in","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=61s"},{"start_seconds":69,"text":"this video, we will be writing our first Tamil smart contract and use DPM to build and test it. Now you must be thinking what is this DPM that this guy","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=69s"},{"start_seconds":78,"text":"is talking about. So now to talk more about DPM. DPM is actually DAML package manager. It's our CLI tool that we use","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=78s"},{"start_seconds":86,"text":"to build and test our DAML smart contract. But it also allows you to interact with your smart contract to play around with it. It has all the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=86s"},{"start_seconds":95,"text":"tools and the resources available to inspect your smart contract and basically do everything possible as as a CLI including having different components to have different features.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=95s"},{"start_seconds":106,"text":"So I feel like this is something that we should get started by and write the first Tamil contract and you know what it's time to go to the actual demo it","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=106s"},{"start_seconds":115,"text":"let's come back to the VS code window that we have set up okay so now we will just install it now for me DPM is","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=115s"},{"start_seconds":122,"text":"already installed so it might just come back install uh the latest version of DAML SDK but I feel like I already have","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=122s"},{"start_seconds":130,"text":"the DL SDK with the latest version if not then hey you can never be super updated it all the time. Am I right? So,","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=130s"},{"start_seconds":138,"text":"let's wait for it to get installed and come back when it is done.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=138s"},{"start_seconds":144,"text":"So, it's still getting installed as you would see it. Latest SDK version of for DAML is 3.4.11","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=144s"},{"start_seconds":151,"text":"and it's downloading the whole SDK and you know it's at 445 pretty fast, right?","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=151s"},{"start_seconds":158,"text":"So, it's getting installed and let's wait till it get installed. I think it's a good time to take a transaction like","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=158s"},{"start_seconds":165,"text":"and it's installed. Now it says please add DPM to your path. And after that successfully, you'll be able to use DPM.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=165s"},{"start_seconds":172,"text":"But since I already have it in my path, I don't think I should need to do that again. I'll just type DPM version. So when you say DPM /v, it","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=172s"},{"start_seconds":182,"text":"gives you the version of DPM available in your system here. But if you want to check specifically what version of TAML","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=182s"},{"start_seconds":189,"text":"SDK does it use, we will use TPM version. And when you type this command,","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=189s"},{"start_seconds":196,"text":"it gives you the DAML SDK available. And is in the green, it shows you the active version that you'll be using in your","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=196s"},{"start_seconds":204,"text":"YAML file. When you're creating a project here is 3.4.11. So we super updated and that's a good thing to go.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=204s"},{"start_seconds":212,"text":"So now you would ask me what to do now.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=212s"},{"start_seconds":216,"text":"So let's explore what DPM does. So when you type DPM, it gives you a list of all the commands available. So I would say","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=216s"},{"start_seconds":223,"text":"never a good time to explore a command now, right? So DPM commands have installation the meta commands. Then you","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=223s"},{"start_seconds":231,"text":"have the DPM SDK. So you build a certain TL file into a DAR which you use to upload on devet test net. Then there is","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=231s"},{"start_seconds":240,"text":"a sandbox command available. a canton console committing to a remote participant and you can do a sandbox","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=240s"},{"start_seconds":247,"text":"environment clean just clean a package uh code generation Java compiler JavaScript compiler is also there so no","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=247s"},{"start_seconds":255,"text":"matter who you are there is a place for you all already when you are trying to develop it my personal favorite is damc","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=255s"},{"start_seconds":262,"text":"it is compiler and ID backend for daml programming language so it is a good place to be and it basically decouples","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=262s"},{"start_seconds":269,"text":"everything and you know what let's talk about it when we you even use it. The one that we would be using is new. So,","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=269s"},{"start_seconds":278,"text":"dam DPM new gives you a list of templates that you can use to start your first project scaffolding, you know. So,","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=278s"},{"start_seconds":287,"text":"let's go. We will sort of go all the way down. I want to clear this hole just to","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=287s"},{"start_seconds":293,"text":"get the mess out. We will say DPM new list. So when we type dpm new list, it","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=293s"},{"start_seconds":303,"text":"gives you a list of all the available templates already available right. So it has Tamil intro choices, compose, constraint, Tamil scripts and whatn not.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=303s"},{"start_seconds":312,"text":"Empty skeleton to get started, finance life cycle, pay of modeling, settlement, upgrades, multi package, quick start, finance, kickstart, Java script,","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=312s"},{"start_seconds":321,"text":"skeleton so much, right? So but since we are making a demo, we will do everything from the scratch, right? So we will be","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=321s"},{"start_seconds":328,"text":"creating a sample smart contract simplest ever Ellis and Bob the classic demo names like you know John Doe but","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=328s"},{"start_seconds":336,"text":"Ellis and Bob for DAL just make a normal invoicing plan DL smart contracts where you can either pay accept or debate you","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=336s"},{"start_seconds":345,"text":"know a certain invoice with each other and we'll add some testing use cases and then we will use DAL build and DL test","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=345s"},{"start_seconds":352,"text":"to see how it all works together so but we need to get started how do we do that we will use the DPM","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=352s"},{"start_seconds":359,"text":"new. Now we will add the name of the project that we want to create in this target folder here is let's just say","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=359s"},{"start_seconds":368,"text":"demo uh J. Uh my name is Jatin my short form is J. And then we will specify which","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=368s"},{"start_seconds":377,"text":"template do we want to use but since it's a demo I just want to do everything from scratch. Well I know my way around DAML","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=377s"},{"start_seconds":385,"text":"right. So we will use the empty skeleton and voila we have a new project of dam demoj. It already gives you all the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=385s"},{"start_seconds":392,"text":"files needed attributes get ignore and ignore everything. The main file that we need here is daml dot the yl file. It","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=392s"},{"start_seconds":401,"text":"specifies the dpm sdk version the name source version of the dpm. It gives you all the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=401s"},{"start_seconds":409,"text":"scripts available. Now it's actually a good thing because now you don't need to worry about you know version mismatch and whatn not and that's why I use this","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=409s"},{"start_seconds":416,"text":"particular feature and I would advise you to do the same. So let's again clear the terminal. It gives us a good room to","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=416s"},{"start_seconds":424,"text":"breathe. Let's zoom out so we can look at the code and we will create a new file in this.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=424s"},{"start_seconds":432,"text":"Let's come to the main fger here. We will uh you know not this one but here we'll create another subfolder called as","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=432s"},{"start_seconds":441,"text":"Tamil because that's a source and inside the Tamil folder we'll create like invoice dot","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=441s"},{"start_seconds":449,"text":"TAML and now we have a new Tamil file generated and we need to start coding.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=449s"},{"start_seconds":453,"text":"So if you really want an extension that helps you basically code better in DAML you can even go to the extension type","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=453s"},{"start_seconds":460,"text":"DAML like this and I'm pretty sure it will give you this one. So this is a DAL by digital asset uh holdings LLC. It","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=460s"},{"start_seconds":468,"text":"helps you to trust more and like build better in Tamil. But you also have a uh","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=468s"},{"start_seconds":474,"text":"like de AI coder by the tenzo. I would say this is also pretty much good like an AI powered dam smart contract","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=474s"},{"start_seconds":482,"text":"assistant and this is also something that you can try. Then we have one from lime chain like a daml formatter. You can also use this if you want to start","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=482s"},{"start_seconds":490,"text":"coding in daml right this is not something let's try out this one but uh yeah we have more so as you would see we","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=490s"},{"start_seconds":498,"text":"already have some extensions available but in our case I am just going to uninstall it all I want to show","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=498s"},{"start_seconds":507,"text":"everything on the at scratch as possible so you know what no shortcut for us normal raw code in front of you me you","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=507s"},{"start_seconds":516,"text":"typing out the code right now. Okay. So let's get started.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=516s"},{"start_seconds":523,"text":"Module. Uh so we start a DAL code by in specifying a module invoice","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=523s"},{"start_seconds":531,"text":"where if you start learning DAML you will realize a lot of it is lesser than loops and functions and logics and more","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=531s"},{"start_seconds":539,"text":"of about defining the axis of things or like access control logic. So that's why","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=539s"},{"start_seconds":546,"text":"DAML might feel a really good space for you if you're coming from a very complex solid rest background and it is a really","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=546s"},{"start_seconds":553,"text":"good language if you ask me you know. So let's import now. So as you would see we already have module invoice where now we will start the whole DAL smart contract.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=553s"},{"start_seconds":564,"text":"So now we need to say daml script or we need to import daml script here because well it's very important and these are","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=564s"},{"start_seconds":572,"text":"the major two things that we need to be done. And now our main thing is going to be to squeeze the logic the use case","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=572s"},{"start_seconds":580,"text":"into actual DAML access way. But how that looks like is you know what let's","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=580s"},{"start_seconds":586,"text":"get started anyway. So in DAML instead of functions and whatnot we have templates. So instead of calling smart","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=586s"},{"start_seconds":594,"text":"contracts we call templates right? So we start by thing called as templates.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=594s"},{"start_seconds":598,"text":"Template would be invoice. Uh nice thank you. And invoice is the template in this case.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=598s"},{"start_seconds":606,"text":"Now inside the template you need to define the parameters. So our invoice will have multiple parameters. Who is the buyer? Who is the seller? How much","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=606s"},{"start_seconds":613,"text":"of the amount? And uh well is it paid or not? Right? So we need to define all that in as a parameter of invoice. So","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=613s"},{"start_seconds":620,"text":"let's describe the parameter. And you might feel like I'm typing English but to be honest dam it genuinely is pretty","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=620s"},{"start_seconds":628,"text":"good. So let's get started. So template invoice with now we have to describe the parameter. So let's just say we have a","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=628s"},{"start_seconds":636,"text":"seller. We have a buyer.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=636s"},{"start_seconds":642,"text":"We need to specify amount. We need to define if it is paid or unpaid or maybe","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=642s"},{"start_seconds":649,"text":"the description the description of the invoice like it should be an invoice for","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=649s"},{"start_seconds":658,"text":"construction. So we can just define invoice description, paid amount, buyer, seller. I think that's pretty much enough of parameters that we can get","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=658s"},{"start_seconds":667,"text":"started, right? So now we need to get started with. So a seller would be a party. So if you don't know what a party","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=667s"},{"start_seconds":676,"text":"is, so party is basically the Canton's version of an address, but in a UTXO style. So instead of addresses on canton","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=676s"},{"start_seconds":684,"text":"you get a party ID to well interact with the blockchain. So a seller will be one party buyer will be a totally one party amount will be in decimal.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=684s"},{"start_seconds":699,"text":"Similarly uh paid would be more of like a condition h","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=699s"},{"start_seconds":705,"text":"like yes or no. So we will define it as a boolean. description would be a text.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=705s"},{"start_seconds":713,"text":"Yep, I think that's pretty much it. So now we have our first template already ready. As you would see, we have","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=713s"},{"start_seconds":722,"text":"template of invoice with the parameters of seller, buyer, amount, paid bullion of a paid like logic and a description","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=722s"},{"start_seconds":730,"text":"about it. So this defines our first template parameter and just defining of the template. Now it does not end here.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=730s"},{"start_seconds":740,"text":"Now we need to define where that means that now we have defined like all this like buyer seller and what not. But we","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=740s"},{"start_seconds":748,"text":"need to define who has what access and this access control this is known as","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=748s"},{"start_seconds":755,"text":"proof of stakeholders. This gives Tamil a specific age to actually provide the best access possible and privacy on the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=755s"},{"start_seconds":764,"text":"smart contract level. So let's define signator.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=764s"},{"start_seconds":770,"text":"So signatory should be the seller uh because seller is selling the whole thing. Uh then buyer should be the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=770s"},{"start_seconds":779,"text":"observer right. So yeah we need to keep keep the buyer as an observer or I guess that's it.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=779s"},{"start_seconds":789,"text":"Server would be buyer. So now we have defined access control of what's the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=789s"},{"start_seconds":797,"text":"parameter of an invoice what will do what and how much access. The signaries are basically the admins in a way where","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=797s"},{"start_seconds":805,"text":"they are the ones that needs to sign for an action to take place where observers are the one who are allowed to see the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=805s"},{"start_seconds":812,"text":"change of the the state of the smart contract. the things get emitted, the events get emitted, how things actually","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=812s"},{"start_seconds":820,"text":"get executed and the and the basically everything that leads into the whole smart contract, you need to be an observer to do it. Observer, signary,","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=820s"},{"start_seconds":828,"text":"everything in between. But if you're not everything in between, you can't see anything. And that's what makes Canton's privacy model special. So you're","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=828s"},{"start_seconds":835,"text":"basically seeing the whole proof of stakeholder mechanism in real time, right? So let's move ahead. Now in","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=835s"},{"start_seconds":842,"text":"template we everything is defined. Now it's a time to make sure that nobody gives a negative or a zero invoice,","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=842s"},{"start_seconds":850,"text":"right? We can use insure um insure amount","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=850s"},{"start_seconds":859,"text":"insure amount should be more than I guess 0.0.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=859s"},{"start_seconds":865,"text":"So this basically what what it does here is that it ensures that whatever invoice amount that uh you declare here should","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=865s"},{"start_seconds":873,"text":"be more than zero. So this basically protects our invoice from all the people who want to create like a negative or a","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=873s"},{"start_seconds":880,"text":"zero invoice. We definitely want a positive numerical as an invoice. Even if I want to get an invoice of 1 cent,","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=880s"},{"start_seconds":889,"text":"it should be 1 cent. An invoice of $0 doesn't make sense, right? Um even 0 CC","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=889s"},{"start_seconds":896,"text":"doesn't make sense. But yeah, this is the first structure. So congratulations.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=896s"},{"start_seconds":900,"text":"We are able to not only code the whole thing but we are also able to define what a template looks like, how signature and observer looks like and","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=900s"},{"start_seconds":908,"text":"even how we would define parameter inside it. Right? Isn't that cool? Now we need to move ahead into the next part","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=908s"},{"start_seconds":915,"text":"of a Tamil smart contract which is the functions. Wait smart contracts like solidity has function. So what's the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=915s"},{"start_seconds":923,"text":"daml version of that? We have something called as choices. So choices is something that you define inside the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=923s"},{"start_seconds":930,"text":"template that acts as a function. You can define logic, you can define loops, you can basically define how something","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=930s"},{"start_seconds":938,"text":"should react in a way uh using the choice. So we will write our first choice here inside the whole uh template, right? So let's get started.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=938s"},{"start_seconds":950,"text":"Choice, right? So now choice is basically what functions are for in DAL.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=950s"},{"start_seconds":957,"text":"Now we need to okay uh just want to make sure it's inside the template. Uh so now","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=957s"},{"start_seconds":964,"text":"choice would be that um a buyer needs to pay the invoice that","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=964s"},{"start_seconds":972,"text":"the seller is uh putting out there and uh it should basically just come back with a receipt once they pay with it. So","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=972s"},{"start_seconds":981,"text":"yeah, I mean so let's do two things. We will be adding two choices. Either a buyer can pay an invoice uh or can","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=981s"},{"start_seconds":991,"text":"dispute uh with it. Right? So if there is a dispute within the whole thing, then there should be a way to dispute or raise a concern or if it it's called","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=991s"},{"start_seconds":1000,"text":"good, it needs to be a pay. So what I'm going to do here is define a choice or a functionality of paying it and then we","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1000s"},{"start_seconds":1008,"text":"will just move forward to define the dispute. Right? So I would say choice pay","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1008s"},{"start_seconds":1016,"text":"contract uh ID of receipt. I would say that is pretty","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1016s"},{"start_seconds":1026,"text":"much it. So we need uh the pay once you pay basically then it should have received that uh you have already paid","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1026s"},{"start_seconds":1033,"text":"with the contract ID. I think that basically makes sense. So that should be how the flow looks like. And as you move ahead about like code.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1033s"},{"start_seconds":1046,"text":"Now we need to define the controller who is the buyer. Now you would ask me","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1046s"},{"start_seconds":1054,"text":"Jatan what is a controller? Now we have a signary and obser what is the controller? So this particular choice has to be controlled by the buyer","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1054s"},{"start_seconds":1062,"text":"because buyer is the one who is actually deciding that if they are paid using the invoice or they need to pay the invoice","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1062s"},{"start_seconds":1070,"text":"right in any condition like that buyer is the one that needs to put the final word here. So we need to define the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1070s"},{"start_seconds":1077,"text":"controller as the buyer to be able to control this whole thing. Right? But what would they do? Uh nope. Do not","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1077s"},{"start_seconds":1085,"text":"recommend me this description. We will now type do. H jeez. Uh yeah. But okay, Jan, this is Isn't this pure English?","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1085s"},{"start_seconds":1096,"text":"Well, I told you DL was simpler, right?","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1096s"},{"start_seconds":1098,"text":"You didn't believe me in the first place. Now, controller is the buyer.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1098s"},{"start_seconds":1101,"text":"Now, what should this choice do? Now, here is a chance to define the logic inside this function of what would this","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1101s"},{"start_seconds":1109,"text":"function do in the first place? Now if I am okay to pay then it should create a receipt then I'm done with the payment","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1109s"},{"start_seconds":1117,"text":"right so what we will do is create a receipt it should create a","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1117s"},{"start_seconds":1123,"text":"receipt with again when whenever we say with we have to define the parameters","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1123s"},{"start_seconds":1130,"text":"that we want to be inside of it right so once a receipt is generated we would want to have of course the seller you","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1130s"},{"start_seconds":1139,"text":"want to have the buyer we want to have the amount I guess uh we also want to have if it is paid","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1139s"},{"start_seconds":1149,"text":"so if it is paid uh I think it should be defined you know received if it is paid you know what I mean it's any paid so we","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1149s"},{"start_seconds":1156,"text":"need that so you know what we can go with description so if it is already paid we don't need to define the boolean right yes or no because it is already paid so who is the seller who is the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1156s"},{"start_seconds":1165,"text":"buyer how much was the amount and what is the description like what is the invite is for that would do it.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1165s"},{"start_seconds":1173,"text":"Uh okay.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1173s"},{"start_seconds":1178,"text":"Now we have officially paid the Tamil export in the room. So now another choice is dispute the whole thing.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1178s"},{"start_seconds":1189,"text":"It should also come with contract ID and dispute","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1189s"},{"start_seconds":1195,"text":"it. Invoice should be the return. Yeah, invoice should be the return. So for","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1195s"},{"start_seconds":1203,"text":"example, if somebody is disputing your your invoice in the first place, then I think it should return with smart","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1203s"},{"start_seconds":1211,"text":"contract ID and the disputed invoice, right? So here the controller needs to","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1211s"},{"start_seconds":1217,"text":"be the seller in a in a way. Um but anyway, I think we don't need to define that because it is a dispute, right? So","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1217s"},{"start_seconds":1225,"text":"we just need to define what the disputed invoice should have as a parameter I guess but at the same time we need a","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1225s"},{"start_seconds":1234,"text":"reason why it got dispute in the first place. So I think the best would be uh to have a reason into this whole thing.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1234s"},{"start_seconds":1243,"text":"So we need to have a reason that would be a text here. So we need to have a reason of why it got uh like you know","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1243s"},{"start_seconds":1253,"text":"disputed in the first place. And now we define who is the controller here.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1253s"},{"start_seconds":1257,"text":"Controller is again the buyer because buyer is the one who is actually putting the dispute. So controller has to be the buyer. Now when the buyer is the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1257s"},{"start_seconds":1266,"text":"controller, they are basically giving you a reason and uh and after the reason all you are doing is just come back with","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1266s"},{"start_seconds":1275,"text":"a dispute uh invoice back to the seller and that is what we need to define right. seller, buyer, pretty much the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1275s"},{"start_seconds":1284,"text":"same thing. Uh, of course, the description of the invoice and amount in the invoice. Uh, I think the reason that","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1284s"},{"start_seconds":1292,"text":"we will define when we want to dispute it, that should also be a part of it.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1292s"},{"start_seconds":1296,"text":"But that said, now we have officially wrote a proper dam smart contract code.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1296s"},{"start_seconds":1302,"text":"And uh, I mean, pardon me if I'm looking like this like this because I'm talking to you guys and I'm also writing the code at the same place, right? So it got","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1302s"},{"start_seconds":1311,"text":"to be the human interaction here. But coming on to the whole thing. So what did we learn in the end people? We have","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1311s"},{"start_seconds":1319,"text":"wrote so much code right. We have a module. We have an import demo script.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1319s"},{"start_seconds":1324,"text":"We defined our first template which was the invoice with the parameters and we defined the access controls. We ensured that it should be more than zero. Of","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1324s"},{"start_seconds":1332,"text":"course it should not be negative or zero. We defined our first choice which is a functionality that if I'm okay with the pay then here is the pay you will","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1332s"},{"start_seconds":1340,"text":"get a receipt of the pay but if I want to dispute the invoice then I should have a reason and you are just giving me seller buyer description amount and","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1340s"},{"start_seconds":1348,"text":"reason back right uh this is definitely not the whole DAL smart contract but you would see how you would define a choice","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1348s"},{"start_seconds":1355,"text":"and a template and everything up now I'm going to complete the rest of the smart contract so you know we don't need to waste time here like","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1355s"},{"start_seconds":1363,"text":"And like this the whole smart contract is complete. To be honest, it took me like almost close to five more minutes to do this. But well, it's a demo. Now","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1363s"},{"start_seconds":1372,"text":"what we have done rest is defined a template structure of what the receipt would look like. We have defined a template structure of what would anuted invoice would look like everything else.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1372s"},{"start_seconds":1384,"text":"Then what we have done is so when you write a DAL smart contract you need to define some test scripts in the DAL","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1384s"},{"start_seconds":1391,"text":"smart contracts accord against which you can test if everything works right or not right for example we have a new testing flow here that you would see the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1391s"},{"start_seconds":1400,"text":"testing flow says that you will identify the script if the parties Alice and Bob right then you would define the whole","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1400s"},{"start_seconds":1407,"text":"seller should do this this this define the services in Q1 then you have a receipt ID that should be submitted by","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1407s"},{"start_seconds":1414,"text":"the buyer and received ID should be queried and buyer should have a receipt ID that which is verified and if it is not found that means it is not right and","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1414s"},{"start_seconds":1423,"text":"sincerely we also add one more submit must fail so I mean to be honest an amount should not be a bad invoice I","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1423s"},{"start_seconds":1431,"text":"don't want to have like a negative invoice for example something like minus $100 doesn't make sense so even though we have insure using the insure amount","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1431s"},{"start_seconds":1439,"text":"but you know it doesn't hurt to add a stress testing in terms Right. So I would say we have a pretty good Tamil","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1439s"},{"start_seconds":1446,"text":"smart contract here. So what we would do is we need to take our terminal all the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1446s"},{"start_seconds":1454,"text":"way up here. So because we are done with the Tamil script now we need to use the DPM to take it next in the action. So let's get started on this one.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1454s"},{"start_seconds":1465,"text":"Basically now we need to CD into the target file. So our target uh project is inside the demo. It is known as demo j","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1465s"},{"start_seconds":1473,"text":"where our whole daml file exist. So let's go to cd demo j and yep we are at","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1473s"},{"start_seconds":1483,"text":"a good place. So the first thing that we do is to try out dpm build. So what dpm build does is convert","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1483s"},{"start_seconds":1491,"text":"your whole damage smart contract into a dar file. Um yeah I mean it basically does that. So the dart file will be used","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1491s"},{"start_seconds":1499,"text":"to push onto the ledger using an API call with your ledger API to be able to deploy on top of devet test net mainet.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1499s"},{"start_seconds":1507,"text":"Right? So we'll click on dpm build and let this whole smart contract convert into an actual d file. So as you would","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1507s"},{"start_seconds":1515,"text":"see it ran smoothly uh just here and here warnings but well we are the coders we don't care about the warnings do we","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1515s"},{"start_seconds":1524,"text":"right? But what to think about is created the DAR file here. So we will go to TAML. We'll go to list and then as","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1524s"},{"start_seconds":1532,"text":"you would see here we have a DAR file that we can use to upload on the ledger.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1532s"},{"start_seconds":1538,"text":"But uh that is the least of our issues right now. Come back to it. Uh happily completed with the Tamil belt. Now we need to test if the whole thing is good.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1538s"},{"start_seconds":1550,"text":"If there are issues against the Tamil contract or not. we have returned some test scripts that will help us identify that. So for that again pure to keep it","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1550s"},{"start_seconds":1559,"text":"pretty simple we'll use DPM test. So DPM test basically use all the test scripts that we have written to create test.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1559s"},{"start_seconds":1567,"text":"You can get a test summary here right.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1567s"},{"start_seconds":1571,"text":"Internal templates three defined two exercised internal templates choices five defined one exercised and why one","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1571s"},{"start_seconds":1578,"text":"out of five is because we have only written scripts for the pay not for the disputed not for the archived only for","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1578s"},{"start_seconds":1586,"text":"the pay because it's a demo. But you can write write more complex testing scripts to give better testing and debugging","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1586s"},{"start_seconds":1594,"text":"experience. And overall we have 100% 100% 100% external test. Um so we have passed this whole thing with the flying","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1594s"},{"start_seconds":1602,"text":"colors. Now DPM test DPM built you have a DAR file you have a DL smart contract which is totally built and this is why I","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1602s"},{"start_seconds":1611,"text":"love DPM because it makes building on top of content much more easier in a lot of ways. You can actually use the the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1611s"},{"start_seconds":1619,"text":"rest of one of the commands that we were talking about is dpm command known as dpm le which is basically a compiler and","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1619s"},{"start_seconds":1628,"text":"ID back end for your daml language. So we will use dpm and I'm just going to show you what happens dam. So when we","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1628s"},{"start_seconds":1637,"text":"type this you need a command dpm daml lacag and now you need to invoke the compiler but uh okay so we need to","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1637s"},{"start_seconds":1646,"text":"define the path where your dar file is installed to be able to use this you know but uh let's see it in action right","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1646s"},{"start_seconds":1654,"text":"why hesitate since you're already this far um and uh let's see it in action and damc so now one of the things that I","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1654s"},{"start_seconds":1663,"text":"love about damc is inspect tar. So what inspect tar does is basically just decouples your tar file.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1663s"},{"start_seconds":1674,"text":"It gives you every dependencies, every package, but most of all it gives you your package hex string. Not the name,","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1674s"},{"start_seconds":1682,"text":"not the version. Your package hex is your identity on the canton ledger. And instead of going around in the binary or","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1682s"},{"start_seconds":1690,"text":"trying to fetch it from the ledger, you can use this. You can route the path of your DAR profile and get it. So let's see that in action as the last thing","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1690s"},{"start_seconds":1698,"text":"that we do on this one. Right. So we have DPM DAL lac inspect DAR. Now we need to give the root for the DAR. So","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1698s"},{"start_seconds":1705,"text":"dar is currently available in daml uh slash","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1705s"},{"start_seconds":1713,"text":"test uh my bad test slash we have the name of the dar file","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1713s"},{"start_seconds":1722,"text":"here we will just going to copy the path and uh well I am really messy but that's","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1722s"},{"start_seconds":1732,"text":"what makes me authentic uh in a in a Okay. Um, yes. So, we are since we're already inside the target folder, we","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1732s"},{"start_seconds":1740,"text":"don't need to give like the whole path, but we can give this particular path of TAML / test /demoj uh of this path. And I hope this works.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1740s"},{"start_seconds":1753,"text":"Nice. So as you would say it gives us a good uh a lot of things here but it gives you","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1753s"},{"start_seconds":1761,"text":"the hex string of almost everything that works you know dar archive contains the following packages. It gives you all the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1761s"},{"start_seconds":1768,"text":"following packages in this one. So you might not know what to make sense of this one but you can just copy paste it into any AI model and ask it to simplify","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1768s"},{"start_seconds":1777,"text":"it for you. So it might give you like a temp table format or something of the available packages the hex strings and","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1777s"},{"start_seconds":1784,"text":"whatnot you can store it for future references but this is a very like you know useful program if you're working on top of canon and we will clear","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1784s"},{"start_seconds":1792,"text":"everything up as always I'll put this whole thing on my GitHub if you want to use it the link will be in the reply of this demo but thank you so much for","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1792s"},{"start_seconds":1800,"text":"basically working with me on this demo and to understand how DPM works. TPM is an amazing tool that can be used as the","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1800s"},{"start_seconds":1808,"text":"best experience to develop on top of tanton. So, make sure that you try it, build it, and if you build anything, tag me on Discord or X and let me know how I can help you. So, till then, bye-bye.","url":"https://www.youtube.com/watch?v=-AWep7dLSXo&t=1808s"}],"youtube_url":"https://youtube.com/watch?v=-AWep7dLSXo","url":"https://ccpedia.xyz/videos/-AWep7dLSXo"}