Fix empty value when contract is deleted.

This commit is contained in:
Arijit Das
2021-09-23 16:06:09 +05:30
parent a1781b1eeb
commit f09f665b11
7 changed files with 49 additions and 14 deletions
+4
View File
@@ -15,6 +15,8 @@ fastify.get('/v1/deployContract', async (req, reply) => {
const token = await GLDToken.deploy();
await token.deployed();
console.log(`Deployed block ${token.deployTransaction.blockNumber}`)
return {
address: token.address,
txHash: token.deployTransaction.hash,
@@ -31,6 +33,8 @@ fastify.get('/v1/destroyContract', async (req, reply) => {
await token.destroy();
const blockNum = await hre.ethers.provider.getBlockNumber()
console.log(`Destroyed block ${blockNum}`)
return {
blockNumber: blockNum,
}