Browse Source

Mainnet toggle

etomic
jl777 7 years ago
parent
commit
c2d500708e
  1. 4
      iguana/exchanges/LP_etomic.c
  2. 2
      iguana/exchanges/LP_prices.c
  3. 2
      iguana/exchanges/etomicswap/etomiccurl.c
  4. 10
      iguana/exchanges/etomicswap/etomiccurl.h
  5. 4
      iguana/exchanges/etomicswap/etomiclib.cpp
  6. 14
      iguana/exchanges/etomicswap/etomiclib.h

4
iguana/exchanges/LP_etomic.c

@ -25,10 +25,6 @@
#include "etomicswap/etomiccurl.h"
#include <inttypes.h>
#define ETOMIC_ALICECONTRACT "0xe1D4236C5774D35Dc47dcc2E5E0CcFc463A3289c"
#define ETOMIC_BOBCONTRACT "0x9387Fd3a016bB0205e4e131Dde886B9d2BC000A2"
#define ETOMIC_SATOSHICAT "0000000000"
char *LP_etomicalice_send_payment(struct basilisk_swap *swap)
{
AliceSendsEthPaymentInput input; AliceSendsErc20PaymentInput input20; BasicTxData txData;

2
iguana/exchanges/LP_prices.c

@ -515,7 +515,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price)
struct LP_priceinfo *basepp,*relpp; struct LP_pubkey_info *pubp; double minprice,maxprice;
*changedp = 0;
//if ( strcmp("DEX",base) == 0 || strcmp("DEX",rel) == 0 )
// printf("%s/%s setprice %.8f\n",base,rel,price);
printf("%s/%s setprice %.8f\n",base,rel,price);
if ( base != 0 && rel != 0 && (basepp= LP_priceinfofind(base)) != 0 && (relpp= LP_priceinfofind(rel)) != 0 )
{

2
iguana/exchanges/etomicswap/etomiccurl.c

@ -4,7 +4,7 @@
#include <stdlib.h>
#include "../../../includes/cJSON.h"
static char *ethRpcUrl = "https://ropsten.infura.io/y07GHxUyTgeN2mdfOonu";
static char *ethRpcUrl = ETOMIC_URL;
struct string {
char *ptr;

10
iguana/exchanges/etomicswap/etomiccurl.h

@ -3,6 +3,14 @@
#ifdef __cplusplus
extern "C"{
#endif
#define ETOMIC_TESTNET
#ifdef ETOMIC_TESTNET
#define ETOMIC_URL "https://ropsten.infura.io/y07GHxUyTgeN2mdfOonu"
#else
#define ETOMIC_URL "https://mainnet.infura.io/y07GHxUyTgeN2mdfOonu"
#endif
typedef struct
{
uint64_t blockNumber;
@ -17,4 +25,4 @@ EthTxReceipt getEthTxReceipt(char *txId);
#ifdef __cplusplus
}
#endif
#endif

4
iguana/exchanges/etomicswap/etomiclib.cpp

@ -27,7 +27,7 @@ TransactionSkeleton txDataToSkeleton(BasicTxData txData)
tx.to = jsToAddress(txData.to);
tx.value = jsToU256(txData.amount);
tx.gas = 300000;
tx.gasPrice = 100 * exp10<9>();
tx.gasPrice = ETOMIC_GASMULT * exp10<9>();
tx.nonce = getNonce(txData.from);
return tx;
}
@ -50,7 +50,7 @@ char* approveErc20(char* amount, char* from, char* secret)
tx.to = jsToAddress("0xc0eb7AeD740E1796992A08962c15661bDEB58003");
tx.value = 0; // exp10<18>();
tx.gas = 300000;
tx.gasPrice = 100 * exp10<9>();
tx.gasPrice = ETOMIC_GASMULT * exp10<9>();
tx.nonce = getNonce(from);
std::stringstream ss;
ss << "0x095ea7b3"

14
iguana/exchanges/etomicswap/etomiclib.h

@ -6,6 +6,20 @@
#ifdef __cplusplus
extern "C" {
#endif
#define ETOMIC_TESTNET
#ifdef ETOMIC_TESTNET
#define ETOMIC_ALICECONTRACT "0xe1D4236C5774D35Dc47dcc2E5E0CcFc463A3289c"
#define ETOMIC_BOBCONTRACT "0x9387Fd3a016bB0205e4e131Dde886B9d2BC000A2"
#define ETOMIC_GASMULT 100
#else
#define ETOMIC_ALICECONTRACT "0x9bC5418CEdED51dB08467fc4b62F32C5D9EBdA55"
#define ETOMIC_BOBCONTRACT "0xB1Ad803ea4F57401639c123000C75F5B66E4D123"
#define ETOMIC_GASMULT 4
#endif
#define ETOMIC_SATOSHICAT "0000000000"
typedef struct {
char from[65];
char to[65];

Loading…
Cancel
Save