Skip to content

Commit

Permalink
feat: add IDKIMRegistry
Browse files Browse the repository at this point in the history
  • Loading branch information
saleel committed Oct 17, 2023
1 parent e6b8a03 commit 319d64d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/contracts/DKIMRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/access/Ownable.sol";
import "./interfaces/IDKIMRegistry.sol";

/**
A Registry that store the hash(dkim_public_key) for each domain
The hash is calculated by taking Poseidon of DKIM key split into 9 chunks of 242 bits each
*/
contract DKIMRegistry is Ownable {
contract DKIMRegistry is IDKIMRegistry, Ownable {
// Mapping from domain name to DKIM public key hash
mapping(string => bytes32) public dkimPublicKeyHashes;

Expand Down
4 changes: 4 additions & 0 deletions packages/contracts/foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[profile.default]
src = './'
out = 'out'
allow_paths = ['../../node_modules']
13 changes: 13 additions & 0 deletions packages/contracts/interfaces/IDKIMRegistry.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface IDKIMRegistry {
function getDKIMPublicKeyHash(
string memory domainName
) external returns (bytes32);

function setDKIMPublicKeyHash(
string memory domainName,
bytes32 publicKeyHash
) external;
}
3 changes: 3 additions & 0 deletions packages/contracts/remappings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@openzeppelin=../../node_modules/@openzeppelin/contracts
@openzeppelin/contracts=../../node_modules/@openzeppelin/contracts
@openzeppelin/contracts-upgradeable=../../node_modules/@openzeppelin/contracts-upgradeable

0 comments on commit 319d64d

Please sign in to comment.