Skip to content

Commit 0ad0267

Browse files
authored
feat: prepare mainnet (#248)
2 parents c37a0de + 5fafdf9 commit 0ad0267

File tree

9 files changed

+60
-15
lines changed

9 files changed

+60
-15
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
# IS_VERIFICATION_API_V2: ${{ vars.IS_VERIFICATION_API_V2 }}
6262
run: npm run deploy -- --network ${{ inputs.network }}
6363

64-
- name: Update config.json with ERC1538Proxy address
64+
- name: Update config.json with Diamond address
6565
if: inputs.network != 'hardhat'
6666
env:
6767
DEPLOYER_PRIVATE_KEY: ${{ secrets.DEPLOYER_PRIVATE_KEY }} # Fixes hardhat issue.

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Changelog
22

33
## vNEXT
4-
4+
- Support Arbitrum One (#248)
55
- Save IexecLibOrders_v5 in config file (#242)
66
- Migrate proxy to Diamond pattern (ERC-2535):
77
- Use lib as storage. (#243)

config/config.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,27 @@
160160
"salt": "0x0000000000000000000000000000000000000000000000000000000000000000"
161161
}
162162
},
163+
"42161": {
164+
"_comment": "Arbitrum One Mainnet",
165+
"asset": "Token",
166+
"token": "0xe649e6a1F2afc63ca268C2363691ceCAF75CF47C",
167+
"richman": "",
168+
"owner": "0x111165e3c379e4f8285df34d7137b433c30afa66",
169+
"uniswap": false,
170+
"v3": {
171+
"Hub": null,
172+
"AppRegistry": null,
173+
"DatasetRegistry": null,
174+
"WorkerpoolRegistry": null
175+
},
176+
"v5": {
177+
"factory": "0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed",
178+
"factoryType": "createx",
179+
"DiamondProxy": "",
180+
"salt": "0x0000000000000000000000000000000000000000000000000000000000000000",
181+
"IexecLibOrders_v5": ""
182+
}
183+
},
163184
"421614": {
164185
"_comment": "Arbitrum Sepolia Testnet",
165186
"asset": "Token",

contracts/facets/IexecPoco1Facet.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {FacetBase} from "./FacetBase.v8.sol";
1212
import {PocoStorageLib} from "../libs/PocoStorageLib.v8.sol";
1313
import {IexecPoco1} from "../interfaces/IexecPoco1.v8.sol";
1414
import {IexecEscrow} from "./IexecEscrow.v8.sol";
15-
import {IexecPocoCommonFacet} from "./IexecPocoCommonFacet.sol";
15+
import {IexecPocoCommon} from "./IexecPocoCommon.sol";
1616
import {SignatureVerifier} from "./SignatureVerifier.v8.sol";
1717

1818
struct Matching {
@@ -31,7 +31,7 @@ contract IexecPoco1Facet is
3131
FacetBase,
3232
IexecEscrow,
3333
SignatureVerifier,
34-
IexecPocoCommonFacet
34+
IexecPocoCommon
3535
{
3636
using Math for uint256;
3737
using IexecLibOrders_v5 for IexecLibOrders_v5.AppOrder;

contracts/facets/IexecPocoAccessorsFacet.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {FacetBase} from "./FacetBase.v8.sol";
88
import {IexecLibCore_v5} from "../libs/IexecLibCore_v5.sol";
99
import {IexecLibOrders_v5} from "../libs/IexecLibOrders_v5.sol";
1010
import {IexecPocoAccessors} from "../interfaces/IexecPocoAccessors.sol";
11-
import {IexecPocoCommonFacet} from "./IexecPocoCommonFacet.sol";
11+
import {IexecPocoCommon} from "./IexecPocoCommon.sol";
1212
import {SignatureVerifier} from "./SignatureVerifier.v8.sol";
1313

1414
/**
@@ -18,7 +18,7 @@ contract IexecPocoAccessorsFacet is
1818
IexecPocoAccessors,
1919
FacetBase,
2020
SignatureVerifier,
21-
IexecPocoCommonFacet
21+
IexecPocoCommon
2222
{
2323
using IexecLibOrders_v5 for IexecLibOrders_v5.AppOrder;
2424
using IexecLibOrders_v5 for IexecLibOrders_v5.DatasetOrder;

contracts/facets/IexecPocoBoostFacet.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {IWorkerpool} from "../registries/workerpools/IWorkerpool.v8.sol";
1616
import {FacetBase} from "./FacetBase.v8.sol";
1717
import {IexecPocoBoost} from "../interfaces/IexecPocoBoost.sol";
1818
import {IexecEscrow} from "./IexecEscrow.v8.sol";
19-
import {IexecPocoCommonFacet} from "./IexecPocoCommonFacet.sol";
19+
import {IexecPocoCommon} from "./IexecPocoCommon.sol";
2020
import {SignatureVerifier} from "./SignatureVerifier.v8.sol";
2121
import {PocoStorageLib} from "../libs/PocoStorageLib.v8.sol";
2222

@@ -29,7 +29,7 @@ contract IexecPocoBoostFacet is
2929
FacetBase,
3030
IexecEscrow,
3131
SignatureVerifier,
32-
IexecPocoCommonFacet
32+
IexecPocoCommon
3333
{
3434
using ECDSA for bytes32;
3535
using MessageHashUtils for bytes32;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {PocoStorageLib} from "../libs/PocoStorageLib.v8.sol";
88
import {IexecLibOrders_v5} from "../libs/IexecLibOrders_v5.sol";
99
import {FacetBase} from "./FacetBase.v8.sol";
1010

11-
contract IexecPocoCommonFacet is FacetBase {
11+
contract IexecPocoCommon is FacetBase {
1212
using Math for uint256;
1313
using IexecLibOrders_v5 for IexecLibOrders_v5.AppOrder;
1414
using IexecLibOrders_v5 for IexecLibOrders_v5.DatasetOrder;

deploy/0_deploy.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,21 +90,27 @@ export default async function deploy() {
9090
const iexecLibOrders = {
9191
['contracts/libs/IexecLibOrders_v5.sol:IexecLibOrders_v5']: iexecLibOrdersAddress,
9292
};
93+
const isArbitrumMainnet = (await ethers.provider.getNetwork()).chainId === 42161n;
9394
const facets = [
94-
new IexecAccessorsFacet__factory(),
9595
new IexecAccessorsABILegacyFacet__factory(),
96+
new IexecAccessorsFacet__factory(),
9697
new IexecCategoryManagerFacet__factory(),
98+
new IexecConfigurationExtraFacet__factory(),
99+
new IexecConfigurationFacet__factory(iexecLibOrders),
97100
new IexecERC20Facet__factory(),
98101
isTokenMode ? new IexecEscrowTokenFacet__factory() : new IexecEscrowNativeFacet__factory(),
99-
new IexecConfigurationFacet__factory(iexecLibOrders),
102+
// new IexecEscrowTokenSwapFacet__factory(), not deployed.
100103
new IexecOrderManagementFacet__factory(iexecLibOrders),
101104
new IexecPoco1Facet__factory(iexecLibOrders),
102105
new IexecPoco2Facet__factory(),
103-
new IexecRelayFacet__factory(),
104-
new IexecConfigurationExtraFacet__factory(),
105106
new IexecPocoAccessorsFacet__factory(iexecLibOrders),
106-
new IexecPocoBoostFacet__factory(iexecLibOrders),
107-
new IexecPocoBoostAccessorsFacet__factory(),
107+
...(!isArbitrumMainnet
108+
? [
109+
new IexecPocoBoostFacet__factory(iexecLibOrders), // not deployed on Arbitrum mainnet
110+
new IexecPocoBoostAccessorsFacet__factory(), // not deployed on Arbitrum mainnet
111+
]
112+
: []),
113+
new IexecRelayFacet__factory(),
108114
];
109115
for (const facet of facets) {
110116
const address = await factoryDeployer.deployContract(facet);

hardhat.config.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ const arbitrumSepoliaBaseConfig = {
4646
chainId: 421614,
4747
};
4848

49+
// Arbitrum specific configuration
50+
const arbitrumBaseConfig = {
51+
blockGasLimit: 30_000_000,
52+
chainId: 42161,
53+
};
54+
4955
const settings = {
5056
optimizer: {
5157
enabled: true,
@@ -164,6 +170,17 @@ const config: HardhatUserConfig = {
164170
],
165171
...fujiBaseConfig,
166172
},
173+
arbitrum: {
174+
url:
175+
process.env.ARBITRUM_RPC_URL || // Used in local development
176+
process.env.RPC_URL || // Defined in Github Actions environments
177+
'https://arbitrum.gateway.tenderly.co',
178+
accounts: [
179+
process.env.DEPLOYER_PRIVATE_KEY ||
180+
'0x0000000000000000000000000000000000000000000000000000000000000000',
181+
],
182+
...arbitrumBaseConfig,
183+
},
167184
arbitrumSepolia: {
168185
url:
169186
process.env.ARBITRUM_SEPOLIA_RPC_URL || // Used in local development
@@ -194,6 +211,7 @@ const config: HardhatUserConfig = {
194211
etherscan: {
195212
// TODO migrate to Etherscan V2 API and use process.env.EXPLORER_API_KEY
196213
apiKey: {
214+
arbitrum: process.env.ARBISCAN_API_KEY || '',
197215
avalancheFujiTestnet: 'nothing', // a non-empty string is needed by the plugin.
198216
arbitrumSepolia: process.env.ARBISCAN_API_KEY || '',
199217
bellecour: 'nothing', // a non-empty string is needed by the plugin.

0 commit comments

Comments
 (0)