MCPcopy Create free account
hub / github.com/PageLeay/celestial-runtime / deploy

Function deploy

lib.esm/_tests/test-contract.js:5–16  ·  view source on GitHub ↗
(abi, bytecode)

Source from the content-addressed store, hash-verified

3import { Contract, ContractFactory, EventLog, isError, Typed } from "../index.js";
4setupProviders();
5async function deploy(abi, bytecode) {
6 const provider = getDevProvider();
7 const signer = await provider.getSigner(0);
8 const factory = new ContractFactory(abi, bytecode, signer);
9 const contract = await factory.deploy();
10 const addr = await contract.getAddress();
11 await contract.waitForDeployment();
12 return {
13 contract: new Contract(addr, abi, provider),
14 contractSigner: new Contract(addr, abi, signer),
15 };
16}
17describe("Test Contract", function () {
18 const abi = [
19 "error CustomError1(uint256 code, string message)",

Callers 1

test-contract.jsFile · 0.70

Calls 5

deployMethod · 0.95
getDevProviderFunction · 0.90
getAddressMethod · 0.65
getSignerMethod · 0.45
waitForDeploymentMethod · 0.45

Tested by

no test coverage detected