Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion contracts/fio.common/fio.common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#define SECONDSPERDAY 86400
#define DOMAINWAITFORBURNDAYS 90 * SECONDSPERDAY
#define ADDRESSWAITFORBURNDAYS 365 * SECONDSPERDAY
#define MAXBOUNTYTOKENSTOMINT 125000000000000000
#define MAXBOUNTYTOKENSTOMINT 75000000000000000
//#define MINVOTEDFIO 10'000'000'000000000 //TESTNET ONLY
#define MINVOTEDFIO 65'000'000'000000000
#define MINUTE 60
Expand Down Expand Up @@ -276,6 +276,13 @@ namespace fioio {

typedef singleton<"bounties"_n, bounty> bounties_table;

// FIP-53 execution guard
struct [[eosio::table]] fip53state {
bool executed = false;
EOSLIB_SERIALIZE(fip53state, (executed))
};
typedef singleton<"fip53state"_n, fip53state> fip53state_table;

//this will call update tpid in the tpid contract,
//add the info to the tpid table for this TPID and also set up the auto proxy if needed.
void set_auto_proxy(const string &tpid, const uint64_t &amount, const name &auth, const name &actor){
Expand Down
7 changes: 7 additions & 0 deletions contracts/fio.token/include/fio.token/fio.token.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ static const vector<fip48datainfo> fip48reallocationlist = {
static const uint64_t fip48expectedtotaltransferamount = 38505959400000000;
static const name fip48recevingaccount = name("pkfbwyi2qzii");

static const uint64_t fip53mintamount = 50000000000000000; // 50,000,000 FIO in SUFs
static const name fip53receivingaccount = name("pkfbwyi2qzii");

//FIP-38 begin
struct bind2eosio {
name accountName;
Expand Down Expand Up @@ -114,6 +117,10 @@ namespace eosio {
[[eosio::action]]
void fipxlviii();

//fip53
[[eosio::action]]
void fipliii();

[[eosio::action]]
void trnsloctoks(const string &payee_public_key,
const int32_t &can_vote,
Expand Down
41 changes: 40 additions & 1 deletion contracts/fio.token/src/fio.token.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,45 @@ namespace eosio {
send_response(response_string.c_str());
}

//fip53
void token::fipliii() {
// Authorization: only callable by eosio (BP msig)
eosio_assert(has_auth(SYSTEMACCOUNT),
"missing required authority of eosio");

// Contract account validation
check(get_self() == TokenContract,
"fipliii must be called on fio.token contract");

// Re-execution guard
fip53state_table fip53_guard(get_self(), get_self().value);
if (!fip53_guard.exists()) {
fip53_guard.set(fioio::fip53state{false}, get_self());
}
check(!fip53_guard.get().executed, "fip53 has already been executed");

// Recipient account validation
check(is_account(fip53receivingaccount),
"fip53 receiving account does not exist");

// Mint and transfer via "issue" action (includes 1B supply cap validation)
action(
permission_level{SYSTEMACCOUNT, "active"_n},
TokenContract, "issue"_n,
make_tuple(fip53receivingaccount,
asset(fip53mintamount, FIOSYMBOL),
string("minted tokens for fip53"))
).send();

fip53_guard.set(fioio::fip53state{true}, get_self());

const string response_string = string("{\"status\": \"OK\"}");
fio_400_assert(transaction_size() <= MAX_TRX_SIZE, "transaction_size", std::to_string(transaction_size()),
"Transaction is too large", ErrorTransactionTooLarge);

send_response(response_string.c_str());
}

void token::trnsloctoks(const string &payee_public_key,
const int32_t &can_vote,
const vector<eosiosystem::lockperiodv2> periods,
Expand Down Expand Up @@ -816,4 +855,4 @@ namespace eosio {
}
} /// namespace eosio

EOSIO_DISPATCH( eosio::token, (create)(issue)(mintfio)(transfer)(trnsfiopubky)(trnsloctoks)(retire)(fipxlviii))
EOSIO_DISPATCH( eosio::token, (create)(issue)(mintfio)(transfer)(trnsfiopubky)(trnsloctoks)(retire)(fipxlviii)(fipliii))