Open code423n4 opened 3 years ago
@cmichelio
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.
Router.updateAnchorPrice
address => index
arrayAnchors
https://github.com/vetherasset/vaderprotocol-contracts/commit/452986a77f1c6cfd9f96255c1b2450d4febd1c0f
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 mappingaddress => index
to easily retrieve the index of the token in thearrayAnchors
mapping.