Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 1.15 KB

Use of hard-coded addresses may cause errors.md

File metadata and controls

31 lines (24 loc) · 1.15 KB

Each contract needs contract addresses in order to be integrated into other protocols and systems.

These addresses are currently hard-coded, which may cause errors and result in the codebase's deployment with an incorrect asset.

Using hard-coded values instead of deployer-provided values makes these contracts incredibly difficult to test.

Recommendation:

Short term, set addresses when contracts are created rather than using hard-coded values.

This practice will facilitate testing.

Long term, to ensure that contracts can be tested and reused across networks, avoid using hard-coded parameters.


Slide Screenshot

157.jpg


Slide Text

  • ToB Audit Advanced Blockchain Finding 27
  • Patching
  • Hardcoded Contract Addresses
  • Contract Deployer
  • Set Addresses

References


Tags