Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This requires CDT 1.6.x or later
- #include <eosio/eosio.hpp>
- #include <string>
- #include <tuple>
- using namespace eosio;
- CONTRACT sample: public contract {
- public:
- WAX_CONTRACT_NAME(name receiver, name code, datastream<const char*> ds)
- : contract(receiver, code, ds) {
- }
- ACTION printrand(uint64_t assoc_id, uint64_t signing_value) {
- action(
- { get_self(), "active"_n },
- "orng.wax"_n,
- "requestrand"_n,
- std::tuple{ assoc_id, signing_value, get_self() })
- .send();
- }
- /// Called automatically by 'orng.wax' smart contract when the RNG Oracle
- /// has generated the random value. wax.orng, before calling this action,
- /// verifies that the generated random value was signed with the
- /// provided "signing_value"
- ACTION receiverand(uint64_t assoc_id, const std::string& random_value) {
- print_f("Assoc ID = %, Random value = %\n", assoc_id, random_value.c_str());
- }
- }; // CONTRACT sample
- EOSIO_DISPATCH(WAX_CONTRACT_NAME, (printrand)(receiverand))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement