Skip to content

Commit

Permalink
minor(hardhat): improve EnergyShield doc
Browse files Browse the repository at this point in the history
  • Loading branch information
xykota committed Dec 14, 2023
1 parent 96e3485 commit edc8f95
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/hardhat/contracts/EnergyShield.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ import {IEnergyShield} from './interfaces/IEnergyShield.sol';
* The functions `single` and `multi` are callable by anyone. Note a caller can
* instruct this contract to set the allowance of any token and this allowance will
* carry over to the next caller.
*
* This contract is stateless, meaning it should never hold any balances.
* While there is a `drain` method, any user can effectively drain this contract
* by using `single` or `multi` to send tokens to themselves.
*/
contract EnergyShield is Ownable, IEnergyShield {
using SafeERC20 for IERC20;
Expand All @@ -29,6 +33,8 @@ contract EnergyShield is Ownable, IEnergyShield {
: IERC20(params.tokenOut).balanceOf(msg.sender);
}

// NOTE: `msg.value` may be zero for calls such as `approve` or `transferFrom`,
// and greater than zero for calls such as wrapping ETH
(bool success, ) = params.target.call{value: msg.value}(params.data);

if (!success) {
Expand Down

0 comments on commit edc8f95

Please sign in to comment.