Guest User

Untitled

a guest
Jul 16th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. //Разработать смарт-контракт (только интерфейс структуры данных и сигнатуры методов),
  2. //который определяет следующие возможности:
  3. //1. Для всех перевести eth на этот смарт-контракт
  4. //2. Для создателя вернуть каждому переведшему 50% от полученной суммы единоразово.
  5.  
  6. pragma solidity ^0.4.19;
  7.  
  8. contract MyContract {
  9.  
  10. address private owner;
  11. mapping (address => uint256) attachments;
  12.  
  13. function MyContract() {
  14. owner = msg.sender;
  15. }
  16.  
  17. modifier onlyOwner() {
  18. require(msg.sender == owner);
  19. _;
  20. }
  21.  
  22. //1. Для всех перевести eth на этот смарт-контракт
  23. function transfer(address _from, uint256 _value) public payable returns (bool);
  24. event Transfer(address indexed from, address indexed to, uint256 value);
  25.  
  26. //2. Для создателя вернуть каждому переведшему 50% от полученной суммы единоразово.
  27. function send() public onlyOwner payable returns (bool);
  28. }
Add Comment
Please, Sign In to add comment