Giter Site home page Giter Site logo

cryptozombie-lessons's Introduction

CryptoZombies - Content Localization

This repository is used to translate CryptoZombies to other languages.

The source content that should be used for all translations is in the en directory.

en/
  1/ - content of Lesson 1
  ...
  N/ - content of Lesson N
  index.json - strings used in the UI
  share-template-msgs.json - strings used on the share page

Strings in index.json and share-template-msgs.json can contain parameters, these will be injected before the strings are displayed to the user. Parameters that are present in the source strings may appear in any position in the translated strings, or omitted entirely if it makes sense to do so.

NOTE: The syntax used to represent parameters differs between the two .json files. In index.json parameters are specified using {parameterName}, while in share-template-msgs.json parameters are specified using {{ .ParameterName }}.

Localizing for a new language

  1. Create a new branch off master.
  2. Create a new folder named after the locale code, e.g. jp (for Japanese), zh (for Chinese).
  3. Translate the content.
  4. Add index.ts to the new folder.
  5. Update index.ts in the root folder.
  6. Submit a PR against master.

Fixing Source Content or Localized Content

  1. Create a new branch off master.
  2. Fix fix fix.
  3. Submit a PR against master.

License

Contributors must assign copyright back to Loom Network for any contributions they make. Loom Network retains ownership of any derivative work created from original content.

cryptozombie-lessons's People

Contributors

ackintosh avatar andreipope avatar antododo avatar cobject avatar duydcoco avatar eduardonunesp avatar enlight avatar fbosio avatar ghiippiez avatar giulianabyui avatar hankxdev avatar hurricanenara avatar jamesmartinduffy avatar lukezhangstudio avatar mamim avatar marcelo-maciel avatar mattkanwisher avatar mentatx avatar miloops avatar mollymoll13 avatar nipol avatar patrik-stas avatar phdooy avatar studroid avatar tinatang1021 avatar vacilagodzila avatar yasergirit avatar yshrsmz avatar zaq1tomo avatar zwoosks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cryptozombie-lessons's Issues

Minor mistake in Lesson 4, Chapter 10

In the instructions, the following is written :

In chapter 6 we calculated a random number from 0 to 100. Now let's use that number to determine who wins the fight, and update our stats accordingly.

However, the random number generated is actually from 0 to 99 (since 100 % 100 returns 0). Therefore, the conditional in the function should be "less than" and no "less than or equal to", as the latter gives a 71% (0 to 70 vs 71 to 99) chance of winning to the attacker.

Thanks for the tutorials btw.

Italian translation

Ciao, Iโ€™d like to translate the course in Italian. Can I work on it? Is someone whoโ€™s already doing it and wants to join forces?

Not all code changes are saved

Even if you finish a chapter succesfully and go to the next one the code changes are not always saved.
What I've noticed:

  1. Complete lesson 5
  2. Go back to the lesson at some point later (unsure if this would happen also right after completing the chapter)
  3. Have a look at chapter 13 (which is the last one which shows the 'newest' codes)
  4. Open zombieattack.sol
  5. Look at function 'attack'. The incrementations are still with ++ even if you had previously replaced them with .add. The same problem manifests probably also elsewhere, but now noticed only this.

Lesson 4 - Chapter 12: Win Count Issue

In this chapter, when you select any one of your zombies, the count shown under "Your Zombie's Win Count:" is shown as the aggregate win count of all your zombies. If I battle 5 times with one zombie and win each time, and then battle for the first time with my second zombie, my second zombie's win count will show as 6.

Since the win and loss count are specified on the Zombie instance itself, this number should be tracked per-zombie. Obviously, this isn't on the blockchain so you are likely just maintaining a count, but it might mislead people who aren't familiar with solidity.

I would suggest changing the wording, or tracking the number per-zombie to have parity with the contract the lesson implements.

Lesson 6 - Chapter 3 - Can't get parser to accept startApp() function

