Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Began Enumerated Lists and ABI Extensions
- Loading branch information
1 parent
a37422f
commit cfbba33
Showing
4 changed files
with
92 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <eosiolib/eosio.hpp> | ||
#include <eosiolib/print.h> | ||
|
||
using namespace eosio; | ||
using std::string; | ||
|
||
class enumerate : eosio::contract { | ||
|
||
private: | ||
// Game status types | ||
enum game_status: uint8_t { | ||
OPEN = 0, | ||
PAUSED = 1, | ||
CLOSED = 2 | ||
}; | ||
}; |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
extern "C" void apply(uint64_t receiver, uint64_t code, uint64_t action) { | ||
|
||
auto self = receiver; | ||
|
||
if (code == self || code == N(eosio.token)) { | ||
|
||
if (action == N(transfer)) { | ||
eosio_assert(code == N(eosio.token), "EOS required for transfer"); | ||
} | ||
|
||
TYPE thiscontract(self); | ||
|
||
switch (action) { | ||
EOSIO_API(TYPE, MEMBERS) | ||
} | ||
|
||
// Prevent contract destructor from executing `eosio_exit(0);` | ||
} | ||
} |