mirror of
https://github.com/Instadapp/yield-contract.git
synced 2024-07-29 21:47:29 +00:00
Added nonReentrant guard to deposit() in token pool
This commit is contained in:
parent
ebe8d5945a
commit
df780b55a0
|
@ -118,7 +118,7 @@ contract PoolToken is ReentrancyGuard, ERC20Pausable, DSMath {
|
|||
* @param tknAmt token amount
|
||||
* @return mintAmt amount of wrap token minted
|
||||
*/
|
||||
function deposit(uint tknAmt) external payable whenNotPaused returns (uint mintAmt) {
|
||||
function deposit(uint tknAmt) external payable nonReentrant whenNotPaused returns (uint mintAmt) {
|
||||
require(msg.value == 0, "non-eth-pool");
|
||||
uint _tokenBal = wdiv(totalSupply(), exchangeRate);
|
||||
uint _newTknBal = add(_tokenBal, tknAmt);
|
||||
|
|
|
@ -115,7 +115,7 @@ contract PoolETH is ReentrancyGuard, ERC20Pausable, DSMath {
|
|||
* @param tknAmt token amount
|
||||
* @return mintAmt amount of wrap token minted
|
||||
*/
|
||||
function deposit(uint tknAmt) external whenNotPaused payable returns (uint mintAmt) {
|
||||
function deposit(uint tknAmt) external nonReentrant whenNotPaused payable returns (uint mintAmt) {
|
||||
require(tknAmt == msg.value, "unmatched-amount");
|
||||
uint _tokenBal = wdiv(totalSupply(), exchangeRate);
|
||||
uint _newTknBal = add(_tokenBal, tknAmt);
|
||||
|
|
Loading…
Reference in New Issue
Block a user