Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Commit

Permalink
Merge pull request #304 from ensdomains/enhancement/registrar-interfa…
Browse files Browse the repository at this point in the history
…ceV3

enhancement/registrar-interfaceV3
  • Loading branch information
Dean Eigenmann authored Dec 29, 2018
2 parents d57384c + e2b9f88 commit 94f4861
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 5 additions & 7 deletions contracts/HashRegistrar.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ contract HashRegistrar is Registrar {

mapping (bytes32 => Entry) _entries;
mapping (address => mapping (bytes32 => Deed)) public sealedBids;

enum Mode { Open, Auction, Owned, Forbidden, Reveal, NotYetAvailable }

uint32 constant totalAuctionLength = 5 days;
uint32 constant revealPeriod = 48 hours;
Expand Down Expand Up @@ -346,6 +344,11 @@ contract HashRegistrar is Registrar {
hash; deed; registrationDate; // Don't warn about unused variables
}

function entries(bytes32 _hash) external view returns (Mode, address, uint, uint, uint) {
Entry storage h = _entries[_hash];
return (state(_hash), address(h.deed), h.registrationDate, h.value, h.highestBid);
}

// State transitions for names:
// Open -> Auction (startAuction)
// Auction -> Reveal
Expand All @@ -372,11 +375,6 @@ contract HashRegistrar is Registrar {
}
}

function entries(bytes32 _hash) public view returns (Mode, address, uint, uint, uint) {
Entry storage h = _entries[_hash];
return (state(_hash), address(h.deed), h.registrationDate, h.value, h.highestBid);
}

/**
* @dev Determines if a name is available for registration yet
*
Expand Down
4 changes: 3 additions & 1 deletion contracts/Registrar.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ import "./Deed.sol";

interface Registrar {

enum Mode { Open, Auction, Owned, Forbidden, Reveal, NotYetAvailable }

event AuctionStarted(bytes32 indexed hash, uint registrationDate);
event NewBid(bytes32 indexed hash, address indexed bidder, uint deposit);
event BidRevealed(bytes32 indexed hash, address indexed owner, uint value, uint8 status);
event HashRegistered(bytes32 indexed hash, address indexed owner, uint value, uint registrationDate);
event HashReleased(bytes32 indexed hash, uint value);
event HashInvalidated(bytes32 indexed hash, string indexed name, uint value, uint registrationDate);


function startAuction(bytes32 _hash) external;
function startAuctions(bytes32[] calldata _hashes) external;
function newBid(bytes32 sealedBid) external payable;
Expand All @@ -25,4 +26,5 @@ interface Registrar {
function eraseNode(bytes32[] calldata labels) external;
function transferRegistrars(bytes32 _hash) external;
function acceptRegistrarTransfer(bytes32 hash, Deed deed, uint registrationDate) external;
function entries(bytes32 _hash) external view returns (Mode, address, uint, uint, uint);
}

0 comments on commit 94f4861

Please sign in to comment.