Skip to content

Commit

Permalink
don't mixup recordhash
Browse files Browse the repository at this point in the history
  • Loading branch information
0xc0de4c0ffee committed Jul 18, 2023
1 parent b5057e5 commit 710e6b1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/CCIP2ETH.sol
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ contract CCIP2ETH is iCCIP2ETH {
if (ENS.recordExists(_namehash)) {
_node = _namehash;
_recordhash = recordhash[_node];
} else if (bytes(recordhash[_namehash]).length > 0) {
} else if (recordhash[_namehash].length > 0) {
_recordhash = recordhash[_namehash];
}
}
Expand All @@ -207,7 +207,7 @@ contract CCIP2ETH is iCCIP2ETH {
_owner = iToken(_owner).ownerOf(uint256(_node));
}
if (_recordhash.length == 0) {
_recordhash = recordhash[keccak256(abi.encodePacked(_owner))];
_recordhash = managed[_owner];
if (_recordhash.length == 0) {
revert("RECORD_NOT_SET");
}
Expand All @@ -228,9 +228,11 @@ contract CCIP2ETH is iCCIP2ETH {
);
}
}

function setManagerhash(bytes calldata _recordhash) external{
recordhash[keccak256(abi.encodePacked(msg.sender))] = _recordhash;
mapping(address => bytes) public managed;
event ManagedRecordSet(address _owner, bytes _recordhash);
function setManagedhash(bytes calldata _recordhash) external{
managed[msg.sender] = _recordhash;
emit ManagedRecordSet(msg.sender, _recordhash);
}

/*
Expand Down

0 comments on commit 710e6b1

Please sign in to comment.