Basic Implementation

This is the authentikeos smart contract's logic. All it's doing is requesting the permission level. For other DSP services other advanced logic can also play into satisfying a request such as:

  1. Owning an NFT

  2. Holding or Staking another token

  3. Having the playload signature match a static checksum

#include "../dappservices/auth.hpp"

#define DAPPSERVICES_ACTIONS() \
  XSIGNAL_DAPPSERVICE_ACTION \
  AUTH_DAPPSERVICE_ACTIONS
#define DAPPSERVICE_ACTIONS_COMMANDS() \
  AUTH_SVC_COMMANDS() 

#define CONTRACT_NAME() authenticator

CONTRACT_START()
 bool allow_usage(name account, name permission, std::string client_code, checksum256 payload_hash,std::vector<char> signature, name current_provider){
     require_auth(permission_level{account, permission}); 
     return true;
 }
CONTRACT_END()

Last updated