Skip to content

Commit

Permalink
Style underscore for function variable
Browse files Browse the repository at this point in the history
  • Loading branch information
hanzel98 committed Feb 21, 2025
1 parent 1b81fca commit 9bb76fd
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/enforcers/ERC20StreamingEnforcer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ contract ERC20StreamingEnforcer is CaveatEnforcer {
view
returns (uint256 availableAmount_)
{
StreamingAllowance storage allowance = streamingAllowances[_delegationManager][_delegationHash];
availableAmount_ = _getAvailableAmount(allowance);
StreamingAllowance storage allowance_ = streamingAllowances[_delegationManager][_delegationHash];
availableAmount_ = _getAvailableAmount(allowance_);
}

/**
Expand Down Expand Up @@ -169,20 +169,20 @@ contract ERC20StreamingEnforcer is CaveatEnforcer {

require(bytes4(callData_[0:4]) == IERC20.transfer.selector, "ERC20StreamingEnforcer:invalid-method");

StreamingAllowance storage allowance = streamingAllowances[msg.sender][_delegationHash];
if (allowance.spent == 0) {
StreamingAllowance storage allowance_ = streamingAllowances[msg.sender][_delegationHash];
if (allowance_.spent == 0) {
// First use of this delegation
allowance.initialAmount = initialAmount_;
allowance.maxAmount = maxAmount_;
allowance.amountPerSecond = amountPerSecond_;
allowance.startTime = startTime_;
allowance_.initialAmount = initialAmount_;
allowance_.maxAmount = maxAmount_;
allowance_.amountPerSecond = amountPerSecond_;
allowance_.startTime = startTime_;
}

uint256 transferAmount_ = uint256(bytes32(callData_[36:68]));

require(transferAmount_ <= _getAvailableAmount(allowance), "ERC20StreamingEnforcer:allowance-exceeded");
require(transferAmount_ <= _getAvailableAmount(allowance_), "ERC20StreamingEnforcer:allowance-exceeded");

allowance.spent += transferAmount_;
allowance_.spent += transferAmount_;

emit IncreasedSpentMap(
msg.sender,
Expand All @@ -193,7 +193,7 @@ contract ERC20StreamingEnforcer is CaveatEnforcer {
maxAmount_,
amountPerSecond_,
startTime_,
allowance.spent,
allowance_.spent,
block.timestamp
);
}
Expand Down

0 comments on commit 9bb76fd

Please sign in to comment.