Skip to content

Commit

Permalink
Merge pull request #301 from fioprotocol/revert-296-audit/bd-2893-march
Browse files Browse the repository at this point in the history
Revert "unpack and dont allow actor to run contract on their account"
  • Loading branch information
ericbutz authored Apr 17, 2023
2 parents 4431e5d + 35c7168 commit e43667a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 13 deletions.
10 changes: 0 additions & 10 deletions contracts/fio.token/include/fio.token/fio.token.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <fio.fee/fio.fee.hpp>
#include <fio.tpid/fio.tpid.hpp>
#include <fio.staking/fio.staking.hpp>
#include <eosiolib/action.hpp>

//FIP-38 begin
struct bind2eosio {
Expand Down Expand Up @@ -111,15 +110,6 @@ namespace eosio {
using mintfio_action = eosio::action_wrapper<"mintfio"_n, &token::mintfio>;
using retire_action = eosio::action_wrapper<"retire"_n, &token::retire>;
using transfer_action = eosio::action_wrapper<"transfer"_n, &token::transfer>;
using trnsfiopubky_action = eosio::action_wrapper<"trnsfiopubky"_n, &token::trnsfiopubky>;

struct st_trnsfiopubky {
string payee_public_key;
int64_t amount;
int64_t max_fee;
name actor;
string tpid;
};

private:
struct [[eosio::table]] account {
Expand Down
4 changes: 1 addition & 3 deletions contracts/fio.token/src/fio.token.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,7 @@ namespace eosio {
fio_fees(actor, asset{(int64_t) reg_amount, FIOSYMBOL}, TRANSFER_TOKENS_PUBKEY_ENDPOINT);
process_rewards(tpid, reg_amount,get_self(), actor);

//BD-2893 don't allow actor to run contract on their account
auto data = eosio::unpack_action_data<st_trnsfiopubky>();
fio_403_assert(data.actor != get_self(), ErrorSignature);
require_recipient(actor);

if (accountExists) {
require_recipient(new_account_name);
Expand Down

0 comments on commit e43667a

Please sign in to comment.