Skip to content

Commit

Permalink
Update OpCodes.md
Browse files Browse the repository at this point in the history
  • Loading branch information
lidangzzz committed Jun 10, 2023
1 parent 92fa972 commit d051875
Showing 1 changed file with 37 additions and 34 deletions.
71 changes: 37 additions & 34 deletions darc-docs/docs/DARC Protocol/OpCodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,40 @@ By defining these operations through opcodes, the DARC protocol ensures consiste

| Opcode | Opcode ID | Parameters | Description |
|------------------------|-----------|--------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
| UNDEFINED | 0 | - | Invalid Operation |
| BATCH_MINT_TOKENS | 1 | - `toAddressArray`: address[]<br/>- `tokenClassArray`: uint256[]<br/>- `amountArray`: uint256[] | Batch Mint Token Operation |
| BATCH_CREATE_TOKEN_CLASS | 2 | - `nameArray`: string[]<br/>- `tokenIndexArray`: uint256[]<br/>- `votingWeightArray`: uint256[]<br/>- `dividendWeightArray`: uint256[] | Batch Create Token Class Operation |
| BATCH_TRANSFER_TOKENS | 3 | - `toAddressArray`: address[]<br/>- `tokenClassArray`: uint256[]<br/>- `amountArray`: uint256[] | Batch Transfer Token Operation |
| BATCH_TRANSFER_TOKENS_FROM_TO | 4 | - `fromAddressArray`: address[]<br/>- `toAddressArray`: address[]<br/>- `tokenClassArray`: uint256[]<br/>- `amountArray`: uint256[] | Batch Transfer Token From Addr A to Addr B Operation |
| BATCH_BURN_TOKENS | 5 | - `tokenClassArray`: uint256[]<br/>- `amountArray`: uint256[] | Batch Burn Token Operation |
| BATCH_BURN_TOKENS_FROM | 6 | - `fromAddressArray`: address[]<br/>- `tokenClassArray`: uint256[]<br/>- `amountArray`: uint256[] | Batch Burn Token From Addr A Operation |
| BATCH_ADD_MEMBERSHIP | 7 | - `memberAddressArray`: address[]<br/>- `memberRoleArray`: uint256[]<br/>- `memberNameArray`: string[] | Batch Add Member Operation |
| BATCH_SUSPEND_MEMBERSHIP | 8 | - `memberAddressArray`: address[] | Batch Suspend Member Operation |
| BATCH_RESUME_MEMBERSHIP | 9 | - `memberAddressArray`: address[] | Batch Resume Member Operation |
| BATCH_CHANGE_MEMBER_ROLE | 10 | - `memberAddressArray`: address[]<br/>- `memberRoleArray`: uint256[] | Batch Change Member Role Operation |
| BATCH_CHANGE_MEMBER_NAME | 11 | - `memberAddressArray`: address[]<br/>- `memberNameArray`: string[] | Batch Change Member Name Operation |
| BATCH_ADD_PLUGIN | 12 | - `pluginList`: Plugin[] | Batch Add Emergency Agent Operation |
| BATCH_ENABLE_PLUGIN | 13 | - `pluginIndexArray`: uint256[]<br/>- `isBeforeOperationArray`: bool[] | Batch Enable Plugin Operation |
| BATCH_DISABLE_PLUGIN | 14 | - `pluginIndexArray`: uint256[]<br/>- `isBeforeOperationArray`: bool[] | Batch Disable Plugin Operation |
| BATCH_ADD_AND_ENABLE_PLUGIN | 15 | - `pluginList`: Plugin[] | Batch Add and Enable Plugin Operation |
| BATCH_SET_PARAMETER | 16 | - `parameterNameArray`: MachineParameter[]<br/>- `parameterValueArray`: uint256[] | Batch Set Parameter Operation |
| BATCH_ADD_WITHDRAWABLE_BALANCE | 17 | - `addressArray`: address[]<br/>- `amountArray`: uint256[] | Batch Add Withdrawable Balance Operation |
| BATCH_REVOKE_WITHDRAWABLE_BALANCE | 18 | - `addressArray`: address[] | Batch Revoke Withdrawable Balance Operation |
| BATCH_WITHDRAW_FROM_BALANCE | 19 | - `addressArray`: address[]<br/>- `amountArray`: uint256[] | Batch Withdraw From Balance Operation |
| BATCH_PAY_TO_MINT_TOKENS | 20 | - `addressArray`: address[]<br/>- `tokenClassArray`: uint256[]<br/>- `amountArray`: uint256[]<br/>- `priceArray`: uint256[] | Batch Pay to Mint Tokens Operation |
| BATCH_PAY_TO_TRANSFER_TOKENS | 21 | - `toAddressArray`: address[]<br/>- `tokenClassArray`: uint256[]<br/>- `amountArray`: uint256[]<br/>- `priceArray`: uint256[] | Pay Some Cash to Transfer Tokens Operation |
| ADD_EMERGENCY | 22 | - `addressArray`: address[] | Add an Array of Addresses as Emergency Agents |
| WITHDRAW_CASH_TO | 23 | - `addressArray`: address[]<br/>- `amountArray`: uint256[] | Withdraw Cash from the Contract's Cash Balance |
| CALL_EMERGENCY | 24 | - `addressArray`: address[] | Call Emergency Agents to Handle Emergency Situations |
| CALL_CONTRACT_ABI | 25 | - `contractAddress`: address<br/>- `abi`: bytes | Call a Contract with the Given ABI |
| PAY_CASH | 26 | - `amount`: uint256<br/>- `paymentType`: uint256<br/>- `dividendable`: uint256 | Pay Some Cash |
| OFFER_DIVIDENDS | 27 | - | Calculate Dividends and Offer to Token Holders |
| WITHDRAW_DIVIDENDS_TO | 28 | - `addressArray`: address[]<br/>- `amountArray`: uint256[] | Withdraw Dividends from the Withdrawable Dividends Balance |
| SET_APPROVAL_FOR_ALL_OPERATIONS | 29 | - `address`: address | Set Approval for All Transfer Operations by Address |
| BATCH_BURN_TOKENS_AND_REFUND | 30 | - | Batch Burn Tokens and Refund |
| ADD_STORAGE_IPFS_HASH | 31 | - `address`: string[] | Add Storage IPFS Hash |
| VOTE | 32 | - `voteArray`: bool[] | Vote for a Voting Pending Program |
| EXECUTE_PROGRAM | 33 | - | Execute a Program that has been Voted and Approved |
| UNDEFINED | 0 | N/A | Invalid Operation |
| BATCH_MINT_TOKENS | 1 | `toAddressArray`: address[]<br/>`tokenClassArray`: uint256[]<br/>`amountArray`: uint256[] | Batch Mint Token Operation |
| BATCH_CREATE_TOKEN_CLASS | 2 | `nameArray`: string[]<br/>`tokenIndexArray`: uint256[]<br/>`votingWeightArray`: uint256[]<br/>`dividendWeightArray`: uint256[] | Batch Create Token Class Operation |
| BATCH_TRANSFER_TOKENS | 3 | `toAddressArray`: address[]<br/>`tokenClassArray`: uint256[]<br/>`amountArray`: uint256[] | Batch Transfer Token Operation |
| BATCH_TRANSFER_TOKENS_FROM_TO | 4 | `fromAddressArray`: address[]<br/>`toAddressArray`: address[]<br/>`tokenClassArray`: uint256[]<br/>`amountArray`: uint256[] | Batch Transfer Token From Addr A to Addr B Operation |
| BATCH_BURN_TOKENS | 5 | `tokenClassArray`: uint256[]<br/>`amountArray`: uint256[] | Batch Burn Token Operation |
| BATCH_BURN_TOKENS_FROM | 6 | `fromAddressArray`: address[]<br/>`tokenClassArray`: uint256[]<br/>`amountArray`: uint256[] | Batch Burn Token From Addr A Operation |
| BATCH_ADD_MEMBERSHIP | 7 | `memberAddressArray`: address[]<br/>`memberRoleArray`: uint256[]<br/>`memberNameArray`: string[] | Batch Add Member Operation |
| BATCH_SUSPEND_MEMBERSHIP | 8 | `memberAddressArray`: address[] | Batch Suspend Member Operation |
| BATCH_RESUME_MEMBERSHIP | 9 | `memberAddressArray`: address[] | Batch Resume Member Operation |
| BATCH_CHANGE_MEMBER_ROLE | 10 | `memberAddressArray`: address[]<br/>`memberRoleArray`: uint256[] | Batch Change Member Role Operation |
| BATCH_CHANGE_MEMBER_NAME | 11 | `memberAddressArray`: address[]<br/>`memberNameArray`: string[] | Batch Change Member Name Operation |
| BATCH_ADD_PLUGIN | 12 | `pluginList`: Plugin[] | Batch Add Emergency Agent Operation |
| BATCH_ENABLE_PLUGIN | 13 | `pluginIndexArray`: uint256[]<br/>`isBeforeOperationArray`: bool[] | Batch Enable Plugin Operation |
| BATCH_DISABLE_PLUGIN | 14 | `pluginIndexArray`: uint256[]<br/>`isBeforeOperationArray`: bool[] | Batch Disable Plugin Operation |
| BATCH_ADD_AND_ENABLE_PLUGIN | 15 | `pluginList`: Plugin[] | Batch Add and Enable Plugin Operation |
| BATCH_SET_PARAMETER | 16 | `parameterNameArray`: MachineParameter[]<br/>`parameterValueArray`: uint256[] | Batch Set Parameter Operation |
| BATCH_ADD_WITHDRAWABLE_BALANCE | 17 | `addressArray`: address[]<br/>`amountArray`: uint256[] | Batch Add Withdrawable Balance Operation |
| BATCH_REVOKE_WITHDRAWABLE_BALANCE | 18 | `addressArray`: address[] | Batch Revoke Withdrawable Balance Operation |
| BATCH_WITHDRAW_FROM_BALANCE | 19 | `addressArray`: address[]<br/>`amountArray`: uint256[] | Batch Withdraw From Balance Operation |
| BATCH_PAY_TO_MINT_TOKENS | 20 | `addressArray`: address[]<br/>`tokenClassArray`: uint256[]<br/>`amountArray`: uint256[]<br/>`priceArray`: uint256[] | Batch Pay to Mint Tokens Operation |
| BATCH_PAY_TO_TRANSFER_TOKENS | 21 | `toAddressArray`: address[]<br/>`tokenClassArray`: uint256[]<br/>`amountArray`: uint256[]<br/>`priceArray`: uint256[] | Pay Some Cash to Transfer Tokens Operation |
| ADD_EMERGENCY | 22 | `addressArray`: address[] | Add an Array of Addresses as Emergency Agents |
| WITHDRAW_CASH_TO | 23 | `addressArray`: address[]<br/>`amountArray`: uint256[] | Withdraw Cash from the Contract's Cash Balance |
| CALL_EMERGENCY | 24 | `addressArray`: address[] | Call Emergency Agents to Handle Emergency Situations |
| CALL_CONTRACT_ABI | 25 | `contractAddress`: address<br/>`abi`: bytes | Call a Contract with the Given ABI |
| PAY_CASH | 26 | `amount`: uint256<br/>`paymentType`: uint256<br/>`dividendable`: uint256 | Pay Some Cash |
| OFFER_DIVIDENDS | 27 | N/A | Calculate Dividends and Offer to Token Holders |
| WITHDRAW_DIVIDENDS_TO | 28 | `addressArray`: address[]<br/>`amountArray`: uint256[] | Withdraw Dividends from the Withdrawable Dividends Balance |
| SET_APPROVAL_FOR_ALL_OPERATIONS | 29 | `address`: address | Set Approval for All Transfer Operations by Address |
| BATCH_BURN_TOKENS_AND_REFUND | 30 | `tokenClassArray`: uint256[] <br/> | Batch Burn Tokens and Refund |
| ADD_STORAGE_IPFS_HASH | 31 | `address`: string[] | Add Storage IPFS Hash |
| VOTE | 32 | `voteArray`: bool[] | Vote for a Voting Pending Program |
| EXECUTE_PROGRAM | 33 | N/A | Execute a Program that has been Voted and Approved |



0 comments on commit d051875

Please sign in to comment.