DNS Ownership Oracle
This oracle checks Google’s DNS service to determine if a given domain is owned by a given blockchain address.
Steps For Using This Oracle
- Write and deploy your Chainlink contract using the network details below
- Fund it with LINK
- Call your request method
Network Details
Ethereum Mainnet
Payment Amount: 1 LINK
LINK Token Address: 0x514910771AF9Ca656af840dff83E8264EcF986CA
Oracle Address: 0x240BaE5A27233Fd3aC5440B5a598467725F7D1cd
JobID: 6ca2e68622bd421d98c648f056ee7c76
Ethereum Kovan Testnet
Payment Amount: 0.1 LINK
LINK Token Address: 0xa36085F69e2889c224210F603D836748e7dC0088
Oracle Address: 0x56dd6586DB0D08c6Ce7B2f2805af28616E082455
JobID: 791bd73c8a1349859f09b1cb87304f71
Binance Smart Chain Mainnet
Payment Amount: 0.1 LINK
LINK Token address:0x404460C6A5EdE2D891e8297795264fDe62ADBB75
Oracle Address: 0x63B72AF260E8b40A7b89E238FeB53448A97b03D2
JobID: fb06afd5a9df4e6cb156f6b797b63a24
Polygon (Matic) Mainnet
Payment Amount: 0.1 LINK
LINK Token Address: 0xb0897686c545045aFc77CF20eC7A532E3120E0F1
Oracle Address: 0x63B72AF260E8b40A7b89E238FeB53448A97b03D2
JobID: f3daed2990114e98906aaf21c4172da3
Create Your Contract
Import ChainlinkClient.sol
into your contract so you can inherit the Chainlink behavior.
pragma solidity ^0.4.24;
import "@chainlink/contracts/v0.4/ChainlinkClient.sol";
contract DnsOwnershipChainlink is ChainlinkClient {
uint256 oraclePayment;
constructor(uint256 _oraclePayment) public {
setPublicChainlinkToken();
oraclePayment = _oraclePayment;
}
// Additional functions here:
}
pragma solidity ^0.5.0;
import "@chainlink/contracts/v0.5/ChainlinkClient.sol";
contract DnsOwnershipChainlink is ChainlinkClient {
uint256 oraclePayment;
constructor(uint256 _oraclePayment) public {
setPublicChainlinkToken();
oraclePayment = _oraclePayment;
}
// Additional functions here:
}
pragma solidity ^0.6.0;
import "@chainlink/contracts/v0.6/ChainlinkClient.sol";
contract DnsOwnershipChainlink is ChainlinkClient {
uint256 oraclePayment;
constructor(uint256 _oraclePayment) public {
setPublicChainlinkToken();
oraclePayment = _oraclePayment;
}
// Additional functions here:
}
Tasks
Request Parameters
type
Always use TXT
Solidity Example
req.add("type", "TXT");
name
The domain name to check ownership of.
Solidity Example
req.add("name", "www5.infernos.io");
record
The Ethereum address to check a given domain against.
Solidity Example
req.add("record", "0xf75519f611776c22275474151a04183665b7feDe");
Chainlink Examples
The examples below show how to create a request for the Chainlink node.
requestProof
function
function requestProof
(
address _oracle,
bytes32 _jobId,
string memory _txt,
string memory _name,
string memory _record
)
public
onlyOwner
{
Chainlink.Request memory req = buildChainlinkRequest(_jobId, address(this), this.fulfill.selector);
req.add("type", _txt);
req.add("name", _name);
req.add("record", _record);
sendChainlinkRequestTo(_oracle, req, oraclePayment);
}
fulfill
function
bool public proof;
function fulfill(bytes32 _requestId, bool _proof)
public
recordChainlinkFulfillment(_requestId)
{
proof = _proof;
}