This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.21; | |
contract LogicalInversion { | |
bool state = true; | |
function LogicalInversion() public { | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.4.22 <0.6.0; | |
/** | |
* @title Ownable | |
* @dev The Ownable contract has an owner address, and provides basic authorization control | |
* functions, this simplifies the implementation of "user permissions". | |
*/ | |
contract Ownable { | |
address private _owner; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.4.22 <0.6.0; | |
library SafeMath { | |
function mul(uint256 a, uint256 b) internal pure returns (uint256) { | |
if (a == 0) { | |
return 0; | |
} | |
uint256 c = a * b; | |
assert(c / a == b); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.4.22 <0.6.0; | |
import "./Ownable.sol"; | |
/** | |
* @title Destructible | |
* @dev Base contract that can be destroyed by owner. All funds in contract will be sent to the owner. | |
*/ | |
contract Destructible is Ownable { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.0; | |
import "./common/Ownable.sol"; | |
import "./common/Destructible.sol"; | |
import "./libs/SafeMath.sol"; | |
contract DDNSService is Destructible { | |
/** USINGS */ | |
using SafeMath for uint256; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity >=0.4.22 <0.6.0; | |
import "./Ownable.sol"; | |
/** | |
* @title Destructible | |
* @dev Base contract that can be destroyed by owner. All funds in contract will be sent to the owner. | |
*/ | |
contract Destructible is Ownable { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct DomainDetails { | |
bytes name; | |
bytes12 topLevel; | |
address owner; | |
bytes15 ip; | |
uint expires; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Receipt { | |
uint amountPaidWei; | |
uint timestamp; | |
uint expires; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
modifier isAvailable(bytes memory domain, bytes12 topLevel) { | |
// @dev - get the domain hash by the domain name and the TLD | |
bytes32 domainHash = getDomainHash(domain, topLevel); | |
// @dev - check whether the domain name is available by checking if is expired | |
// if it was not registered at all the `expires` property will be default: 0x00 | |
require( | |
domainNames[domainHash].expires < block.timestamp, | |
"Domain name is not available." |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
modifier collectDomainNamePayment(bytes memory domain) { | |
// @dev - get the price for the provided domain | |
uint domainPrice = getPrice(domain); | |
// @dev - require the payment sent to be enough for | |
// the current domain cost | |
require( | |
msg.value >= domainPrice, | |
"Insufficient amount." |
OlderNewer