From 5d057f58e405d85aae380c1fbe0a99aae2af6a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20Schoentgen?= Date: Thu, 25 Jan 2024 16:33:07 +0100 Subject: [PATCH 1/2] fix: Several minor corrections --- 1/contract_structure.md | 2 +- 1/state_vars_and_ints.md | 2 +- 2/assert.md | 2 +- 2/calling_a_contract.md | 6 +++--- 2/interfaces.md | 4 ++-- 2/msg-sender.md | 2 +- 2/wild_pokemons.md | 4 ++-- README.md | 6 +++--- _coverpage.md | 4 ++-- _sidebar.md | 2 +- ar-sa/_sidebar.md | 2 +- assets/1/wildPokemons.vy | 2 +- assets/2/2.11-finished-code.vy | 8 ++++---- assets/2/2.6-finished-code.vy | 2 +- assets/2/2.7-finished-code.vy | 2 +- assets/2/2.7-template-code.vy | 2 +- assets/final/pokemon-battle.vy | 2 +- assets/final/pokemon-trainer.vy | 8 ++++---- de/1/contract_structure.md | 2 +- de/1/state_vars_and_ints.md | 2 +- de/_sidebar.md | 2 +- en-lessons.html => es-lessons.html | 0 es/1/state_vars_and_ints.md | 2 +- es/2/interfaces.md | 2 +- es/2/wild_pokemons.md | 4 ++-- es/_sidebar.md | 2 +- fr/1/contract_structure.md | 2 +- fr/1/state_vars_and_ints.md | 2 +- fr/_sidebar.md | 2 +- index.html | 2 +- it/1/contract_structure.md | 2 +- it/_sidebar.md | 2 +- ja-jp/_sidebar.md | 2 +- pt-br/1/contract_structure.md | 2 +- pt-br/1/state_vars_and_ints.md | 2 +- pt-br/_sidebar.md | 2 +- ru/1/contract_structure.md | 2 +- ru/_sidebar.md | 2 +- zh-cn/_sidebar.md | 2 +- 39 files changed, 52 insertions(+), 52 deletions(-) rename en-lessons.html => es-lessons.html (100%) diff --git a/1/contract_structure.md b/1/contract_structure.md index 90984a7..5236004 100644 --- a/1/contract_structure.md +++ b/1/contract_structure.md @@ -11,7 +11,7 @@ one contract. Vyper supports a version pragma to ensure that a contract is only compiled by the intended compiler version, or range of versions. Version -strings use [NPM](https://docs.npmjs.com/misc/semver) style syntax. +strings use [NPM](https://docs.npmjs.com/about-semantic-versioning) style syntax. For the scope of this tutorial, we'll want to compile our smart contracts with any compiler version in the range of `0.2.0` (inclusive) to `0.3.0` (exclusive). It looks like this: diff --git a/1/state_vars_and_ints.md b/1/state_vars_and_ints.md index 44ce8fa..a97e7a9 100644 --- a/1/state_vars_and_ints.md +++ b/1/state_vars_and_ints.md @@ -13,7 +13,7 @@ State variables are permanently stored in contract storage. This means they're w storedData: int128 ``` -In this example contract, we created a [`int128`](https://vyper.readthedocs.io/en/stable/types.html#signed-integer-128-bit) called `storedData` which holds a _default_ value of `1`. +In this example contract, we created a [`int128`](https://docs.vyperlang.org/en/stable/types.html#signed-integer-n-bit) called `storedData` which holds a _default_ value of `1`. ## Unsigned Integers: `uint256` diff --git a/2/assert.md b/2/assert.md index a73e7bd..c539b0b 100644 --- a/2/assert.md +++ b/2/assert.md @@ -38,7 +38,7 @@ To select a specific `Pokemon` of a trainer we need 2 things: - A `uint256` index that will choose a specific pokemon of the trainer. -You may recall from [Chapter 2](/#/2/msg-sender) that you can get the address of the contract caller using `msg.sender`. +You may recall from [Chapter 2](/2/msg-sender) that you can get the address of the contract caller using `msg.sender`. 1. Create an `external` function named `battleWildPokemon` which takes a single parameter: `pokemonIndex` of `uint256` type. diff --git a/2/calling_a_contract.md b/2/calling_a_contract.md index 989ab87..e9a66c2 100644 --- a/2/calling_a_contract.md +++ b/2/calling_a_contract.md @@ -1,14 +1,14 @@ # Chapter 10: Calling a Contract -In [Chapter 8](/#/2/interfaces), we added `WildPokemons` interface in the trainer contract. In this chapter, we will call the `battle` function of the `WildPokemon` interface. +In [Chapter 8](/2/interfaces), we added `WildPokemons` interface in the trainer contract. In this chapter, we will call the `battle` function of the `WildPokemon` interface. -If you recall from [Chapter 8](/#/2/interfaces), we need a contract address to interact with `WildPokemons`. +If you recall from [Chapter 8](/2/interfaces), we need a contract address to interact with `WildPokemons`. We will learn how to deploy a contract to Ethereum blockchain and get the contract address in future lessons. For the purpose of this chapter, I have deployed the [`WildPokemons` contract to the Rinkeby Testnet](https://rinkeby.etherscan.io/address/0x66f4804E06007630e1aF0a7B0b279e6F27A3FdE5) Here is the contract address: [0x66f4804E06007630e1aF0a7B0b279e6F27A3FdE5](https://rinkeby.etherscan.io/address/0x66f4804E06007630e1aF0a7B0b279e6F27A3FdE5) -Using the contract address and the interface, you can make external calls to the interface functions (which was discussed in depth in [Chapter 8](/#/2/interfaces)): +Using the contract address and the interface, you can make external calls to the interface functions (which was discussed in depth in [Chapter 8](/2/interfaces)): ```vyper interface Car: diff --git a/2/interfaces.md b/2/interfaces.md index 97b20a8..7b92afd 100644 --- a/2/interfaces.md +++ b/2/interfaces.md @@ -12,7 +12,7 @@ So, for our use-case, we need to create an interface for the pokemon battle cont ### Using Interfaces -Interfaces can be added to contracts either through inline definition or by [importing them from a separate file](https://vyper.readthedocs.io/en/stable/interfaces.html?highlight=import#imports-via-import). +Interfaces can be added to contracts either through inline definition or by [importing them from a separate file](https://docs.vyperlang.org/en/stable/interfaces.html?highlight=import#imports-via-import). The `interface` keyword is used to define an inline external interface: @@ -65,7 +65,7 @@ def test(some_address: address): ## Put it to the test -As the coding area can only have one file at a time, we have removed the pokemon battle contract and added the trainer contract. You can check out the pokemon battle contract [here](https://github.com/vyperlang/vyper.fun/blob/chapter1/assets/2/2.7-finished-code.vy). +As the coding area can only have one file at a time, we have removed the pokemon battle contract and added the trainer contract. You can check out the pokemon battle contract [here](https://github.com/vyperlang/learn/blob/chapter1/assets/2/2.7-finished-code.vy). 1. The pokemon battle contract only has 1 external function: `battle` diff --git a/2/msg-sender.md b/2/msg-sender.md index 7490701..2a84b3b 100644 --- a/2/msg-sender.md +++ b/2/msg-sender.md @@ -6,7 +6,7 @@ In order to do this, we need to use something called `msg.sender`. ## msg.sender -In Vyper, there are certain global variables that are available to all functions. One of these is `msg.sender`, which refers to the address of the person (or smart contract) who called the current function. +In Vyper, there are certain [global variables](https://docs.vyperlang.org/en/stable/constants-and-vars.html#environment-variables) that are available to all functions. One of these is `msg.sender`, which refers to the address of the person (or smart contract) who called the current function. > Note: In Vyper, function execution always needs to start with an external caller. A contract will just sit on the blockchain doing nothing until someone calls one of its functions. So there will always be a `msg.sender`. diff --git a/2/wild_pokemons.md b/2/wild_pokemons.md index a2987b9..442883e 100644 --- a/2/wild_pokemons.md +++ b/2/wild_pokemons.md @@ -17,8 +17,8 @@ We will re-use some parts of our previous contract. Now, let's add some state va 4. Make following changes to the `_generateRandomDNA` function: - Remove the `_name` input parameter so that `_generateRandomDNA` accepts no parameter. - - In the `_generateRandomDNA` body, replace `_name` with `battleCount`. Now, you may remember from [Lesson 1, Chapter 11](/#/1/keccak256-and-typecasting), that `keccak256` expects a single parameter of type `bytes32`, `Bytes` or `String`. So, we need to use `convert` to typecast `battleCount` to `bytes32`. - - You may remember from [Lesson 1, Chapter 10](/#/1/more_on_functions) that we add `@pure` decorator to a function which does not read contract state or environment variables. But now as `_generateRandomDNA` is accessing `battleCount` (a state variable), it is no longer a `@pure` function. So, remove the `@pure` function decorator. + - In the `_generateRandomDNA` body, replace `_name` with `battleCount`. Now, you may remember from [Lesson 1, Chapter 11](/1/keccak256-and-typecasting), that `keccak256` expects a single parameter of type `bytes32`, `Bytes` or `String`. So, we need to use `convert` to typecast `battleCount` to `bytes32`. + - You may remember from [Lesson 1, Chapter 10](/1/more_on_functions) that we add `@pure` decorator to a function which does not read contract state or environment variables. But now as `_generateRandomDNA` is accessing `battleCount` (a state variable), it is no longer a `@pure` function. So, remove the `@pure` function decorator. diff --git a/README.md b/README.md index 2b29c08..326b537 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@ ## What is this? -This is an [interactive tutorial website]( https://learn.vyperlang.org/#/) for learning Vyper while building games using smart contracts, similar to Cryptozombies. +This is an [interactive tutorial website](https://learn.vyperlang.org/) for learning Vyper while building games using smart contracts, similar to Cryptozombies. ## Running tutorials locally 1. Clone the repo: ```bash -git clone https://github.com/vyperlang/vyper.fun +git clone https://github.com/vyperlang/learn ``` 2. Download and Install [Node.js](https://nodejs.org/). @@ -37,7 +37,7 @@ Given that Vyper.fun is a global project, we believe it's critical that Vyper.fu ### How to get involved -Check out [contribution guide](https://github.com/vyperlang/vyper.fun/blob/master/CONTRIBUTION.md) for instructions on how to get started as a translator. Don't see your language listed? Please comment [here](https://github.com/vyperlang/vyper.fun/issues/6) & we'll help get you set up. +Check out [contribution guide](https://github.com/vyperlang/learn/blob/master/CONTRIBUTION.md) for instructions on how to get started as a translator. Don't see your language listed? Please comment [here](https://github.com/vyperlang/learn/issues/6) & we'll help get you set up. Join our [Discord server](https://discord.gg/Svaav43) for collaboration & support. diff --git a/_coverpage.md b/_coverpage.md index 320e5ac..1e687ed 100644 --- a/_coverpage.md +++ b/_coverpage.md @@ -5,8 +5,8 @@ > Learn Vyper by building a Pokémon Game! [Get Started](/lessons.html) -[Empezar](https://vyper.fun/en-lessons.html) -[GitHub](https://github.com/vyperlang/vyper.fun) +[Empezar](/es-lessons.html) +[GitHub](https://github.com/vyperlang/learn) diff --git a/es/_sidebar.md b/es/_sidebar.md index 957d16e..983b68d 100644 --- a/es/_sidebar.md +++ b/es/_sidebar.md @@ -31,4 +31,4 @@ - [Juntándolo todo](es/2/putting_it_together.md) - [Beca Gitcoin](https://gitcoin.co/grants/112es/2/vyperfun) -- [Reportar un problema](https://github.com/vyperlang/vyper.fun/issues) +- [Reportar un problema](https://github.com/vyperlang/learn/issues) diff --git a/fr/1/contract_structure.md b/fr/1/contract_structure.md index 887f8c9..8bc6303 100644 --- a/fr/1/contract_structure.md +++ b/fr/1/contract_structure.md @@ -11,7 +11,7 @@ Les contrats Vyper sont contenus dans des fichiers. Chaque fichier contient exac ## Version Pragma -Vyper prend en charge un pragma de version pour garantir qu'un contrat n'est compilé que par la version de compilateur ou la plage de versions prévue. Les chaînes de version utilisent la syntaxe de style [NPM](https://docs.npmjs.com/misc/semver). +Vyper prend en charge un pragma de version pour garantir qu'un contrat n'est compilé que par la version de compilateur ou la plage de versions prévue. Les chaînes de version utilisent la syntaxe de style [NPM](https://docs.npmjs.com/about-semantic-versioning). Dans le cadre de ce tutoriel, nous allons compiler nos contrats intelligents avec n'importe quelle version du compilateur comprise entre `0.2.0` (inclus) et `0.3.0` (exclus). Cela ressemble à ceci : diff --git a/fr/1/state_vars_and_ints.md b/fr/1/state_vars_and_ints.md index 9e0aa98..97f08c2 100644 --- a/fr/1/state_vars_and_ints.md +++ b/fr/1/state_vars_and_ints.md @@ -16,7 +16,7 @@ Les variables d'état sont stockées de façon permanente dans le stockage des c storedData: int128 ``` -Dans cet exemple de contrat, nous avons créé un [`int128`](https://vyper.readthedocs.io/en/stable/types.html#signed-integer-128-bit) appelé `storedData` qui contient une valeur par _défaut_ de `1`. +Dans cet exemple de contrat, nous avons créé un [`int128`](https://docs.vyperlang.org/en/stable/types.html#signed-integer-n-bit) appelé `storedData` qui contient une valeur par _défaut_ de `1`. ## Entiers non signés : `uint256`. diff --git a/fr/_sidebar.md b/fr/_sidebar.md index 71dd49b..1672143 100644 --- a/fr/_sidebar.md +++ b/fr/_sidebar.md @@ -31,4 +31,4 @@ - [Putting It Together](2/putting_it_together.md) - [Gitcoin Grant](https://gitcoin.co/grants/1122/vyperfun) -- [Report an Issue](https://github.com/vyperlang/vyper.fun/issues) +- [Report an Issue](https://github.com/vyperlang/learn/issues) diff --git a/index.html b/index.html index 08d6e76..dbea599 100644 --- a/index.html +++ b/index.html @@ -150,7 +150,7 @@
Getting things ready!