Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fbe/improvements before uniswap dev 2 #101

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ include $(BOLOS_SDK)/Makefile.defines
# Mandatory configuration #
########################################
# Application name
# Will be displayed on screen by the Ethereum app
APPNAME = "PluginBoilerplate"

# Application version
Expand Down
2 changes: 1 addition & 1 deletion src/contract.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
********************************************************************************/

#include <stdint.h>
#include "boilerplate_plugin.h"
#include "plugin.h"
#include "xmacro_helpers.h"

const uint32_t SELECTORS[SELECTOR_COUNT] = {SELECTORS_LIST(TO_VALUE)};
2 changes: 1 addition & 1 deletion src/handle_finalize.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "boilerplate_plugin.h"
#include "plugin.h"

void handle_finalize(void *parameters) {
ethPluginFinalize_t *msg = (ethPluginFinalize_t *) parameters;
Expand Down
2 changes: 1 addition & 1 deletion src/handle_init_contract.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "boilerplate_plugin.h"
#include "plugin.h"
#include "utils.h"

// Called once to init.
Expand Down
2 changes: 1 addition & 1 deletion src/handle_provide_parameter.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "boilerplate_plugin.h"
#include "plugin.h"

// EDIT THIS: Remove this function and write your own handlers!
static void handle_swap_exact_eth_for_tokens(ethPluginProvideParameter_t *msg, context_t *context) {
Expand Down
2 changes: 1 addition & 1 deletion src/handle_provide_token.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "boilerplate_plugin.h"
#include "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
Expand Down
4 changes: 2 additions & 2 deletions src/handle_query_contract_id.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "boilerplate_plugin.h"
#include "plugin.h"

// Sets the first screen to display.
void handle_query_contract_id(ethQueryContractID_t *msg) {
Expand All @@ -7,7 +7,7 @@ void handle_query_contract_id(ethQueryContractID_t *msg) {
// msg->version will be the lower sentence displayed on the screen.

// For the first screen, display the plugin name.
strlcpy(msg->name, PLUGIN_NAME, msg->nameLength);
strlcpy(msg->name, APPNAME, msg->nameLength);

// EDIT THIS: Adapt the cases by modifying the strings you pass to `strlcpy`.
if (context->selectorIndex == SWAP_EXACT_ETH_FOR_TOKENS) {
Expand Down
2 changes: 1 addition & 1 deletion src/handle_query_contract_ui.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "boilerplate_plugin.h"
#include "plugin.h"

// EDIT THIS: You need to adapt / remove the static functions (set_send_ui, set_receive_ui ...) to
// match what you wish to display.
Expand Down
4 changes: 0 additions & 4 deletions src/boilerplate_plugin.h → src/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
#include "eth_plugin_interface.h"
#include "xmacro_helpers.h"

// Name of the plugin.
// EDIT THIS: Replace with your plugin name.
#define PLUGIN_NAME "PluginBoilerplate"

// All possible selectors of your plugin.
// EDIT THIS: Enter your selectors here, in the format X(NAME, value)
// A macro below will create for you:
Expand Down
Loading