Skip to content

Commit 70d51d3

Browse files
committed
chore(protocol-contracts): rename contract to ConfidentialTokenWrappersRegistry
1 parent bea4181 commit 70d51d3

23 files changed

+119
-117
lines changed

.github/workflows/protocol-contracts-confidential-tokens-registry-tests.yml renamed to .github/workflows/protocol-contracts-confidential-token-wrappers-registry-tests.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Run tests
2-
name: protocol-contracts-confidential-tokens-registry-tests
2+
name: protocol-contracts-confidential-token-wrappers-registry-tests
33

44
on:
55
pull_request:
@@ -12,19 +12,19 @@ on:
1212
permissions: {}
1313

1414
concurrency:
15-
group: ci-protocol-contracts-confidential-tokens-registry-tests-${{ github.ref }}
15+
group: ci-protocol-contracts-confidential-token-wrappers-registry-tests-${{ github.ref }}
1616
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
1717

1818
jobs:
1919
check-changes:
20-
name: protocol-contracts-confidential-tokens-registry-tests/check-changes
20+
name: protocol-contracts-confidential-token-wrappers-registry-tests/check-changes
2121
permissions:
2222
actions: 'read' # Required to read workflow run information
2323
contents: 'read' # Required to checkout repository code
2424
pull-requests: 'read' # Required to read pull request information
2525
runs-on: ubuntu-latest
2626
outputs:
27-
changes-protocol-contracts-confidential-tokens-registry: ${{ steps.filter.outputs.protocol-contracts-confidential-tokens-registry }}
27+
changes-protocol-contracts-confidential-token-wrappers-registry: ${{ steps.filter.outputs.protocol-contracts-confidential-token-wrappers-registry }}
2828
steps:
2929
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3030
with:
@@ -33,13 +33,13 @@ jobs:
3333
id: filter
3434
with:
3535
filters: |
36-
protocol-contracts-confidential-tokens-registry:
37-
- .github/workflows/protocol-contracts-confidential-tokens-registry-tests.yml
38-
- protocol-contracts/confidential-tokens-registry/**
36+
protocol-contracts-confidential-token-wrappers-registry:
37+
- .github/workflows/protocol-contracts-confidential-token-wrappers-registry-tests.yml
38+
- protocol-contracts/confidential-token-wrappers-registry/**
3939
tests:
40-
name: protocol-contracts-confidential-tokens-registry-tests/tests (bpr)
40+
name: protocol-contracts-confidential-token-wrappers-registry-tests/tests (bpr)
4141
needs: check-changes
42-
if: ${{ needs.check-changes.outputs.changes-protocol-contracts-confidential-tokens-registry == 'true' }}
42+
if: ${{ needs.check-changes.outputs.changes-protocol-contracts-confidential-token-wrappers-registry == 'true' }}
4343
runs-on: ubuntu-latest
4444
permissions:
4545
contents: 'read' # Required to checkout repository code
@@ -50,18 +50,18 @@ jobs:
5050
persist-credentials: 'false'
5151

5252
- name: Install dependencies
53-
working-directory: protocol-contracts/confidential-tokens-registry
53+
working-directory: protocol-contracts/confidential-token-wrappers-registry
5454
run: npm ci
5555

5656
- name: Run conformance
57-
working-directory: protocol-contracts/confidential-tokens-registry
57+
working-directory: protocol-contracts/confidential-token-wrappers-registry
5858
run: make conformance
5959

6060
- name: Run compile
61-
working-directory: protocol-contracts/confidential-tokens-registry
61+
working-directory: protocol-contracts/confidential-token-wrappers-registry
6262
run: make compile
6363

6464
- name: Run unit tests
65-
working-directory: protocol-contracts/confidential-tokens-registry
65+
working-directory: protocol-contracts/confidential-token-wrappers-registry
6666
run: make test
6767

protocol-contracts/confidential-tokens-registry/.env.example renamed to protocol-contracts/confidential-token-wrappers-registry/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ REPORT_GAS=false
1414

1515

1616
# ----------------------------------------------------------------------------
17-
# ConfidentialTokensRegistry deployment
17+
# ConfidentialTokenWrappersRegistry deployment
1818
# ----------------------------------------------------------------------------
1919

2020
# The number of tokens to register initially

protocol-contracts/confidential-tokens-registry/.gitignore renamed to protocol-contracts/confidential-token-wrappers-registry/.gitignore

File renamed without changes.

protocol-contracts/confidential-tokens-registry/.prettierignore renamed to protocol-contracts/confidential-token-wrappers-registry/.prettierignore

File renamed without changes.

protocol-contracts/confidential-tokens-registry/.prettierrc renamed to protocol-contracts/confidential-token-wrappers-registry/.prettierrc

File renamed without changes.

protocol-contracts/confidential-tokens-registry/Makefile renamed to protocol-contracts/confidential-token-wrappers-registry/Makefile

File renamed without changes.

protocol-contracts/confidential-tokens-registry/contracts/ConfidentialTokensRegistry.sol renamed to protocol-contracts/confidential-token-wrappers-registry/contracts/ConfidentialTokenWrappersRegistry.sol

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeab
66
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
77

88
/**
9-
* @title ConfidentialTokensRegistry
9+
* @title ConfidentialTokenWrappersRegistry
1010
* @notice A registry contract to map ERC20 token addresses to their corresponding ERC7984
1111
* confidential fhevm wrapper addresses, also called confidential tokens.
1212
* @dev This contract allows an owner to register new entries and flag revoked ones.
1313
*/
14-
contract ConfidentialTokensRegistry is Ownable2StepUpgradeable, UUPSUpgradeable {
14+
contract ConfidentialTokenWrappersRegistry is Ownable2StepUpgradeable, UUPSUpgradeable {
1515
/// @notice Struct to represent a (token, confidential token, is revoked) tuple.
1616
struct ConfidentialTokenPair {
1717
/// @notice The address of the token.
@@ -22,8 +22,8 @@ contract ConfidentialTokensRegistry is Ownable2StepUpgradeable, UUPSUpgradeable
2222
bool isRevoked;
2323
}
2424

25-
/// @custom:storage-location erc7201:fhevm_protocol.storage.ConfidentialTokensRegistry
26-
struct ConfidentialTokensRegistryStorage {
25+
/// @custom:storage-location erc7201:fhevm_protocol.storage.ConfidentialTokenWrappersRegistry
26+
struct ConfidentialTokenWrappersRegistryStorage {
2727
/// @notice Mapping from token address to confidential token address.
2828
mapping(address tokenAddress => address confidentialTokenAddress) _tokensToConfidentialTokens;
2929
/// @notice Mapping from confidential token address to token address.
@@ -36,9 +36,9 @@ contract ConfidentialTokensRegistry is Ownable2StepUpgradeable, UUPSUpgradeable
3636
ConfidentialTokenPair[] _tokenConfidentialTokenPairs;
3737
}
3838

39-
// keccak256(abi.encode(uint256(keccak256("fhevm_protocol.storage.ConfidentialTokensRegistry")) - 1)) & ~bytes32(uint256(0xff))
40-
bytes32 private constant CONFIDENTIAL_TOKENS_REGISTRY_STORAGE_LOCATION =
41-
0x25094496394205337c7da64eaca0c35bf780125467d04de96cd0ee9b701d6c00;
39+
// keccak256(abi.encode(uint256(keccak256("fhevm_protocol.storage.ConfidentialTokenWrappersRegistry")) - 1)) & ~bytes32(uint256(0xff))
40+
bytes32 private constant CONFIDENTIAL_TOKEN_WRAPPERS_REGISTRY_STORAGE_LOCATION =
41+
0xc361bd0b1d7584416623b46edb98317525b8de8e557ab49cee21f14d6752da00;
4242

4343
/// @notice Error thrown when the token address is zero.
4444
error TokenZeroAddress();
@@ -80,7 +80,7 @@ contract ConfidentialTokensRegistry is Ownable2StepUpgradeable, UUPSUpgradeable
8080
}
8181

8282
/**
83-
* @notice Initialize the ConfidentialTokensRegistry contract.
83+
* @notice Initialize the ConfidentialTokenWrappersRegistry contract.
8484
* @param initialOwner The initial owner of the contract.
8585
*/
8686
function initialize(address initialOwner) public initializer {
@@ -116,7 +116,7 @@ contract ConfidentialTokensRegistry is Ownable2StepUpgradeable, UUPSUpgradeable
116116
revert TokenAlreadyAssociatedWithConfidentialToken(tokenAddress, existingConfidentialTokenAddress);
117117
}
118118

119-
ConfidentialTokensRegistryStorage storage $ = _getConfidentialTokensRegistryStorage();
119+
ConfidentialTokenWrappersRegistryStorage storage $ = _getConfidentialTokenWrappersRegistryStorage();
120120

121121
// Register the token and confidential token mappings.
122122
$._tokensToConfidentialTokens[tokenAddress] = confidentialTokenAddress;
@@ -155,7 +155,7 @@ contract ConfidentialTokensRegistry is Ownable2StepUpgradeable, UUPSUpgradeable
155155
revert NoTokenAssociatedWithConfidentialToken(confidentialTokenAddress);
156156
}
157157

158-
ConfidentialTokensRegistryStorage storage $ = _getConfidentialTokensRegistryStorage();
158+
ConfidentialTokenWrappersRegistryStorage storage $ = _getConfidentialTokenWrappersRegistryStorage();
159159

160160
$._revokedConfidentialTokens[confidentialTokenAddress] = true;
161161

@@ -173,7 +173,7 @@ contract ConfidentialTokensRegistry is Ownable2StepUpgradeable, UUPSUpgradeable
173173
* @return The address of the confidential token.
174174
*/
175175
function getConfidentialTokenAddress(address tokenAddress) public view returns (bool, address) {
176-
address confidentialTokenAddress = _getConfidentialTokensRegistryStorage()._tokensToConfidentialTokens[
176+
address confidentialTokenAddress = _getConfidentialTokenWrappersRegistryStorage()._tokensToConfidentialTokens[
177177
tokenAddress
178178
];
179179
bool isRevoked = isConfidentialTokenRevoked(confidentialTokenAddress);
@@ -189,7 +189,7 @@ contract ConfidentialTokensRegistry is Ownable2StepUpgradeable, UUPSUpgradeable
189189
*/
190190
function getTokenAddress(address confidentialTokenAddress) public view returns (bool, address) {
191191
bool isRevoked = isConfidentialTokenRevoked(confidentialTokenAddress);
192-
address tokenAddress = _getConfidentialTokensRegistryStorage()._confidentialTokensToTokens[
192+
address tokenAddress = _getConfidentialTokenWrappersRegistryStorage()._confidentialTokensToTokens[
193193
confidentialTokenAddress
194194
];
195195
return (isRevoked, tokenAddress);
@@ -202,7 +202,7 @@ contract ConfidentialTokensRegistry is Ownable2StepUpgradeable, UUPSUpgradeable
202202
* @return The array of (token address, confidential token address, is revoked) tuples.
203203
*/
204204
function getTokenConfidentialTokenPairs() public view returns (ConfidentialTokenPair[] memory) {
205-
return _getConfidentialTokensRegistryStorage()._tokenConfidentialTokenPairs;
205+
return _getConfidentialTokenWrappersRegistryStorage()._tokenConfidentialTokenPairs;
206206
}
207207

208208
/**
@@ -211,7 +211,7 @@ contract ConfidentialTokensRegistry is Ownable2StepUpgradeable, UUPSUpgradeable
211211
* @return True if the confidential token has been revoked, false otherwise.
212212
*/
213213
function isConfidentialTokenRevoked(address confidentialTokenAddress) public view returns (bool) {
214-
return _getConfidentialTokensRegistryStorage()._revokedConfidentialTokens[confidentialTokenAddress];
214+
return _getConfidentialTokenWrappersRegistryStorage()._revokedConfidentialTokens[confidentialTokenAddress];
215215
}
216216

217217
function _authorizeUpgrade(address newImplementation) internal override onlyOwner {}
@@ -239,13 +239,13 @@ contract ConfidentialTokensRegistry is Ownable2StepUpgradeable, UUPSUpgradeable
239239
}
240240
}
241241

242-
function _getConfidentialTokensRegistryStorage()
242+
function _getConfidentialTokenWrappersRegistryStorage()
243243
private
244244
pure
245-
returns (ConfidentialTokensRegistryStorage storage $)
245+
returns (ConfidentialTokenWrappersRegistryStorage storage $)
246246
{
247247
assembly {
248-
$.slot := CONFIDENTIAL_TOKENS_REGISTRY_STORAGE_LOCATION
248+
$.slot := CONFIDENTIAL_TOKEN_WRAPPERS_REGISTRY_STORAGE_LOCATION
249249
}
250250
}
251251
}

protocol-contracts/confidential-tokens-registry/contracts/mocks/ERC165.sol renamed to protocol-contracts/confidential-token-wrappers-registry/contracts/mocks/ERC165.sol

File renamed without changes.

protocol-contracts/confidential-tokens-registry/contracts/mocks/ERC7984.sol renamed to protocol-contracts/confidential-token-wrappers-registry/contracts/mocks/ERC7984.sol

File renamed without changes.

protocol-contracts/confidential-tokens-registry/foundry.toml renamed to protocol-contracts/confidential-token-wrappers-registry/foundry.toml

File renamed without changes.

0 commit comments

Comments
 (0)