Skip to content

Latest commit

 

History

History
16 lines (10 loc) · 472 Bytes

10.md

File metadata and controls

16 lines (10 loc) · 472 Bytes

Delegatecall

Description:

delegatecall is tricky to use and wrong usage or incorrect understanding can lead to devastating results.

You must keep 2 things in mind when using delegatecall

  1. delegatecall preserves context (storage, caller, etc...)
  2. storage layout must be the same for the contract calling delegatecall and the contract getting called

Remediation:

Use stateless Library

References:

https://solidity-by-example.org/hacks/delegatecall/