Open haydenadams opened 5 years ago
Uniswap is safe from re-entrancy for tokens that don't allow arbitrary callbacks in transfer functions. However, for tokens that do allow arbitrary callbacks (such as ERC777), a re-entrancy guard could make the contract more secure.
Implementation: https://github.com/protofire/zeppelin-solidity/blob/master/contracts/ReentrancyGuard.sol
This would add ~5000-1000 gas until https://eips.ethereum.org/EIPS/eip-1283 is merged
https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/utils/ReentrancyGuard.sol looks like it has had a few updates.
I haven't been able to find a similar library written in vyper though.
Can now add the decorator
@nonreentrant(key)
https://github.com/ethereum/vyper/pull/1264
Uniswap is safe from re-entrancy for tokens that don't allow arbitrary callbacks in transfer functions. However, for tokens that do allow arbitrary callbacks (such as ERC777), a re-entrancy guard could make the contract more secure.
Implementation: https://github.com/protofire/zeppelin-solidity/blob/master/contracts/ReentrancyGuard.sol
This would add ~5000-1000 gas until https://eips.ethereum.org/EIPS/eip-1283 is merged