How does Balancer prevent reentrancy attacks?

Hello!

As part of a research project I am doing at uni, I wanted to know what kind of countermeasures does Balancer implement to avoid reentrancy attacks?

It would be very nice if I can get specific lines of codes about this topic in the smart contract of Balancer.

Thanks in advance!

1 Like

Here’s a quick search for reentry on the github, https://github.com/search?q=org%3Abalancer-labs+reentry&type=code

This page, https://docs.balancer.finance/api/core-contracts#mutex states,

All stateful functions use either a lock or viewlock function modifier. A mutex places a lock on contract state and prevents any sort of re-entrancy.

Is that helpful?

2 Likes

That is awesome! Thank you for your help.