Skip to content

Commit 039d41e

Browse files
feat: upgrade to contracts v2.2.0 (#450)
* feat: upgrade to protocol v2.2.0 * rename "operator" into "assistant" * fix e2e tests * add e2e tests for reserving offer range for voucher contract * fix subgraph test * add e2e test to approve preminted tokens and validate seaport orders * lint code * add e2e tests for calling seaport validate for preminted vouchers with meta-transactions * replace MockSeaport with real Seaport contract (from protocol-contracts submodules) * point protocol-contracts onto tag v2.2.0-rc.4 * fix issue with meta-tx e2e test * (try to) fix e2e test pipeline * Allow to override the txGas for signMetaTxCallExternalContract and signMetaTxSetApprovalForAllToContract
1 parent f955cb2 commit 039d41e

83 files changed

Lines changed: 4452 additions & 1005 deletions

File tree

Some content is hidden

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

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
steps:
8080
- uses: actions/checkout@v3
8181
with:
82-
submodules: "true"
82+
submodules: "recursive"
8383
token: ${{ secrets.BSNORG_ACTIONS_SECRET }}
8484
- uses: actions/setup-node@v3
8585
with:

contracts/hardhat.config.js

Lines changed: 64 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
/* eslint @typescript-eslint/no-var-requires: "off" */
2-
const { task } = require("hardhat/config");
2+
const { task, subtask } = require("hardhat/config");
33
const { ACCOUNTS } = require("./accounts");
44
require("dotenv").config();
55

66
require("@nomiclabs/hardhat-waffle");
77
require("hardhat-abi-exporter");
88
require("@nomiclabs/hardhat-etherscan");
9+
const path = require("node:path");
10+
const { glob } = require("glob");
11+
const {
12+
TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS
13+
} = require("hardhat/builtin-tasks/task-names");
914

1015
// This is a sample Hardhat task. To learn how to create your own go to
1116
// https://hardhat.org/guides/create-task.html
@@ -17,6 +22,49 @@ task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
1722
}
1823
});
1924

25+
// Allow to merge different sources folder in hardhat config
26+
subtask(TASK_COMPILE_SOLIDITY_GET_SOURCE_PATHS, async (_, { config }) => {
27+
const contracts_path = path.join(
28+
config.paths.root,
29+
"protocol-contracts",
30+
"contracts",
31+
"**",
32+
"*.sol"
33+
);
34+
const contracts = await glob(contracts_path.replace(/\\/g, "/")); // Windows support
35+
const seaportSubmodule_path = path.join(
36+
config.paths.root,
37+
"protocol-contracts",
38+
"submodules",
39+
"seaport"
40+
);
41+
const submodulesContracts = await glob(
42+
[
43+
path
44+
.join(seaportSubmodule_path, "contracts", "*.sol")
45+
.replace(/\\/g, "/"), // Windows support
46+
path
47+
.join(seaportSubmodule_path, "contracts", "conduit", "*.sol")
48+
.replace(/\\/g, "/") // Windows support
49+
],
50+
{
51+
ignore: [
52+
path
53+
.join(seaportSubmodule_path, "node_modules", "**")
54+
.replace(/\\/g, "/"), // Windows support
55+
path
56+
.join(seaportSubmodule_path, "contracts", "test", "**")
57+
.replace(/\\/g, "/"), // Windows support
58+
path
59+
.join(seaportSubmodule_path, "contracts", "interfaces", "**")
60+
.replace(/\\/g, "/") // Windows support
61+
]
62+
}
63+
);
64+
console.log("Add submodulesContracts:", submodulesContracts);
65+
return [...contracts, ...submodulesContracts].map(path.normalize);
66+
});
67+
2068
const accountsFromEnv = process.env.DEPLOYER_PK
2169
? [process.env.DEPLOYER_PK]
2270
: [];
@@ -26,16 +74,23 @@ const accountsFromEnv = process.env.DEPLOYER_PK
2674
*/
2775
module.exports = {
2876
solidity: {
29-
version: "0.8.9",
30-
settings: {
31-
optimizer: {
32-
enabled: true,
33-
runs: 200,
34-
details: {
35-
yul: true
77+
compilers: [
78+
{
79+
version: "0.8.9",
80+
settings: {
81+
optimizer: {
82+
enabled: true,
83+
runs: 200,
84+
details: {
85+
yul: true
86+
}
87+
}
3688
}
89+
},
90+
{
91+
version: "0.8.17"
3792
}
38-
}
93+
]
3994
},
4095
networks: {
4196
hardhat: {

0 commit comments

Comments
 (0)