--- tags: ncd title: NEAR Certified Developer -2- Day 2 description: This course is an opportunity for web developers to earn a Certificate of Completion that represents the ability to design, develop, test and deploy smart contracts on the NEAR platform. image: https://near.org/wp-content/themes/near-19/assets/downloads/near_logo.svg GA: UA-188414449-3 --- # Day 2 ## Writing web 3 *Learn to write contracts that control money, identity and ownership.* --- ### :sparkles: The goal for today is to write contracts that compile. :sparkles: --- Make sure you clone every repository and build it locally. Getting each application running is as important as reading the code because today you will be focused on understanding how all the moving parts work. If you get stuck on one application for some reason, just ask for help in Discord and MOVE ON immediately. If possible, don't wait for someone to reply before you continue or you will lose time. :::success ### :green_book: CORE Activities ::: <!-- 1. **WATCH** [this orientation video](https://www.loom.com/share/2fe06f17a7234ba5bcbff42d3a73b58e) before doing anything else --> In the [Resources section](#-Resources) below choose AssemblyScript or Rust - **REVIEW** all 3 applications labeled as **CORE Activity** for your language --- If you prefer to have specific steps, you could do something like this to study each contract or dApp carefully: 1. Pick any **contract from Day 1** (see Day 1 page) or **dApp from Day 2** (see below) 2. **Clone the repo** locally (or in Gitpod if using Windows) 3. Make sure you can **find the contract source code** and that you can compile the contract to a `.wasm` file 4. **Test the contract somehow** so you know it's working. You can do this using NEAR CLI commands or by running existing unit or simulation tests, or even by using a web interface if the dApp has one. The **KEY** idea here is to make sure you will **NOTICE a change** to the contract if you make one 5. **Make any small change** to the contract. Not a big change, but something simple. 6. Rebuild and retest (**repeat steps 3 & 4**) 7. Did the change you made **work as expected?** Or did you break something? 8. **Ask for help** if you need it 9. **Keep repeating 6-7-8** until your confidence increases... until you believe you understand the contract and can control it 10. **Delete the contract and write it again** from your notes (you took notes right?). You can also just rewrite small parts of the contract, of course. :::info ### :blue_book: BONUS Activities *If you have the time to look around the corner, here's a little more for you.* ::: The more applications you see, the more ideas you will have about what is possible with NEAR. 1. Read through ALL the applications for your language of choice, not just 3 2. Read through all the applications from the OTHER language as well. 4. Check out this little puzzle, it may be fun for you - [Scavenger Hunt Challenge #3](https://hackmd.io/@nearly-learning/hunt-03) 5. Write a script in your favorite language that automates some of the tedious bits. You will find some inspiration among the other projects you've already seen. - compiling a contract - deploying (and optionally initializing) a contract - exercising contract methods :::warning ### :orange_book: Going Deeper *If you're feeling fearless, here's about as far as you might take this road in a day* ::: **AssemblyScript** - Complete these challenges in the AssemblyScript workshop - `#1`. [scavenger hunt](https://github.com/Learn-NEAR/workshop--exploring-assemblyscript-contracts#activityscavenger-hunt) through several AssemblyScript projects - `#2`. [debugging challenge](https://github.com/Learn-NEAR/workshop--exploring-assemblyscript-contracts#activitydebugging-challenge) to fix a few failing unit tests with broken contracts - Complete this challenge then modify the contract in some interesting ways - `#3`. a [development lifecycle challenge](https://github.com/Learn-NEAR/workshop--exploring-assemblyscript-contracts#activitydevelopment-lifecycle) to guide you through deploying a contract - Review some of NEAR's data "convenience" structures. These are all wrappers for NEAR Storage as [seen in docs](https://docs.near.org/docs/concepts/data-storage#docsNav) - collections in [`near-sdk-as`](https://github.com/near/near-sdk-as/tree/master/sdk-core/assembly/collections) - collection [performance](https://github.com/near-examples/collection-examples-as) - Review Fungible and Non-fungible Token contracts in AssemblyScript - [FT](https://github.com/near-examples/FT) - [NFT](https://github.com/near-examples/NFT) **Rust** - Complete this guided [workshop on Rust contracts](https://github.com/Learn-NEAR/workshop--berry-club-bot) (based on [berryclub](https://berryclub.io)) to fix failing tests and draw some sweet decentralized pictures - Review some of NEAR's data "convenience" structures. These are all wrappers for NEAR Storage as [seen in docs](https://docs.near.org/docs/concepts/data-storage#docsNav) - collections in [`near-sdk-rs`](https://github.com/near/near-sdk-rs/tree/master/near-sdk/src/collections) - collection [performance](https://github.com/near-examples/collection-examples-rs) - Review Fungible and Non-fungible Token contracts in Rust - [FT](https://github.com/near-examples/FT) - [NFT](https://github.com/near-examples/NFT) - Review berryclub [contracts](https://github.com/evgenykuzyakov/berryclub) --- > _To call methods, and methods, and methods, signing transactions in this petty pace from day to day, to the last token of recorded block height;_ > > _And all our ledgers have hard forked on their way to a dusty death. Out, out, brief consensus!_ > > _web 3's but a walking shadow, a poor player, that struts and frets his hour upon the internet, and then gossips no more._ > > _It is a tale told by a HODLer, full of sound and fury, signifying nothing._ > > *-- Willmoon Shakeschain* --- # :dart: Resources REMEMBER: For today's activity - You DO need to build (and run tests, if available for) each dApp ("decentralized app") - You should TRY to understand EVERY line of code in the contract ## AssemblyScript If you intend to focus on AssemblyScript, [**[ OPEN the list of dApps using AssemblyScript ]**](https://airtable.com/shrzKsvgmkM8lvfpp) You should review a **minimum of 3** applications marked as **CORE Activity**. ![The list of AssemblyScript-powered applications](https://i.imgur.com/D8qNxCs.png) ## Rust **If this is your first time using Rust** on your computer, please follow this [**Intro to Rust**](https://docs.near.org/docs/tutorials/contracts/intro-to-rust) in our docs. The "3-Step Rust Installation" will help you install the required software. If you intend to focus on Rust, [**[ OPEN the list of dApps using Rust ]**](https://airtable.com/shrY5TMWP96L9wSyP) You should read a **minimum of 3** applications marked as **CORE Activity**. You can read more about [Rust contract basics](https://hackmd.io/@nearly-learning/contract-basics-rust) as well. ![The list of Rust-powered applications](https://i.imgur.com/7A4zp5j.png) ## No Contract It's possible to build applications with NEAR that do not use a contract. Here are some examples of these: [**[ OPEN the list of apps using NO CONTRACT ]**](https://airtable.com/shr5VqiNCEoPWl0JQ) ![The list of applications with no contract](https://i.imgur.com/je1WxFL.png)