40,000 USDC
View results
Submission Details
Severity: gas

Optimizing Ethereum Network with Self-Destruct Function

Summary

In the world of Ethereum blockchain, contracts that are no longer in use or required can become a burden on the network, as they continue to occupy precious space and consume resources. To address this issue, developers can implement a self-destruct function within their smart contracts.

Vulnerability Details

Once we know that the escrow contract is in Resolved state, we can define a function that will self-destruct the escrow contract since the contract is no longer required.

Impact

The Resolved Escrow contracts take up unnecessary space on Ethereum blockchain

Tools Used

Manual Analysis

Recommendations

Add a following function to self-destruct Resolved Escrow Contracts

The Fix

function destroy() public onlyBuyerOrSeller{
// if the state is resolved then call self-destruct
}

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.