Skip to content

Commit

Permalink
ENS set name
Browse files Browse the repository at this point in the history
  • Loading branch information
carletex committed Mar 14, 2024
1 parent b927c9c commit 018e297
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/hardhat/contracts/BGGrants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";

interface ENSContract {
function setName(string memory newName) external;
}

/**
* @title BGGrants
* @notice A smart contract to split ETH or ERC20 tokens between multiple recipients.
Expand All @@ -15,6 +19,8 @@ import "@openzeppelin/contracts/access/AccessControl.sol";

contract BGGrants is ReentrancyGuard, AccessControl {
using SafeERC20 for IERC20;
// Mainnet ENS contract
ENSContract public immutable ensContract = ENSContract(0xa58E81fe9b61B5c3fE2AFD33CF304c454AbFc7Cb);

bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");

Expand Down Expand Up @@ -227,5 +233,14 @@ contract BGGrants is ReentrancyGuard, AccessControl {
}
}

/**
* Set the reverse ENS name for the contract
* @param _newName The new ENS name for the contract
* @dev only meant to be call on mainnet
*/
function setName(string memory _newName) onlyAdmin public {
ensContract.setName(_newName);
}

receive() external payable {}
}

0 comments on commit 018e297

Please sign in to comment.