Skip to content

Instantly share code, notes, and snippets.

@quocle108
Created November 30, 2018 06:20
Show Gist options
  • Save quocle108/3394054af8f6d1a425e0a3e1d25ef589 to your computer and use it in GitHub Desktop.
Save quocle108/3394054af8f6d1a425e0a3e1d25ef589 to your computer and use it in GitHub Desktop.
#define EOSIO_ABI_EX( TYPE, MEMBERS )
extern "C" {
void apply( uint64_t receiver, uint64_t code, uint64_t action ) {
auto self = receiver;
if( code == self || code == N(eosio.token) || action == N(onerror) ) {
if( action == N(transfer)){
eosio_assert( code == N(eosio.token), "Must transfer EOS");
}
TYPE thiscontract( self );
switch( action ) {
EOSIO_API( TYPE, MEMBERS )
}
/* does not allow destructor of thiscontract to run: eosio_exit(0); */
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment