Burning/Deleting contract deployed using truffle

I am following the Ultimate NFT Programming Tutorial Course video by Filip.
In the tutorial he uses remix to deploy the contract to the rinkeby testnet.
I used truffle.
I am now trying to change the contract and trying to deploy by changing the secret key in the dotenv file which is used by truffle-hdwallet-provider.
I do not know if this is the appropriate forum to ask this but how do I delete the contract already pushed to the rinkeby network using my address(owner) [in order to burn/discard the NFTs]?
If that is not possible, how do I deploy the same modified contract ( i tried truffle migrate --network rinkeby reset compile all) with the new wallet address?

It is not possible to remove that smart contract, unless you wrote it with a selfdestruct functionality.

It should be easy to redeploy a modified version of your smart contract, I think that you only have to deploy it again.

I get this error when attempting to deploy it

VM Exception while processing transaction: revert This function is restricted to the contract’s owner

Is it because I changed the secret phrase tied to the truffle-hdwallet-provider?
How do I deploy the contract?

it looks like that error is from Migrations.sol: Something is wrong with my smartcontract

// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;

contract Migrations {
address public owner = msg.sender;
uint public last_completed_migration;

modifier restricted() {
require(
msg.sender == owner,
“This function is restricted to the contract’s owner”
);
_;
}

function setCompleted(uint completed) public restricted {
last_completed_migration = completed;
}
}

This is my migrations file. The thread included does not seem to be resolved and suggested using --reset which I already tried.Do you suggest removing the modifier restricted?

You could use remix until you understand more on how to use truffle. You could also completely remove that Migrations.sol.

1_rinkeby_migration.js

Replacing ‘NFTContract’

block number: 9605393
block timestamp: 1636362214
account: 0x3Fe400fcebC9A20e4D46cD3aEc3968647f572169
balance: 99.97104624
gas used: 2895376 (0x2c2e10)
gas price: 10 gwei
value sent: 0 ETH
total cost: 0.02895376 ETH

RuntimeError: VM Exception while processing transaction: revert This function is restricted to the contract’s owner

I tried removing the Migrations.sol file and encountered the same error. If I deploy the contract with remix, I will have to find another way to link it with the subsequent steps required to display the NFTs on the webpage being made in visual studio code and deviate from the steps in the “Ultimate NFT Moralis Tutorial”.

Any other alternative?

you can also start a new truffle environment, and maybe using new migration files for new deployment, or rename the contract name, without reseting truffle

Pardon my noob ignorance but how to start a new truffle environment? new infura node?

I mean creating a new folder where you init truffle, or what do you mean?

You mean change the entire working file directory?

yes, like starting from scratch

but it may be more important what you have in your migrations folder, where you can remove that migration file that deploys “Migrations” contract. (and also rename what you have now as a migration for your smart contract maybe so that it starts with 1_)