Skip to content

Commit

Permalink
Add Multi-sig Vault SC
Browse files Browse the repository at this point in the history
  • Loading branch information
icyblob committed Dec 13, 2024
1 parent fd2ce1e commit 8fa006a
Show file tree
Hide file tree
Showing 7 changed files with 1,144 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Qubic.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<ClInclude Include="contracts\EmptyTemplate.h" />
<ClInclude Include="contracts\GeneralQuorumProposal.h" />
<ClInclude Include="contracts\math_lib.h" />
<ClInclude Include="contracts\MsVault.h" />
<ClInclude Include="contracts\MyLastMatch.h" />
<ClInclude Include="contracts\qpi.h" />
<ClInclude Include="contracts\Quottery.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 @@ -102,6 +102,9 @@
</ClInclude>
<ClInclude Include="contracts\Quottery.h">
<Filter>contracts</Filter>
</ClInclude>
<ClInclude Include="contracts\MsVault.h">
<Filter>contracts</Filter>
</ClInclude>
<ClInclude Include="contracts\QUtil.h">
<Filter>contracts</Filter>
Expand Down
12 changes: 12 additions & 0 deletions src/contract_core/contract_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,16 @@ struct __FunctionOrProcedureBeginEndGuard
#define CONTRACT_STATE2_TYPE QVAULT2
#include "contracts/QVAULT.h"

#undef CONTRACT_INDEX
#undef CONTRACT_STATE_TYPE
#undef CONTRACT_STATE2_TYPE

#define MSVAULT_CONTRACT_INDEX 11
#define CONTRACT_INDEX MSVAULT_CONTRACT_INDEX
#define CONTRACT_STATE_TYPE MSVAULT
#define CONTRACT_STATE2_TYPE MSVAULT2
#include "contracts/MsVault.h"

#define MAX_CONTRACT_ITERATION_DURATION 0 // In milliseconds, must be above 0; for now set to 0 to disable timeout, because a rollback mechanism needs to be implemented to properly handle timeout

#undef INITIALIZE
Expand Down Expand Up @@ -214,6 +224,7 @@ constexpr struct ContractDescription
{"CCF", 127, 10000, sizeof(CCF)}, // proposal in epoch 125, IPO in 126, construction and first use in 127
{"QEARN", 137, 10000, sizeof(QEARN)}, // proposal in epoch 135, IPO in 136, construction in 137 / first donation after END_EPOCH, first round in epoch 138
{"QVAULT", 138, 10000, sizeof(IPO)}, // proposal in epoch 136, IPO in 137, construction and first use in 138
{"MSVAULT", 999, 10000, sizeof(MSVAULT)},
};

constexpr unsigned int contractCount = sizeof(contractDescriptions) / sizeof(contractDescriptions[0]);
Expand Down Expand Up @@ -300,4 +311,5 @@ static void initializeContracts()
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(CCF);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(QEARN);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(QVAULT);
REGISTER_CONTRACT_FUNCTIONS_AND_PROCEDURES(MSVAULT);
}
Loading

0 comments on commit 8fa006a

Please sign in to comment.