Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lidangzzz committed May 22, 2023
1 parent eb1a8d3 commit c3fbfd1
Show file tree
Hide file tree
Showing 11 changed files with 369 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ years by limiting the `set_parameters()` function.
const dividend_yield_rate_law = {
condition:
(operation == "set_parameters") & // operation is "set_parameters"
(set_parameters_key == "dividentPermyriadPerTransaction") & // the key is "dividend_yield_rate"
(set_parameters_key == "dividendPermyriadPerTransaction") & // the key is "dividend_yield_rate"
(set_parameters_value < 500) & // the value is < 500‱ (5%)
(timestamp < 1893477600), // the timestamp < unix timestamp 2030-01-01 00:00:00 (UTC)

Expand Down
2 changes: 1 addition & 1 deletion README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ dividend_X
const dividend_yield_rate_law = {
condition:
(operation == "set_parameters") & // 操作指令是 "set_parameters"
(set_parameters_key == "dividentPermyriadPerTransaction") & // 设置参数的键值为 "dividend_yield_rate"
(set_parameters_key == "dividendPermyriadPerTransaction") & // 设置参数的键值为 "dividend_yield_rate"
(set_parameters_value < 500) & // the value is < 500‱ (5%)
(timestamp < 1893477600), // 时间戳小于 < unix timestamp 2030-01-01 00:00:00 (UTC)

Expand Down
13 changes: 11 additions & 2 deletions darc-protocol/contracts/MachineState.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ struct MachineStateParameters{
* For each dividend cycle, the dividend will be distributed to all the token owners
* The dividend will be calculated by the following formula:
* currentCashBalanceForDividends +=
* NEW_TRANSACTION_INCOME * dividentPermyriadPerTransaction / 10000
* NEW_TRANSACTION_INCOME * dividendPermyriadPerTransaction / 10000
* */
uint256 dividentPermyriadPerTransaction;
uint256 dividendPermyriadPerTransaction;

/**
* @notice the dividend cycle of the DARC protocol
Expand Down Expand Up @@ -82,6 +82,15 @@ struct MachineStateParameters{
* or tokens/NFTs for the token owners
*/
string[] strStorageList;

/**
* @notice The list of the active emergency agents
* The emergency agents can be used to do all emergency operations
* of the DARC protocol
*/
address[] activeEmergencyAgentsAddressList;

bool bIsEmergency;
}

/**
Expand Down
7 changes: 7 additions & 0 deletions darc-protocol/contracts/MachineStateManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ contract MachineStateManager {
* @notice the finite state
*/
FiniteState public finiteState;

/**
* Parameters and configs
*/
uint256 dividendBufferSize;



Expand All @@ -68,6 +73,8 @@ contract MachineStateManager {

currentMachineState.beforeOpPlugins = new Plugin[](0);
currentMachineState.afterOpPlugins = new Plugin[](0);

dividendBufferSize = 10000;

/**
* Todo:
Expand Down
4 changes: 2 additions & 2 deletions darc-protocol/contracts/Opcodes.sol
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ enum EnumOpcode {

/**
* @notice Call emergency agents to handle emergency situations
* @param uint256[] addressArray: the array of the emergency agent index to call
* @param UINT256_2DARRAY[0] address[] addressArray: the array of the emergency agents index to call
* ID:24
*/
CALL_EMERGENCY,
Expand Down Expand Up @@ -276,7 +276,7 @@ enum EnumOpcode {

/**
* @notice Add storage IPFS hash to the storage list permanently
* @paran address: the address to set approval for all cash withdraw operations
* @paran STRING_2DARRAY[0] address: the address to set approval for all cash withdraw operations
* ID:31
*/
ADD_STORAGE_IPFS_HASH,
Expand Down
2 changes: 1 addition & 1 deletion darc-protocol/contracts/Program.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ enum EnumParameterType {

enum MachineParameter{
UNDEFINED,
dividentPermyriadPerTransaction,
dividendPermyriadPerTransaction,
dividendCycleOfTransactions,
currentCashBalanceForDividends,
dividendCycleCounter
Expand Down
Loading

0 comments on commit c3fbfd1

Please sign in to comment.