MCPcopy Create free account
hub / github.com/NoteProtocol/NoteWallet / publishSmartContract

Function publishSmartContract

src/publish.ts:4–17  ·  view source on GitHub ↗
(
  wallet: Wallet,
  contractFileName: string
)

Source from the content-addressed store, hash-verified

2
3//Wrirte your smart contract upload function here
4export async function publishSmartContract(
5 wallet: Wallet,
6 contractFileName: string
7) {
8 const json: Partial<any> = require(`./contracts/${contractFileName}.json`);
9 json.file && delete json.file;
10 json.sourceMapFile && delete json.sourceMapFile;
11
12 const tx = await wallet.buildCommitDataTransaction(
13 json,
14 wallet.currentAccount.mainAddress!.address!
15 );
16 return await wallet.broadcastTransaction(tx);
17}

Callers 1

processCommandMethod · 0.90

Calls 1

Tested by

no test coverage detected