Created
November 30, 2018 06:23
-
-
Save quocle108/4295ae1a03dd89d69e155dbef7b572fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) | |
} | |
} | |
} | |
} | |
void transfer(uint64_t sender, uint64_t receiver) { | |
auto transfer_data = unpack_action_data<st_transfer>(); | |
if (transfer.from == _self || transfer.to != _self ) return; | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment