cryptnox-pos 1.0.0
Standalone USDC payment terminal firmware (ESP32 + Cryptnox smart card)
Loading...
Searching...
No Matches
config_defaults.h
Go to the documentation of this file.
1/*
2 * SPDX-License-Identifier: LGPL-3.0-or-later
3 * Copyright (c) 2026 Cryptnox SA
4 */
5
11
12#ifndef CONFIG_DEFAULTS_H
13#define CONFIG_DEFAULTS_H
14
15#include "config.h"
16
17/* Tron TRC-20 support post-dates the first config.h files in the field. An
18 * empty contract fails its base58 decode at boot, which disables that asset
19 * rather than breaking the build of a config that predates it. */
20#ifndef TRON_ADDR_USDT
21#define TRON_ADDR_USDT ""
22#endif
23/* Same story for every asset added since: an empty contract fails its parse at
24 * boot and only that one asset is refused, so a config.h written before it
25 * existed still builds and still charges in whatever it was set up for. */
26#ifndef TRON_ADDR_USDC
27#define TRON_ADDR_USDC ""
28#endif
29#ifndef ADDR_USDT
30#define ADDR_USDT ""
31#endif
32#ifndef POLY_ADDR_USDC
33#define POLY_ADDR_USDC ""
34#endif
35#ifndef POLY_ADDR_USDT
36#define POLY_ADDR_USDT ""
37#endif
38/* Polygon needs an endpoint and a chain id of its own. A config.h that predates
39 * Polygon support falls back to the Ethereum ones, which is harmless: its assets
40 * have no contract either, so they are refused before anything is signed. */
41#ifndef POLY_RPC_URL
42#define POLY_RPC_URL RPC_URL
43#endif
44#ifndef CHAIN_ID_AMOY
45#define CHAIN_ID_AMOY CHAIN_ID_SEPOLIA
46#endif
47#ifndef POLY_MIN_PRIORITY_FEE_GWEI
48#define POLY_MIN_PRIORITY_FEE_GWEI 30U
49#endif
50/* A plain value transfer to an account costs exactly 21000 gas — no contract
51 * runs — so GAS_LIMIT_ERC20's allowance for a token's storage writes is not
52 * merely generous here, it is the wrong number. */
53#ifndef GAS_LIMIT_NATIVE
54#define GAS_LIMIT_NATIVE 21000ULL
55#endif
56#ifndef TRON_TRC20_FEE_LIMIT_SUN
57#define TRON_TRC20_FEE_LIMIT_SUN 100000000ULL
58#endif
59/* The production networks. A config.h written before they were selectable falls
60 * back to its testnet values everywhere, so such a build keeps working exactly as
61 * it did — the switch on the config page then moves nothing, which is the right
62 * answer for a file that names no mainnet to move to. The empty contracts are the
63 * usual "this asset was never set up": refused, with the rest still working. */
64#ifndef RPC_URL_MAIN
65#define RPC_URL_MAIN RPC_URL
66#endif
67#ifndef POLY_RPC_URL_MAIN
68#define POLY_RPC_URL_MAIN POLY_RPC_URL
69#endif
70#ifndef TRON_URL_MAIN
71#define TRON_URL_MAIN TRON_URL
72#endif
73#ifndef CHAIN_ID_MAINNET
74#define CHAIN_ID_MAINNET CHAIN_ID_SEPOLIA
75#endif
76#ifndef CHAIN_ID_POLYGON
77#define CHAIN_ID_POLYGON CHAIN_ID_AMOY
78#endif
79#ifndef ADDR_USDC_MAIN
80#define ADDR_USDC_MAIN ""
81#endif
82#ifndef ADDR_USDT_MAIN
83#define ADDR_USDT_MAIN ""
84#endif
85#ifndef POLY_ADDR_USDC_MAIN
86#define POLY_ADDR_USDC_MAIN ""
87#endif
88#ifndef POLY_ADDR_USDT_MAIN
89#define POLY_ADDR_USDT_MAIN ""
90#endif
91#ifndef TRON_ADDR_USDT_MAIN
92#define TRON_ADDR_USDT_MAIN ""
93#endif
94#ifndef TRON_ADDR_USDC_MAIN
95#define TRON_ADDR_USDC_MAIN ""
96#endif
97
98#endif /* CONFIG_DEFAULTS_H */