@openzeppelin/wizard 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,10 +9,10 @@
9
9
  "author": "",
10
10
  "license": "ISC",
11
11
  "devDependencies": {
12
- "@openzeppelin/contracts": "^5.0.0",
13
- "@openzeppelin/contracts-upgradeable": "^5.0.0",
12
+ "@openzeppelin/contracts": "^5.4.0",
13
+ "@openzeppelin/contracts-upgradeable": "^5.4.0",
14
14
  "@openzeppelin/hardhat-upgrades": "^3.0.0",
15
- "@nomicfoundation/hardhat-toolbox": "^5.0.0",
15
+ "@nomicfoundation/hardhat-toolbox": "^6.1.0",
16
16
  "hardhat": "^2.16.1"
17
17
  }
18
18
  }
package/src/erc20.ts CHANGED
@@ -5,7 +5,6 @@ import { addPauseFunctions } from './add-pausable';
5
5
  import { defineFunctions } from './utils/define-functions';
6
6
  import type { CommonOptions } from './common-options';
7
7
  import { withCommonDefaults, defaults as commonDefaults } from './common-options';
8
- import type { Upgradeable } from './set-upgradeable';
9
8
  import { setUpgradeable } from './set-upgradeable';
10
9
  import { setInfo } from './set-info';
11
10
  import { printContract } from './print';
@@ -90,7 +89,7 @@ export function buildERC20(opts: ERC20Options): ContractBuilder {
90
89
  addBase(c, allOpts.name, allOpts.symbol);
91
90
 
92
91
  if (allOpts.crossChainBridging) {
93
- addCrossChainBridging(c, allOpts.crossChainBridging, allOpts.upgradeable, access);
92
+ addCrossChainBridging(c, allOpts.crossChainBridging, access);
94
93
  }
95
94
 
96
95
  if (allOpts.premint) {
@@ -305,26 +304,15 @@ function addFlashMint(c: ContractBuilder) {
305
304
  });
306
305
  }
307
306
 
308
- function addCrossChainBridging(
309
- c: ContractBuilder,
310
- crossChainBridging: 'custom' | 'superchain',
311
- upgradeable: Upgradeable,
312
- access: Access,
313
- ) {
307
+ function addCrossChainBridging(c: ContractBuilder, crossChainBridging: 'custom' | 'superchain', access: Access) {
314
308
  const ERC20Bridgeable = {
315
309
  name: 'ERC20Bridgeable',
316
- path: `@openzeppelin/community-contracts/token/ERC20/extensions/ERC20Bridgeable.sol`,
310
+ path: `@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Bridgeable.sol`,
317
311
  };
318
312
 
319
313
  c.addParent(ERC20Bridgeable);
320
314
  c.addOverride(ERC20Bridgeable, supportsInterface);
321
315
 
322
- if (upgradeable) {
323
- throw new OptionsError({
324
- crossChainBridging: 'Upgradeability is not currently supported with Cross-Chain Bridging',
325
- });
326
- }
327
-
328
316
  c.addOverride(ERC20Bridgeable, functions._checkTokenBridge);
329
317
  switch (crossChainBridging) {
330
318
  case 'custom':
@@ -345,13 +333,13 @@ function addCustomBridging(c: ContractBuilder, access: Access) {
345
333
  switch (access) {
346
334
  case false:
347
335
  case 'ownable': {
348
- const addedBridgeImmutable = c.addVariable(`address public immutable TOKEN_BRIDGE;`);
336
+ const addedBridgeImmutable = c.addVariable(`address public tokenBridge;`);
349
337
  if (addedBridgeImmutable) {
350
- c.addConstructorArgument({ type: 'address', name: 'tokenBridge' });
351
- c.addConstructorCode(`require(tokenBridge != address(0), "Invalid TOKEN_BRIDGE address");`);
352
- c.addConstructorCode(`TOKEN_BRIDGE = tokenBridge;`);
338
+ c.addConstructorArgument({ type: 'address', name: 'tokenBridge_' });
339
+ c.addConstructorCode(`require(tokenBridge_ != address(0), "Invalid tokenBridge_ address");`);
340
+ c.addConstructorCode(`tokenBridge = tokenBridge_;`);
353
341
  }
354
- c.setFunctionBody([`if (caller != TOKEN_BRIDGE) revert Unauthorized();`], functions._checkTokenBridge, 'view');
342
+ c.setFunctionBody([`if (caller != tokenBridge) revert Unauthorized();`], functions._checkTokenBridge, 'view');
355
343
  break;
356
344
  }
357
345
  case 'roles': {
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * Semantic version string representing of the minimum compatible version of Contracts to display in output.
3
3
  */
4
- export const compatibleContractsSemver = '^5.0.0';
4
+ export const compatibleContractsSemver = '^5.4.0';