code-423n4 / 2021-04-vader-findings

1 stars 0 forks source link

Add anchor map #236

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

@cmichelio

Vulnerability details

Router.updateAnchorPrice iterates over all anchor tokens on each update which is very inefficient and does a lot of expensive storage loads. add a mapping address => index to easily retrieve the index of the token in the arrayAnchors mapping.

0xBrian commented 3 years ago

https://github.com/vetherasset/vaderprotocol-contracts/commit/452986a77f1c6cfd9f96255c1b2450d4febd1c0f