github.com/inklabsfoundation/inkchain@v0.17.1-0.20181025012015-c3cef8062f19/examples/xc/eth/contracts/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       * Set the current contract platform name.
    26       * @param platformName platform name.
    27       */
    28      function setPlatformName(bytes32 platformName) external;
    29  
    30      /**
    31       * Get the current contract platform name.
    32       * @return contract platform name.
    33       */
    34      function getPlatformName() external view returns (bytes32);
    35  
    36      /**
    37       * Set the current contract administrator.
    38       * @param account account of contract administrator.
    39       */
    40      function setAdmin(address account) external;
    41  
    42      /**
    43       * Get the current contract administrator.
    44       * @return contract administrator.
    45       */
    46      function getAdmin() external view returns (address);
    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       * Add a trusted platform name.
    75       * @param name a platform name.
    76       */
    77      function addPlatform(bytes32 name) external;
    78  
    79      /**
    80       * Delete a trusted platform name.
    81       * @param name a platform name.
    82       */
    83      function deletePlatform(bytes32 name) external;
    84  
    85      /**
    86       * Whether the trusted platform information exists.
    87       * @param name a platform name.
    88       * @return whether exists.
    89       */
    90      function existPlatform(bytes32 name) external view returns (bool);
    91  
    92      /**
    93       * Add the trusted platform public key information.
    94       * @param platformName a platform name.
    95       * @param publicKey a public key.
    96       */
    97      function addPublicKey(bytes32 platformName, address publicKey) external;
    98  
    99      /**
   100       * Delete the trusted platform public key information.
   101       * @param platformName a platform name.
   102       * @param publicKey a public key.
   103       */
   104      function deletePublicKey(bytes32 platformName, address publicKey) external;
   105  
   106      /**
   107       * Whether the trusted platform public key information exists.
   108       * @param platformName a platform name.
   109       * @param publicKey a public key.
   110       */
   111      function existPublicKey(bytes32 platformName, address publicKey) external view returns (bool);
   112  
   113      /**
   114       * Get the count of public key for the trusted platform.
   115       * @param platformName a platform name.
   116       * @return count of public key.
   117       */
   118      function countOfPublicKey(bytes32 platformName) external view returns (uint);
   119  
   120      /**
   121       * Get the list of public key for the trusted platform.
   122       * @param platformName a platform name.
   123       * @return list of public key.
   124       */
   125      function publicKeys(bytes32 platformName) external view returns (address[]);
   126  
   127      /**
   128       * Set the weight of a trusted platform.
   129       * @param platformName a platform name.
   130       * @param weight weight of platform.
   131       */
   132      function setWeight(bytes32 platformName, uint weight) external;
   133  
   134      /**
   135       * Get the weight of a trusted platform.
   136       * @param platformName a platform name.
   137       * @return weight of platform.
   138       */
   139      function getWeight(bytes32 platformName) external view returns (uint);
   140  
   141      /**
   142       * Initiate and vote on the transaction proposal.
   143       * @param fromPlatform name of form platform.
   144       * @param fromAccount name of to platform.
   145       * @param toAccount account of to platform.
   146       * @param value transfer amount.
   147       * @param txid transaction id.
   148       * @param r transaction signature (signature[0:64]).
   149       * @param s transaction signature (signature[64:128]).
   150       * @param v transaction signature (uint8(signature[128:130])).
   151       */
   152      function voteProposal(bytes32 fromPlatform, address fromAccount, address toAccount, uint value, string txid, bytes32 r, bytes32 s, uint8 v) external;
   153  
   154      /**
   155       * Verify that the transaction proposal is valid.
   156       * @param fromPlatform name of form platform.
   157       * @param fromAccount name of to platform.
   158       * @param toAccount account of to platform.
   159       * @param value transfer amount.
   160       * @param txid transaction id.
   161       */
   162      function verifyProposal(bytes32 fromPlatform, address fromAccount, address toAccount, uint value, string txid) external view returns (bool, bool);
   163  
   164      /**
   165       * Commit the transaction proposal.
   166       * @param platformName a platform name.
   167       * @param txid transaction id.
   168       */
   169      function commitProposal(bytes32 platformName, string txid) external returns (bool);
   170  
   171      /**
   172       * Get the transaction proposal information.
   173       * @param platformName a platform name.
   174       * @param txid transaction id.
   175       * @return status completion status of proposal.
   176       * @return fromAccount account of to platform.
   177       * @return toAccount account of to platform.
   178       * @return value transfer amount.
   179       * @return voters notarial voters.
   180       * @return weight The weight value of the completed time.
   181       */
   182      function getProposal(bytes32 platformName, string txid) external view returns (bool status, address fromAccount, address toAccount, uint value, address[] voters, uint weight);
   183  
   184      /**
   185       * Delete the transaction proposal information.
   186       * @param platformName a platform name.
   187       * @param txid transaction id.
   188       */
   189      function deleteProposal(bytes32 platformName, string txid) external;
   190  
   191      /**
   192       * Transfer the money(qtum/eth) from the contract account.
   193       * @param account the specified account.
   194       * @param value transfer amount.
   195       */
   196      function transfer(address account, uint value) external payable;
   197  }