Skip to content

Commit

Permalink
no master, no lords
Browse files Browse the repository at this point in the history
  • Loading branch information
0xc0de4c0ffee committed Jul 18, 2023
1 parent 6342f22 commit b5057e5
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/CCIP2ETH.sol
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,18 @@ contract CCIP2ETH is iCCIP2ETH {
_recordhash = recordhash[_namehash];
}
}

if (_recordhash.length == 0) {
//if (bytes4(request[:4]) == iResolver.contenthash.selector) {
// 404 default page; triggers when resolver is set but missing recordhash
// return abi.encode(recordhash[bytes32(uint256(404))]);
//}
revert("RECORD_NOT_SET");
}
string memory _recType = gateway.funcToJson(request); // Filename for the requested record
address _owner = ENS.owner(_node);
if (isWrapper[_owner]) {
_owner = iToken(_owner).ownerOf(uint256(_node));
}
if (_recordhash.length == 0) {
_recordhash = recordhash[keccak256(abi.encodePacked(_owner))];
if (_recordhash.length == 0) {
revert("RECORD_NOT_SET");
}
}
string memory _recType = gateway.funcToJson(request); // Filename for the requested record

bytes32 _checkHash = keccak256(
abi.encodePacked(this, blockhash(block.number - 1), _owner, _domain, _path, request, _recType)
);
Expand All @@ -230,6 +229,10 @@ contract CCIP2ETH is iCCIP2ETH {
}
}

function setManagerhash(bytes calldata _recordhash) external{
recordhash[keccak256(abi.encodePacked(msg.sender))] = _recordhash;
}

/*
* @dev Redirects the CCIP-Read request
* @param _encodedName - ENS domain to resolve; must be DNS encoded
Expand Down Expand Up @@ -476,12 +479,12 @@ contract CCIP2ETH is iCCIP2ETH {
emit Approved(msg.sender, _node, _signer, _approval);
}

/**
/*
* @dev Sets multiple signer (= manager) as approved to manage records for a node
* @param _node - Namehash of ENS domain
* @param _signer - Address of signer (= manager)
* @param _approval - Status to set
*/
function multiApprove(bytes32[] calldata _node, address[] calldata _signer, bool[] calldata _approval) external {
uint256 len = _node.length;
require(len == _signer.length, "BAD_LENGTH");
Expand All @@ -491,6 +494,7 @@ contract CCIP2ETH is iCCIP2ETH {
emit Approved(msg.sender, _node[i], _signer[i], _approval[i]);
}
}
*/

/**
* @dev Checks if a signer (= manager) is approved to manage records for a node
Expand Down

0 comments on commit b5057e5

Please sign in to comment.