Advertisement
foryou97

SVATT2017

Nov 18th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. "pragma solidity ^0.4.18;
  2.  
  3. contract ctf {
  4. address public owner;
  5. // uint public secret;
  6. uint private flag; //no public, it's a secret;
  7.  
  8. /* CONSTRUCTOR */
  9. function ctf(uint _flag) public {
  10. owner = msg.sender;
  11. flag = _flag;
  12. }
  13.  
  14. /* let me change the secret just in case I want to */
  15. // deployed at https://etherscan.io/address/0xeec8a45a3406c8cf1de7ba0083b1c8dd2e31a27f
  16. function change_flag(uint newflag, uint key) public {
  17. require(msg.sender == owner); //make sure it's me
  18. flag = newflag^key;
  19. }
  20.  
  21. function() payable public {
  22. return;
  23. }
  24. // don't need it anymore
  25. function kill(address _to) public {
  26. require(msg.sender == owner);
  27. selfdestruct(_to);
  28. }
  29. }"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement