Skip to content

Commit f9d6f2c

Browse files
committed
deploy contracts
1 parent 555e0d9 commit f9d6f2c

File tree

6 files changed

+107
-105
lines changed

6 files changed

+107
-105
lines changed

addresses/address.json

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,11 @@
145145
"VestingWalletC": "0x29F74B853C4B8D36273666FB63a3b71c754424Ed",
146146
"OceanNodesBooster": "0x73558Ef3bb6543A8107ac032C5a98Da03ceb0eEf",
147147
"OPFCommunityFeeCollectorCompute": "0x1705CaF86B86e85804e20FE342f39B17322Ff592",
148-
"Escrow": "0x5D7a9F0c8E9E9af5674DEE832Cc97FC425b655Bc",
149-
"AccessListFactory": "0x7ed6ac4243472adA55408fEE45c5Dff379f7aBE0"
148+
"Escrow": "0x225Fd0CfA1200F1e42c6C54071B646738A1d81bb",
149+
"AccessListFactory": "0x7ed6ac4243472adA55408fEE45c5Dff379f7aBE0",
150+
"EnterpriseFeeCollector": "0x254302d1Ae1e1200319c885D93D40a8927ACFcD7",
151+
"EnterpriseEscrow": "0x7F773EE2B8AFE158FA03B72fC20672B408Cd9818",
152+
"FixedPriceEnterprise": "0x6C97D128f7E7D21ac3C722458Dc5d71f7e1bBa6e"
150153
},
151154
"goerli": {
152155
"chainId": 5,
@@ -282,8 +285,7 @@
282285
"Dispenser": "0xbde8224d15885c2E46Be665b9392E619cD142de8",
283286
"ERC721Factory": "0x315ef329D214cde5cE7C206104aC35B1fe66bb8c",
284287
"PredictoorHelper": "0x2e4cb19faD077768fDcB04Bc0549AB76BE8eA63F",
285-
"AccessListFactory": "0xdA412123a3Cc0D921bcf7246f8742e3b7c3E7b94",
286-
"USDC": "0x9159984c4B7E1B5c1e120ED63132846599696327"
288+
"AccessListFactory": "0xdA412123a3Cc0D921bcf7246f8742e3b7c3E7b94"
287289
},
288290
"sepolia": {
289291
"chainId": 11155111,
@@ -303,11 +305,11 @@
303305
"Dispenser": "0x2720d405ef7cDC8a2E2e5AeBC8883C99611d893C",
304306
"ERC721Factory": "0xEF62FB495266C72a5212A11Dce8baa79Ec0ABeB1",
305307
"OPFCommunityFeeCollectorCompute": "0x0Ee8b03Dafc868a0899ebE1c12d734D53A957250",
306-
"Escrow": "0x86F2BB9F8f18B5a836b342199a3eC89F282E4018",
307-
"EnterpriseFeeCollector": "0x4D49eEedFac8Ea03328c0E4871b680C06d892092",
308-
"FixedPriceEnterprise": "0xEcD0C3519a081e3924D6F3197f86980eA7dfCf71",
308+
"Escrow": "0x8149276f275EEFAc110D74AFE8AFECEaeC7d1593",
309+
"EnterpriseFeeCollector": "0x8c98ea273bA22327F896Aa1a1a46E1BFf56e9b1D",
310+
"FixedPriceEnterprise": "0xfa48673a7C36A2A768f89AC1ee8C355D5c367B02",
309311
"AccessListFactory": "0x43eC0a34E1b70C7f8E579ab866F37642777727E7",
310-
"EnterpriseEscrow": "0x5494711392a67DA50D3bC7b1fcC2d1877cFaA4d2"
312+
"EnterpriseEscrow": "0x49E35cd2bAE043Abd9074B6e5a649a5AdEB05C33"
311313
},
312314
"oasis_sapphire": {
313315
"chainId": 23294,
@@ -334,8 +336,7 @@
334336
"AccessListFactory": "0x12bB8D85a091A69A07E22E52d4567dBB91568f52",
335337
"BatchPayments": "0x9497d1d64F2aFeBcd4f9916Eef3d9094E5Df962f",
336338
"OPFCommunityFeeCollectorCompute": "0xE5aa2C9B551aFcA4C0A98BB3B37D7A43084d0a66",
337-
"Escrow": "0xf0c7A31D7Ee26bEBfb4BAD8e37490bEadE3F846f",
338-
"USDC": "0x2c2E3812742Ab2DA53a728A09F5DE670Aba584b6"
339+
"Escrow": "0xA0329eFFa1370eAb1DC5998Db4292ae0F535a282"
339340
},
340341
"optimism_sepolia": {
341342
"chainId": 11155420,
@@ -354,7 +355,7 @@
354355
"Dispenser": "0x30E4CC2C7A9c6aA2b2Ce93586E3Df24a3A00bcDD",
355356
"ERC721Factory": "0xDEfD0018969cd2d4E648209F876ADe184815f038",
356357
"OPFCommunityFeeCollectorCompute": "0xe47991939632757DEe324E8ec9A3268c62C0DB76",
357-
"Escrow": "0x4D49eEedFac8Ea03328c0E4871b680C06d892092",
358+
"Escrow": "0xD3173c3E3d9ea662E914C30Bcd647eF573AcE405",
358359
"AccessListFactory": "0xEcD0C3519a081e3924D6F3197f86980eA7dfCf71"
359360
},
360361
"optimism": {
@@ -374,8 +375,11 @@
374375
"Dispenser": "0x2112Eb973af1DBf83a4f11eda82f7a7527D7Fde5",
375376
"ERC721Factory": "0x80E63f73cAc60c1662f27D2DFd2EA834acddBaa8",
376377
"OPFCommunityFeeCollectorCompute": "0xc37F8341Ac6e4a94538302bCd4d49Cf0852D30C0",
377-
"Escrow": "0x3c21a90599b5B7f37014cA5Bf30d3f1b73d7e391",
378-
"AccessListFactory": "0x4E6058dC00e90C0DCA47A5d0D3346F409939A5ab"
378+
"Escrow": "0x98679D582AB3398C03D3308dEB9c7AeC50B52ded",
379+
"AccessListFactory": "0x4E6058dC00e90C0DCA47A5d0D3346F409939A5ab",
380+
"EnterpriseFeeCollector": "0xE9397625Df9B63f0C152f975234b7988b54710B8",
381+
"EnterpriseEscrow": "0xc313e19146Fc9a04470689C9d41a4D3054693531",
382+
"FixedPriceEnterprise": "0x1d535147a97bd87c8443125376E6671B60556E07"
379383
},
380384
"pontus-x-devnet": {
381385
"chainId": 32456,
@@ -411,7 +415,7 @@
411415
"ERC721Factory": "0x159924ca0F47D6F704B97E29099b89e518A17B5E",
412416
"BatchPayments": "0xFe7967A5176fDAFa8DE109b3507016B885a82D6e",
413417
"OPFCommunityFeeCollectorCompute": "0x7b0576CF01E868bce46cca91b2a8E674141b0355",
414-
"Escrow": "0x8389bC1306208488D665F939AFB4079adf6f5a06",
418+
"Escrow": "0xf0c7A31D7Ee26bEBfb4BAD8e37490bEadE3F846f",
415419
"AccessListFactory": "0xE5aa2C9B551aFcA4C0A98BB3B37D7A43084d0a66"
416420
}
417-
}
421+
}

