15,000 USDC
View results
Submission Details
Severity: gas

Constructor can be payable

[GAS] Constructor can be payable to save gas

Gas saved: ~13 gas per instance

Number of Instances: 2

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/d1c5501aa79320ca0aeaa73f47f0dbc88c7b77e2/src/DSCEngine.sol#L112

constructor(address[] memory tokenAddresses, address[] memory priceFeedAddresses, address dscAddress) {
//code
}

https://github.com/Cyfrin/2023-07-foundry-defi-stablecoin/blob/d1c5501aa79320ca0aeaa73f47f0dbc88c7b77e2/src/DecentralizedStableCoin.sol#L44

constructor() ERC20("DecentralizedStableCoin", "DSC") {}

Recommedation

make constructor payable

Support

FAQs

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