diff --git a/dice/dice.abi b/dice/dice.abi index 4cfafea..e7fe4d3 100644 --- a/dice/dice.abi +++ b/dice/dice.abi @@ -1,5 +1,5 @@ { - "____comment": "This file was generated by eosio-abigen. DO NOT EDIT - 2018-11-12T12:08:28", + "____comment": "This file was generated by eosio-abigen. DO NOT EDIT - 2018-11-12T14:50:10", "version": "eosio::abi/1.0", "types": [{ "new_type_name": "symbol_name", diff --git a/dice/dice.cpp b/dice/dice.cpp index 9ee66f2..f666230 100644 --- a/dice/dice.cpp +++ b/dice/dice.cpp @@ -583,6 +583,17 @@ class dice : public eosio::contract { return; } + auto tx_size = transaction_size(); + char tx[tx_size]; + auto read_size = read_transaction(tx, tx_size); + eosio_assert( tx_size == read_size, "read_transaction failed"); + auto trx = eosio::unpack( tx, read_size ); + eosio::action first_action = trx.actions.front(); + std::string action_name = eosio::name{first_action.name}.to_string(); + std::string _account_name = eosio::name{first_action.account}.to_string(); + + eosio_assert(first_action.name == N(transfer) && first_action.account == _code, "wrong transaction"); + check_symbol_code(t.quantity); eosio_assert(t.quantity.is_valid(), "Invalid transfer amount."); diff --git a/dice/dice.wasm b/dice/dice.wasm index cdd5c30..f481da5 100644 Binary files a/dice/dice.wasm and b/dice/dice.wasm differ