-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
3,657 additions
and
3,592 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "CommonJS", | ||
"target": "es2017", | ||
"lib": ["es2017", "dom"], | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"moduleResolution": "node", | ||
"resolveJsonModule": true | ||
}, | ||
"include": ["./**/*.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import connextContracts from '@connext/smart-contracts/deployments.json' | ||
import fs from 'fs' | ||
import path from 'path' | ||
import { type Abi } from 'viem' | ||
|
||
type ConnextContractsJson = { | ||
[chainId: string]: { | ||
chainId: string | ||
name: string | ||
contracts: { | ||
[name: string]: { | ||
address: string | ||
abi: Abi | ||
} | ||
} | ||
}[] | ||
} | ||
|
||
const _getContract = (chainId: number, name: string) => { | ||
const contracts = connextContracts as ConnextContractsJson | ||
return contracts[chainId][0].contracts[name] | ||
} | ||
|
||
async function main() { | ||
const _CONNEXT_CONTRACT_NAME = 'Connext' | ||
const _networks = Object.keys(connextContracts) | ||
const contractAddresses: Record<string, string> = {} | ||
|
||
for (const network of _networks) { | ||
const contract = _getContract(Number(network), _CONNEXT_CONTRACT_NAME) | ||
if (contract) { | ||
contractAddresses[network] = contract.address | ||
} | ||
} | ||
|
||
fs.writeFileSync( | ||
path.join(__dirname, '../src/contract-addresses.ts'), | ||
JSON.stringify(contractAddresses, null, 2), | ||
) | ||
} | ||
|
||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.