tokenika / eosfactory

Python-based EOS smart-contract development & testing framework
http://eosfactory.io/
Other
243 stars 62 forks source link

Convert demo examples for compatibility with CDT #81

Closed jakub-zarembinski closed 5 years ago

jakub-zarembinski commented 5 years ago

CDT can be switched on by editing the core/config.py file and removing comments in those two lines:

# eosio_cpp_ = ("EOSIO_CPP", ["/usr/local/eosio.cdt/bin/eosio-cpp"])
# eosio_abigen_ = ("EOSIO_ABIGEN", ["/usr/local/eosio.cdt/bin/eosio-abigen"])

An example of annotations required by CDT:

[[eosio::action]]
void hi( account_name user ) {
   logger_info( "debug user name: ", name{user} );
   require_auth( user );
   print( "Hello, ", name{user} );
}
stefanzarembinski commented 5 years ago

Done, will be effective in the next edition.