- Changed msg.sender to _msgSender()

This commit is contained in:
eboado 2020-10-27 14:42:11 +01:00
parent bb6b322925
commit 87bbfb9571
4 changed files with 13 additions and 13 deletions

View File

@ -22,7 +22,7 @@ contract MintableERC20 is ERC20 {
* @return A boolean that indicates if the operation was successful. * @return A boolean that indicates if the operation was successful.
*/ */
function mint(uint256 value) public returns (bool) { function mint(uint256 value) public returns (bool) {
_mint(msg.sender, value); _mint(_msgSender(), value);
return true; return true;
} }
} }

View File

@ -40,7 +40,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
bytes32 public DOMAIN_SEPARATOR; bytes32 public DOMAIN_SEPARATOR;
modifier onlyLendingPool { 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 //transfer event to track balances
emit Transfer(user, address(0), amount); emit Transfer(user, address(0), amount);
emit Burn(msg.sender, receiverOfUnderlying, amount, index); emit Burn(_msgSender(), receiverOfUnderlying, amount, index);
} }
/** /**

View File

@ -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 recipient the recipient of the tokens
* @param amount the amount of tokens being transferred * @param amount the amount of tokens being transferred
* @return true if the transfer succeeds, false otherwise * @return true if the transfer succeeds, false otherwise
**/ **/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) { function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount); _transfer(_msgSender(), recipient, amount);
emit Transfer(msg.sender, recipient, amount); emit Transfer(_msgSender(), recipient, amount);
return true; return true;
} }
@ -101,8 +101,8 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
} }
/** /**
* @dev allows spender to spend the tokens owned by msg.sender * @dev allows spender to spend the tokens owned by _msgSender()
* @param spender the user allowed to spend msg.sender tokens * @param spender the user allowed to spend _msgSender() tokens
* @return true * @return true
**/ **/
function approve(address spender, uint256 amount) public virtual override returns (bool) { 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 sender the owner of the tokens
* @param recipient the recipient of the tokens * @param recipient the recipient of the tokens
* @param amount the amount of tokens being transferred * @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 * @dev increases the allowance of spender to spend _msgSender() tokens
* @param spender the user allowed to spend on behalf of msg.sender * @param spender the user allowed to spend on behalf of _msgSender()
* @param addedValue the amount being added to the allowance * @param addedValue the amount being added to the allowance
* @return true * @return true
**/ **/
@ -144,8 +144,8 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
} }
/** /**
* @dev decreases the allowance of spender to spend msg.sender tokens * @dev decreases the allowance of spender to spend _msgSender() tokens
* @param spender the user allowed to spend on behalf of msg.sender * @param spender the user allowed to spend on behalf of _msgSender()
* @param subtractedValue the amount being subtracted to the allowance * @param subtractedValue the amount being subtracted to the allowance
* @return true * @return true
**/ **/

View File

@ -23,7 +23,7 @@ abstract contract DebtTokenBase is IncentivizedERC20, VersionedInitializable {
* @dev Only lending pool can call functions marked by this modifier * @dev Only lending pool can call functions marked by this modifier
**/ **/
modifier onlyLendingPool { modifier onlyLendingPool {
require(msg.sender == address(POOL), Errors.CALLER_MUST_BE_LENDING_POOL); require(_msgSender() == address(POOL), Errors.CALLER_MUST_BE_LENDING_POOL);
_; _;
} }