Creating First Smart Contract — Nothing Different From a Container

Ahmet Arda Orak
2 min readJun 11, 2022

So we must first learn “What Are Smart Contracts”? As it says in IBM’s website documentation: Smart contracts are simply programs stored on a blockchain that run when predetermined conditions are met. They typically are used to automate the execution of an agreement so that all participants can be immediately certain of the outcome, without an intermediary’s involvement or time loss. They can also automate a workflow, triggering the next action when conditions are met.

Ok, that was a boring explanation — but not enough — you can watch videos from the WhiteBoard Crypto YouTube channel on Youtube.

With that said, I think I talked about NEAR in a previous article so I won’t dive into the “what is NEAR” question. But we will look to:

Near Smart Contract Structure

Near smart contract structure is really really simple — so if you know about programming — think a data container variable; a contract is the same :)

Interesting right! (very simple1 functions example below)

export function hello(): string {
return "Hello, World!";
}

The contract above is created with Assembly Script. So let’s answer the “What is Assembly Script” question.

AssemblyScript is a TypeScript-based programming language that is optimized for, and statically compiled to, WebAssembly (currently using asc, the reference AssemblyScript compiler). Resembling ECMAScript and JavaScript, but with static types, the language is developed by the AssemblyScript Project with contributions from the AssemblyScript community.

Another (boring but important)answer from Wikipedia. And after all, I want to look at the popular question —

Wich one is better Rust or Assembly Script

Feasibility — The assembly script is more programmer-friendly(my idea)

Popularity — Rust Has more documentation

Future Success — Rust is used for years by millions but assembly script is also growing fast.

So both are good choices it’s up to you!

Closing

That was all for today for learning and reading more about React, web dev, web3.0, blockchain, chrome dev and more don’t forget to follow me on LinkedIn & Medium!

--

--

Ahmet Arda Orak

Entrepreneur 📍 Leader At Young Leaders Over The Horizon 📍 Web Developer 📍 Mobile App Developer