Here is my code for Lesson 6 - Chapter 3. The parser keeps flagging my definition for startApp(). Also, the parser will not tolerate a semi-colon after the call to startApp():

startApp();

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>CryptoZombies front-end</title>
    <script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
    <script language="javascript" type="text/javascript" src="web3.min.js"></script>
    <script language="javascript" type="text/javascript" src="cryptozombies_abi.js"></script>
  </head>
  <body>

    <script>
      // 2. Start code here
      var cryptoZombies;

      function startApp(){
        var cryptoZombiesAddress = "YOUR_CONTRACT_ADDRESS";

        cryptoZombies = new web3js.eth.Contract(cryptoZombiesABI, crytpoZombieAddress);
      }

      window.addEventListener('load', function() 
      {
        // Checking if Web3 has been injected by the browser (Mist/MetaMask)
        if (typeof web3 !== 'undefined') {
          // Use Mist/MetaMask's provider
          web3js = new Web3(web3.currentProvider);
        } else {
          // Handle the case where the user doesn't have Metamask installed
          // Probably show them a message prompting them to install Metamask
        }

        // Now you can start your app & access web3 freely:
        startApp()

      })
    </script>
  </body>
</html>

lesson-6-chapter-3-issue

Lesson 6 - Chapter 7 case issue

It says copy "createRandomZombie" code shown above,
however, the return statement
return CryptoZombies.methods.createRandomZombie(name)...
I think it should be camel case cryptoZombies instead of pascal case CryptoZombies.

uint32 error for timestamp storage ?

Hello,
In your lessons you say that about time stored in uint32 type:
"Note: We chose not to prevent the year 2038 problem... So don't need worry about overflows on readyTime. Our app is screwed in 2038 anyway ;)".

It seems incorrect to me, with a uint32 you're good until february 2106 (2^32 = 4294967296 -> 7th february 2106 at 7:28:16) , isn'it ?

Am I wrong ?

ERC721 Standard

Hey @enlight

These lessons are absolutely awesome!

I'd just like to talk about lesson number 5 or the one on NFT (aka ethereum/EIPs#721). The implementation in cryptozombies is influenced by CryptoKitties for obvious reasons, but it is not reflective of the 721 current draft going through the EIP process. I am more than happy to work with you or someone on your team to get lesson 5 to be compliant with the proposed 721 draft. IChanges include things like no takeOwnership and the addition of transferFrom and approvals to be more ERC20 like.

I see your Note that this is a proposal and you're using what is in OpenZeppelin currently. OpenZeppelin are also about to change that interface to be the new proposal.

Lesson 6 - Chapter 7 issue

My code is as below:

        $("#txStatus").text("Eating a kitty. This may take a while...");
        return CryptoZombies.methods.feedOnKitty(zombieId, kittyId)

The answer shows me KittyId instead of kittyId.

    return CryptoZombies.methods.feedOnKitty(zombieId, KittyId)

error

I desire to contribute with translations to Spanish.

Hello, hope this message finds you well.

I saw the instructions on the README file about creating a new branch to add a new lenguage. Just wanted to make sure this repo would also welcome spanish translation, if so I'll be glad to help.

Thank you!

Inconsistent call for toWei() in Lesson 6 Chapter 8

In Lesson 6 Chapter 8, step 3 says:

When it calls levelUp on the contract, it should send "0.001" ETH converted toWei, as in the example above"

The contract referenced is:

CryptoZombies.methods.levelUp(zombieId).send({ from: userAccount, value: web3js.utils.toWei("0.001", "ether") })

However, when you check the solution we get:

.send({ from: userAccount, value: web3js.utils.toWei("0.001") })

Functionally this is fine, since "ether" is the default value for the unit argument of toWei. But can we either include "ether" in the solution to make it consistent with the instructions, or include a line explaining why we don't need to specify "ether"?

ZombieAttack or ZombieBattle in Lesson 5, Chapter 1

