Files
app-ethereum/src_plugins/erc721/erc721_plugin.h
Alexandre Paillier eb531de5d2 [clean] Linting pass
2022-01-14 17:33:20 +01:00

47 lines
868 B
C

#ifdef HAVE_NFT_SUPPORT
#pragma once
#include <string.h>
#include "eth_plugin_handler.h"
#include "shared_context.h"
#include "ethUtils.h"
#include "utils.h"
// Internal plugin for EIP 721: https://eips.ethereum.org/EIPS/eip-721
#define NUM_ERC721_SELECTORS 5
typedef enum {
APPROVE,
SET_APPROVAL_FOR_ALL,
TRANSFER,
SAFE_TRANSFER,
SAFE_TRANSFER_DATA,
} erc721_selector_t;
typedef enum {
FROM,
TO,
DATA,
TOKEN_ID,
OPERATOR,
APPROVED,
NONE,
} erc721_selector_field;
typedef struct erc721_context_t {
uint8_t address[ADDRESS_LENGTH];
uint8_t tokenId[INT256_LENGTH];
bool approved;
erc721_selector_field next_param;
uint8_t selectorIndex;
} erc721_context_t;
void handle_provide_parameter_721(void *parameters);
void handle_query_contract_ui_721(void *parameters);
#endif // HAVE_NFT_SUPPORT