From 272df17d0b6faf6cd26c1f7def328cd72c5e4f44 Mon Sep 17 00:00:00 2001 From: wojciech-turek Date: Fri, 16 Aug 2024 16:53:15 +0200 Subject: [PATCH] Revert to oz contract 4.9.2 to fix storage issue --- .../500_marketplace/508_exchange_setup.ts | 2 + packages/marketplace/contracts/Exchange.sol | 4 +- .../marketplace/contracts/OrderValidator.sol | 2 +- .../contracts/RoyaltiesRegistry.sol | 2 +- packages/marketplace/contracts/Whitelist.sol | 2 +- packages/marketplace/package.json | 180 +++++++++--------- yarn.lock | 4 +- 7 files changed, 99 insertions(+), 97 deletions(-) diff --git a/packages/deploy/deploy/500_marketplace/508_exchange_setup.ts b/packages/deploy/deploy/500_marketplace/508_exchange_setup.ts index 88e6020508..f4b1f9f6c7 100644 --- a/packages/deploy/deploy/500_marketplace/508_exchange_setup.ts +++ b/packages/deploy/deploy/500_marketplace/508_exchange_setup.ts @@ -88,5 +88,7 @@ func.dependencies = [ 'Land_deploy', 'PolygonSand_deploy', 'PolygonLand_deploy', + 'PolygonLandV2_deploy', + 'LandV4_deploy', 'ExchangeV2_deploy', ]; diff --git a/packages/marketplace/contracts/Exchange.sol b/packages/marketplace/contracts/Exchange.sol index d9231673f9..f942f6ae97 100644 --- a/packages/marketplace/contracts/Exchange.sol +++ b/packages/marketplace/contracts/Exchange.sol @@ -2,9 +2,9 @@ pragma solidity 0.8.23; -import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol"; +import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol"; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; -import {AccessControlEnumerableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/extensions/AccessControlEnumerableUpgradeable.sol"; +import {AccessControlEnumerableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import {ContextUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol"; import {ERC2771HandlerUpgradeable} from "@sandbox-smart-contracts/dependency-metatx/contracts/ERC2771HandlerUpgradeable.sol"; import {IOrderValidator} from "./interfaces/IOrderValidator.sol"; diff --git a/packages/marketplace/contracts/OrderValidator.sol b/packages/marketplace/contracts/OrderValidator.sol index da05766f85..d36a432904 100644 --- a/packages/marketplace/contracts/OrderValidator.sol +++ b/packages/marketplace/contracts/OrderValidator.sol @@ -7,7 +7,7 @@ import {LibAsset} from "./libraries/LibAsset.sol"; import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; import {EIP712Upgradeable, Initializable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/EIP712Upgradeable.sol"; import {ERC165Upgradeable} from "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol"; -import {AccessControlEnumerableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/extensions/AccessControlEnumerableUpgradeable.sol"; +import {AccessControlEnumerableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import {IOrderValidator} from "./interfaces/IOrderValidator.sol"; import {Whitelist} from "./Whitelist.sol"; diff --git a/packages/marketplace/contracts/RoyaltiesRegistry.sol b/packages/marketplace/contracts/RoyaltiesRegistry.sol index 1bf29d2ec8..142f2bb051 100644 --- a/packages/marketplace/contracts/RoyaltiesRegistry.sol +++ b/packages/marketplace/contracts/RoyaltiesRegistry.sol @@ -63,7 +63,7 @@ contract RoyaltiesRegistry is OwnableUpgradeable, IRoyaltiesProvider, ERC165Upgr /// @notice Royalties registry initializer function initialize() external initializer { - __Ownable_init(_msgSender()); + __Ownable_init(); } /// @notice Assigns an external provider for a token's royalties and sets the royalty type as 'EXTERNAL_PROVIDER' (2). diff --git a/packages/marketplace/contracts/Whitelist.sol b/packages/marketplace/contracts/Whitelist.sol index 173ed1d3e9..0847a6f473 100644 --- a/packages/marketplace/contracts/Whitelist.sol +++ b/packages/marketplace/contracts/Whitelist.sol @@ -3,7 +3,7 @@ pragma solidity 0.8.23; import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; -import {AccessControlEnumerableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/extensions/AccessControlEnumerableUpgradeable.sol"; +import {AccessControlEnumerableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol"; import {IWhitelist} from "./interfaces/IWhitelist.sol"; /// @author The Sandbox diff --git a/packages/marketplace/package.json b/packages/marketplace/package.json index 9e85ead828..76a6d23ec3 100644 --- a/packages/marketplace/package.json +++ b/packages/marketplace/package.json @@ -1,95 +1,95 @@ { - "name": "@sandbox-smart-contracts/marketplace", - "version": "1.0.2", - "description": "", - "mocha": { - "require": "hardhat/register", - "timeout": 40000, - "_": [ - "test/**/*.ts" - ] + "name": "@sandbox-smart-contracts/marketplace", + "version": "1.0.2", + "description": "", + "mocha": { + "require": "hardhat/register", + "timeout": 40000, + "_": [ + "test/**/*.ts" + ] + }, + "files": [ + "contracts", + "docs", + "README.md", + "CHANGELOG.md" + ], + "publishConfig": { + "access": "public" + }, + "devDependencies": { + "@nomicfoundation/hardhat-chai-matchers": "^2.0.1", + "@nomicfoundation/hardhat-ethers": "^3.0.3", + "@nomicfoundation/hardhat-network-helpers": "^1.0.8", + "@nomicfoundation/hardhat-toolbox": "^3.0.0", + "@nomicfoundation/hardhat-verify": "^1.0.0", + "@nomiclabs/hardhat-etherscan": "^3.1.7", + "@openzeppelin/hardhat-upgrades": "^2.2.1", + "@release-it/keep-a-changelog": "^4.0.0", + "@typechain/ethers-v6": "^0.4.0", + "@typechain/hardhat": "^8.0.0", + "@types/chai": "^4.3.6", + "@types/mocha": "^10.0.1", + "@types/node": "^20.2.5", + "@typescript-eslint/eslint-plugin": "^5.59.8", + "@typescript-eslint/parser": "^5.59.8", + "chai": "^4.3.7", + "eslint": "^8.41.0", + "eslint-config-prettier": "^8.8.0", + "eslint-plugin-mocha": "^10.1.0", + "eslint-plugin-prettier": "^4.2.1", + "ethers": "^6.6.2", + "hardhat": "^2.14.1", + "hardhat-contract-sizer": "^2.10.0", + "hardhat-gas-reporter": "^1.0.9", + "mocha": "^10.2.0", + "prettier": "^2.8.8", + "prettier-plugin-solidity": "^1.1.3", + "release-it": "^16.2.1", + "solhint": "^3.6.2", + "solhint-plugin-prettier": "^0.0.5", + "solidity-coverage": "^0.8.3", + "ts-node": "^10.9.1", + "typechain": "^8.2.0", + "typescript": "5.0.4" + }, + "scripts": { + "lint": "eslint --max-warnings 0 \"**/*.{js,ts}\" && solhint --max-warnings 0 \"contracts/**/*.sol\"", + "lint:fix": "eslint --fix \"**/*.{js,ts}\" && solhint --fix \"contracts/**/*.sol\"", + "format": "prettier --check \"**/*.{ts,js,sol,md}\"", + "format:fix": "prettier --write \"**/*.{ts,js,sol,md}\"", + "test": "hardhat test", + "coverage": "hardhat coverage --testfiles 'test/*.ts''test/*.js'", + "analyze": "slither .", + "hardhat": "hardhat", + "compile": "hardhat compile", + "release": "release-it" + }, + "release-it": { + "git": { + "commitMessage": "chore: @sandbox-smart-contracts/marketplace release v${version}", + "tagAnnotation": "@sandbox-smart-contracts/marketplace release v${version}", + "tagName": "@sandbox-smart-contracts/marketplace@v${version}" }, - "files": [ - "contracts", - "docs", - "README.md", - "CHANGELOG.md" - ], - "publishConfig": { - "access": "public" + "plugins": { + "@release-it/keep-a-changelog": {} }, - "devDependencies": { - "@nomicfoundation/hardhat-chai-matchers": "^2.0.1", - "@nomicfoundation/hardhat-ethers": "^3.0.3", - "@nomicfoundation/hardhat-network-helpers": "^1.0.8", - "@nomicfoundation/hardhat-toolbox": "^3.0.0", - "@nomicfoundation/hardhat-verify": "^1.0.0", - "@nomiclabs/hardhat-etherscan": "^3.1.7", - "@openzeppelin/hardhat-upgrades": "^2.2.1", - "@release-it/keep-a-changelog": "^4.0.0", - "@typechain/ethers-v6": "^0.4.0", - "@typechain/hardhat": "^8.0.0", - "@types/chai": "^4.3.6", - "@types/mocha": "^10.0.1", - "@types/node": "^20.2.5", - "@typescript-eslint/eslint-plugin": "^5.59.8", - "@typescript-eslint/parser": "^5.59.8", - "chai": "^4.3.7", - "eslint": "^8.41.0", - "eslint-config-prettier": "^8.8.0", - "eslint-plugin-mocha": "^10.1.0", - "eslint-plugin-prettier": "^4.2.1", - "ethers": "^6.6.2", - "hardhat": "^2.14.1", - "hardhat-contract-sizer": "^2.10.0", - "hardhat-gas-reporter": "^1.0.9", - "mocha": "^10.2.0", - "prettier": "^2.8.8", - "prettier-plugin-solidity": "^1.1.3", - "release-it": "^16.2.1", - "solhint": "^3.6.2", - "solhint-plugin-prettier": "^0.0.5", - "solidity-coverage": "^0.8.3", - "ts-node": "^10.9.1", - "typechain": "^8.2.0", - "typescript": "5.0.4" - }, - "scripts": { - "lint": "eslint --max-warnings 0 \"**/*.{js,ts}\" && solhint --max-warnings 0 \"contracts/**/*.sol\"", - "lint:fix": "eslint --fix \"**/*.{js,ts}\" && solhint --fix \"contracts/**/*.sol\"", - "format": "prettier --check \"**/*.{ts,js,sol,md}\"", - "format:fix": "prettier --write \"**/*.{ts,js,sol,md}\"", - "test": "hardhat test", - "coverage": "hardhat coverage --testfiles 'test/*.ts''test/*.js'", - "analyze": "slither .", - "hardhat": "hardhat", - "compile": "hardhat compile", - "release": "release-it" - }, - "release-it": { - "git": { - "commitMessage": "chore: @sandbox-smart-contracts/marketplace release v${version}", - "tagAnnotation": "@sandbox-smart-contracts/marketplace release v${version}", - "tagName": "@sandbox-smart-contracts/marketplace@v${version}" - }, - "plugins": { - "@release-it/keep-a-changelog": {} - }, - "hooks": { - "before:init": [ - "yarn lint", - "yarn test" - ] - } - }, - "author": "", - "license": "ISC", - "dependencies": { - "@manifoldxyz/royalty-registry-solidity": "^3.0.0", - "@openzeppelin/contracts": "5.0.2", - "@openzeppelin/contracts-upgradeable": "5.0.2", - "@sandbox-smart-contracts/dependency-metatx": "1.0.1", - "@sandbox-smart-contracts/dependency-royalty-management": "1.0.2", - "@sandbox-smart-contracts/land": "1.0.0-rc.1" + "hooks": { + "before:init": [ + "yarn lint", + "yarn test" + ] } + }, + "author": "", + "license": "ISC", + "dependencies": { + "@manifoldxyz/royalty-registry-solidity": "^3.0.0", + "@openzeppelin/contracts": "^4.9.2", + "@openzeppelin/contracts-upgradeable": "^4.9.2", + "@sandbox-smart-contracts/dependency-metatx": "1.0.1", + "@sandbox-smart-contracts/dependency-royalty-management": "1.0.2", + "@sandbox-smart-contracts/land": "1.0.0-rc.1" + } } diff --git a/yarn.lock b/yarn.lock index 9a55039699..723f5142ee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3124,8 +3124,8 @@ __metadata: "@nomicfoundation/hardhat-toolbox": ^3.0.0 "@nomicfoundation/hardhat-verify": ^1.0.0 "@nomiclabs/hardhat-etherscan": ^3.1.7 - "@openzeppelin/contracts": 5.0.2 - "@openzeppelin/contracts-upgradeable": 5.0.2 + "@openzeppelin/contracts": ^4.9.2 + "@openzeppelin/contracts-upgradeable": ^4.9.2 "@openzeppelin/hardhat-upgrades": ^2.2.1 "@release-it/keep-a-changelog": ^4.0.0 "@sandbox-smart-contracts/dependency-metatx": 1.0.1