Skip to content
Open
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
22 changes: 15 additions & 7 deletions eosio.lost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ void lostcontract::verify(std::vector<char> sig, name account, public_key newpub
auto whitelisted = whitelist.get(account.value, "Account is not whitelisted");

auto verification = verifications.find(account.value);
eosio_assert(verification == verifications.end(), "Account already verified");
eosio_assert(verification == verifications.end() || verification->updated == 0, "Account has already been updated");


/////////////////////////
Expand Down Expand Up @@ -166,12 +166,20 @@ void lostcontract::verify(std::vector<char> sig, name account, public_key newpub
eosio_assert( calculated_eth_address == lowercase_whitelist, "Message was not properly signed by the ETH key for the account" );

// Once all checks have passed, store the key change information
verifications.emplace(rampayer, [&](verify_info &v){
v.claimer = account;
v.added = time_point_sec(now());
v.new_key = newpubkey;
v.updated = 0;
});
if (verification == verifications.end()) {
verifications.emplace(rampayer, [&](verify_info &v){
v.claimer = account;
v.added = time_point_sec(now());
v.new_key = newpubkey;
v.updated = 0;
});
}
else {
verifications.modify(verification, rampayer, [&](verify_info &v){
v.added = time_point_sec(now());
v.new_key = newpubkey;
});
}

string msg = "Someone is trying to reset your EOS private key";
action(permission_level{_self, "active"_n},
Expand Down