Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bytes12(0) #48

Merged
merged 39 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c5d6a7a
README update
sshmatrix Jul 18, 2023
c827465
Purge masterhash()
sshmatrix Jul 18, 2023
cc20ffe
README.md update
sshmatrix Jul 19, 2023
e61e9f7
README.md update: 2
sshmatrix Jul 19, 2023
5e2eae6
Reinstate signedRedirect() & ownerhash[]
sshmatrix Jul 19, 2023
ea7b34f
Merge branch 'main' into sshmatrix
sshmatrix Jul 19, 2023
c03c0b6
some more NatSpec
sshmatrix Jul 19, 2023
755925f
Goerli-v4: 0x4b9A4521442485ad7e1b25295125240b5f3F5aaC
sshmatrix Jul 19, 2023
f3b1404
Remove redundant parts; more natSpec
sshmatrix Jul 19, 2023
66511e0
Merge branch 'main' into sshmatrix
sshmatrix Jul 19, 2023
26387ca
update ownerhash[addr] to accept keccak(addr)
sshmatrix Jul 19, 2023
4c6274f
Merge branch 'main' into sshmatrix
sshmatrix Jul 19, 2023
6d747a2
natSpec for GatewayManager
sshmatrix Jul 19, 2023
6a5526a
Mainnet: 0x57532d78FfBcC6ac5534A9b39899C7eC89082CdA
sshmatrix Jul 23, 2023
da31ea1
Merge branch 'main' into sshmatrix
sshmatrix Jul 23, 2023
e74ded2
Fixes for bugs in v1-beta
sshmatrix Jul 26, 2023
b8cb9f9
Fixes for bugs in v1-beta (#34)
sshmatrix Jul 26, 2023
41d4fc5
Some natSpec and fix for avatar/contenthash
sshmatrix Jul 31, 2023
86227e3
Updated Fixes in v1.0.0-beta (#36)
sshmatrix Jul 31, 2023
6f55ddc
Fix error in test.yml
sshmatrix Aug 1, 2023
e8d969e
Merge branch 'sshmatrix' into play
sshmatrix Aug 1, 2023
125bad4
Fix errors in test.yml (#38)
sshmatrix Aug 1, 2023
971afa6
Review of #40
sshmatrix Aug 14, 2023
8b4df64
Merge Review for #40 from 'play' to 'sshmatrix'
sshmatrix Aug 14, 2023
fdc3718
Merge branch 'main' into sshmatrix
sshmatrix Aug 14, 2023
24e960c
Fix typo-2
sshmatrix Aug 14, 2023
811b755
Merge branch 'main' into sshmatrix
sshmatrix Aug 14, 2023
cf762c6
Re-try merge (#43)
sshmatrix Aug 14, 2023
1d9e3db
Typo-2
sshmatrix Aug 14, 2023
c43c97c
Typo-2.1
sshmatrix Aug 14, 2023
319596d
Typo-2.2
sshmatrix Aug 14, 2023
acc417d
Get ChainID from ENV
sshmatrix Aug 15, 2023
76cfa55
rSync
sshmatrix Aug 15, 2023
a869852
getRecordhash() fix
sshmatrix Aug 15, 2023
00f5a7b
Merge branch 'main' into sshmatrix
sshmatrix Aug 15, 2023
f3a968b
Tests for wrapped names
sshmatrix Aug 15, 2023
a45b145
Testnet Wrapper set
sshmatrix Aug 15, 2023
893c10b
Merge branch 'main' into sshmatrix
sshmatrix Aug 15, 2023
1a13630
Fix stale bytes12(0): 2
sshmatrix Aug 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions src/CCIP2ETH.sol
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,8 @@ contract CCIP2ETH is iCCIP2ETH {
* @return _recordhash - IPNS contenthash that is set as recordhash
*/
function getRecordhash(bytes32 _node) external view returns (bytes memory _recordhash) {
_recordhash = recordhash[_node];
// Check if first 12 bytes are bytes12(0)
bool _isQueryOwnerhash = _node & bytes32(uint256(0xFFFFFFFFFFFFFFFFFFFFFFFF) >> 96) == bytes32(0);
if (_recordhash.length == 0 && !_isQueryOwnerhash) {
_recordhash = recordhash[_node]; // > Fix here
if (_recordhash.length == 0) {
address _owner = ENS.owner(_node);
if (isWrapper[_owner]) {
_owner = iToken(_owner).ownerOf(uint256(_node));
Expand All @@ -112,10 +110,10 @@ contract CCIP2ETH is iCCIP2ETH {
}

/**
* @dev Sets standard recordhash for a node
* @dev Sets regular recordhash for a node
* Note - Only ENS owner or manager of node can call
* @param _node - Namehash of domain.eth
* @param _recordhash - IPNS contenthash to set as recordhash
* @param _recordhash - Regular IPNS contenthash to set as recordhash
*/
function setRecordhash(bytes32 _node, bytes calldata _recordhash) external payable {
address _owner = ENS.owner(_node);
Expand Down Expand Up @@ -151,7 +149,7 @@ contract CCIP2ETH is iCCIP2ETH {
/**
* @dev Sets ownerhash for an owner
* Note - Wallet-specific fallback recordhash
* @param _recordhash - Short IPNS contenthash to set as ownerhash
* @param _recordhash - Regular IPNS contenthash to set as ownerhash
*/
function setOwnerhash(bytes calldata _recordhash) external payable {
if (msg.value < ownerhashFees) {
Expand All @@ -162,7 +160,7 @@ contract CCIP2ETH is iCCIP2ETH {
}

/**
* @dev Sets ownerhash for an owner
* @dev Sets short ownerhash for an owner
* Note - Without the constant prefix hex'e5010172002408011220'
* Note - Wallet-specific fallback recordhash
* @param _recordhash - Short IPNS contenthash to set as ownerhash
Expand All @@ -182,7 +180,7 @@ contract CCIP2ETH is iCCIP2ETH {
* Note - Only ENS owner or manager of parent node can call
* @param _node - Namehash of domain.eth
* @param _subdomain - Subdomain labels; sub.domain.eth = "sub"
* @param _recordhash - IPNS contenthash to set as recordhash
* @param _recordhash - Regular IPNS contenthash to set as recordhash
*/
function setSubRecordhash(bytes32 _node, string calldata _subdomain, bytes calldata _recordhash) external payable {
address _owner = ENS.owner(_node);
Expand All @@ -202,7 +200,7 @@ contract CCIP2ETH is iCCIP2ETH {
* Note - Only ENS owner or manager of parent node can call
* @param _node - Namehash of domain.eth
* @param _subdomain - Subdomain labels; a.b.c.domain.eth = [a, b, c]
* @param _recordhash - IPNS contenthash to set as recordhash
* @param _recordhash - Regular IPNS contenthash to set as recordhash
*/
function setDeepSubRecordhash(bytes32 _node, string[] calldata _subdomain, bytes calldata _recordhash)
external
Expand Down
4 changes: 2 additions & 2 deletions test/CCIP2ETH.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface xENS is iENS {

/**
* @author freetib.eth, sshmatrix.eth
* @title CCIP2.eth Resolver tester
* @title CCIP2.eth Resolver tester
* Note Tests unwrapped/legacy domains
*/
contract CCIP2ETHTestLegacy is Test {
Expand Down Expand Up @@ -496,7 +496,7 @@ contract CCIP2ETHTestLegacy is Test {

/**
* @author freetib.eth, sshmatrix.eth
* @title CCIP2.eth Resolver tester
* @title CCIP2.eth Resolver tester
* Note Tests wrapped domains
*/
contract CCIP2ETHTestWrapped is Test {
Expand Down