Skip to content

Commit

Permalink
Revert back from chainId to coinType
Browse files Browse the repository at this point in the history
  • Loading branch information
makoto committed Mar 28, 2024
1 parent 18d4b17 commit 469086e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions contracts/reverseRegistrar/L2ReverseRegistrar.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ contract L2ReverseRegistrar is
/*
* @dev Constructor
* @param _L2ReverseNode The namespace to set. The converntion is '${coinType}.reverse'
* @param _chainId The chainId converted from the chainId of the chain this contract is deployed to.
* @param _coinType The cointype converted from the chainId of the chain this contract is deployed to.
*/
constructor(
bytes32 _L2ReverseNode,
uint256 _chainId
) SignatureReverseResolver(_L2ReverseNode, _chainId) {
uint256 _coinType
) SignatureReverseResolver(_L2ReverseNode, _coinType) {
L2ReverseNode = _L2ReverseNode;
}

Expand Down Expand Up @@ -80,7 +80,7 @@ contract L2ReverseRegistrar is
addr,
owner,
inceptionDate,
chainId
coinType
)
).toEthSignedMessageHash();
bytes32 node = _getNamehash(addr);
Expand Down
10 changes: 5 additions & 5 deletions contracts/reverseRegistrar/SignatureReverseResolver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ contract SignatureReverseResolver is Ownable, ISignatureReverseResolver {
mapping(bytes32 => uint64) internal recordVersions;

bytes32 public immutable parentNode;
uint256 public immutable chainId;
uint256 public immutable coinType;

/*
* @dev Constructor
* @param parentNode The namespace to set.
* @param _chainId The chainId converted from the chainId of the chain this contract is deployed to.
* @param _coinType The coinType converted from the chainId of the chain this contract is deployed to.
*/
constructor(bytes32 _parentNode, uint256 _chainId) {
constructor(bytes32 _parentNode, uint256 _coinType) {
parentNode = _parentNode;
chainId = _chainId;
coinType = _coinType;
}

modifier authorised(address addr) {
Expand Down Expand Up @@ -67,7 +67,7 @@ contract SignatureReverseResolver is Ownable, ISignatureReverseResolver {
hash,
addr,
inceptionDate,
chainId
coinType
)
).toEthSignedMessageHash();
bytes32 node = _getNamehash(addr);
Expand Down
2 changes: 1 addition & 1 deletion deploy/l2/03_l2reverse_registrar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
)
await deploy('L2ReverseRegistrar', {
from: deployer,
args: [REVERSENODE, chainId],
args: [REVERSENODE, coinType],
log: true,
})
}
Expand Down
28 changes: 14 additions & 14 deletions test/reverseRegistrar/TestL2ReverseRegistrar.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('L2ReverseRegistrar', function () {
'setTextForAddrWithSignature(address,string,string,uint256,bytes)'
let setTextForAddrWithSignatureAndOwnableFuncSig =
'setTextForAddrWithSignatureAndOwnable(address,address,string,string,uint256,bytes)'
let chainId = 123
let coinType = 123

before(async function () {
signers = await ethers.getSigners()
Expand All @@ -38,7 +38,7 @@ describe('L2ReverseRegistrar', function () {
)
L2ReverseRegistrar = await L2ReverseRegistrarFactory.deploy(
namehash('optimism.reverse'),
chainId,
coinType,
)

const MockSmartContractWalletFactory = await ethers.getContractFactory(
Expand Down Expand Up @@ -116,7 +116,7 @@ describe('L2ReverseRegistrar', function () {
keccak256(['bytes4', 'string'], [funcId, name]),
account,
inceptionDate,
chainId,
coinType,
],
),
),
Expand Down Expand Up @@ -193,7 +193,7 @@ describe('L2ReverseRegistrar', function () {
keccak256(['bytes4', 'string'], [funcId, 'hello.eth']),
account,
inceptionDate,
chainId,
coinType,
],
),
),
Expand All @@ -219,7 +219,7 @@ describe('L2ReverseRegistrar', function () {
keccak256(['bytes4', 'string'], [funcId, 'hello.eth']),
account,
inceptionDate2,
chainId,
coinType,
],
),
),
Expand Down Expand Up @@ -268,7 +268,7 @@ describe('L2ReverseRegistrar', function () {
MockOwnable.address,
MockSmartContractWallet.address,
inceptionDate,
chainId,
coinType,
],
),
),
Expand Down Expand Up @@ -338,7 +338,7 @@ describe('L2ReverseRegistrar', function () {
),
account,
inceptionDate,
chainId,
coinType,
],
),
),
Expand Down Expand Up @@ -417,7 +417,7 @@ describe('L2ReverseRegistrar', function () {
),
account,
inceptionDate,
chainId,
coinType,
],
),
),
Expand Down Expand Up @@ -450,7 +450,7 @@ describe('L2ReverseRegistrar', function () {
),
account,
inceptionDate2,
chainId,
coinType,
],
),
),
Expand Down Expand Up @@ -498,7 +498,7 @@ describe('L2ReverseRegistrar', function () {
MockOwnable.address,
MockSmartContractWallet.address,
inceptionDate,
chainId,
coinType,
],
),
),
Expand Down Expand Up @@ -572,7 +572,7 @@ describe('L2ReverseRegistrar', function () {
),
account,
inceptionDate,
chainId,
coinType,
],
),
),
Expand All @@ -587,7 +587,7 @@ describe('L2ReverseRegistrar', function () {
keccak256(['bytes4', 'string'], [funcId2, 'hello.eth']),
account,
inceptionDate + 1,
chainId,
coinType,
],
),
),
Expand Down Expand Up @@ -654,7 +654,7 @@ describe('L2ReverseRegistrar', function () {
keccak256(['bytes4'], [funcId]),
account,
inceptionDate,
chainId,
coinType,
],
),
),
Expand Down Expand Up @@ -694,7 +694,7 @@ describe('L2ReverseRegistrar', function () {
keccak256(['bytes4'], [funcId]),
account,
inceptionDate,
chainId,
coinType,
],
),
),
Expand Down

0 comments on commit 469086e

Please sign in to comment.