Files
linea-monorepo/contracts/local-deployments-artifacts/deployLondonEvmTestingFramework.ts
The Dark Jester 4405f315a9 [Chore] - standardise contract deploy logs (#460)
* standardise contract deploy logs

* apply standardization to hardhat deploy scripts

* Update contracts/common/helpers/deployments.ts

Co-authored-by: kyzooghost <73516204+kyzooghost@users.noreply.github.com>
Signed-off-by: The Dark Jester <thedarkjester@users.noreply.github.com>

* fix copy paste issues

* use refactored deployment logger

* add a lint space

---------

Signed-off-by: The Dark Jester <thedarkjester@users.noreply.github.com>
Co-authored-by: kyzooghost <73516204+kyzooghost@users.noreply.github.com>
2024-12-18 07:13:56 -08:00

62 lines
1.7 KiB
TypeScript

import { ethers } from "ethers";
import {
contractName as londonEvmYulName,
abi as londonEvmYulAbi,
bytecode as londonEvmYulBytecode,
} from "./static-artifacts/LondonEvmCodes.json";
import {
contractName as opcodeTesterName,
abi as opcodeTesterAbi,
bytecode as opcodeTesterBytecode,
} from "./static-artifacts/OpcodeTester.json";
import { deployContractFromArtifacts } from "../common/helpers/deployments";
async function main() {
const provider = new ethers.JsonRpcProvider(process.env.RPC_URL);
const wallet = new ethers.Wallet(process.env.PRIVATE_KEY!, provider);
console.log(`Deploying London EVM Yul based contract with verbatim bytecode`);
const londonEvmYulAddress = await deployLondonEvmYul(wallet);
console.log(`Deploying the main OPCODE tester with yul contract at ${londonEvmYulAddress}`);
await deployOpcodeTester(wallet, londonEvmYulAddress);
}
async function deployLondonEvmYul(wallet: ethers.Wallet): Promise<string> {
const walletNonce = await wallet.getNonce();
const londonEvmYul = await deployContractFromArtifacts(
londonEvmYulName,
londonEvmYulAbi,
londonEvmYulBytecode,
wallet,
{
nonce: walletNonce,
},
);
const londonEvmYulAddress = await londonEvmYul.getAddress();
return londonEvmYulAddress;
}
async function deployOpcodeTester(wallet: ethers.Wallet, londonEvmYulAddress: string) {
const walletNonce = await wallet.getNonce();
await deployContractFromArtifacts(
opcodeTesterName,
opcodeTesterAbi,
opcodeTesterBytecode,
wallet,
londonEvmYulAddress,
{
nonce: walletNonce,
},
);
}
main().catch((error) => {
console.error(error);
process.exit(1);
});