Add Compound support as an internal plugin
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "eth_plugin_internal.h"
|
||||
|
||||
void erc20_plugin_call(int message, void *parameters);
|
||||
void compound_plugin_call(int message, void *parameters);
|
||||
void starkware_plugin_call(int message, void *parameters);
|
||||
|
||||
static const uint8_t const ERC20_TRANSFER_SELECTOR[SELECTOR_SIZE] = { 0xa9, 0x05, 0x9c, 0xbb };
|
||||
@@ -10,6 +11,16 @@ const uint8_t* const ERC20_SELECTORS[NUM_ERC20_SELECTORS] = {
|
||||
ERC20_TRANSFER_SELECTOR, ERC20_APPROVE_SELECTOR
|
||||
};
|
||||
|
||||
static const uint8_t const COMPOUND_REDEEM_UNDERLYING_SELECTOR[SELECTOR_SIZE] = { 0x85, 0x2a, 0x12, 0xe3 };
|
||||
static const uint8_t const COMPOUND_REDEEM_SELECTOR[SELECTOR_SIZE] = { 0xdb, 0x00, 0x6a, 0x75 };
|
||||
static const uint8_t const COMPOUND_MINT_SELECTOR[SELECTOR_SIZE] = { 0xa0, 0x71, 0x2d, 0x68 };
|
||||
static const uint8_t const CETH_MINT_SELECTOR[SELECTOR_SIZE] = { 0x12, 0x49, 0xc5, 0x8b };
|
||||
|
||||
const uint8_t* const COMPOUND_SELECTORS[NUM_COMPOUND_SELECTORS] = {
|
||||
COMPOUND_REDEEM_UNDERLYING_SELECTOR, COMPOUND_REDEEM_SELECTOR,
|
||||
COMPOUND_MINT_SELECTOR, CETH_MINT_SELECTOR
|
||||
};
|
||||
|
||||
#ifdef HAVE_STARKWARE
|
||||
|
||||
static const uint8_t const STARKWARE_REGISTER_ID[SELECTOR_SIZE] = { 0x76, 0x57, 0x18, 0xd7 };
|
||||
@@ -42,6 +53,13 @@ const internalEthPlugin_t const INTERNAL_ETH_PLUGINS[NUM_INTERNAL_PLUGINS] = {
|
||||
erc20_plugin_call
|
||||
},
|
||||
|
||||
{
|
||||
COMPOUND_SELECTORS,
|
||||
4,
|
||||
"-cmpd",
|
||||
compound_plugin_call
|
||||
},
|
||||
|
||||
#ifdef HAVE_STARKWARE
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user