Skip to content

Commit 469086e

Browse files
committed
Revert back from chainId to coinType
1 parent 18d4b17 commit 469086e

File tree

4 files changed

+24
-24
lines changed

4 files changed

+24
-24
lines changed

contracts/reverseRegistrar/L2ReverseRegistrar.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ contract L2ReverseRegistrar is
3131
/*
3232
* @dev Constructor
3333
* @param _L2ReverseNode The namespace to set. The converntion is '${coinType}.reverse'
34-
* @param _chainId The chainId converted from the chainId of the chain this contract is deployed to.
34+
* @param _coinType The cointype converted from the chainId of the chain this contract is deployed to.
3535
*/
3636
constructor(
3737
bytes32 _L2ReverseNode,
38-
uint256 _chainId
39-
) SignatureReverseResolver(_L2ReverseNode, _chainId) {
38+
uint256 _coinType
39+
) SignatureReverseResolver(_L2ReverseNode, _coinType) {
4040
L2ReverseNode = _L2ReverseNode;
4141
}
4242

@@ -80,7 +80,7 @@ contract L2ReverseRegistrar is
8080
addr,
8181
owner,
8282
inceptionDate,
83-
chainId
83+
coinType
8484
)
8585
).toEthSignedMessageHash();
8686
bytes32 node = _getNamehash(addr);

contracts/reverseRegistrar/SignatureReverseResolver.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ contract SignatureReverseResolver is Ownable, ISignatureReverseResolver {
2121
mapping(bytes32 => uint64) internal recordVersions;
2222

2323
bytes32 public immutable parentNode;
24-
uint256 public immutable chainId;
24+
uint256 public immutable coinType;
2525

2626
/*
2727
* @dev Constructor
2828
* @param parentNode The namespace to set.
29-
* @param _chainId The chainId converted from the chainId of the chain this contract is deployed to.
29+
* @param _coinType The coinType converted from the chainId of the chain this contract is deployed to.
3030
*/
31-
constructor(bytes32 _parentNode, uint256 _chainId) {
31+
constructor(bytes32 _parentNode, uint256 _coinType) {
3232
parentNode = _parentNode;
33-
chainId = _chainId;
33+
coinType = _coinType;
3434
}
3535

3636
modifier authorised(address addr) {
@@ -67,7 +67,7 @@ contract SignatureReverseResolver is Ownable, ISignatureReverseResolver {
6767
hash,
6868
addr,
6969
inceptionDate,
70-
chainId
70+
coinType
7171
)
7272
).toEthSignedMessageHash();
7373
bytes32 node = _getNamehash(addr);

deploy/l2/03_l2reverse_registrar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
1919
)
2020
await deploy('L2ReverseRegistrar', {
2121
from: deployer,
22-
args: [REVERSENODE, chainId],
22+
args: [REVERSENODE, coinType],
2323
log: true,
2424
})
2525
}

test/reverseRegistrar/TestL2ReverseRegistrar.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('L2ReverseRegistrar', function () {
2626
'setTextForAddrWithSignature(address,string,string,uint256,bytes)'
2727
let setTextForAddrWithSignatureAndOwnableFuncSig =
2828
'setTextForAddrWithSignatureAndOwnable(address,address,string,string,uint256,bytes)'
29-
let chainId = 123
29+
let coinType = 123
3030

3131
before(async function () {
3232
signers = await ethers.getSigners()
@@ -38,7 +38,7 @@ describe('L2ReverseRegistrar', function () {
3838
)
3939
L2ReverseRegistrar = await L2ReverseRegistrarFactory.deploy(
4040
namehash('optimism.reverse'),
41-
chainId,
41+
coinType,
4242
)
4343

4444
const MockSmartContractWalletFactory = await ethers.getContractFactory(
@@ -116,7 +116,7 @@ describe('L2ReverseRegistrar', function () {
116116
keccak256(['bytes4', 'string'], [funcId, name]),
117117
account,
118118
inceptionDate,
119-
chainId,
119+
coinType,
120120
],
121121
),
122122
),
@@ -193,7 +193,7 @@ describe('L2ReverseRegistrar', function () {
193193
keccak256(['bytes4', 'string'], [funcId, 'hello.eth']),
194194
account,
195195
inceptionDate,
196-
chainId,
196+
coinType,
197197
],
198198
),
199199
),
@@ -219,7 +219,7 @@ describe('L2ReverseRegistrar', function () {
219219
keccak256(['bytes4', 'string'], [funcId, 'hello.eth']),
220220
account,
221221
inceptionDate2,
222-
chainId,
222+
coinType,
223223
],
224224
),
225225
),
@@ -268,7 +268,7 @@ describe('L2ReverseRegistrar', function () {
268268
MockOwnable.address,
269269
MockSmartContractWallet.address,
270270
inceptionDate,
271-
chainId,
271+
coinType,
272272
],
273273
),
274274
),
@@ -338,7 +338,7 @@ describe('L2ReverseRegistrar', function () {
338338
),
339339
account,
340340
inceptionDate,
341-
chainId,
341+
coinType,
342342
],
343343
),
344344
),
@@ -417,7 +417,7 @@ describe('L2ReverseRegistrar', function () {
417417
),
418418
account,
419419
inceptionDate,
420-
chainId,
420+
coinType,
421421
],
422422
),
423423
),
@@ -450,7 +450,7 @@ describe('L2ReverseRegistrar', function () {
450450
),
451451
account,
452452
inceptionDate2,
453-
chainId,
453+
coinType,
454454
],
455455
),
456456
),
@@ -498,7 +498,7 @@ describe('L2ReverseRegistrar', function () {
498498
MockOwnable.address,
499499
MockSmartContractWallet.address,
500500
inceptionDate,
501-
chainId,
501+
coinType,
502502
],
503503
),
504504
),
@@ -572,7 +572,7 @@ describe('L2ReverseRegistrar', function () {
572572
),
573573
account,
574574
inceptionDate,
575-
chainId,
575+
coinType,
576576
],
577577
),
578578
),
@@ -587,7 +587,7 @@ describe('L2ReverseRegistrar', function () {
587587
keccak256(['bytes4', 'string'], [funcId2, 'hello.eth']),
588588
account,
589589
inceptionDate + 1,
590-
chainId,
590+
coinType,
591591
],
592592
),
593593
),
@@ -654,7 +654,7 @@ describe('L2ReverseRegistrar', function () {
654654
keccak256(['bytes4'], [funcId]),
655655
account,
656656
inceptionDate,
657-
chainId,
657+
coinType,
658658
],
659659
),
660660
),
@@ -694,7 +694,7 @@ describe('L2ReverseRegistrar', function () {
694694
keccak256(['bytes4'], [funcId]),
695695
account,
696696
inceptionDate,
697-
chainId,
697+
coinType,
698698
],
699699
),
700700
),

0 commit comments

Comments
 (0)