Contract Management System
Ready for Sale
Contract Management System A smart contract offering a solution for handling a network of interacting contracts and contract version control.
- upgradeContract: sets new contractAddress for contractIdentifier
- rollbackContract: rollbacks the contract for the given contract identifier to the provided version.
- activeContracts: gets the active document per provided address
- owner: gets the contract owner address
- existsManagedContract: gets if exists contractIdentifier for contract address
- getActiveContractAddress: gets activeContract for the provided contractIdentifier
- transferOwnership: transfers contract ownership to a new owner address
We will define an example network formed by a: Shop contract: processes purchases from purchasers Storage contract: stores products information Contracts are defined in contracts/Example
####Set up 1.Deploy ContractManagementSystem 2.Deploy Shop contract with manager constructor argument set to CMS address 3.Deploy Storage contract with manager constructor argument set to CMS address 4.Upgrade the contracts in CMS following this pseudocode: const SHOP_ID = 1, STORAGE_ID = 2; ContractManagementSystem.upgradeContract(SHOP_ID, shopAddr); ContractManagementSystem.upgradeContract(STORAGE_ID, storageId);
####Features After you set up your network you have the posibility to upgrade contracts in any particular orders and the interaction between them will not be affected. For example lets say we developed a discount feature in the shop contract. After deployment we will upgrade it using CMS contract and it will still interact with Storage contract without any problems."