From 710e6b1473fbf5e69bba61fb2fb1c375ad4fed85 Mon Sep 17 00:00:00 2001 From: 0xc0de4c0ffee <43116881+0xc0de4c0ffee@users.noreply.github.com> Date: Tue, 18 Jul 2023 12:13:43 +0600 Subject: [PATCH] don't mixup recordhash --- src/CCIP2ETH.sol | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/CCIP2ETH.sol b/src/CCIP2ETH.sol index b36a2f4..cb40f52 100644 --- a/src/CCIP2ETH.sol +++ b/src/CCIP2ETH.sol @@ -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]; } } @@ -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"); } @@ -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); } /*