Skip to content

Instantly share code, notes, and snippets.

@kvhnuke
Created May 9, 2020 01:26
Show Gist options
  • Save kvhnuke/fe547109276c2743840091ce760cf093 to your computer and use it in GitHub Desktop.
Save kvhnuke/fe547109276c2743840091ce760cf093 to your computer and use it in GitHub Desktop.
pragma solidity >=0.4.22 <0.6.0;
pragma solidity ^0.5.0;
interface ENS{
function nameExpires(uint256 id) external view returns(uint);
}
contract NameExpires {
constructor() public {}
function getExpirationDates(address ensAdd, uint[] memory labelHases) public view returns(uint[] memory){
ENS ens = ENS(ensAdd);
uint[] memory expires = new uint[](labelHases.length);
for(uint i=0; i<labelHases.length; i++){
expires[i] = ens.nameExpires(labelHases[i]);
}
return expires;
}
}
@kvhnuke
Copy link
Author

kvhnuke commented May 9, 2020

[
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"constant": true,
"inputs": [
{
"internalType": "address",
"name": "ensAdd",
"type": "address"
},
{
"internalType": "uint256[]",
"name": "labelHases",
"type": "uint256[]"
}
],
"name": "getExpirationDates",
"outputs": [
{
"internalType": "uint256[]",
"name": "",
"type": "uint256[]"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
]

@kvhnuke
Copy link
Author

kvhnuke commented May 9, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment