]> Git Repo - VerusCoin.git/blame - src/cc/CCcustom.cpp
Cleanup, comment out test code, prepare for release PR
[VerusCoin.git] / src / cc / CCcustom.cpp
CommitLineData
44a9fd7c 1/******************************************************************************
2 * Copyright © 2014-2018 The SuperNET Developers. *
3 * *
4 * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at *
5 * the top-level directory of this distribution for the individual copyright *
6 * holder information and the developer policies on copyright and licensing. *
7 * *
8 * Unless otherwise agreed in a custom licensing agreement, no part of the *
9 * SuperNET software, including this file may be copied, modified, propagated *
10 * or distributed except according to the terms contained in the LICENSE file *
11 * *
12 * Removal or modification of this copyright notice is prohibited. *
13 * *
14 ******************************************************************************/
15
ec8a120b 16#include "key_io.h"
44a9fd7c 17#include "CCinclude.h"
287efad4 18#include "CCassets.h"
19#include "CCfaucet.h"
20#include "CCrewards.h"
2fcf7a42 21#include "CCdice.h"
69829385 22#include "CCauction.h"
23#include "CClotto.h"
7137a022 24#include "CCfsm.h"
794a347f 25#include "CCMofN.h"
bae910a5 26#include "CCchannels.h"
c926780f 27#include "CCOracles.h"
28#include "CCPrices.h"
29#include "CCPegs.h"
30#include "CCTriggers.h"
31#include "CCPayments.h"
32#include "CCGateways.h"
ca4a5f26 33#include "StakeGuard.h"
44a9fd7c 34
35/*
36 CCcustom has most of the functions that need to be extended to create a new CC contract.
37
44a9fd7c 38 A CC scriptPubKey can only be spent if it is properly signed and validated. By constraining the vins and vouts, it is possible to implement a variety of functionality. CC vouts have an otherwise non-standard form, but it is properly supported by the enhanced bitcoin protocol code as a "cryptoconditions" output and the same pubkey will create a different address.
39
40 This allows creation of a special address(es) for each contract type, which has the privkey public. That allows anybody to properly sign and spend it, but with the constraints on what is allowed in the validation code, the contract functionality can be implemented.
a3518492 41
42 what needs to be done to add a new contract:
43 1. add EVAL_CODE to eval.h
44 2. initialize the variables in the CCinit function below
45 3. write a Validate function to reject any unsanctioned usage of vin/vout
46 4. make helper functions to create rawtx for RPC functions
da8b0b33 47 5. add rpc calls to rpcserver.cpp and rpcserver.h and in one of the rpc.cpp files
48 6. add the new .cpp files to src/Makefile.am
d5dae053 49
50 IMPORTANT: make sure that all CC inputs and CC outputs are properly accounted for and reconcile to the satoshi. The built in utxo management will enforce overall vin/vout constraints but it wont know anything about the CC constraints. That is what your Validate function needs to do.
51
52 Generally speaking, there will be normal coins that change into CC outputs, CC outputs that go back to being normal coins, CC outputs that are spent to new CC outputs.
53
54 Make sure both the CC coins and normal coins are preserved and follow the rules that make sense. It is a good idea to define specific roles for specific vins and vouts to reduce the complexity of validation.
44a9fd7c 55 */
56
287a373a 57// to create a new CCaddr, add to rpcwallet the CCaddress and start with -pubkey= with the pubkey of the new address, with its wif already imported. set normaladdr and CChexstr. run CCaddress and it will print the privkey along with autocorrect the CCaddress. which should then update the CCaddr here
4a4ab6c7 58
35173333 59// StakeGuard - nothing at stake
ec8a120b 60std::string StakeGuardAddr = "RCG8KwJNDVwpUBcdoa6AoHqHVJsA1uMYMR";
35173333 61std::string StakeGuardPubKey = "03166b7813a4855a88e9ef7340a692ef3c2decedfdc2c7563ec79537e89667d935";
62std::string StakeGuardWIF = "Uw7vRYHGKjyi1FaJ8Lv1USSuj7ntUti8fAhSDiCdbzuV6yDagaTn";
63
4a4ab6c7 64// Assets, aka Tokens
65#define FUNCNAME IsAssetsInput
66#define EVALCODE EVAL_ASSETS
075a1114 67const char *AssetsCCaddr = "RGKRjeTBw4LYFotSDLT6RWzMHbhXri6BG6";
68const char *AssetsNormaladdr = "RFYE2yL3KknWdHK6uNhvWacYsCUtwzjY3u";
44a9fd7c 69char AssetsCChexstr[67] = { "02adf84e0e075cf90868bd4e3d34a03420e034719649c41f371fc70d8e33aa2702" };
70uint8_t AssetsCCpriv[32] = { 0x9b, 0x17, 0x66, 0xe5, 0x82, 0x66, 0xac, 0xb6, 0xba, 0x43, 0x83, 0x74, 0xf7, 0x63, 0x11, 0x3b, 0xf0, 0xf3, 0x50, 0x6f, 0xd9, 0x6b, 0x67, 0x85, 0xf9, 0x7a, 0xf0, 0x54, 0x4d, 0xb1, 0x30, 0x77 };
194ad5b8 71
4a4ab6c7 72#include "CCcustom.inc"
73#undef FUNCNAME
74#undef EVALCODE
75
76// Faucet
77#define FUNCNAME IsFaucetInput
78#define EVALCODE EVAL_FAUCET
075a1114 79const char *FaucetCCaddr = "R9zHrofhRbub7ER77B7NrVch3A63R39GuC";
80const char *FaucetNormaladdr = "RKQV4oYs4rvxAWx1J43VnT73rSTVtUeckk";
65a961ff 81char FaucetCChexstr[67] = { "03682b255c40d0cde8faee381a1a50bbb89980ff24539cb8518e294d3a63cefe12" };
939225fa 82uint8_t FaucetCCpriv[32] = { 0xd4, 0x4f, 0xf2, 0x31, 0x71, 0x7d, 0x28, 0x02, 0x4b, 0xc7, 0xdd, 0x71, 0xa0, 0x39, 0xc4, 0xbe, 0x1a, 0xfe, 0xeb, 0xc2, 0x46, 0xda, 0x76, 0xf8, 0x07, 0x53, 0x3d, 0x96, 0xb4, 0xca, 0xa0, 0xe9 };
44a9fd7c 83
4a4ab6c7 84#include "CCcustom.inc"
85#undef FUNCNAME
86#undef EVALCODE
87
88// Rewards
89#define FUNCNAME IsRewardsInput
90#define EVALCODE EVAL_REWARDS
8bbfc238 91const char *RewardsCCaddr = "RTsRBYL1HSvMoE3qtBJkyiswdVaWkm8YTK";
92const char *RewardsNormaladdr = "RMgye9jeczNjQx9Uzq8no8pTLiCSwuHwkz";
93char RewardsCChexstr[67] = { "03da60379d924c2c30ac290d2a86c2ead128cb7bd571f69211cb95356e2dcc5eb9" };
94uint8_t RewardsCCpriv[32] = { 0x82, 0xf5, 0xd2, 0xe7, 0xd6, 0x99, 0x33, 0x77, 0xfb, 0x80, 0x00, 0x97, 0x23, 0x3d, 0x1e, 0x6f, 0x61, 0xa9, 0xb5, 0x2e, 0x5e, 0xb4, 0x96, 0x6f, 0xbc, 0xed, 0x6b, 0xe2, 0xbb, 0x7b, 0x4b, 0xb3 };
4a4ab6c7 95#include "CCcustom.inc"
96#undef FUNCNAME
97#undef EVALCODE
ea06d536 98
cfea7a46 99// Dice
100#define FUNCNAME IsDiceInput
101#define EVALCODE EVAL_DICE
075a1114 102const char *DiceCCaddr = "REabWB7KjFN5C3LFMZ5odExHPenYzHLtVw";
103const char *DiceNormaladdr = "RLEe8f7Eg3TDuXii9BmNiiiaVGraHUt25c";
fac62537 104char DiceCChexstr[67] = { "039d966927cfdadab3ee6c56da63c21f17ea753dde4b3dfd41487103e24b27e94e" };
6f1e714b 105uint8_t DiceCCpriv[32] = { 0x0e, 0xe8, 0xf5, 0xb4, 0x3d, 0x25, 0xcc, 0x35, 0xd1, 0xf1, 0x2f, 0x04, 0x5f, 0x01, 0x26, 0xb8, 0xd1, 0xac, 0x3a, 0x5a, 0xea, 0xe0, 0x25, 0xa2, 0x8f, 0x2a, 0x8e, 0x0e, 0xf9, 0x34, 0xfa, 0x77 };
cfea7a46 106#include "CCcustom.inc"
107#undef FUNCNAME
108#undef EVALCODE
109
69829385 110// Lotto
111#define FUNCNAME IsLottoInput
112#define EVALCODE EVAL_LOTTO
075a1114 113const char *LottoCCaddr = "RNXZxgyWSAE6XS3qGnTaf5dVNCxnYzhPrg";
114const char *LottoNormaladdr = "RLW6hhRqBZZMBndnyPv29Yg3krh6iBYCyg";
69829385 115char LottoCChexstr[67] = { "03f72d2c4db440df1e706502b09ca5fec73ffe954ea1883e4049e98da68690d98f" };
d3e128d9 116uint8_t LottoCCpriv[32] = { 0xb4, 0xac, 0xc2, 0xd9, 0x67, 0x34, 0xd7, 0x58, 0x80, 0x4e, 0x25, 0x55, 0xc0, 0x50, 0x66, 0x84, 0xbb, 0xa2, 0xe7, 0xc0, 0x39, 0x17, 0xb4, 0xc5, 0x07, 0xb7, 0x3f, 0xca, 0x07, 0xb0, 0x9a, 0xeb };
69829385 117#include "CCcustom.inc"
118#undef FUNCNAME
119#undef EVALCODE
120
7137a022 121// Finite State Machine
122#define FUNCNAME IsFSMInput
123#define EVALCODE EVAL_FSM
124const char *FSMCCaddr = "RUKTbLBeKgHkm3Ss4hKZP3ikuLW1xx7B2x";
125const char *FSMNormaladdr = "RWSHRbxnJYLvDjpcQ2i8MekgP6h2ctTKaj";
126char FSMCChexstr[67] = { "039b52d294b413b07f3643c1a28c5467901a76562d8b39a785910ae0a0f3043810" };
127uint8_t FSMCCpriv[32] = { 0x11, 0xe1, 0xea, 0x3e, 0xdb, 0x36, 0xf0, 0xa8, 0xc6, 0x34, 0xe1, 0x21, 0xb8, 0x02, 0xb9, 0x4b, 0x12, 0x37, 0x8f, 0xa0, 0x86, 0x23, 0x50, 0xb2, 0x5f, 0xe4, 0xe7, 0x36, 0x0f, 0xda, 0xae, 0xfc };
69829385 128#include "CCcustom.inc"
129#undef FUNCNAME
130#undef EVALCODE
131
132// Auction
133#define FUNCNAME IsAuctionInput
134#define EVALCODE EVAL_AUCTION
075a1114 135const char *AuctionCCaddr = "RL4YPX7JYG3FnvoPqWF2pn3nQknH5NWEwx";
136const char *AuctionNormaladdr = "RFtVDNmdTZBTNZdmFRbfBgJ6LitgTghikL";
69829385 137char AuctionCChexstr[67] = { "037eefe050c14cb60ae65d5b2f69eaa1c9006826d729bc0957bdc3024e3ca1dbe6" };
8ee5c997 138uint8_t AuctionCCpriv[32] = { 0x8c, 0x1b, 0xb7, 0x8c, 0x02, 0xa3, 0x9d, 0x21, 0x28, 0x59, 0xf5, 0xea, 0xda, 0xec, 0x0d, 0x11, 0xcd, 0x38, 0x47, 0xac, 0x0b, 0x6f, 0x19, 0xc0, 0x24, 0x36, 0xbf, 0x1c, 0x0a, 0x06, 0x31, 0xfb };
69829385 139#include "CCcustom.inc"
140#undef FUNCNAME
141#undef EVALCODE
142
da629dfe 143// MofN
144#define FUNCNAME IsMofNInput
145#define EVALCODE EVAL_MOFN
5ed65e2d 146const char *MofNCCaddr = "RDVHcSekmXgeYBqRupNTmqo3Rn8QRXNduy";
da629dfe 147const char *MofNNormaladdr = "RTPwUjKYECcGn6Y4KYChLhgaht1RSU4jwf";
148char MofNCChexstr[67] = { "03c91bef3d7cc59c3a89286833a3446b29e52a5e773f738a1ad2b09785e5f4179e" };
5ed65e2d 149uint8_t MofNCCpriv[32] = { 0x9d, 0xa1, 0xf8, 0xf7, 0xba, 0x0a, 0x91, 0x36, 0x89, 0x9a, 0x86, 0x30, 0x63, 0x20, 0xd7, 0xdf, 0xaa, 0x35, 0xe3, 0x99, 0x32, 0x2b, 0x63, 0xc0, 0x66, 0x9c, 0x93, 0xc4, 0x5e, 0x9d, 0xb9, 0xce };
da629dfe 150#include "CCcustom.inc"
151#undef FUNCNAME
152#undef EVALCODE
153
287a373a 154// Channels
155#define FUNCNAME IsChannelsInput
156#define EVALCODE EVAL_CHANNELS
cce2a32b 157const char *ChannelsCCaddr = "RQy3rwX8sP9oDm3c39vGKA6H315cgtPLfr";
287a373a 158const char *ChannelsNormaladdr = "RQUuT8zmkvDfXqECH4m3VD3SsHZAfnoh1v";
159char ChannelsCChexstr[67] = { "035debdb19b1c98c615259339500511d6216a3ffbeb28ff5655a7ef5790a12ab0b" };
cce2a32b 160uint8_t ChannelsCCpriv[32] = { 0xec, 0x91, 0x36, 0x15, 0x2d, 0xd4, 0x48, 0x73, 0x22, 0x36, 0x4f, 0x6a, 0x34, 0x5c, 0x61, 0x0f, 0x01, 0xb4, 0x79, 0xe8, 0x1c, 0x2f, 0xa1, 0x1d, 0x4a, 0x0a, 0x21, 0x16, 0xea, 0x82, 0x84, 0x60 };
287a373a 161#include "CCcustom.inc"
162#undef FUNCNAME
163#undef EVALCODE
164
c926780f 165// Oracles
166#define FUNCNAME IsOraclesInput
167#define EVALCODE EVAL_ORACLES
aed3f987 168const char *OraclesCCaddr = "REt2C4ZMnX8YYX1DRpffNA4hECZTFm39e3";
c926780f 169const char *OraclesNormaladdr = "RHkFKzn1csxA3fWzAsxsLWohoCgBbirXb5";
170char OraclesCChexstr[67] = { "038c1d42db6a45a57eccb8981b078fb7857b9b496293fe299d2b8d120ac5b5691a" };
aed3f987 171uint8_t OraclesCCpriv[32] = { 0xf7, 0x4b, 0x5b, 0xa2, 0x7a, 0x5e, 0x9c, 0xda, 0x89, 0xb1, 0xcb, 0xb9, 0xe6, 0x9c, 0x2c, 0x70, 0x85, 0x37, 0xdd, 0x00, 0x7a, 0x67, 0xff, 0x7c, 0x62, 0x1b, 0xe2, 0xfb, 0x04, 0x8f, 0x85, 0xbf };
c926780f 172#include "CCcustom.inc"
173#undef FUNCNAME
174#undef EVALCODE
175
176// Prices
177#define FUNCNAME IsPricesInput
178#define EVALCODE EVAL_PRICES
aed3f987 179const char *PricesCCaddr = "RAL5Vh8NXmFqEKJRKrk1KjKaUckK7mM1iS";
c926780f 180const char *PricesNormaladdr = "RBunXCsMHk5NPd6q8SQfmpgre3x133rSwZ";
181char PricesCChexstr[67] = { "039894cb054c0032e99e65e715b03799607aa91212a16648d391b6fa2cc52ed0cf" };
aed3f987 182uint8_t PricesCCpriv[32] = { 0x0a, 0x3b, 0xe7, 0x5d, 0xce, 0x06, 0xed, 0xb7, 0xc0, 0xb1, 0xbe, 0xe8, 0x7b, 0x5a, 0xd4, 0x99, 0xb8, 0x8d, 0xde, 0xac, 0xb2, 0x7e, 0x7a, 0x52, 0x96, 0x15, 0xd2, 0xa0, 0xc6, 0xb9, 0x89, 0x61 };
c926780f 183#include "CCcustom.inc"
184#undef FUNCNAME
185#undef EVALCODE
186
187// Pegs
188#define FUNCNAME IsPegsInput
189#define EVALCODE EVAL_PEGS
aed3f987 190const char *PegsCCaddr = "RHnkVb7vHuHnjEjhkCF1bS6xxLLNZPv5fd";
c926780f 191const char *PegsNormaladdr = "RMcCZtX6dHf1fz3gpLQhUEMQ8cVZ6Rzaro";
192char PegsCChexstr[67] = { "03c75c1de29a35e41606363b430c08be1c2dd93cf7a468229a082cc79c7b77eece" };
aed3f987 193uint8_t PegsCCpriv[32] = { 0x52, 0x56, 0x4c, 0x78, 0x87, 0xf7, 0xa2, 0x39, 0xb0, 0x90, 0xb7, 0xb8, 0x62, 0x80, 0x0f, 0x83, 0x18, 0x9d, 0xf4, 0xf4, 0xbd, 0x28, 0x09, 0xa9, 0x9b, 0x85, 0x54, 0x16, 0x0f, 0x3f, 0xfb, 0x65 };
c926780f 194#include "CCcustom.inc"
195#undef FUNCNAME
196#undef EVALCODE
197
198// Triggers
199#define FUNCNAME IsTriggersInput
200#define EVALCODE EVAL_TRIGGERS
aed3f987 201const char *TriggersCCaddr = "RGLSRDnUqTB43bYtRtNVgmwSSd1sun2te8";
c926780f 202const char *TriggersNormaladdr = "RMN25Tn8NNzcyQDiQNuMp8UmwLMFd9thYc";
203char TriggersCChexstr[67] = { "03afc5be570d0ff419425cfcc580cc762ab82baad88c148f5b028d7db7bfeee61d" };
aed3f987 204uint8_t TriggersCCpriv[32] = { 0x7c, 0x0b, 0x54, 0x9b, 0x65, 0xd4, 0x89, 0x57, 0xdf, 0x05, 0xfe, 0xa2, 0x62, 0x41, 0xa9, 0x09, 0x0f, 0x2a, 0x6b, 0x11, 0x2c, 0xbe, 0xbd, 0x06, 0x31, 0x8d, 0xc0, 0xb9, 0x96, 0x76, 0x3f, 0x24 };
c926780f 205#include "CCcustom.inc"
206#undef FUNCNAME
207#undef EVALCODE
208
209// Payments
210#define FUNCNAME IsPaymentsInput
211#define EVALCODE EVAL_PAYMENTS
2cd8440c 212const char *PaymentsCCaddr = "REpyKi7avsVduqZ3eimncK4uKqSArLTGGK";
c926780f 213const char *PaymentsNormaladdr = "RHRX8RTMAh2STWe9DHqsvJbzS7ty6aZy3d";
214char PaymentsCChexstr[67] = { "0358f1764f82c63abc7c7455555fd1d3184905e30e819e97667e247e5792b46856" };
2cd8440c 215uint8_t PaymentsCCpriv[32] = { 0x03, 0xc9, 0x73, 0xc2, 0xb8, 0x30, 0x3d, 0xbd, 0xc8, 0xd9, 0xbf, 0x02, 0x49, 0xd9, 0x65, 0x61, 0x45, 0xed, 0x9e, 0x93, 0x51, 0xab, 0x8b, 0x2e, 0xe7, 0xc7, 0x40, 0xf1, 0xc4, 0xd2, 0xc0, 0x5b };
c926780f 216#include "CCcustom.inc"
217#undef FUNCNAME
218#undef EVALCODE
219
220// Gateways
221#define FUNCNAME IsGatewaysInput
222#define EVALCODE EVAL_GATEWAYS
2cd8440c 223const char *GatewaysCCaddr = "RKWpoK6vTRtq5b9qrRBodLkCzeURHeEk33";
c926780f 224const char *GatewaysNormaladdr = "RGJKV97ZN1wBfunuMt1tebiiHENNEq73Yh";
225char GatewaysCChexstr[67] = { "03ea9c062b9652d8eff34879b504eda0717895d27597aaeb60347d65eed96ccb40" };
2cd8440c 226uint8_t GatewaysCCpriv[32] = { 0xf7, 0x4b, 0x5b, 0xa2, 0x7a, 0x5e, 0x9c, 0xda, 0x89, 0xb1, 0xcb, 0xb9, 0xe6, 0x9c, 0x2c, 0x70, 0x85, 0x37, 0xdd, 0x00, 0x7a, 0x67, 0xff, 0x7c, 0x62, 0x1b, 0xe2, 0xfb, 0x04, 0x8f, 0x85, 0xbf };
c926780f 227#include "CCcustom.inc"
228#undef FUNCNAME
229#undef EVALCODE
230
8a727a26 231struct CCcontract_info *CCinit(struct CCcontract_info *cp, uint8_t evalcode)
194ad5b8 232{
287efad4 233 cp->evalcode = evalcode;
234 switch ( evalcode )
194ad5b8 235 {
ca4a5f26 236 case EVAL_STAKEGUARD:
ec8a120b 237 strcpy(cp->unspendableCCaddr,StakeGuardAddr.c_str());
238 strcpy(cp->normaladdr,StakeGuardAddr.c_str());
239 strcpy(cp->CChexstr,StakeGuardPubKey.c_str());
240 memcpy(cp->CCpriv,DecodeSecret(StakeGuardWIF).begin(),32);
ca4a5f26 241 cp->validate = StakeGuardValidate;
ec8a120b 242 cp->ismyvin = IsStakeGuardInput;
8a727a26 243 break;
244
287efad4 245 case EVAL_ASSETS:
eb304fa0 246 strcpy(cp->unspendableCCaddr,AssetsCCaddr);
075a1114 247 strcpy(cp->normaladdr,AssetsNormaladdr);
287efad4 248 strcpy(cp->CChexstr,AssetsCChexstr);
249 memcpy(cp->CCpriv,AssetsCCpriv,32);
250 cp->validate = AssetsValidate;
251 cp->ismyvin = IsAssetsInput;
252 break;
253 case EVAL_FAUCET:
eb304fa0 254 strcpy(cp->unspendableCCaddr,FaucetCCaddr);
075a1114 255 strcpy(cp->normaladdr,FaucetNormaladdr);
287efad4 256 strcpy(cp->CChexstr,FaucetCChexstr);
257 memcpy(cp->CCpriv,FaucetCCpriv,32);
258 cp->validate = FaucetValidate;
259 cp->ismyvin = IsFaucetInput;
260 break;
261 case EVAL_REWARDS:
eb304fa0 262 strcpy(cp->unspendableCCaddr,RewardsCCaddr);
075a1114 263 strcpy(cp->normaladdr,RewardsNormaladdr);
287efad4 264 strcpy(cp->CChexstr,RewardsCChexstr);
265 memcpy(cp->CCpriv,RewardsCCpriv,32);
266 cp->validate = RewardsValidate;
267 cp->ismyvin = IsRewardsInput;
268 break;
cfea7a46 269 case EVAL_DICE:
270 strcpy(cp->unspendableCCaddr,DiceCCaddr);
075a1114 271 strcpy(cp->normaladdr,DiceNormaladdr);
cfea7a46 272 strcpy(cp->CChexstr,DiceCChexstr);
273 memcpy(cp->CCpriv,DiceCCpriv,32);
274 cp->validate = DiceValidate;
275 cp->ismyvin = IsDiceInput;
276 break;
b935ab65 277 case EVAL_LOTTO:
278 strcpy(cp->unspendableCCaddr,LottoCCaddr);
075a1114 279 strcpy(cp->normaladdr,LottoNormaladdr);
b935ab65 280 strcpy(cp->CChexstr,LottoCChexstr);
281 memcpy(cp->CCpriv,LottoCCpriv,32);
282 cp->validate = LottoValidate;
283 cp->ismyvin = IsLottoInput;
284 break;
7137a022 285 case EVAL_FSM:
286 strcpy(cp->unspendableCCaddr,FSMCCaddr);
287 strcpy(cp->normaladdr,FSMNormaladdr);
288 strcpy(cp->CChexstr,FSMCChexstr);
289 memcpy(cp->CCpriv,FSMCCpriv,32);
290 cp->validate = FSMValidate;
291 cp->ismyvin = IsFSMInput;
b935ab65 292 break;
293 case EVAL_AUCTION:
294 strcpy(cp->unspendableCCaddr,AuctionCCaddr);
075a1114 295 strcpy(cp->normaladdr,AuctionNormaladdr);
b935ab65 296 strcpy(cp->CChexstr,AuctionCChexstr);
297 memcpy(cp->CCpriv,AuctionCCpriv,32);
298 cp->validate = AuctionValidate;
299 cp->ismyvin = IsAuctionInput;
300 break;
d96ce6e9 301 case EVAL_MOFN:
da629dfe 302 strcpy(cp->unspendableCCaddr,MofNCCaddr);
303 strcpy(cp->normaladdr,MofNNormaladdr);
304 strcpy(cp->CChexstr,MofNCChexstr);
305 memcpy(cp->CCpriv,MofNCCpriv,32);
306 cp->validate = MofNValidate;
307 cp->ismyvin = IsMofNInput;
308 break;
287a373a 309 case EVAL_CHANNELS:
310 strcpy(cp->unspendableCCaddr,ChannelsCCaddr);
311 strcpy(cp->normaladdr,ChannelsNormaladdr);
312 strcpy(cp->CChexstr,ChannelsCChexstr);
313 memcpy(cp->CCpriv,ChannelsCCpriv,32);
314 cp->validate = ChannelsValidate;
315 cp->ismyvin = IsChannelsInput;
316 break;
c926780f 317 case EVAL_ORACLES:
318 strcpy(cp->unspendableCCaddr,OraclesCCaddr);
319 strcpy(cp->normaladdr,OraclesNormaladdr);
320 strcpy(cp->CChexstr,OraclesCChexstr);
321 memcpy(cp->CCpriv,OraclesCCpriv,32);
322 cp->validate = OraclesValidate;
323 cp->ismyvin = IsOraclesInput;
324 break;
325 case EVAL_PRICES:
326 strcpy(cp->unspendableCCaddr,PricesCCaddr);
327 strcpy(cp->normaladdr,PricesNormaladdr);
328 strcpy(cp->CChexstr,PricesCChexstr);
329 memcpy(cp->CCpriv,PricesCCpriv,32);
330 cp->validate = PricesValidate;
331 cp->ismyvin = IsPricesInput;
332 break;
333 case EVAL_PEGS:
334 strcpy(cp->unspendableCCaddr,PegsCCaddr);
335 strcpy(cp->normaladdr,PegsNormaladdr);
336 strcpy(cp->CChexstr,PegsCChexstr);
337 memcpy(cp->CCpriv,PegsCCpriv,32);
338 cp->validate = PegsValidate;
339 cp->ismyvin = IsPegsInput;
340 break;
341 case EVAL_TRIGGERS:
342 strcpy(cp->unspendableCCaddr,TriggersCCaddr);
343 strcpy(cp->normaladdr,TriggersNormaladdr);
344 strcpy(cp->CChexstr,TriggersCChexstr);
345 memcpy(cp->CCpriv,TriggersCCpriv,32);
346 cp->validate = TriggersValidate;
347 cp->ismyvin = IsTriggersInput;
348 break;
349 case EVAL_PAYMENTS:
350 strcpy(cp->unspendableCCaddr,PaymentsCCaddr);
351 strcpy(cp->normaladdr,PaymentsNormaladdr);
352 strcpy(cp->CChexstr,PaymentsCChexstr);
353 memcpy(cp->CCpriv,PaymentsCCpriv,32);
354 cp->validate = PaymentsValidate;
355 cp->ismyvin = IsPaymentsInput;
356 break;
357 case EVAL_GATEWAYS:
358 strcpy(cp->unspendableCCaddr,GatewaysCCaddr);
359 strcpy(cp->normaladdr,GatewaysNormaladdr);
360 strcpy(cp->CChexstr,GatewaysCChexstr);
361 memcpy(cp->CCpriv,GatewaysCCpriv,32);
362 cp->validate = GatewaysValidate;
363 cp->ismyvin = IsGatewaysInput;
364 break;
194ad5b8 365 }
287efad4 366 return(cp);
44a9fd7c 367}
368
This page took 0.188131 seconds and 4 git commands to generate.