Skip to content
Merged
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 src/Qubic.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
<ClInclude Include="contracts\QThirtyFour.h" />
<ClInclude Include="contracts\Pulse.h" />
<ClInclude Include="contracts\Escrow.h" />
<ClInclude Include="contracts\GGWP.h" />
<ClInclude Include="contracts\TestExampleA.h" />
<ClInclude Include="contracts\TestExampleB.h" />
<ClInclude Include="contracts\TestExampleC.h" />
Expand Down
3 changes: 3 additions & 0 deletions src/Qubic.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@
<ClInclude Include="contracts\Escrow.h">
<Filter>contracts</Filter>
</ClInclude>
<ClInclude Include="contracts\GGWP.h">
<Filter>contracts</Filter>
</ClInclude>
<ClInclude Include="contract_core\contract_def.h">
<Filter>contract_core</Filter>
</ClInclude>
Expand Down
42 changes: 36 additions & 6 deletions src/contract_core/contract_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,20 @@
#define CONTRACT_STATE2_TYPE ESCROW2
#include "contracts/Escrow.h"

#ifndef NO_GGWP

#undef CONTRACT_INDEX
#undef CONTRACT_STATE_TYPE
#undef CONTRACT_STATE2_TYPE

#define WOLFPACK_CONTRACT_INDEX 28
#define CONTRACT_INDEX WOLFPACK_CONTRACT_INDEX
#define CONTRACT_STATE_TYPE WOLFPACK
#define CONTRACT_STATE2_TYPE WOLFPACK2
#include "contracts/GGWP.h"

#endif

// new contracts should be added above this line

#ifdef INCLUDE_CONTRACT_TEST_EXAMPLES
Expand Down Expand Up @@ -402,6 +416,9 @@ constexpr struct ContractDescription
{"VOTTUN", 206, 10000, sizeof(VOTTUNBRIDGE::StateData)}, // proposal in epoch 204, IPO in 205, construction and first use in 206
{"QUSINO", 208, 10000, sizeof(QUSINO::StateData)}, // proposal in epoch 206, IPO in 207, construction and first use in 208
{"ESCROW", 210, 10000, sizeof(ESCROW::StateData)}, // proposal in epoch 208, IPO in 209, construction and first use in 210
#ifndef NO_GGWP
{"GGWP", 217, 10000, sizeof(WOLFPACK::StateData)}, // proposal in epoch 215, IPO in 216, construction and first use in 217
#endif
// new contracts should be added above this line
#ifdef INCLUDE_CONTRACT_TEST_EXAMPLES
{"TESTEXA", 138, 10000, sizeof(TESTEXA::StateData)},
Expand Down Expand Up @@ -525,6 +542,9 @@ static void initializeContracts()
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(VOTTUNBRIDGE);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(QUSINO);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(ESCROW);
#ifndef NO_GGWP
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(WOLFPACK);
#endif
// new contracts should be added above this line
#ifdef INCLUDE_CONTRACT_TEST_EXAMPLES
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(TESTEXA);
Expand All @@ -534,13 +554,23 @@ static void initializeContracts()
#endif
}

// Automatic Contract Padding
// Contracts whose state struct grew this epoch. Update this list each epoch as needed.
// Automatic Contract State Changes
enum ContractStateChangeType
{
PADDING,
RESET,
};
struct ContractStateChangeInfo
{
unsigned int contractIndex;
ContractStateChangeType changeType;
};
// Contracts whose state struct changed this epoch. Update this list each epoch as needed.
// When enabling, replace both lines below, e.g.:
// constexpr unsigned int paddableContracts[] = { RANDOM_CONTRACT_INDEX };
// constexpr unsigned int paddableCount = sizeof(paddableContracts) / sizeof(paddableContracts[0]);
constexpr const unsigned int* paddableContracts = nullptr;
constexpr unsigned int paddableCount = 0;
constexpr ContractStateChangeInfo contractStateChangeInfos[] = { { QIP_CONTRACT_INDEX, RESET } };
constexpr unsigned int contractStateChangeCount = sizeof(contractStateChangeInfos) / sizeof(contractStateChangeInfos[0]);
// constexpr const ContractStateChangeInfo* contractStateChangeInfos = nullptr;
// constexpr unsigned int contractStateChangeCount = 0;


// Class for registering and looking up user procedures independently of input type, for example for notifications
Expand Down
Loading
Loading