-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "Prepare infrastructure for skale-contracts""
- Loading branch information
1 parent
1190a8c
commit a5d86ce
Showing
9 changed files
with
144 additions
and
159 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
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
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
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,26 @@ | ||
import { promises as fs } from 'fs'; | ||
import { contracts } from "../migrations/deployMainnet"; | ||
import { ethers } from "hardhat"; | ||
import { getAbi, getVersion } from '@skalenetwork/upgrade-tools'; | ||
|
||
async function main() { | ||
const abi: {[name: string]: []} = {}; | ||
for (const contractName of contracts) { | ||
console.log(`Load ABI of ${contractName}`); | ||
const factory = await ethers.getContractFactory(contractName); | ||
abi[contractName] = getAbi(factory.interface); | ||
} | ||
const version = await getVersion(); | ||
const filename = `data/mainnet-ima-${version}-abi.json`; | ||
console.log(`Save to ${filename}`) | ||
await fs.writeFile(filename, JSON.stringify(abi, null, 4)); | ||
} | ||
|
||
if (require.main === module) { | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); | ||
} |
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.