First a compliment for the incredible lessons, but there was an error in the first chapter of lesson 5, where our ZombieOwnership contract should inherit from ZombieAttack, but that does not exist, so the ZombieOwnership should inherit from ZombieBattle developed by every correct 4th lesson?

In short

pragma solidity ^0.4.19;

import "./zombieattack.sol";

contract ZombieOwnership is ZombieAttack {

}

should be

pragma solidity ^0.4.19;

import "./zombieattack.sol";

contract ZombieOwnership is ZombieBattle {

}

CryptoZombie rewards disappears (GitHub oAuth)

How to reproduce:

  1. Go to github.com and change your GitHub primary email address
  2. Logout and log back in CZ
  3. Go to rewards, now it will show like you haven't completed the CZ tasks before snapshot.

Unclear why zombieToOwner mapping is needed

I've now completed the course up to level 5, and I really like it.

There is just one thing that is unclear for me: What is the rationale to having a zombieToOwner mapping instead of just adding the owner as a field to the Zombie struct? It is initialized at the same point as the others, and we are updating other fields (so the reason cannot be that they cannot be updated). Also, from other programming languages, I learned it to be a bad idea to have a mapping/hashtable whose keys are consecutive numbers (use an array instead). And since we already have an array here (the array of Zombie structs) I would probably have added the owner in there.

