Skip to content

Commit

Permalink
add new admin app function detail
Browse files Browse the repository at this point in the history
  • Loading branch information
sadiabbasi committed Feb 21, 2024
1 parent eeee93b commit 7850d79
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions contracts/tonomy/include/tonomy/tonomy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,29 @@ namespace tonomysystem
string origin,
public_key key);

/**
* Create a new admin account for an app and registers it's details
*
* @details Creates a new admin account for an app and registers it's details.
*
* @param user_name - name of the admin
* @param name - name of the app
* @param description - description of the app
* @param username_hash - hash of the username
* @param logo_url - url to the logo of the app
* @param origin - domain associated with the app
* @param password_key - public key generated from the account's password
*/
[[eosio::action]] void newappadmin(
string user_name,
string app_name,
string description,
checksum256 username_hash,
string logo_url,
string origin,
public_key key);


/**
* Adds a new key to a person's account to log into an app with
*
Expand Down Expand Up @@ -308,6 +331,7 @@ namespace tonomysystem
using newperson_action = action_wrapper<"newperson"_n, &tonomy::newperson>;
using updatekeyper_action = action_wrapper<"updatekeyper"_n, &tonomy::updatekeyper>;
using newapp_action = action_wrapper<"newapp"_n, &tonomy::newapp>;
using newappadmin_action = action_wrapper<"newappadmin"_n, &tonomy::newappadmin>;
using loginwithapp_action = action_wrapper<"loginwithapp"_n, &tonomy::loginwithapp>;
using adminsetapp_action = action_wrapper<"adminsetapp"_n, &tonomy::adminsetapp>;
using setresparams_action = action_wrapper<"setresparams"_n, &tonomy::setresparams>;
Expand Down
2 changes: 1 addition & 1 deletion contracts/tonomy/src/tonomy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ namespace tonomysystem
string logo_url,
string origin,
public_key key) {
eosio::require_auth(user_name);
require_auth(native::governance_name); // check authorization is gov.tmy
checksum256 description_hash = eosio::sha256(description.c_str(), description.length());

// use the password_key public key for the owner authority
Expand Down

0 comments on commit 7850d79

Please sign in to comment.