( wallet: Wallet, contractFileName: string )
| 2 | |
| 3 | //Wrirte your smart contract upload function here |
| 4 | export 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 | } |
no test coverage detected