-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from blooo-io/feat/LAPP-4-add-minttoken-selecto…
…r-in-main-c feat(poap ledger plugin): added mintToken method to poap plugin
- Loading branch information
Showing
8 changed files
with
131 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,18 @@ | ||
#include "poap_plugin.h" | ||
|
||
// EDIT THIS: Adapt this function to your needs! Remember, the information for tokens are held in | ||
// `msg->token1` and `msg->token2`. If those pointers are `NULL`, this means the ethereum app didn't | ||
// find any info regarding the requested tokens! | ||
void handle_provide_token(void *parameters) { | ||
ethPluginProvideToken_t *msg = (ethPluginProvideToken_t *) parameters; | ||
context_t *context = (context_t *) msg->pluginContext; | ||
|
||
if (msg->token1) { | ||
// The Ethereum App found the information for the requested token! | ||
// Store its decimals. | ||
PRINTF("POAP plugin provide token: 0x%p\n", msg->token1); | ||
|
||
if (msg->token1 != NULL) { | ||
context->decimals = msg->token1->decimals; | ||
// Store its ticker. | ||
strlcpy(context->ticker, (char *) msg->token1->ticker, sizeof(context->ticker)); | ||
|
||
// Keep track that we found the token. | ||
context->token_found = true; | ||
context->tokens_found |= TOKEN_RECEIVED_FOUND; | ||
} else { | ||
// The Ethereum App did not manage to find the info for the requested token. | ||
context->token_found = false; | ||
|
||
// If we wanted to add a screen, say a warning screen for example, we could instruct the | ||
// ethereum app to add an additional screen by setting `msg->additionalScreens` here, just | ||
// like so: | ||
// msg->additionalScreens = 1; | ||
context->decimals = DEFAULT_DECIMAL; | ||
msg->additionalScreens++; | ||
} | ||
msg->result = ETH_PLUGIN_RESULT_OK; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.