Skip to content

Commit

Permalink
upgrade to eosio.CDT 1.6.1, remove custom dispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
slyon committed Apr 17, 2019
1 parent d4fa924 commit 3ed561f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
all:
eosio-cpp -Oz -o signup.wasm -I../eosio.contracts-old/eosio.system/include -I../eosio.contracts-old/eosio.system signup.cpp --abigen
eosio-cpp -Oz -o signup.wasm -I. -I../eosio.contracts-old/eosio.system/include -I../eosio.contracts-old/eosio.system signup.cpp --abigen
15 changes: 3 additions & 12 deletions signup.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "extra.cpp"

void signup::transfer( name from, name to, asset quantity, string memo ) {
void signup::dummy() { print("DUMMY"); }

void signup::on_transfer( name from, name to, asset quantity, string memo ) {
// do nothing on outgoing transfers
if (from == _self || to != _self) {
return;
Expand Down Expand Up @@ -145,14 +147,3 @@ void signup::transfer( name from, name to, asset quantity, string memo ) {
// Notify a partner about this newly created account
require_recipient(PARTNER);
}

//EOSIO_DISPATCH(signup, (transfer))
// custom dispatcher:
// https://developers.eos.io/eosio-home/docs/writing-a-custom-dispatcher
extern "C" {
void apply(uint64_t receiver, uint64_t code, uint64_t action) {
if(code==name("eosio.token").value && action==name("transfer").value) {
execute_action(name(receiver), name(code), &signup::transfer );
}
}
};
8 changes: 4 additions & 4 deletions signup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ CONTRACT signup : public eosio::contract {
public:
using contract::contract;

ACTION transfer( name from,
name to,
asset quantity,
string memo );
ACTION dummy();

[[eosio::on_notify("eosio.token::transfer")]]
void on_transfer( name from, name to, asset quantity, string memo );

signup( name receiver, name code, datastream<const char*> ds ):
contract( receiver, code, ds ) {}
Expand Down

0 comments on commit 3ed561f

Please sign in to comment.