Skip to content

Commit 9332743

Browse files
Update contracts package name (#309)
1 parent 52a5d9e commit 9332743

File tree

19 files changed

+51
-51
lines changed

19 files changed

+51
-51
lines changed

.github/workflows/prepare-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
echo "New version: $NEW_VERSION"
6464
6565
# Update package.json version field manually
66-
yarn workspace @openzeppelin-compact/contracts version "$NEW_VERSION"
66+
yarn workspace @openzeppelin/compact-contracts version "$NEW_VERSION"
6767
6868
# Escape special characters for sed
6969
ESCAPED_CURRENT=$(printf '%s' "$CURRENT_VERSION" | sed -e 's/[\/&]/\\&/g')

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
uses: ./.github/actions/setup
3131

3232
- name: Compile contracts (with retry)
33-
run: turbo compact --filter=@openzeppelin-compact/contracts --concurrency=1
33+
run: turbo compact --filter=@openzeppelin/compact-contracts --concurrency=1
3434

3535
- name: Run type checks
3636
run: turbo types

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ SKIP_ZK=true yarn compact
5757
### Write a custom contract using library modules
5858

5959
In the root of `my-project`, create a custom contract using OpenZeppelin Compact modules.
60-
Import the modules through `compact-contracts/node_modules/@openzeppelin-compact/contracts/...`.
60+
Import the modules through `compact-contracts/node_modules/@openzeppelin/compact-contracts/...`.
6161
Import modules through `node_modules` rather than directly to avoid state conflicts between shared dependencies.
6262

6363
> NOTE: Installing the library will be easier once it's available as an NPM package.
@@ -68,11 +68,11 @@ Import modules through `node_modules` rather than directly to avoid state confli
6868
pragma language_version >= 0.18.0;
6969

7070
import CompactStandardLibrary;
71-
import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/access/Ownable"
71+
import "./compact-contracts/node_modules/@openzeppelin/compact-contracts/src/access/Ownable"
7272
prefix Ownable_;
73-
import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/security/Pausable"
73+
import "./compact-contracts/node_modules/@openzeppelin/compact-contracts/src/security/Pausable"
7474
prefix Pausable_;
75-
import "./compact-contracts/node_modules/@openzeppelin-compact/contracts/src/token/FungibleToken"
75+
import "./compact-contracts/node_modules/@openzeppelin/compact-contracts/src/token/FungibleToken"
7676
prefix FungibleToken_;
7777

7878
constructor(
@@ -180,7 +180,7 @@ ZK key generation is slow and usually unnecessary during development.
180180
181181
```bash
182182
# Individual module compilation (recommended for development)
183-
turbo compact:token --filter=@openzeppelin-compact/contracts -- --skip-zk
183+
turbo compact:token --filter=@openzeppelin/compact-contracts -- --skip-zk
184184

185185
# Full compilation with skip-zk (use environment variable)
186186
SKIP_ZK=true turbo compact

contracts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@openzeppelin-compact/contracts",
2+
"name": "@openzeppelin/compact-contracts",
33
"version": "0.0.1",
44
"description": "OpenZeppelin Compact contract library",
55
"keywords": [

contracts/src/access/test/AccessControl.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {
2-
convertFieldToBytes,
32
type CoinPublicKey,
3+
convertFieldToBytes,
44
} from '@midnight-ntwrk/compact-runtime';
55
import { beforeEach, describe, expect, it } from 'vitest';
66
import { AccessControlSimulator } from './simulators/AccessControlSimulator.js';
@@ -24,11 +24,11 @@ const Z_OPERATOR_CONTRACT =
2424

2525
// Roles
2626
const DEFAULT_ADMIN_ROLE = utils.zeroUint8Array();
27-
const OPERATOR_ROLE_1 = convertFieldToBytes(32, 1n, "");
28-
const OPERATOR_ROLE_2 = convertFieldToBytes(32, 2n, "");
29-
const OPERATOR_ROLE_3 = convertFieldToBytes(32, 3n, "");
30-
const CUSTOM_ADMIN_ROLE = convertFieldToBytes(32, 4n, "");
31-
const UNINITIALIZED_ROLE = convertFieldToBytes(32, 5n, "");
27+
const OPERATOR_ROLE_1 = convertFieldToBytes(32, 1n, '');
28+
const OPERATOR_ROLE_2 = convertFieldToBytes(32, 2n, '');
29+
const OPERATOR_ROLE_3 = convertFieldToBytes(32, 3n, '');
30+
const CUSTOM_ADMIN_ROLE = convertFieldToBytes(32, 4n, '');
31+
const UNINITIALIZED_ROLE = convertFieldToBytes(32, 5n, '');
3232

3333
let accessControl: AccessControlSimulator;
3434
let caller: CoinPublicKey;

contracts/src/access/test/ZOwnablePK.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const buildCommitmentFromId = (
4141
counter: bigint,
4242
): Uint8Array => {
4343
const rt_type = new CompactTypeVector(4, new CompactTypeBytes(32));
44-
const bCounter = convertFieldToBytes(32, counter, "");
44+
const bCounter = convertFieldToBytes(32, counter, '');
4545
const bDomain = new TextEncoder().encode(DOMAIN);
4646

4747
const commitment = persistentHash(rt_type, [
@@ -63,7 +63,7 @@ const buildCommitment = (
6363
const id = createIdHash(pk, nonce);
6464

6565
const rt_type = new CompactTypeVector(4, new CompactTypeBytes(32));
66-
const bCounter = convertFieldToBytes(32, counter, "");
66+
const bCounter = convertFieldToBytes(32, counter, '');
6767
const bDomain = new TextEncoder().encode(domain);
6868

6969
const commitment = persistentHash(rt_type, [

contracts/src/access/test/utils/address.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ const baseGeneratePubKeyPair = (
6565
str: string,
6666
asEither: boolean,
6767
): [
68-
string,
69-
(
70-
| Compact.ZswapCoinPublicKey
71-
| Compact.Either<Compact.ZswapCoinPublicKey, Compact.ContractAddress>
72-
),
73-
] => {
68+
string,
69+
(
70+
| Compact.ZswapCoinPublicKey
71+
| Compact.Either<Compact.ZswapCoinPublicKey, Compact.ContractAddress>
72+
),
73+
] => {
7474
const pk = toHexPadded(str);
7575
const zpk = asEither ? createEitherTestUser(str) : encodeToPK(str);
7676
return [pk, zpk];
@@ -86,7 +86,7 @@ export const generateEitherPubKeyPair = (str: string) =>
8686
];
8787

8888
export const zeroUint8Array = (length = 32) =>
89-
convertFieldToBytes(length, 0n, "");
89+
convertFieldToBytes(length, 0n, '');
9090

9191
export const ZERO_KEY = {
9292
is_left: true,

contracts/src/archive/test/utils/address.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ export const createEitherTestContractAddress = (str: string) => {
7070

7171
export const ZERO_KEY = {
7272
is_left: true,
73-
left: { bytes: convertFieldToBytes(32, 0n, "") },
73+
left: { bytes: convertFieldToBytes(32, 0n, '') },
7474
right: encodeToAddress(''),
7575
};
7676

7777
export const ZERO_ADDRESS = {
7878
is_left: false,
7979
left: encodeToPK(''),
80-
right: { bytes: convertFieldToBytes(32, 0n, "") },
80+
right: { bytes: convertFieldToBytes(32, 0n, '') },
8181
};

contracts/src/security/test/utils/address.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ export const createEitherTestContractAddress = (str: string) => {
7070

7171
export const ZERO_KEY = {
7272
is_left: true,
73-
left: { bytes: convertFieldToBytes(32, 0n, "") },
73+
left: { bytes: convertFieldToBytes(32, 0n, '') },
7474
right: encodeToAddress(''),
7575
};
7676

7777
export const ZERO_ADDRESS = {
7878
is_left: false,
7979
left: encodeToPK(''),
80-
right: { bytes: convertFieldToBytes(32, 0n, "") },
80+
right: { bytes: convertFieldToBytes(32, 0n, '') },
8181
};

contracts/src/token/test/utils/address.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const createEitherTestContractAddress = (str: string) => ({
6262
});
6363

6464
export const zeroUint8Array = (length = 32) =>
65-
convertFieldToBytes(length, 0n, "");
65+
convertFieldToBytes(length, 0n, '');
6666

6767
export const ZERO_KEY = {
6868
is_left: true,

0 commit comments

Comments
 (0)