contracts.go 1.5 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package resolver
  2. const ( // built-in contracts address and code
  3. ContractCodeURLhint = "0x60c180600c6000396000f30060003560e060020a90048063300a3bbf14601557005b6024600435602435604435602a565b60006000f35b6000600084815260200190815260200160002054600160a060020a0316600014806078575033600160a060020a03166000600085815260200190815260200160002054600160a060020a0316145b607f5760bc565b336000600085815260200190815260200160002081905550806001600085815260200190815260200160002083610100811060b657005b01819055505b50505056"
  4. /*
  5. contract URLhint {
  6. function register(uint256 _hash, uint8 idx, uint256 _url) {
  7. if (owner[_hash] == 0 || owner[_hash] == msg.sender) {
  8. owner[_hash] = msg.sender;
  9. url[_hash][idx] = _url;
  10. }
  11. }
  12. mapping (uint256 => address) owner;
  13. mapping (uint256 => uint256[256]) url;
  14. }
  15. */
  16. ContractCodeHashReg = "0x609880600c6000396000f30060003560e060020a9004806331e12c2014601f578063d66d6c1014602b57005b6025603d565b60006000f35b6037600435602435605d565b60006000f35b600054600160a060020a0316600014605357605b565b336000819055505b565b600054600160a060020a031633600160a060020a031614607b576094565b8060016000848152602001908152602001600020819055505b505056"
  17. /*
  18. contract HashReg {
  19. function setowner() {
  20. if (owner == 0) {
  21. owner = msg.sender;
  22. }
  23. }
  24. function register(uint256 _key, uint256 _content) {
  25. if (msg.sender == owner) {
  26. content[_key] = _content;
  27. }
  28. }
  29. address owner;
  30. mapping (uint256 => uint256) content;
  31. }
  32. */
  33. )