Skip to content

Commit 7c08ec1

Browse files
author
Alex Sedighi
committed
Merge branch 'main' into aliX/ens-1
2 parents bc9146b + 252d100 commit 7c08ec1

File tree

9 files changed

+687
-39
lines changed

9 files changed

+687
-39
lines changed

.github/workflows/checks.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ jobs:
2323
uses: actions/checkout@v4
2424
with:
2525
submodules: recursive
26-
27-
- name: Install cSpell
28-
run: npm install -g cspell
26+
27+
- name: Install dependencies
28+
run: yarn
2929

3030
- name: Spell Check
31-
run: cspell --config .cspell.json
31+
run: yarn spellcheck
3232

3333
- name: Lint
34-
run: forge fmt --check
34+
run: yarn lint
3535

3636
- name: Run tests
3737
run: forge test --zksync

.solhint.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
"ignoreConstructors": true
99
}
1010
],
11-
"constructor-syntax": "error"
11+
"constructor-syntax": "error",
12+
"immutable-vars-naming": "off",
13+
"gas-custom-errors": "error"
1214
}
1315
}

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"scripts": {
99
"compile": "hardhat compile",
1010
"clean": "hardhat clean",
11-
"lint": "solhint 'src/**/*.sol'"
11+
"lint": "solhint 'src/**/*.sol'",
12+
"spellcheck": "cspell --config .cspell.json"
1213
},
1314
"devDependencies": {
1415
"@matterlabs/hardhat-zksync": "^1.3.0",
@@ -25,6 +26,7 @@
2526
"@types/mocha": "^10.0.1",
2627
"@types/node": "^20.12.12",
2728
"chai": "^4.4.1",
29+
"cspell": "^8.16.1",
2830
"dotenv": "^16.4.5",
2931
"ethers": "^6.12.1",
3032
"hardhat": "^2.22.4",

src/Grants.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// SPDX-License-Identifier: BSD-3-Clause-Clear
22
pragma solidity ^0.8.23;
33

4-
import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
5-
import "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
4+
import {IERC20} from "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
5+
import {SafeERC20} from "openzeppelin-contracts/contracts/token/ERC20/utils/SafeERC20.sol";
66

77
/**
88
* @title Grants

src/Rewards.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ pragma solidity 0.8.23;
33

44
import {NODL} from "./NODL.sol";
55
import {QuotaControl} from "./QuotaControl.sol";
6-
import {AccessControl} from "openzeppelin-contracts/contracts/access/AccessControl.sol";
76
import {EIP712} from "openzeppelin-contracts/contracts/utils/cryptography/EIP712.sol";
87
import {SignatureChecker} from "openzeppelin-contracts/contracts/utils/cryptography/SignatureChecker.sol";
98
import {Math} from "openzeppelin-contracts/contracts/utils/math/Math.sol";

src/bridge/MigrationNFT.sol

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
pragma solidity 0.8.23;
2424

2525
import {ERC721} from "openzeppelin-contracts/contracts/token/ERC721/ERC721.sol";
26-
import {Strings} from "openzeppelin-contracts/contracts/utils/Strings.sol";
2726
import {NODLMigration} from "./NODLMigration.sol";
2827

2928
contract MigrationNFT is ERC721 {

src/contentsign/BaseContentSign.sol

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ pragma solidity 0.8.23;
55
import {ERC721} from "openzeppelin-contracts/contracts/token/ERC721/ERC721.sol";
66
import {ERC721URIStorage} from "openzeppelin-contracts/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
77

8-
import {WhitelistPaymaster} from "../paymasters/WhitelistPaymaster.sol";
9-
108
/// @notice a simple NFT contract for contentsign data where each nft is mapped to a one-time
119
/// configurable URL. This is used for every variant of ContentSign with associated hooks.
1210
abstract contract BaseContentSign is ERC721, ERC721URIStorage {

src/nameservice/ClickResolver.sol

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ interface IExtendedResolver {
2323
contract ClickResolver is IExtendedResolver, IERC165, Ownable {
2424
bytes4 private constant EXTENDED_INTERFACE_ID = 0x9061b923; // ENSIP-10
2525

26-
bytes4 constant ADDR_SELECTOR = 0x3b3b57de; // addr(bytes32)
27-
bytes4 constant ADDR_MULTICHAIN_SELECTOR = 0xf1cb7e06; // addr(bytes32,uint)
28-
uint256 constant ZKSYNC_MAINNET_COIN_TYPE = 2147483972; // (0x80000000 | 0x144) >>> 0 as per ENSIP11
26+
bytes4 private constant ADDR_SELECTOR = 0x3b3b57de; // addr(bytes32)
27+
bytes4 private constant ADDR_MULTICHAIN_SELECTOR = 0xf1cb7e06; // addr(bytes32,uint)
28+
uint256 private constant ZKSYNC_MAINNET_COIN_TYPE = 2147483972; // (0x80000000 | 0x144) >>> 0 as per ENSIP11
2929

3030
error OffchainLookup(address sender, string[] urls, bytes callData, bytes4 callbackFunction, bytes extraData);
3131
error UnsupportedCoinType(uint256 coinType);
@@ -110,12 +110,12 @@ contract ClickResolver is IExtendedResolver, IERC165, Ownable {
110110
}
111111

112112
/// @notice Resolves a name based on its subdomain part regardless of the given domain and top level
113-
/// @param _name The name to resolve which must be a pack of length prefixed names for subdomain, domain and top.
113+
/// @param _name The name to resolve which must be a pack of length prefixed names for subdomain, domain and top.
114114
/// example: b"\x07example\x05clave\x03eth"
115115
///
116116
/// @param _data The ABI encoded data for the underlying resolution function (Eg, addr(bytes32), text(bytes32,string), etc).
117117
function resolve(bytes calldata _name, bytes calldata _data) external view returns (bytes memory) {
118-
(string memory sub, string memory _domain, string memory _top) = parseDnsDomain(_name);
118+
(string memory sub,,) = parseDnsDomain(_name);
119119

120120
if (bytes(sub).length == 0) {
121121
return abi.encodePacked(domainOwner);
@@ -130,26 +130,14 @@ contract ClickResolver is IExtendedResolver, IERC165, Ownable {
130130

131131
bytes4 functionSelector = bytes4(_data[:4]);
132132
if (functionSelector == ADDR_SELECTOR) {
133-
revert OffchainLookup(
134-
address(this),
135-
urls,
136-
callData,
137-
ClickResolver.resolveWithProof.selector,
138-
callData
139-
);
133+
revert OffchainLookup(address(this), urls, callData, ClickResolver.resolveWithProof.selector, callData);
140134
} else if (functionSelector == ADDR_MULTICHAIN_SELECTOR) {
141135
(, uint256 coinType) = abi.decode(_data[4:], (bytes32, uint256));
142136
if (coinType != ZKSYNC_MAINNET_COIN_TYPE) {
143137
// TODO: Handle other chains when this is supported
144138
revert UnsupportedCoinType(coinType);
145139
}
146-
revert OffchainLookup(
147-
address(this),
148-
urls,
149-
callData,
150-
ClickResolver.resolveWithProof.selector,
151-
callData
152-
);
140+
revert OffchainLookup(address(this), urls, callData, ClickResolver.resolveWithProof.selector, callData);
153141
} else {
154142
revert UnsupportedSelector(functionSelector);
155143
}

0 commit comments

Comments
 (0)