github.com/inklabsfoundation/inkchain@v0.17.1-0.20181025012015-c3cef8062f19/examples/xc/eth-v1.0.3/XCPluginInterface.sol (about) 1 pragma solidity ^0.4.19; 2 3 /** 4 * XC Plugin Contract Interface. 5 */ 6 interface XCPluginInterface { 7 8 /** 9 * Open the contract service status. 10 */ 11 function start() external; 12 13 /** 14 * Close the contract service status. 15 */ 16 function stop() external; 17 18 /** 19 * Get contract service status. 20 * @return contract service status. 21 */ 22 function getStatus() external view returns (bool); 23 24 /** 25 * Get the current contract platform name. 26 * @return contract platform name. 27 */ 28 function getPlatformName() external view returns (bytes32); 29 30 /** 31 * Set the current contract administrator. 32 * @param account account of contract administrator. 33 */ 34 function setAdmin(address account) external; 35 36 /** 37 * Get the current contract administrator. 38 * @return contract administrator. 39 */ 40 function getAdmin() external view returns (address); 41 42 /** 43 * Get the current token symbol. 44 * @return token symbol. 45 */ 46 function getTokenSymbol() external view returns (bytes32); 47 48 /** 49 * Add a contract trust caller. 50 * @param caller account of caller. 51 */ 52 function addCaller(address caller) external; 53 54 /** 55 * Delete a contract trust caller. 56 * @param caller account of caller. 57 */ 58 function deleteCaller(address caller) external; 59 60 /** 61 * Whether the trust caller exists. 62 * @param caller account of caller. 63 * @return whether exists. 64 */ 65 function existCaller(address caller) external view returns (bool); 66 67 /** 68 * Get all contract trusted callers. 69 * @return al lcallers. 70 */ 71 function getCallers() external view returns (address[]); 72 73 /** 74 * Get the trusted platform name. 75 * @return name a platform name. 76 */ 77 function getTrustPlatform() external view returns (bytes32 name); 78 79 /** 80 * Add the trusted platform public key information. 81 * @param publicKey a public key. 82 */ 83 function addPublicKey(address publicKey) external; 84 85 /** 86 * Delete the trusted platform public key information. 87 * @param publicKey a public key. 88 */ 89 function deletePublicKey(address publicKey) external; 90 91 /** 92 * Whether the trusted platform public key information exists. 93 * @param publicKey a public key. 94 */ 95 function existPublicKey(address publicKey) external view returns (bool); 96 97 /** 98 * Get the count of public key for the trusted platform. 99 * @return count of public key. 100 */ 101 function countOfPublicKey() external view returns (uint); 102 103 /** 104 * Get the list of public key for the trusted platform. 105 * @return list of public key. 106 */ 107 function publicKeys() external view returns (address[]); 108 109 /** 110 * Set the weight of a trusted platform. 111 * @param weight weight of platform. 112 */ 113 function setWeight(uint weight) external; 114 115 /** 116 * Get the weight of a trusted platform. 117 * @return weight of platform. 118 */ 119 function getWeight() external view returns (uint); 120 121 /** 122 * Initiate and vote on the transaction proposal. 123 * @param fromAccount name of to platform. 124 * @param toAccount account of to platform. 125 * @param value transfer amount. 126 * @param txid transaction id. 127 * @param sig transaction signature. 128 */ 129 function voteProposal(address fromAccount, address toAccount, uint value, string txid, bytes sig) external; 130 131 /** 132 * Verify that the transaction proposal is valid. 133 * @param fromAccount name of to platform. 134 * @param toAccount account of to platform. 135 * @param value transfer amount. 136 * @param txid transaction id. 137 */ 138 function verifyProposal(address fromAccount, address toAccount, uint value, string txid) external view returns (bool, bool); 139 140 /** 141 * Commit the transaction proposal. 142 * @param txid transaction id. 143 */ 144 function commitProposal(string txid) external returns (bool); 145 146 /** 147 * Get the transaction proposal information. 148 * @param txid transaction id. 149 * @return status completion status of proposal. 150 * @return fromAccount account of to platform. 151 * @return toAccount account of to platform. 152 * @return value transfer amount. 153 * @return voters notarial voters. 154 * @return weight The weight value of the completed time. 155 */ 156 function getProposal(string txid) external view returns (bool status, address fromAccount, address toAccount, uint value, address[] voters, uint weight); 157 158 /** 159 * Delete the transaction proposal information. 160 * @param txid transaction id. 161 */ 162 function deleteProposal(string txid) external; 163 }