Destroying two contracts: (1) contract A with 1 integer variable stored in it and (2) contract B with 100 integer variables stored in it, would result in the same amount of refund: 24000 gas. So does the self-destruct clear all the contract variables and just not give the refunds for deleting them? Or it just removes the contract reference but doesn’t remove its variables from the current EVM state?
It does clear the storage, but there is a limit for the refund you get.
Deleting a variable refunds 15,000 gas up to a maximum of half the gas cost of the transaction