hardhat.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ module.exports = {
148148
accounts:
149149
process.env.PRIVATE_KEY !== undefined ? [process.env.PRIVATE_KEY] : [],
150150
},
151-
oasis_saphire: {
151+
oasis_sapphire: {
152152
url:
153153
process.env.NETWORK_RPC_URL !== undefined ? process.env.NETWORK_RPC_URL : "",
154154
accounts:
@@ -222,7 +222,7 @@ module.exports = {
222222
},
223223
},
224224
{
225-
network: "oasis_saphire",
225+
network: "oasis_sapphire",
226226
chainId: 23294,
227227
urls: {
228228
apiURL: "https://explorer.sapphire.oasis.io/api",

scripts/deploy_enterpriseescrow.js

Lines changed: 7 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -48,66 +48,18 @@ async function main() {
4848
switch (networkDetails.chainId) {
4949
case 1:
5050
networkName = "mainnet";
51-
OPFOwner = "0x0d27cd67c4A3fd3Eb9C7C757582f59089F058167";
52-
RouterAddress = "0x8149276f275EEFAc110D74AFE8AFECEaeC7d1593";
53-
gasLimit = 15000000;
54-
gasPrice = ethers.utils.parseUnits("0.4", "gwei");
51+
gasLimit = 6500000;
52+
gasPrice = ethers.utils.parseUnits("1.15", "gwei");
5553
break;
5654
case 10:
5755
networkName = "optimism";
58-
OPFOwner = "0xC7EC1970B09224B317c52d92f37F5e1E4fF6B687";
59-
RouterAddress = "0xf26c6C93f9f1d725e149d95f8E7B2334a406aD10";
60-
gasPrice = ethers.utils.parseUnits("0.0010", "gwei");
61-
gasLimit = 28000000;
62-
break;
63-
case 0x89:
64-
networkName = "polygon";
65-
OPFOwner = "0x6272E00741C16b9A337E29DB672d51Af09eA87dD";
66-
RouterAddress = "0x78e1317186786591912A10a7aF2490B8B4697A93";
67-
gasLimit = 19000000;
68-
gasPrice = ethers.utils.parseUnits("30", "gwei");
69-
break;
70-
case 8453:
71-
networkName = "base";
72-
OPFOwner = "0x4169e846f1524Cf0ac02Bd4B04fa33242709Cf64";
73-
RouterAddress = "0xEF62FB495266C72a5212A11Dce8baa79Ec0ABeB1";
74-
gasPrice = ethers.utils.parseUnits("0.009260", "gwei");
75-
gasLimit = 28000000;
76-
break;
77-
case 23294:
78-
networkName = "oasis_saphire";
79-
OPFOwner = "0x086E7F0588755af5AF5f8194542Fd8328238F3C1";
80-
RouterAddress = "0xd8992Ed72C445c35Cb4A2be468568Ed1079357c8";
81-
gasPrice = ethers.utils.parseUnits("100", "gwei");
82-
gasLimit = 15000000;
83-
break;
84-
case 23295:
85-
networkName = "oasis_saphire_testnet";
86-
OPFOwner = "0xC7EC1970B09224B317c52d92f37F5e1E4fF6B687";
87-
RouterAddress = "0x5FBC2A29f7C8e4533dECD14Dc1c561A8eF0d4e31";
88-
gasPrice = ethers.utils.parseUnits("100", "gwei");
89-
gasLimit = 28000000;
56+
gasPrice = ethers.utils.parseUnits("0.001200495", "gwei");
57+
gasLimit = 6500000;
9058
break;
9159
case 11155111:
9260
networkName = "sepolia";
93-
OPFOwner = "0xC7EC1970B09224B317c52d92f37F5e1E4fF6B687";
94-
RouterAddress = "0x2112Eb973af1DBf83a4f11eda82f7a7527D7Fde5";
95-
gasPrice = ethers.utils.parseUnits("1", "gwei");
96-
gasLimit = 5000000;
97-
break;
98-
case 11155420:
99-
networkName = "optimism_sepolia";
100-
OPFOwner = "0xC7EC1970B09224B317c52d92f37F5e1E4fF6B687";
101-
RouterAddress = "0x1B083D8584dd3e6Ff37d04a6e7e82b5F622f3985";
102-
gasPrice = ethers.utils.parseUnits("1", "gwei");
103-
gasLimit = 28000000;
104-
break;
105-
default:
106-
OPFOwner = "0x0d27cd67c4A3fd3Eb9C7C757582f59089F058167";
107-
networkName = "development";
108-
routerOwner = OPFOwner;
109-
shouldDeployOceanMock = true;
110-
sleepAmount = 0;
61+
gasPrice = ethers.utils.parseUnits("0.001000011", "gwei");
62+
gasLimit = 6500000;
11163
break;
11264
}
11365

@@ -139,6 +91,7 @@ async function main() {
13991
console.error("Missing EnterpriseFeeCollector address. Aborting..");
14092
return null;
14193
}
94+
14295
if (logging) console.info("Deploying EnterpriseEscrow");
14396
const Escrow = await ethers.getContractFactory("EnterpriseEscrow", owner);
14497

scripts/deploy_escrow.js

Lines changed: 59 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ async function main() {
3434
console.error("Missing MNEMONIC or PRIVATE_KEY. Aborting..");
3535
return null;
3636
}
37+
if (!process.env.ADDRESS_FILE) {
38+
console.error("Missing ADDRESS_FILE. Aborting..");
39+
return null;
40+
}
3741
owner = wallet.connect(provider);
3842
let gasLimit = 3000000;
3943
let gasPrice = null;
@@ -46,8 +50,8 @@ async function main() {
4650
networkName = "mainnet";
4751
OPFOwner = "0x0d27cd67c4A3fd3Eb9C7C757582f59089F058167";
4852
RouterAddress = "0x8149276f275EEFAc110D74AFE8AFECEaeC7d1593";
49-
gasLimit = 15000000
50-
gasPrice = ethers.utils.parseUnits('0.4', 'gwei')
53+
gasLimit = 5000000
54+
gasPrice = ethers.utils.parseUnits('1.2', 'gwei')
5155
break;
5256
case 10:
5357
networkName = "optimism";
@@ -67,11 +71,11 @@ async function main() {
6771
networkName = "base";
6872
OPFOwner = '0x4169e846f1524Cf0ac02Bd4B04fa33242709Cf64';
6973
RouterAddress = "0xEF62FB495266C72a5212A11Dce8baa79Ec0ABeB1";
70-
gasPrice = ethers.utils.parseUnits('0.009260', 'gwei')
71-
gasLimit = 28000000
74+
gasPrice = ethers.utils.parseUnits('0.022999855', 'gwei')
75+
gasLimit = 5000000
7276
break;
7377
case 23294:
74-
networkName = "oasis_saphire";
78+
networkName = "oasis_sapphire";
7579
OPFOwner = '0x086E7F0588755af5AF5f8194542Fd8328238F3C1'
7680
RouterAddress = "0xd8992Ed72C445c35Cb4A2be468568Ed1079357c8";
7781
gasPrice = ethers.utils.parseUnits('100', 'gwei')
@@ -88,8 +92,8 @@ async function main() {
8892
networkName = "sepolia";
8993
OPFOwner = '0xC7EC1970B09224B317c52d92f37F5e1E4fF6B687';
9094
RouterAddress = "0x2112Eb973af1DBf83a4f11eda82f7a7527D7Fde5";
91-
gasPrice = ethers.utils.parseUnits('1', 'gwei')
92-
gasLimit = 28000000
95+
gasPrice = ethers.utils.parseUnits('0.001000011', 'gwei')
96+
gasLimit = 5000000
9397
break;
9498
case 11155420:
9599
networkName = "optimism_sepolia";
@@ -114,15 +118,36 @@ async function main() {
114118
else{
115119
options = { gasLimit }
116120
}
117-
121+
console.log("Network:"+networkName)
122+
const addressFile = process.env.ADDRESS_FILE;
123+
let oldAddresses;
124+
if (addressFile) {
125+
try {
126+
oldAddresses = JSON.parse(fs.readFileSync(addressFile));
127+
} catch (e) {
128+
console.log(e);
129+
oldAddresses = {};
130+
}
131+
if (!oldAddresses[networkName]) oldAddresses[networkName] = {};
132+
addresses = oldAddresses[networkName];
133+
}
134+
if (logging)
135+
console.info(
136+
"Use existing addresses:" + JSON.stringify(addresses, null, 2)
137+
);
138+
if (!addresses.Router) {
139+
console.error("Missing RouterAddress address. Aborting..");
140+
return null;
141+
}
142+
RouterAddress=addresses.Router
118143
if (!OPFOwner || !RouterAddress) {
119144
console.error("Missing OPFOwner or Router. Aborting..");
120145
return null;
121146
}
122147
console.log("Deployer nonce:", await owner.getTransactionCount());
123-
124-
if (logging) console.info("Deploying Compute Collector");
125-
const NewCollector = await ethers.getContractFactory("OPFCommunityFeeCollector",
148+
if(!addresses.OPFCommunityFeeCollectorCompute){
149+
if (logging) console.info("Deploying Compute Collector");
150+
const NewCollector = await ethers.getContractFactory("OPFCommunityFeeCollector",
126151
owner
127152
);
128153

@@ -133,22 +158,42 @@ async function main() {
133158
console.log("\tnpx hardhat verify --network " + networkName + " " + deployNewCollector.address + " " + OPFOwner + " " + OPFOwner)
134159

135160
}
161+
addresses.OPFCommunityFeeCollectorCompute=deployNewCollector.address
162+
}
136163
if (logging) console.info("Deploying Escrow");
137164
const Escrow = await ethers.getContractFactory(
138165
"Escrow",
139166
owner
140167
);
141168

142-
const deployEscrow = await Escrow.connect(owner).deploy(RouterAddress,deployNewCollector.address,options)
169+
const deployEscrow = await Escrow.connect(owner).deploy(RouterAddress,addresses.OPFCommunityFeeCollectorCompute,options)
143170
await deployEscrow.deployTransaction.wait();
144171
if (show_verify) {
145172
console.log("\tRun the following to verify on etherscan");
146-
console.log("\tnpx hardhat verify --network " + networkName + " " + deployEscrow.address+ " " + RouterAddress + " " + deployNewCollector.address)
173+
console.log("\tnpx hardhat verify --network " + networkName + " " + deployEscrow.address+ " " + RouterAddress + " " + addresses.OPFCommunityFeeCollectorCompute)
147174

148175
}
149176
console.log("\r\n\r\n")
150-
console.log("\"OPFCommunityFeeCollectorCompute\":\""+deployNewCollector.address+"\"")
177+
console.log("\"OPFCommunityFeeCollectorCompute\":\""+addresses.OPFCommunityFeeCollectorCompute+"\"")
151178
console.log("\"Escrow\":\""+deployEscrow.address+"\"")
179+
addresses.Escrow=deployEscrow.address
180+
181+
if (addressFile) {
182+
// write address.json if needed
183+
oldAddresses[networkName] = addresses;
184+
//if (logging)
185+
// console.info(
186+
// "writing to " +
187+
// addressFile +
188+
// "\r\n" +
189+
// JSON.stringify(oldAddresses, null, 2)
190+
//);
191+
try {
192+
fs.writeFileSync(addressFile, JSON.stringify(oldAddresses, null, 2));
193+
} catch (e) {
194+
console.error(e);
195+
}
196+
}
152197
}
153198

154199

scripts/deploy_fixedrate.js renamed to scripts/deploy_fixedrateenterprise.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ async function main() {
4444
switch (networkDetails.chainId) {
4545
case 1:
4646
networkName = "mainnet";
47-
gasLimit = 15000000;
48-
gasPrice = ethers.utils.parseUnits("0.4", "gwei");
47+
gasLimit = 5000000;
48+
gasPrice = ethers.utils.parseUnits("2.2", "gwei");
4949
break;
5050
case 10:
5151
networkName = "optimism";
52-
gasPrice = ethers.utils.parseUnits("0.0010", "gwei");
53-
gasLimit = 28000000;
52+
gasPrice = ethers.utils.parseUnits("0.001200495", "gwei");
53+
gasLimit = 5000000;
5454
break;
5555
case 11155111:
5656
networkName = "sepolia";
57-
gasPrice = ethers.utils.parseUnits("2.07", "gwei");
58-
gasLimit = 28000000;
57+
gasPrice = ethers.utils.parseUnits("0.021000011", "gwei");
58+
gasLimit = 5000000;
5959
break;
6060
}
6161

@@ -124,7 +124,7 @@ async function main() {
124124
if (sleepAmount > 0) await sleep(sleepAmount);
125125
}
126126

127-
if (!addresses.FixedPriceEnterprise) {
127+
if (!addresses.FixedPriceEnterprise || true) {
128128
if (logging) console.info("Deploying FixedrateExchangeEnterprise");
129129
const FixedrateExchangeEnterprise = await ethers.getContractFactory(
130130
"FixedRateExchangeEnterprise",
@@ -159,13 +159,13 @@ async function main() {
159159
if (addressFile) {
160160
// write address.json if needed
161161
oldAddresses[networkName] = addresses;
162-
if (logging)
163-
console.info(
164-
"writing to " +
165-
addressFile +
166-
"\r\n" +
167-
JSON.stringify(oldAddresses, null, 2)
168-
);
162+
//if (logging)
163+
//console.info(
164+
// "writing to " +
165+
// addressFile +
166+
// "\r\n" +
167+
// JSON.stringify(oldAddresses, null, 2)
168+
//);
169169
try {
170170
fs.writeFileSync(addressFile, JSON.stringify(oldAddresses, null, 2));
171171
} catch (e) {

scripts/deploy_oeFeeCollector.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ async function main() {
4444
switch (networkDetails.chainId) {
4545
case 1:
4646
networkName = "mainnet";
47-
gasLimit = 15000000;
48-
gasPrice = ethers.utils.parseUnits("0.4", "gwei");
47+
gasLimit = 1500000;
48+
gasPrice = ethers.utils.parseUnits("0.15", "gwei");
4949
break;
5050
case 10:
5151
networkName = "optimism";
52-
gasPrice = ethers.utils.parseUnits("0.0010", "gwei");
53-
gasLimit = 28000000;
52+
gasPrice = ethers.utils.parseUnits("0.001200495", "gwei");
53+
gasLimit = 1500000;
5454
break;
5555
case 11155111:
5656
networkName = "sepolia";
57-
gasPrice = ethers.utils.parseUnits("2.07", "gwei");
58-
gasLimit = 28000000;
57+
gasPrice = ethers.utils.parseUnits("0.001000011", "gwei");
58+
gasLimit = 1500000;
5959
break;
6060
}
6161

0 commit comments

Comments
 (0)