Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- **Breaking change**: Update to OpenZeppelin Contracts 4.9. ([#252](https://github.com/OpenZeppelin/contracts-wizard/pull/252))

## 0.2.3 (2023-03-23)

- Fix module not found error. ([#235](https://github.com/OpenZeppelin/contracts-wizard/issues/235))
Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"update-env": "rm ./src/environments/hardhat/package-lock.json && npm install --package-lock-only --prefix ./src/environments/hardhat && rm ./src/environments/hardhat/upgradeable/package-lock.json && npm install --package-lock-only --prefix ./src/environments/hardhat/upgradeable"
},
"devDependencies": {
"@openzeppelin/contracts": "4.8.3",
"@openzeppelin/contracts-upgradeable": "4.8.3",
"@openzeppelin/contracts": "4.9.0",
"@openzeppelin/contracts-upgradeable": "4.9.0",
"@types/node": "^10.17.51",
"@types/rimraf": "^3.0.0",
"array.prototype.flat": "^1.2.4",
Expand Down
12 changes: 6 additions & 6 deletions packages/core/src/environments/hardhat/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions packages/core/src/erc721.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ Generated by [AVA](https://avajs.dev).
{␊
return super.tokenURI(tokenId);␊
}␊
function supportsInterface(bytes4 interfaceId)␊
public␊
view␊
override(ERC721, ERC721URIStorage)␊
returns (bool)␊
{␊
return super.supportsInterface(interfaceId);␊
}␊
}␊
`

Expand Down Expand Up @@ -135,6 +144,15 @@ Generated by [AVA](https://avajs.dev).
{␊
return super.tokenURI(tokenId);␊
}␊
function supportsInterface(bytes4 interfaceId)␊
public␊
view␊
override(ERC721, ERC721URIStorage)␊
returns (bool)␊
{␊
return super.supportsInterface(interfaceId);␊
}␊
}␊
`

Expand Down Expand Up @@ -178,6 +196,15 @@ Generated by [AVA](https://avajs.dev).
{␊
return super.tokenURI(tokenId);␊
}␊
function supportsInterface(bytes4 interfaceId)␊
public␊
view␊
override(ERC721, ERC721URIStorage)␊
returns (bool)␊
{␊
return super.supportsInterface(interfaceId);␊
}␊
}␊
`

Expand Down Expand Up @@ -224,6 +251,15 @@ Generated by [AVA](https://avajs.dev).
{␊
return super.tokenURI(tokenId);␊
}␊
function supportsInterface(bytes4 interfaceId)␊
public␊
view␊
override(ERC721, ERC721URIStorage)␊
returns (bool)␊
{␊
return super.supportsInterface(interfaceId);␊
}␊
}␊
`

Expand Down
Binary file modified packages/core/src/erc721.test.ts.snap
Binary file not shown.
1 change: 1 addition & 0 deletions packages/core/src/erc721.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ function addURIStorage(c: ContractBuilder) {

c.addOverride('ERC721URIStorage', functions._burn);
c.addOverride('ERC721URIStorage', functions.tokenURI);
c.addOverride('ERC721URIStorage', supportsInterface);
}

function addBurnable(c: ContractBuilder) {
Expand Down
8 changes: 8 additions & 0 deletions packages/core/src/governor.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,14 @@ Generated by [AVA](https://avajs.dev).
{␊
return super.supportsInterface(interfaceId);␊
}␊
function cancel(address[] memory targets, uint256[] memory values, bytes[] memory calldatas, bytes32 descriptionHash)␊
public␊
override(Governor, IGovernor, GovernorCompatibilityBravo)␊
returns (uint256)␊
{␊
return super.cancel(targets, values, calldatas, descriptionHash);␊
}␊
}␊
`

Expand Down
Binary file modified packages/core/src/governor.test.ts.snap
Binary file not shown.
13 changes: 13 additions & 0 deletions packages/core/src/governor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ function addBase(c: ContractBuilder, { name }: GovernorOptions) {
c.addOverride('Governor', functions._cancel);
c.addOverride('Governor', functions._executor);
c.addOverride('Governor', supportsInterface);
c.addOverride('Governor', functions.cancel);
}

function addSettings(c: ContractBuilder, allOpts: Required<GovernorOptions>) {
Expand Down Expand Up @@ -365,6 +366,8 @@ function addBravo(c: ContractBuilder, { bravo, timelock }: GovernorOptions) {
path: '@openzeppelin/contracts/governance/compatibility/GovernorCompatibilityBravo.sol',
});
c.addOverride('IGovernor', functions.state);
c.addOverride('IGovernor', functions.cancel);
c.addOverride('GovernorCompatibilityBravo', functions.cancel);
c.addOverride('GovernorCompatibilityBravo', functions.propose);
c.addOverride('IERC165', supportsInterface);
}
Expand Down Expand Up @@ -433,6 +436,16 @@ const functions = defineFunctions({
returns: ['uint256'],
kind: 'internal',
},
cancel: {
args: [
{ name: 'targets', type: 'address[] memory' },
{ name: 'values', type: 'uint256[] memory' },
{ name: 'calldatas', type: 'bytes[] memory' },
{ name: 'descriptionHash', type: 'bytes32' },
],
returns: ['uint256'],
kind: 'public',
},
state: {
args: [
{ name: 'proposalId', type: 'uint256' },
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/zip.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ test('erc721 auto increment', t => {
'@openzeppelin/contracts/utils/introspection/IERC165.sol',
'@openzeppelin/contracts/utils/math/',
'@openzeppelin/contracts/utils/math/Math.sol',
'@openzeppelin/contracts/utils/math/SignedMath.sol',
'MyToken.sol',
]);
});
Expand Down Expand Up @@ -99,6 +100,7 @@ test('erc721 auto increment uups', t => {
'@openzeppelin/contracts-upgradeable/utils/introspection/IERC165Upgradeable.sol',
'@openzeppelin/contracts-upgradeable/utils/math/',
'@openzeppelin/contracts-upgradeable/utils/math/MathUpgradeable.sol',
'@openzeppelin/contracts-upgradeable/utils/math/SignedMathUpgradeable.sol',
'MyToken.sol',
]);
});
Expand Down
18 changes: 9 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -746,15 +746,15 @@
"@nomicfoundation/solidity-analyzer-win32-ia32-msvc" "0.1.1"
"@nomicfoundation/solidity-analyzer-win32-x64-msvc" "0.1.1"

"@openzeppelin/contracts-upgradeable@4.8.3":
version "4.8.3"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.8.3.tgz#6b076a7b751811b90fe3a172a7faeaa603e13a3f"
integrity sha512-SXDRl7HKpl2WDoJpn7CK/M9U4Z8gNXDHHChAKh0Iz+Wew3wu6CmFYBeie3je8V0GSXZAIYYwUktSrnW/kwVPtg==

"@openzeppelin/contracts@4.8.3":
version "4.8.3"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.8.3.tgz#cbef3146bfc570849405f59cba18235da95a252a"
integrity sha512-bQHV8R9Me8IaJoJ2vPG4rXcL7seB7YVuskr4f+f5RyOStSZetwzkWtoqDMl5erkBJy0lDRUnIR2WIkPiC0GJlg==
"@openzeppelin/contracts-upgradeable@4.9.0":
version "4.9.0"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.0.tgz#70aaef469c8ac5bb0ff781480f3d321cbf7be3a8"
integrity sha512-+6i2j6vr2fdudTqkBvG+UOosankukxYzg3WN1nqU7ijjQ5A4osWaD3ip6CEz6YvDoSdZgcFVZoiGr7zRlUUoZw==

"@openzeppelin/contracts@4.9.0":
version "4.9.0"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.0.tgz#683f33b6598970051bc5f0806fd8660da9e018dd"
integrity sha512-DUP74AFGKlic2sQb/CmgrN2aUPMFGxRrmCTUxLHsiU2RzwWqVuMPZBxiAyvlff6Pea77uylAX6B5x9W6evEbhA==

"@pkgjs/parseargs@^0.11.0":
version "0.11.0"
Expand Down