mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Merge branch 'fix/83-msgSender' into 'master'
- Changed msg.sender to _msgSender() See merge request aave-tech/protocol-v2!97
This commit is contained in:
commit
7eb31124b2
|
@ -22,7 +22,7 @@ contract MintableERC20 is ERC20 {
|
|||
* @return A boolean that indicates if the operation was successful.
|
||||
*/
|
||||
function mint(uint256 value) public returns (bool) {
|
||||
_mint(msg.sender, value);
|
||||
_mint(_msgSender(), value);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
|
|||
bytes32 public DOMAIN_SEPARATOR;
|
||||
|
||||
modifier onlyLendingPool {
|
||||
require(msg.sender == address(POOL), Errors.CALLER_MUST_BE_LENDING_POOL);
|
||||
require(_msgSender() == address(POOL), Errors.CALLER_MUST_BE_LENDING_POOL);
|
||||
_;
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
|
|||
|
||||
//transfer event to track balances
|
||||
emit Transfer(user, address(0), amount);
|
||||
emit Burn(msg.sender, receiverOfUnderlying, amount, index);
|
||||
emit Burn(_msgSender(), receiverOfUnderlying, amount, index);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -73,14 +73,14 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
|
|||
}
|
||||
|
||||
/**
|
||||
* @dev executes a transfer of tokens from msg.sender to recipient
|
||||
* @dev executes a transfer of tokens from _msgSender() to recipient
|
||||
* @param recipient the recipient of the tokens
|
||||
* @param amount the amount of tokens being transferred
|
||||
* @return true if the transfer succeeds, false otherwise
|
||||
**/
|
||||
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
|
||||
_transfer(_msgSender(), recipient, amount);
|
||||
emit Transfer(msg.sender, recipient, amount);
|
||||
emit Transfer(_msgSender(), recipient, amount);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -101,8 +101,8 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
|
|||
}
|
||||
|
||||
/**
|
||||
* @dev allows spender to spend the tokens owned by msg.sender
|
||||
* @param spender the user allowed to spend msg.sender tokens
|
||||
* @dev allows spender to spend the tokens owned by _msgSender()
|
||||
* @param spender the user allowed to spend _msgSender() tokens
|
||||
* @return true
|
||||
**/
|
||||
function approve(address spender, uint256 amount) public virtual override returns (bool) {
|
||||
|
@ -111,7 +111,7 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
|
|||
}
|
||||
|
||||
/**
|
||||
* @dev executes a transfer of token from sender to recipient, if msg.sender is allowed to do so
|
||||
* @dev executes a transfer of token from sender to recipient, if _msgSender() is allowed to do so
|
||||
* @param sender the owner of the tokens
|
||||
* @param recipient the recipient of the tokens
|
||||
* @param amount the amount of tokens being transferred
|
||||
|
@ -133,8 +133,8 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
|
|||
}
|
||||
|
||||
/**
|
||||
* @dev increases the allowance of spender to spend msg.sender tokens
|
||||
* @param spender the user allowed to spend on behalf of msg.sender
|
||||
* @dev increases the allowance of spender to spend _msgSender() tokens
|
||||
* @param spender the user allowed to spend on behalf of _msgSender()
|
||||
* @param addedValue the amount being added to the allowance
|
||||
* @return true
|
||||
**/
|
||||
|
@ -144,8 +144,8 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
|
|||
}
|
||||
|
||||
/**
|
||||
* @dev decreases the allowance of spender to spend msg.sender tokens
|
||||
* @param spender the user allowed to spend on behalf of msg.sender
|
||||
* @dev decreases the allowance of spender to spend _msgSender() tokens
|
||||
* @param spender the user allowed to spend on behalf of _msgSender()
|
||||
* @param subtractedValue the amount being subtracted to the allowance
|
||||
* @return true
|
||||
**/
|
||||
|
|
|
@ -23,7 +23,7 @@ abstract contract DebtTokenBase is IncentivizedERC20, VersionedInitializable {
|
|||
* @dev Only lending pool can call functions marked by this modifier
|
||||
**/
|
||||
modifier onlyLendingPool {
|
||||
require(msg.sender == address(POOL), Errors.CALLER_MUST_BE_LENDING_POOL);
|
||||
require(_msgSender() == address(POOL), Errors.CALLER_MUST_BE_LENDING_POOL);
|
||||
_;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user