Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Commit e6a9fb4

Browse files
committed
feat(celo): marketplace deployment celo
1 parent 9b58d33 commit e6a9fb4

File tree

8 files changed

+875
-220
lines changed

8 files changed

+875
-220
lines changed

contracts/hardhat.config.cts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ function getChainConfig(chain: keyof typeof chainIds) {
116116
config = {
117117
...config,
118118
url: `https://arb-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}`,
119-
// url: "https://virtual.arbitrum.rpc.tenderly.co/143c1212-e69c-4f74-bd24-8676c965c44c",
120119
};
121120
}
122121

@@ -135,7 +134,6 @@ function getChainConfig(chain: keyof typeof chainIds) {
135134
config = {
136135
...config,
137136
url: `https://filecoin-calibration.chainup.net/rpc/v1`,
138-
// url: "https://virtual.arbitrum.rpc.tenderly.co/143c1212-e69c-4f74-bd24-8676c965c44c",
139137
};
140138
}
141139

@@ -160,6 +158,7 @@ const config: HardhatUserConfig = {
160158
"StrategyHypercertFractionOffer",
161159
"CreatorFeeManagerWithRoyalties",
162160
"RoyaltyFeeRegistry",
161+
"ImmutableCreate2Factory",
163162
],
164163
except: ["@openzeppelin"],
165164
},
@@ -173,15 +172,15 @@ const config: HardhatUserConfig = {
173172
apiKey: {
174173
sepolia: ETHERSCAN_API_KEY!,
175174
optimisticEthereum: OPTIMISTIC_ETHERSCAN_API_KEY!,
176-
celo: CELOSCAN_API_KEY!,
175+
"celo-mainnet": CELOSCAN_API_KEY!,
177176
base: BASESCAN_API_KEY!,
178177
"base-sepolia": BASESCAN_API_KEY!,
179178
"arb-sepolia": ARBISCAN_API_KEY!,
180179
arbitrumOne: "DPB1JAY49URG4RJP76WQ11CMGPBF2FX3C5",
181180
},
182181
customChains: [
183182
{
184-
network: "celo",
183+
network: "celo-mainnet",
185184
chainId: 42220,
186185
urls: {
187186
apiURL: "https://api.celoscan.io/api",
@@ -217,6 +216,9 @@ const config: HardhatUserConfig = {
217216
path: "m/44'/60'/0'/0",
218217
},
219218
chainId: chainIds.hardhat,
219+
forking: {
220+
url: `https://celo-mainnet.infura.io/v3/${INFURA_API_KEY}`,
221+
},
220222
},
221223
localhost: {
222224
accounts: {
@@ -273,6 +275,9 @@ const config: HardhatUserConfig = {
273275
typechain: {
274276
outDir: "./types",
275277
},
278+
sourcify: {
279+
enabled: true,
280+
},
276281
};
277282

278283
export default config;

contracts/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
"@commitlint/cli": "^17.1.2",
3434
"@commitlint/config-conventional": "^17.1.0",
3535
"@looksrare/contracts-libs": "^3.4.0",
36-
"@nomicfoundation/hardhat-ethers": "^3.0.6",
36+
"@nomicfoundation/hardhat-ethers": "^3.0.8",
3737
"@nomicfoundation/hardhat-toolbox": "^5.0.0",
38-
"@nomicfoundation/hardhat-viem": "^2.0.2",
38+
"@nomicfoundation/hardhat-viem": "^2.0.6",
3939
"@openzeppelin/contracts": "^4.9.3",
4040
"@openzeppelin/hardhat-upgrades": "3.2.1",
4141
"@primitivefi/hardhat-dodoc": "^0.2.3",
@@ -92,6 +92,8 @@
9292
"build": "pnpm clean && forge compile && hardhat compile && pnpm tsc -p tsconfig.build.json && rollup -c",
9393
"build:forge": "pnpm clean && forge build",
9494
"clean": "rimraf abi artifacts build cache cache_hardhat dist out types",
95+
"deploy:create2-factory": "NODE_OPTIONS='--experimental-loader ts-node/esm/transpile-only --no-warnings=ExperimentalWarning' hardhat deploy-create2-factory",
96+
"deploy:marketplace:celo": "NODE_OPTIONS='--experimental-loader ts-node/esm/transpile-only --no-warnings=ExperimentalWarning' hardhat deploy-marketplace-celo",
9597
"deploy:marketplace:dryrun": "NODE_OPTIONS='--experimental-loader ts-node/esm/transpile-only --no-warnings=ExperimentalWarning' hardhat deploy-marketplace",
9698
"deploy:marketplace": "NODE_OPTIONS='--experimental-loader ts-node/esm/transpile-only --no-warnings=ExperimentalWarning' hardhat deploy-marketplace",
9799
"deploy:protocol:dryrun": "pnpm hardhat deploy-minter",
@@ -112,6 +114,6 @@
112114
"dependencies": {
113115
"@starboardventures/hardhat-verify": "^1.0.1",
114116
"@tenderly/hardhat-tenderly": "^2.3.0",
115-
"hardhat": "^2.22.8"
117+
"hardhat": "^2.22.16"
116118
}
117119
}

contracts/pnpm-lock.yaml

Lines changed: 160 additions & 170 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"TransferManager": {
3+
"address": "0xd64827b10f019EB2A45E407C785231FE969D7805",
4+
"fullNamespace": "TransferManager",
5+
"args": ["0xb92fd98b5085d686944ff997772d3d8e37e28573"],
6+
"encodedArgs": "0xb92fd98b5085d686944ff997772d3d8e37e28573",
7+
"tx": "0x41a3925dc2f4163d28d1d4ea3fed496dbba73e0ccbff26ed268e5d2a96728814"
8+
},
9+
"HypercertExchange": {
10+
"address": "0xfB29FDb0677b1acB4b148F953DE5ee6ec5cBf717",
11+
"fullNamespace": "LooksRareProtocol",
12+
"args": [
13+
"0xb92fd98b5085d686944ff997772d3d8e37e28573",
14+
"0xE7C4531ad8828794904D332a12702beC8ff1A498",
15+
"0xd64827b10f019EB2A45E407C785231FE969D7805",
16+
"0x0000000000000000000000000000000000000000"
17+
],
18+
"encodedArgs": "0xb92fd98b5085d686944ff997772d3d8e37e28573e7c4531ad8828794904d332a12702bec8ff1a498d64827b10f019eb2a45e407c785231fe969d78050000000000000000000000000000000000000000",
19+
"tx": "0x4b3d34dc62d4634df09bf6cd69938c781371f6b06ab9baf025872b03e2733d74"
20+
},
21+
"RoyaltyFeeRegistry": {
22+
"address": "0xee550d3E9F741f187D5957C75937dbeE94278Db2",
23+
"fullNamespace": "RoyaltyFeeRegistry",
24+
"args": ["1000"],
25+
"encodedArgs": "0x00000000000000000000000000000000000000000000000000000000000003e8",
26+
"tx": "0xb08d9232ba8cd2845854058569817d8289f73a08550bebcb16fd18e17cecffd8"
27+
},
28+
"OrderValidator": {
29+
"address": "0x1c4654558674e5b0Aa9C33F3A74F2EfA83d0C35e",
30+
"fullNamespace": "OrderValidatorV2A",
31+
"args": ["0xfB29FDb0677b1acB4b148F953DE5ee6ec5cBf717"],
32+
"encodedArgs": "0xfb29fdb0677b1acb4b148f953de5ee6ec5cbf717"
33+
},
34+
"CreatorFeeManager": {
35+
"address": "0x5bd2524c95ad3033e86d84a29d1cc52207f08df7",
36+
"fullNamespace": "CreatorFeeManagerWithRoyalties",
37+
"args": ["0xee550d3E9F741f187D5957C75937dbeE94278Db2"],
38+
"encodedArgs": "0xee550d3e9f741f187d5957c75937dbee94278db2",
39+
"tx": "0x16c6de547199655e056785aca8419191c3fa48b226b4de4c06b636a168831a32"
40+
},
41+
"StrategyHypercertFractionOffer": {
42+
"address": "0xc80b087d36acab5a4ececba203b589bb3c5606ee",
43+
"fullNamespace": "StrategyHypercertFractionOffer",
44+
"args": [],
45+
"encodedArgs": "0x",
46+
"tx": "0xfc515150190f135ba7b24554c94eda602fdeb092e55a0807af30b45418c5938c"
47+
}
48+
}

contracts/tasks/config.ts

Lines changed: 106 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,113 @@
1-
export type TokenAddressType = { sepolia: string; [key: string]: string };
2-
3-
const WETH: TokenAddressType = {
4-
localhost: "0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9", //dummy
5-
hardhat: "0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9", //dummy
6-
sepolia: "0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9",
7-
"optimism-mainnet": "0x4200000000000000000000000000000000000006",
8-
"base-sepolia": "0x4200000000000000000000000000000000000006",
9-
"arb-sepolia": "0x3031a6D5D9648BA5f50f656Cd4a1672E1167a34A",
10-
arbitrumOne: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1",
1+
// Define supported networks and their tokens
2+
type NetworkTokens = {
3+
[network: string]: {
4+
tokens: {
5+
symbol: string;
6+
address: string;
7+
faucetUrl?: string;
8+
}[];
9+
};
1110
};
1211

13-
// LINK faucet for Sepolia: https://faucets.chain.link/
14-
const DAI: TokenAddressType = {
15-
localhost: "0x779877A7B0D9E8603169DdbD7836e478b4624789",
16-
hardhat: "0x779877A7B0D9E8603169DdbD7836e478b4624789",
17-
sepolia: "0x779877A7B0D9E8603169DdbD7836e478b4624789",
18-
"optimism-mainnet": "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1",
19-
"base-sepolia": "0xE4aB69C077896252FAFBD49EFD26B5D171A32410",
20-
"arb-sepolia": "0xb1D4538B4571d411F07960EF2838Ce337FE1E80E",
21-
arbitrumOne: "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",
12+
const NETWORK_TOKENS: NetworkTokens = {
13+
localhost: {
14+
tokens: [
15+
{ symbol: "ETH", address: "0x0000000000000000000000000000000000000000" },
16+
{ symbol: "WETH", address: "0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9" },
17+
{ symbol: "DAI", address: "0x779877A7B0D9E8603169DdbD7836e478b4624789" },
18+
{ symbol: "USDC", address: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238" },
19+
],
20+
},
21+
hardhat: {
22+
tokens: [{ symbol: "ETH", address: "0x0000000000000000000000000000000000000000" }],
23+
},
24+
sepolia: {
25+
tokens: [
26+
{ symbol: "ETH", address: "0x0000000000000000000000000000000000000000" },
27+
{ symbol: "WETH", address: "0x7b79995e5f793A07Bc00c21412e50Ecae098E7f9" },
28+
{
29+
symbol: "DAI",
30+
address: "0x779877A7B0D9E8603169DdbD7836e478b4624789",
31+
faucetUrl: "https://faucets.chain.link/",
32+
},
33+
{
34+
symbol: "USDC",
35+
address: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
36+
faucetUrl: "https://faucet.circle.com/",
37+
},
38+
],
39+
},
40+
"optimism-mainnet": {
41+
tokens: [
42+
{ symbol: "ETH", address: "0x0000000000000000000000000000000000000000" },
43+
{ symbol: "WETH", address: "0x4200000000000000000000000000000000000006" },
44+
{ symbol: "DAI", address: "0xda10009cbd5d07dd0cecc66161fc93d7c9000da1" },
45+
{ symbol: "USDC", address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85" },
46+
],
47+
},
48+
"base-sepolia": {
49+
tokens: [
50+
{ symbol: "ETH", address: "0x0000000000000000000000000000000000000000" },
51+
{ symbol: "WETH", address: "0x4200000000000000000000000000000000000006" },
52+
{ symbol: "DAI", address: "0xE4aB69C077896252FAFBD49EFD26B5D171A32410" },
53+
{ symbol: "USDC", address: "0x036CbD53842c5426634e7929541eC2318f3dCF7e" },
54+
],
55+
},
56+
"arb-sepolia": {
57+
tokens: [
58+
{ symbol: "ETH", address: "0x0000000000000000000000000000000000000000" },
59+
{ symbol: "WETH", address: "0x3031a6D5D9648BA5f50f656Cd4a1672E1167a34A" },
60+
{ symbol: "DAI", address: "0xb1D4538B4571d411F07960EF2838Ce337FE1E80E" },
61+
{ symbol: "USDC", address: "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d" },
62+
],
63+
},
64+
arbitrumOne: {
65+
tokens: [
66+
{ symbol: "ETH", address: "0x0000000000000000000000000000000000000000" },
67+
{ symbol: "WETH", address: "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1" },
68+
{ symbol: "DAI", address: "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1" },
69+
{ symbol: "USDC", address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831" },
70+
],
71+
},
72+
"celo-mainnet": {
73+
//https://docs.celo.org/cel2/fee-currencies
74+
tokens: [
75+
{
76+
symbol: "CELO",
77+
address: "0x471EcE3750Da237f93B8E339c536989b8978a438", // NO support for CELO as zero-address, as that breaks the marketplace flow on receiving and wrapping native tokens (no wrapper on Celo)
78+
},
79+
{
80+
symbol: "cUSD",
81+
address: "0x765DE816845861e75A25fCA122bb6898B8B1282a",
82+
},
83+
{
84+
symbol: "USDC",
85+
address: "0xcebA9300f2b948710d2653dD7B07f33A8B32118C",
86+
},
87+
{
88+
symbol: "USDT",
89+
address: "0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e",
90+
},
91+
],
92+
},
2293
};
2394

24-
// USDC https://faucet.circle.com/
25-
// https://developers.circle.com/stablecoins/docs/usdc-on-main-networks
26-
const USDC: TokenAddressType = {
27-
localhost: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
28-
hardhat: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
29-
sepolia: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
30-
"optimism-mainnet": "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
31-
"base-sepolia": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
32-
"arb-sepolia": "0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d",
33-
arbitrumOne: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
95+
// New helper functions
96+
export const getSupportedTokens = (network: string) => {
97+
const networkConfig = NETWORK_TOKENS[network];
98+
if (!networkConfig) {
99+
throw new Error(`Network "${network}" is not supported`);
100+
}
101+
return networkConfig.tokens;
34102
};
35103

36-
export const getTokenAddresses = (network: string) => {
37-
return {
38-
wethAddress: WETH[network],
39-
usdceAddress: USDC[network],
40-
daiAddress: DAI[network],
41-
};
104+
export const getTokenAddress = (network: string, symbol: string) => {
105+
const tokens = getSupportedTokens(network);
106+
const token = tokens.find((t) => t.symbol === symbol);
107+
if (!token) {
108+
throw new Error(`Token "${symbol}" is not supported on network "${network}"`);
109+
}
110+
return token.address;
42111
};
43112

44113
const ADMIN_ACCOUNT: { [key: string]: string } = {
@@ -47,7 +116,7 @@ const ADMIN_ACCOUNT: { [key: string]: string } = {
47116
sepolia: "0x4f37308832c6eFE5A74737955cBa96257d76De17",
48117
"base-sepolia": "0xA2Cb9D926b090577AD45fC0F40C753BF369B82Ff",
49118
"optimism-mainnet": "0x560adA72a80b4707e493cA8c3B7B7528930E7Be5",
50-
celo: "0x14ae502FEF3843fF3a1735B3209D39B320130af9",
119+
"celo-mainnet": "0x14ae502FEF3843fF3a1735B3209D39B320130af9",
51120
base: "0x14ae502FEF3843fF3a1735B3209D39B320130af9",
52121
arbitrumOne: "0x14ae502FEF3843fF3a1735B3209D39B320130af9",
53122
"arb-sepolia": "0x5d36971451AE593685Cab8815d644f9B4B66Ec99",
@@ -69,7 +138,7 @@ const FEE_RECIPIENT: { [key: string]: string } = {
69138
sepolia: "0x4f37308832c6eFE5A74737955cBa96257d76De17",
70139
"base-sepolia": "0xe518aED97D9d45174a06bB8EF663B4fB51330725",
71140
"optimism-mainnet": "0xE7C4531ad8828794904D332a12702beC8ff1A498",
72-
celo: "0xE7C4531ad8828794904D332a12702beC8ff1A498",
141+
"celo-mainnet": "0xE7C4531ad8828794904D332a12702beC8ff1A498",
73142
base: "0xE7C4531ad8828794904D332a12702beC8ff1A498",
74143
arbitrumOne: "0xE7C4531ad8828794904D332a12702beC8ff1A498",
75144
"arb-sepolia": "0x5d36971451AE593685Cab8815d644f9B4B66Ec99",

0 commit comments

Comments
 (0)