Advertisement
Guest User

Untitled

a guest
Feb 18th, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. pragma solidity ^0.4.0;
  2.  
  3. // The Delphi Contract will be used by Ethereum Smart Contracts
  4. // interested in having a decentralized bridge network with the
  5. // Hyperledger Fabric Platform
  6. contract Delphi {
  7.  
  8. // General info about a bounty hunter
  9. struct BountyInfo {
  10. // The amount of Eth the bounty hunter staked
  11. uint staking_amount;
  12. // The amount of Eth the bounty is for
  13. uint bounty_amount;
  14. // If the Bounty Hunter lies, we set that he/she is evil
  15. bool is_evil;
  16. // The Bounty Hunter's Eth Address
  17. address bounty_hunter_address;
  18. // Bounty Hunter Server's IP to authenticate on hyperledger
  19. string bounty_hunter_ip;
  20. // Bounty Hunter's private key to authenticate on hyperledger
  21. }
  22.  
  23. // List of Bounty Delphi Servers
  24. BountyInfo[] public bounty_hunters;
  25.  
  26. uint total_bounty_ammount;
  27. uint num_hunters;
  28.  
  29. // Create the Ethereum smart contract for the Bounty Hunters
  30. function Delphi(uint _total_bounty_ammount, uint _num_hunters_requested) public {
  31. }
  32.  
  33. // Called by Bounty Hunters when they wish to enter the Bounty
  34. // They pass their information so they can be authenticated on they Hyperledger
  35. // private chain
  36. function enterBounty(string ip, string public_key) public{
  37. }
  38.  
  39. // Called by the Delphi Contract Creator when the Bounty period is over
  40. // all audited. Evil Bounty hunters will neither get their stake bad nor
  41. // receive bounty
  42. function completeBounty() public {
  43. }
  44.  
  45. // Called by a Smart Contract Using Delphi to get Hyperledger Data
  46. // Data received is only that that has recieved consensus from a majority
  47. // of bounty hunters
  48. function getHyperledgerData(string data_name) public {
  49. }
  50.  
  51. // Called by a Smart Contract Using Delphi wishing to submit Data to
  52. // Hyperledger. This gets transmitted by bounty hunters to Hyperledger
  53. // where it is collected so only a matching majority goes through
  54. function sendHyperledgerData(string data_name) public {
  55. }
  56.  
  57. // Called by Bounty Hunters when they wish to submit Hyperledger Data
  58. // to Ethereum. This is compared with results of other Bounty Hunters. If this
  59. // bounty hunter differs from the majority they are set as 'Evil'
  60. function submitBountyData(string data_name) public {
  61. }
  62.  
  63. // Called by Bounty Hunters when they wish to get data from the
  64. // smart contract to send to Hyperledger
  65. function getBountyData() public {
  66.  
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement