Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mainnet launch asset suggestion: Etheremon #10

Open
protinam opened this issue Feb 16, 2018 · 7 comments
Open

Mainnet launch asset suggestion: Etheremon #10

protinam opened this issue Feb 16, 2018 · 7 comments

Comments

@protinam
Copy link
Member

Name: Etheremon
Kind: Unknown - ERC721?

Background: https://medium.com/@myetheremon/etheremon-decentralized-world-of-ether-monsters-a4f355971ea2

@protinam
Copy link
Member Author

https://etherscan.io/address/0x4ba72f0f8dad13709ee28a992869e79d0fe47030#code

@goanym
Copy link

goanym commented Mar 3, 2018

The contract storing all the data for every Etheremon is: 0xabc1c404424bdf24c19a5cc5ef8f47781d18eb3e

You get information about a monster from getMonsterObj() when passing that monster's ID.

classId is the value you're looking for. Use that as the index of the attached lists to get the name of a class and the filename of its image.
Etheremon Class Names.txt
Etheremon Class Filenames.txt

Simply append that filename to "https://www.etheremon.com/" to get the image URL of a mon. For example, class 39 is Pyrode and its image is: https://www.etheremon.com/0e29c8971f1c0f2be56031ace53d0d2f.png

Etheremon #­21 doesn't officially exist, which is the reason for its generic name and blank filename. It is no longer possible to obtain, but for a brief time some people managed to catch it for free by interacting directly with the smart contract. Since the mon technically exists on the backend, it can be traded and might end up on the Wyvern Exchange. There's no official name or image for it so feel free to use whatever placeholder you like or even nothing at all.

Some other data that is not necessary but may be useful to people browsing the market if you choose to include it:

  • Name: getMonsterName() when passing the monster's ID. This can differ from the class name, as it's the nickname given to a monster by its owner. It's also the only type of name actually stored on-chain.

  • Experience: "exp" return value from getMonsterObj() when passing the monster's ID. This is how much experience the mon has accumulated in battle. A mon's level is determined by this value.

  • Level: (from the battle contract: 0xdf6164efd12678bf6a7d5a1ddf73c831493f6574) getLevel() when passing an Experience value. A list is provided for convenience, but you could also perform this calculation easily by copying the math in the genLevelExp() and getLevel() functions of that contract.
    Etheremon Level Experience.txt

  • Catch #: "createIndex" return value from getMonsterObj() when passing the monster's ID. This counts from 1 and represents how many Etheremon of the same class existed in the world once it was caught. Some people might care about catch # for collector's value, and in Etheremon's frontend the first three mons of each class display the following badges:
    1: https://www.etheremon.com/7cd29d65f88be9616e544acd6e69db82.png
    2: https://www.etheremon.com/268c7ea6ad26ba823cd198032f220bda.png
    3: https://www.etheremon.com/45d371164725aefd8ad9f6264842faaa.png

  • Stats: Each mon has six stats that determine its effectiveness in combat. They are HP, Primary Attack (PA), Primary Defense (PD), Secondary Attack (SA), Secondary Defense (SD), and Speed (SP).
    You use the monster's unique ID and the monster's class ID to look up the following two values in the data contract for each stat:
    Starting value: getElementInArrayType(3, monId, stat)
    Growth rate: getElementInArrayType(1, classId, stat)
    You can then calculate the actual stat values using these and the monster's level:
    stat = startingValue + level * growthRate * 3

    Etheremon #­25478 is a Cryptise (class #­81). As of this writing it has 1132 experience, which makes it level 8. Its starting stats are:
    HP: getElementInArrayType(3, 25478, 0) = 61
    PA: getElementInArrayType(3, 25478, 1) = 79
    PD: getElementInArrayType(3, 25478, 2) = 66
    SA: getElementInArrayType(3, 25478, 3) = 75
    SD: getElementInArrayType(3, 25478, 4) = 75
    SP: getElementInArrayType(3, 25478, 5) = 79
    And Cryptise's growth rates are:
    HP: getElementInArrayType(1, 81, 0) = 2
    PA: getElementInArrayType(1, 81, 1) = 1
    PD: getElementInArrayType(1, 81, 2) = 1
    SA: getElementInArrayType(1, 81, 3) = 2
    SD: getElementInArrayType(1, 81, 4) = 1
    SP: getElementInArrayType(1, 81, 5) = 2
    Thus its final stats are:
    HP: 61 + 2*8*3 = 109
    PA: 79 + 1*8*3 = 103
    PD: 66 + 1*8*3 = 90
    SA: 75 + 2*8*3 = 123
    SD: 75 + 1*8*3 = 99
    SP: 79 + 2*8*3 = 127

  • BP: An Etheremon's BP is simply the floor of the average of all six stats. Continuing the above example, that Cryptise's BP is 108.

  • Type: getElementInArrayType(0, classId, index) with "index" counting from 0 and continuing for however large the array is. Each class has one or more types which can provide advantages or disadvantages in combat depending on the opponent's types. There are 18 types in total and their names (and filenames for the corresponding icons) are provided in the attached lists. Type #­10 is currently unused so I do not know its name or filename.
    Etheremon Type Filenames.txt
    Etheremon Type Names.txt

I believe that covers absolutely everything anyone could possibly want to know about an Etheremon and how to find it all from its ID. The only parts of this that could ever need updating are the image filenames. I will provide an update as soon as possible whenever new classes are added or if the image URLs ever change. Eventually there will be a way to get that data automatically, but for now I hope this is good enough!

@protinam
Copy link
Member Author

protinam commented Mar 3, 2018

@goanym Thank you - this looks great.

I will look into adding Etheremon today if possible and tomorrow at the latest.

@goanym
Copy link

goanym commented Mar 3, 2018

Updated lists including the new mons that were released today:
Etheremon Class Filenames.txt
Etheremon Class Names.txt

@protinam
Copy link
Member Author

protinam commented Mar 6, 2018

Order placement and matching functionality works, e.g. https://exchange.projectwyvern.com/orders/0x58673e230baddc394e35d00cbeea83ac73b01aa9dcc8482bb654955ab4b6ed0d.

I do not think Etheremon implements the ERC721 spec completely - it looks like FreeTransfer events are only fired when a user trades an Etheremon (not during initial purchase). This means Etheremon will not - yet - show up on the assets page in all cases. Etheremon is not the only game for which this is the case, planning to implement a workaround ASAP.

@protinam
Copy link
Member Author

protinam commented Mar 6, 2018

Indexing solution implemented (reading trainerDex); all Etheremon should now show up on the assets page.

@goanym Anything else that would be helpful?

@protinam
Copy link
Member Author

ERC721 wrapper added - https://etherscan.io/address/0xb2c0782ae4a299f7358758b2d15da9bf29e1dd99#readContract

API for token info - https://www.etheremon.com/api/monster/get_data?monster_ids=1001

Transfer event still only fired through the ERC721 proxy contract.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants