Welcome to the discussion thread about this lecture section. Here you can feel free to discuss the topic at hand and ask questions.
Some improvements im working in the dog contract, at this time, its not completed, but im working and researching in order to learn how to build a decent contract.
1st challenge is to learn how to manage tables with structs variables has vectors, from my understanding, it is the most simple and decent way to build your tables.
Next days ill be building the erase, modify actions.
2nd challenge is to learn how to insert time stamp or block timestamp on the table:
- time stamps or block timestamps are need it in order to set future actions once a data has reach certain block or time. (planning to fed the dog with food, dogs can only be fed once or two per day)
3rd challenge is to learn how to build functions to get data from tables, in order to create a table explorer.
any suggestion is greatly accepted, also more contracts and web site to research more about eos smart contracts.
PD: will be all docummented when its finish, so it can be used (if filip aprove it) has another example for academy members.
UPDATE 12/2/2020: modify, erase and erase all has been added.
UPDATE 25/2/2020: time stamp added, no block number for now WHY?.
UPDATE 27/3/2020: been lazy with this, still improving it, im researching mostly the timestamp and time management, i change the hole structure of the contract, opinions would be awesomeâŚ
I did the EOS101+201 course and started working on more complex smart contracts after. But in doing so I found I needed something more comprehensive than EOSStudio and a bit more friendly than running nodeos - like Truffle/Ganache in the Ethereum world.
What do you guys think of TypeScript test environments like:
- Hydra: https://klevoya.com/hydra/index.html
- Lamington: https://lamington.io/
Do you plan to introduce these kind of environments in the next iteration of the course?
Hi.
We are currently working on an update of the EOS courses, but iâm not sure what kind of environments Filip will introduce in the next iteration of the EOS courses. But all suggestions are appreciated.
Ivo
Thanks for the feedback Ivo!
Hi Filip,
I recently joined the Ivan o Tech Academy, hoping to improve my skills and learn more about EOS smart contract development. I have a general idea about most things, however I am finding it difficult to continue due to the fact the dog/pet contract from EOS 101 has been updated and is now different from the dog/pet contract in EOS 201. I have tried to follow along and modify the existing contract from EOS 101 but I seem to be running into a few issues which has brought my course to a halt.
Is the EOS 201 course scheduled to be updated, with a new contract to match the EOS 101 course allowing new course users to continue ?
Hello sir, congratulations on finishing the EOS 101 course!
Now the EOS 201 update is not planned for now, but it will come at any moment.
I have my personal notes over the EOS 201 course, here you can find 2 smart contracts (cpp files) that are 100% compatible with the EOS 201 course, you can use them as example to fix your contract, or you can take it for yourself.
thecil-github-EOSCoding
Hope you find this useful.
If you have any doubt, please let us know so we can help you!
Carlos Z.
Thank you very much
Im not sure where Im still going wrong or if its an issue with the contract, Im still experiencing the same error when trying to send tokens to the dogcontract. I cloned the dogcontractTOKEN.cpp from github, compiled and deployed to my node without any changes⌠I created some DOGCOIN, issued them, transferred them to a seperate account (tycen) and then attempted to transfer DOGCOIN to dogcontract.
Im getting the error âNot the right coinâ, meaning quantity.symbol != currency_symbol when it fact it does, so I am baffled.
CONTRACT dogcontract : public contract {
public:
using contract::contract;
dogcontract(name receiver, name code, datastream<const char*> ds)
:contract(receiver, code, ds)
, currency_symbol(âDOGCOINâ, 0){}
users-iMac:dogcontract user$ cleos push action eosio.token issue â[âeosio.tokenâ, â1000.0000 DOGCOINâ, âissue 1000 DOGCOINâ]â -p eosio.token@active
executed transaction: 0aeaa754299e3ccc20559a1f4e446ff7f36b6aec2f7e904f9a03c2cfad22a4db 136 bytes 250 us
eosio.token <= eosio.token::issue {âtoâ:âeosio.tokenâ,âquantityâ:â1000.0000 DOGCOINâ,âmemoâ:âissue 10000 DOGCOINâ}
warning: transaction executed locally, but may not be confirmed by the network yet ]
users-iMac:dogcontract user$ cleos transfer eosio.token tycen â200 DOGCOINâ âmemmeoâ -p eosio.token@active
executed transaction: 0902c4d2303717ac63b509873ee3d22616e773b3d006ca8c2f59a6e045d8faa1 136 bytes 209 us
eosio.token <= eosio.token::transfer {âfromâ:âeosio.tokenâ,âtoâ:âtycenâ,âquantityâ:â200.0000 DOGCOINâ,âmemoâ:âmemmeoâ}
tycen <= eosio.token::transfer {âfromâ:âeosio.tokenâ,âtoâ:âtycenâ,âquantityâ:â200.0000 DOGCOINâ,âmemoâ:âmemmeoâ}
warning: transaction executed locally, but may not be confirmed by the network yet ]
users-iMac:dogcontract user$ cleos transfer tycen dogcontract â200 DOGCOINâ âmemmoâ -p tycen@active
Error 3050003: eosio_assert_message assertion failure
Error Details:
assertion failure with message: Not the right coin.
This was the same error I was getting when modifying the new contract from EOS101 and where I was getting stuck before. It totally doesnât make sense to me
Scratch that
Issue was that I created the token with 4 decimals⌠after modifying the constructor to currency_symbol(âDOGCOINâ,4) all is good
Glad to see you find the answer by yourself! congratulations!
If you have any doubt, please let us know so we can help you!
Carlos Z.
I am yet to finish the course, at the time of writing (22/32 lessons completed). I feel as though while going through the whole pets table setup etc⌠there were some new syntax and EOS functions not seen before which could have been explained.
For example:
It was not explained why we needed an empty constructor pet_t(){}
. What purpose does the empty constructor serve? Is it not obsolete when we are not using it?
In the screenshot above there is a different kind of way towards defining a constructor via the use of :
followed by property(parameter)
assignment which was not seen before in the C++ Programming course.
A little explanation about EOSLIB_SERIALIZE
and why we need to serialize all members of the class.
*
What does emplace
do?