Anchor for EVM Developers
  • Anchor for EVM Developers
  • Program Address
  • Functions
  • Token
  • Validation
  • Mutation
  • Calling Other Contract
  • Wrap Native Token
  • Transfer Native Token
  • Transfer Fungible Token
  • Deploy A Fungible Token
  • Access Control
  • Address Mining
  • Events
  • Forking Mainnet
  • Function Selector
  • Feature Flags
  • Feature Dependencies
  • Migration / Scripts
  • Upgrade Programs
  • Block Timestamp
  • Verifying A Contract
  • Destroying A Contract
  • Reclaiming Rent From A Token Account
Powered by GitBook
On this page

Destroying A Contract

PreviousVerifying A ContractNextReclaiming Rent From A Token Account

Last updated 1 day ago

EVM

Deployed contracts cannot be destroyed unless it contains a function that calls selfdestruct. However, since the Cancun hard fork, a contract can only be destroyed if selfdestruct is called in the same transaction that deploys the contract.

Solana

solana program close $PROGRAM_ID

Use this with caution as you can accidentally lock users out of their funds!

OptiFi Program Incident Report — 08/29/22Medium
Logo