-
Notifications
You must be signed in to change notification settings - Fork 18
/
overrrides.ts
53 lines (46 loc) · 1.79 KB
/
overrrides.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { starknetNetworks } from '@snapshot-labs/sx';
import { validateAndParseAddress } from 'starknet';
export const networkNodeUrl =
process.env.NETWORK_NODE_URL ||
'https://starknet-sepolia.infura.io/v3/46a5dd9727bf48d4a132672d3f376146';
export const manaRpcUrl = process.env.VITE_MANA_URL || 'https://mana.box';
const verifiedSpaces = {
sn: [
'0x009fedaf0d7a480d21a27683b0965c0f8ded35b3f1cac39827a25a06a8a682a4',
'0x05ea5ef0c54c84dc7382629684c6e536c0b06246b3b0981c426b42372e3ef263',
'0x07c251045154318a2376a3bb65be47d3c90df1740d8e35c9b9d943aa3f240e50',
'0x07bd3419669f9f0cc8f19e9e2457089cdd4804a4c41a5729ee9c7fd02ab8ab62'
],
'sn-sep': [
'0x0141464688e48ae5b7c83045edb10ecc242ce0e1ad4ff44aca3402f7f47c1ab9'
]
};
const createConfig = (
networkId: keyof typeof starknetNetworks,
{ startBlock }: { startBlock: number }
) => {
const config = starknetNetworks[networkId];
return {
manaRpcUrl: `${manaRpcUrl}/stark_rpc/${config.Meta.eip712ChainId}`,
baseChainId: config.Meta.herodotusAccumulatesChainId,
factoryAddress: config.Meta.spaceFactory,
erc20VotesStrategy: config.Strategies.ERC20Votes,
propositionPowerValidationStrategyAddress:
config.ProposalValidations.VotingPower,
spaceClassHash: config.Meta.masterSpace,
verifiedSpaces: verifiedSpaces[networkId],
herodotusStrategies: [
config.Strategies.OZVotesStorageProof,
config.Strategies.OZVotesTrace208StorageProof,
config.Strategies.EVMSlotValue
]
.filter(address => !!address)
.map(strategy => validateAndParseAddress(strategy)),
startBlock
};
};
let networkProperties = createConfig('sn-sep', { startBlock: 17960 });
if (process.env.NETWORK === 'SN_MAIN') {
networkProperties = createConfig('sn', { startBlock: 445498 });
}
export { networkProperties };