2022-03-08 17:59:36 +01:00
|
|
|
#include <string.h>
|
2020-09-22 09:22:49 +02:00
|
|
|
#include "eth_plugin_internal.h"
|
2024-01-15 19:25:44 +01:00
|
|
|
#include "plugin_utils.h"
|
2020-09-22 09:22:49 +02:00
|
|
|
|
2020-12-01 16:20:13 +01:00
|
|
|
void erc20_plugin_call(int message, void* parameters);
|
2021-11-22 14:39:36 +01:00
|
|
|
|
2020-10-27 11:16:50 +01:00
|
|
|
#ifdef HAVE_ETH2
|
2020-12-01 16:20:13 +01:00
|
|
|
void eth2_plugin_call(int message, void* parameters);
|
2020-10-27 11:16:50 +01:00
|
|
|
#endif
|
2020-09-22 09:22:49 +02:00
|
|
|
|
2021-07-05 11:01:51 +02:00
|
|
|
static const uint8_t ERC20_TRANSFER_SELECTOR[SELECTOR_SIZE] = {0xa9, 0x05, 0x9c, 0xbb};
|
|
|
|
|
static const uint8_t ERC20_APPROVE_SELECTOR[SELECTOR_SIZE] = {0x09, 0x5e, 0xa7, 0xb3};
|
2020-09-22 09:22:49 +02:00
|
|
|
|
2020-12-01 16:20:13 +01:00
|
|
|
const uint8_t* const ERC20_SELECTORS[NUM_ERC20_SELECTORS] = {ERC20_TRANSFER_SELECTOR,
|
|
|
|
|
ERC20_APPROVE_SELECTOR};
|
2020-09-22 09:22:49 +02:00
|
|
|
|
2020-10-27 11:16:50 +01:00
|
|
|
#ifdef HAVE_ETH2
|
|
|
|
|
|
2021-07-05 11:01:51 +02:00
|
|
|
static const uint8_t ETH2_DEPOSIT_SELECTOR[SELECTOR_SIZE] = {0x22, 0x89, 0x51, 0x18};
|
2020-10-27 11:16:50 +01:00
|
|
|
|
2020-12-01 16:20:13 +01:00
|
|
|
const uint8_t* const ETH2_SELECTORS[NUM_ETH2_SELECTORS] = {ETH2_DEPOSIT_SELECTOR};
|
2020-10-27 11:16:50 +01:00
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
2020-09-22 09:22:49 +02:00
|
|
|
// All internal alias names start with 'minus'
|
|
|
|
|
|
2021-07-05 11:01:51 +02:00
|
|
|
const internalEthPlugin_t INTERNAL_ETH_PLUGINS[] = {
|
2024-04-12 16:40:05 +02:00
|
|
|
{NULL, ERC20_SELECTORS, NUM_ERC20_SELECTORS, "-erc20", erc20_plugin_call},
|
2020-12-01 16:20:13 +01:00
|
|
|
|
2020-10-27 11:16:50 +01:00
|
|
|
#ifdef HAVE_ETH2
|
|
|
|
|
|
2024-04-12 16:40:05 +02:00
|
|
|
{NULL, ETH2_SELECTORS, NUM_ETH2_SELECTORS, "-eth2", eth2_plugin_call},
|
2020-10-27 11:16:50 +01:00
|
|
|
|
2020-12-01 16:20:13 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
{NULL, NULL, 0, "", NULL}};
|