(And in case somebody complains that this should be discussed via Telegram - I refuse to sign up to any services who do not let me sign up without disclosing my mobile phone number to them, therefore I don't have a Telegram account).

wrong version of web3.min.js.

I tried to use the code in the cryptozombies lessons Chapter 6 and use the web3.min.js (api version 0.20.3). But it's always wrong, even the code to initialize a contract is wrong.
I had to use
new web3.eth.contract(coreABI).at(address);
It's right, but when i tried to call a function in solidity , it's wrong again.
There is a state variable (public string) called symbol in my contract. So i tried to get the value of it via
contract.symbol.call()
It says
inpage.js: 1 Uncaught TypeError: this._eth.call is not a function
So, i dont know if it's the problem of the API version or something.
I used a CDN version of web3.min.js which is
<script src="https://cdn.jsdelivr.net/gh/ethereum/web3.js/dist/web3.min.js"></script>

I want to ask you guys where you can find a good web3.min.js which can use the style in the Chapter 6 lesson. like
new web3js.eth.Contract(coreABI,address);

Can you simply share the right file, please? Thanks in advance!! ๐Ÿฅ‡ ๐Ÿ‘ ๐Ÿ‘

Lesson 6 - Chapter 8 - Answer Parser won't accept unit parameter in toWei call

Look at the screenshot below where I clicked on "Show Answer" to find out why the answer parser was not accepting my answer for Lesson 6, Chapter 8. As you can see, the answer shows the toWei() call without "ether" as the second argument. I'm assuming that "ether" is the default argument? In any case, I believe most people will duplicate the toWei() call shown in the lesson text like this:

CryptoZombies.methods.levelUp(zombieId)
.send({ from: userAccount, value: web3js.utils.toWei("0.001"**, "ether"**) })

And it looks like the answer parser won't accept it. See below.

image

L1C8: Missed opportunity to talk about (saving) gas

// create a New Person:
Person satoshi = Person(172, "Satoshi");
// Add that person to the Array:
people.push(satoshi);
We can also combine these together and do them in one line of code to keep things clean:
people.push(Person(16, "Vitalik"));

It's not just cleaner, but cheaper (less gas) to do it the second way.

"YOUR_CONTRACT_ADDRESS" in the lesson 6

Hi it seems that in lesson 6 - Chapter 3 there is a string "YOUR_CONTRACT_ADDRESS" instead of actual address of a contract (CryptoKitties and CryptoZombies).

If you recall from Lesson 2, the address of the CryptoKitties contract on Ethereum mainnet is YOUR_CONTRACT_ADDRESS.
... and set it equal to the string "YOUR_CONTRACT_ADDRESS" (this is the address of the CryptoZombies contract on mainnet).

Require msg.sender first in lesson 5 chapter 8

Hi Cryptozombie team,

I really like your course: simple, clear, fun, and very well-guided. Thanks.

I wanted to point a minor thing (nitpicking): Up to now, when doing a require on msg.sender, we always start with require(msg.sender == ...); (e.g. ownerOf and onlyOwner)
The function takeOwnership is expecting msg.sender to be on the right-hand of the comparison.
Once again, a very minor change that may not be needed after all.

Thanks again for this great course.

Lesson 4 chapter 1 Issues

Just few text issues, below:

But in Ethereum, because both the money (Ether), the data (transaction payload), and the contract code itself all live on Ethereum, it's possible for for you to call a function and pay money to the contract at the same time.

Let's say our game has a feature where users can pay ETH to level up their zombies. The ETH wil get stored in the contract, which you own โ€” this a simple example of how you could make money on your games!

The function should first require that msg.value is (are) equal to levelUpFee.

Cebuano Localization

Hi Good Day! I would like to request to contribute in your project. Please allow me to have translation in Cebuano. Hoping for your positive response!
Thank You!

Polish translation.

Hi guys. Thanks for a great work you are doing!

I have seen that there is a polish translation in the repo (thanks to @piotr-galas) but it's not on the CryptoZombies.io yet.

Is there any more work required? If so I am willing to help.

Typo of capitalised parameter when calling function

In Chapter 7: Sending Transactions, a call to feedOnKitty() for some reason expecting one of the argumets kittyId to be capitalised:
return CryptoZombies.methods.feedOnKitty(zombieId, KittyId)
Should be lower case.

Lesson 6 - Chapter 1 - script tags

Hi! Crypto Zombie Team.
The existing sample code in chapter 1 is like this.

<script language="javascript" type="text/javascript" src="web3.min.js"></script>

But, language attribute is deprecated in HTML5.
Also, as it is possible omit the type attribute too.
How about removing both?

<script src="web3.min.js"></script>

Lesson Six - Chapter 1 - HTML comments treated as bugs

Hi Loom Network,

Glad to see Lesson 6 released! I'll be posting issues as I find them.

In Chapter 1 - if you don't delete the hint HTML comment:

It flags that line as an error. I guess HTML comments are not being ignored by the parser?

Lesson 11 and later - Chapter 5 - _transfer function dont use _from and use msg.sender

this function should be use _from instead of msg.sender
like:

function _transfer(address _from, address _to, uint256 _tokenId) private {
        ownerZombieCount[_to] = ownerZombieCount[_to].add(1);
        //ownerZombieCount[msg.sender] = ownerZombieCount[msg.sender].sub(1);
        ownerZombieCount[_from] = ownerZombieCount[_from].sub(1);
        zombieToOwner[_tokenId] = _to;
       Transfer(_from, _to, _tokenId);
  }

A security hole!

Hello Loom team,
I like your course very much. Thanks. But I found a security hole in this code which could probably cause fatal problems in an application.
Look at the code in Lesson 5 Chapter 8.
Imagine there are 3 persons: A, B and C. A owned a zombie. First, A approved that zombie to B, and then A transferred it to C in an exchange. What if B executed "takeOwnership" of the same zombie after that? Yes! He/she would succeed and got ownership of it! And poor C lost his/her zombie without knowing why....
We should add some code to cancel the approval of the zombie in the same time it is transferred.

Misleading instructions in Lesson 6, Chapter 8

In this chapter, we are instructed to make the user send 0.001 ether using the web3j.utils.toWei function. In the example, the "ether" argument is specified as such :

web3js.utils.toWei("0.001", "ether")

However, inputting this function as is in the exercise returns an error. The corrector actually seems to check for:

web3js.utils.toWei("0.001")

I'm aware that toWei defaults to ether, but perhaps the corrector could accept both?

Also, I did not find it clear that the following had to be included:

.on("error", function(error) {
          $("#txStatus").text(error);
        });        

since there is not mention of it in the instructions. Maybe this should be specified?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.