Skip to content

Commit 32ff02c

Browse files
ericglauAmxx
andauthored
Add ERC-20 option for embedding ERC-7786 based crosschain bridge, use Contracts 5.6.0 (#747)
Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com>
1 parent f067b9f commit 32ff02c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1255
-683
lines changed

.changeset/ninety-ears-slide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@openzeppelin/wizard-common': patch
3+
---
4+
5+
Solidity `erc20`, `stablecoin`, `realWorldAsset`: Support 'erc7786native' option for `crossChainBridging`.

.changeset/sad-cases-yawn.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@openzeppelin/wizard': patch
3+
'@openzeppelin/contracts-mcp': patch
4+
---
5+
6+
Solidity `erc20`, `stablecoin`, `realWorldAsset`: Support 'erc7786native' option for `crossChainBridging`.
7+
- Uses OpenZeppelin Contracts 5.6.0
8+
- **Breaking changes**: Solidity `erc20`, `stablecoin`, `realWorldAsset`: 'custom' option for `crossChainBridging` now requires access control, and adds a function to allow updating the token bridge address after deployment. Constructor/initializer parameter order changed due to access control requirement.

packages/common/src/ai/descriptions/solidity.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ export const solidityERC20Descriptions = {
3131
flashmint:
3232
"Whether to include built-in flash loans to allow lending tokens without requiring collateral as long as they're returned in the same transaction.",
3333
crossChainBridging:
34-
'Whether to allow authorized bridge contracts to mint and burn tokens for cross-chain transfers. Options are to use custom bridges on any chain, or the SuperchainERC20 standard with the predeployed SuperchainTokenBridge. The SuperchainERC20 feature is only available on chains in the Superchain, and requires deploying your contract to the same address on every chain in the Superchain.',
34+
'Whether to allow authorized bridge contracts to mint and burn tokens for cross-chain transfers. Options are to use custom bridges on any chain, to embed an ERC-7786 based bridge directly in the token contract, or to use the SuperchainERC20 standard with the predeployed SuperchainTokenBridge. The SuperchainERC20 feature is only available on chains in the Superchain, and requires deploying your contract to the same address on every chain in the Superchain.',
35+
crossChainLinkAllowOverride:
36+
'Whether to allow replacing a crosschain link that has already been registered. Only used if crossChainBridging is set to "erc7786native".',
3537
premintChainId: 'The chain ID of the network on which to premint tokens.',
3638
callback:
3739
'Whether to include support for code execution after transfers and approvals on recipient contracts in a single transaction.',

packages/core/confidential/src/erc7984.test.ts.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Generated by [AVA](https://avajs.dev).
4343
> Snapshot 1
4444
4545
`// SPDX-License-Identifier: MIT␊
46-
// Compatible with OpenZeppelin Contracts ^5.5.0 and Confidential Contracts ^0.3.1␊
46+
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
4747
pragma solidity ^0.8.27;␊
4848
4949
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
@@ -82,7 +82,7 @@ Generated by [AVA](https://avajs.dev).
8282
> Snapshot 1
8383
8484
`// SPDX-License-Identifier: MIT␊
85-
// Compatible with OpenZeppelin Contracts ^5.5.0 and Confidential Contracts ^0.3.1␊
85+
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
8686
pragma solidity ^0.8.27;␊
8787
8888
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
@@ -104,7 +104,7 @@ Generated by [AVA](https://avajs.dev).
104104
> Snapshot 1
105105
106106
`// SPDX-License-Identifier: MIT␊
107-
// Compatible with OpenZeppelin Contracts ^5.5.0 and Confidential Contracts ^0.3.1␊
107+
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
108108
pragma solidity ^0.8.27;␊
109109
110110
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
@@ -126,7 +126,7 @@ Generated by [AVA](https://avajs.dev).
126126
> Snapshot 1
127127
128128
`// SPDX-License-Identifier: MIT␊
129-
// Compatible with OpenZeppelin Contracts ^5.5.0 and Confidential Contracts ^0.3.1␊
129+
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
130130
pragma solidity ^0.8.27;␊
131131
132132
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
@@ -148,7 +148,7 @@ Generated by [AVA](https://avajs.dev).
148148
> Snapshot 1
149149
150150
`// SPDX-License-Identifier: MIT␊
151-
// Compatible with OpenZeppelin Contracts ^5.5.0 and Confidential Contracts ^0.3.1␊
151+
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
152152
pragma solidity ^0.8.27;␊
153153
154154
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
@@ -189,7 +189,7 @@ Generated by [AVA](https://avajs.dev).
189189
> Snapshot 1
190190
191191
`// SPDX-License-Identifier: MIT␊
192-
// Compatible with OpenZeppelin Contracts ^5.5.0 and Confidential Contracts ^0.3.1␊
192+
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
193193
pragma solidity ^0.8.27;␊
194194
195195
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
@@ -252,7 +252,7 @@ Generated by [AVA](https://avajs.dev).
252252
> Snapshot 1
253253
254254
`// SPDX-License-Identifier: MIT␊
255-
// Compatible with OpenZeppelin Contracts ^5.5.0 and Confidential Contracts ^0.3.1␊
255+
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
256256
pragma solidity ^0.8.27;␊
257257
258258
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
@@ -324,7 +324,7 @@ Generated by [AVA](https://avajs.dev).
324324
> Snapshot 1
325325
326326
`// SPDX-License-Identifier: MIT␊
327-
// Compatible with OpenZeppelin Contracts ^5.5.0 and Confidential Contracts ^0.3.1␊
327+
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
328328
pragma solidity ^0.8.27;␊
329329
330330
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
@@ -401,7 +401,7 @@ Generated by [AVA](https://avajs.dev).
401401
> Snapshot 1
402402
403403
`// SPDX-License-Identifier: MIT␊
404-
// Compatible with OpenZeppelin Contracts ^5.5.0 and Confidential Contracts ^0.3.1␊
404+
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
405405
pragma solidity ^0.8.27;␊
406406
407407
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
-1 Bytes
Binary file not shown.

packages/core/confidential/src/print-versioned.test.ts.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ Generated by [AVA](https://avajs.dev).
99
> Snapshot 1
1010
1111
`// SPDX-License-Identifier: MIT␊
12-
// Compatible with OpenZeppelin Contracts ^5.5.0 and Confidential Contracts ^0.3.1␊
12+
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
1313
pragma solidity ^0.8.27;␊
1414
1515
import {LocalImport} from "../utils/FooLocal.sol";␊
1616
import {CustomContract} from "./FooCustom.sol";␊
1717
import {FhevmContract} from "@fhevm/solidity@0.9.1/Foo2.sol";␊
1818
import {FhevmType} from "@fhevm/solidity@0.9.1/Types.sol";␊
1919
import {ConfidentialContract} from "@openzeppelin/confidential-contracts@0.3.1/Foo1.sol";␊
20-
import {UpgradeableContract} from "@openzeppelin/contracts-upgradeable@5.5.0/Foo4.sol";␊
21-
import {FooUpgradeable} from "@openzeppelin/contracts-upgradeable@5.5.0/FooUpgradeable.sol";␊
22-
import {StandardContract} from "@openzeppelin/contracts@5.5.0/Foo3.sol";␊
23-
import {IFoo} from "@openzeppelin/contracts@5.5.0/IFoo.sol";␊
20+
import {UpgradeableContract} from "@openzeppelin/contracts-upgradeable@5.6.0/Foo4.sol";␊
21+
import {FooUpgradeable} from "@openzeppelin/contracts-upgradeable@5.6.0/FooUpgradeable.sol";␊
22+
import {StandardContract} from "@openzeppelin/contracts@5.6.0/Foo3.sol";␊
23+
import {IFoo} from "@openzeppelin/contracts@5.6.0/IFoo.sol";␊
2424
import {ThirdPartyLib} from "@third-party/library/FooThirdParty.sol";␊
2525
import {FooUnrelated} from "@unrelated/package/FooUnrelated.sol";␊
2626
-1 Bytes
Binary file not shown.

packages/core/confidential/src/zip-hardhat.test.ts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Generated by [AVA](https://avajs.dev).
9090
9191
[
9292
`// SPDX-License-Identifier: AGPL-3.0-only␊
93-
// Compatible with OpenZeppelin Contracts ^5.5.0 and Confidential Contracts ^0.3.1␊
93+
// Compatible with OpenZeppelin Contracts ^5.6.0 and Confidential Contracts ^0.3.1␊
9494
pragma solidity ^0.8.27;␊
9595
9696
import {ZamaEthereumConfig} from "@fhevm/solidity/config/ZamaConfig.sol";␊
0 Bytes
Binary file not shown.

packages/core/solidity/hardhat.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ module.exports = {
6666
enabled: true,
6767
runs: 200,
6868
},
69+
viaIR: true,
6970
},
7071
},
7172
};

0 commit comments

Comments
 (0)