github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/Decentralized-Energy-Composer-master/models/model.cto (about) 1 /** 2 * Decentalized energy network 3 */ 4 namespace org.decentralized.energy.network 5 6 participant Resident identified by residentID { 7 o String residentID 8 o String firstName 9 o String lastName 10 --> Coins coins 11 --> Cash cash 12 --> Energy energy 13 } 14 15 participant Bank identified by bankID { 16 o String bankID 17 o String name 18 --> Coins coins 19 --> Cash cash 20 } 21 22 participant UtilityCompany identified by utilityID { 23 o String utilityID 24 o String name 25 --> Coins coins 26 --> Energy energy 27 } 28 29 30 enum OwnerEntity { 31 o Resident 32 o Bank 33 o UtilityCompany 34 } 35 36 37 asset Coins identified by coinsID { 38 o String coinsID 39 o Double value 40 o String ownerID 41 o OwnerEntity ownerEntity 42 43 } 44 45 asset Energy identified by energyID { 46 o String energyID 47 o String units 48 o Double value 49 o String ownerID 50 o OwnerEntity ownerEntity 51 } 52 53 asset Cash identified by cashID { 54 o String cashID 55 o String currency 56 o Double value 57 o String ownerID 58 o OwnerEntity ownerEntity 59 } 60 61 62 transaction EnergyToCoins { 63 o Double energyRate 64 o Double energyValue 65 --> Coins coinsInc 66 --> Coins coinsDec 67 --> Energy energyInc 68 --> Energy energyDec 69 } 70 71 transaction CashToCoins { 72 o Double cashRate 73 o Double cashValue 74 --> Coins coinsInc 75 --> Coins coinsDec 76 --> Cash cashInc 77 --> Cash cashDec 78 }