Skip to content

Commit

Permalink
Fix typos and refine comment sentences
Browse files Browse the repository at this point in the history
  • Loading branch information
zodahu committed May 9, 2023
1 parent 4a1a577 commit ef23c9e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/Router.sol
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ contract Router is IRouter, EIP712, FeeVerifier {
/// @notice Address for invoking pause
address public pauser;

/// @notice Flag for indicating pasue
/// @notice Flag for indicating pause
bool public paused;

modifier checkCaller() {
Expand Down Expand Up @@ -87,7 +87,7 @@ contract Router is IRouter, EIP712, FeeVerifier {
return _domainSeparatorV4();
}

/// @notice Get agent address of an user
/// @notice Get agent address of a user
/// @param user The user address
/// @return The agent address of the user
function getAgent(address user) external view returns (address) {
Expand All @@ -102,7 +102,7 @@ contract Router is IRouter, EIP712, FeeVerifier {
return (user, address(agents[user]));
}

/// @notice Calculate agent address for an user using the CREATE2 formula
/// @notice Calculate agent address for a user using the CREATE2 formula
/// @param user The user address
/// @return The calculated agent address for the user
function calcAgent(address user) external view returns (address) {
Expand Down
8 changes: 4 additions & 4 deletions src/fees/FeeCalculatorBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ abstract contract FeeCalculatorBase {
}

/// @notice Calculate the fee for the given amount
/// @param amount The amount for which the fee needs to be calculated
/// @param amount The amount with the fee included
/// @return The calculated fee
function calculateFee(uint256 amount) public view returns (uint256) {
return (amount * feeRate) / (_BPS_BASE + feeRate);
}

/// @notice Calculate the fees for the given array of amounts
/// @param amounts An array of amounts for which fees need to be calculated
/// @param amounts An array of amounts with the fee included
/// @return An array of calculated fees
function calculateFee(uint256[] memory amounts) public view returns (uint256[] memory) {
for (uint256 i = 0; i < amounts.length; ) {
Expand All @@ -45,14 +45,14 @@ abstract contract FeeCalculatorBase {
}

/// @notice Calculate the amount with the fee included for the given amount
/// @param amount The amount to calculate the total with the fee included
/// @param amount The amount to be calculated
/// @return The total amount with the fee included
function calculateAmountWithFee(uint256 amount) public view returns (uint256) {
return (amount * (_BPS_BASE + feeRate)) / _BPS_BASE;
}

/// @notice Calculate the amounts with the fees included for the given array of amounts
/// @param amounts An array of amounts to calculate the totals with the fees included
/// @param amounts An array of amounts to be calculated
/// @return An array of the total amounts with the fees included
function calculateAmountWithFee(uint256[] memory amounts) public view returns (uint256[] memory) {
for (uint256 i = 0; i < amounts.length; ) {
Expand Down
2 changes: 1 addition & 1 deletion src/fees/FeeVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {IParam} from '../interfaces/IParam.sol';
import {IFeeCalculator} from '../interfaces/IFeeCalculator.sol';

/// @title Fee verifier
/// @notice An abstruct contract that verifies and calculates fees on-chain
/// @notice An abstract contract that verifies and calculates fees on-chain
abstract contract FeeVerifier is Ownable {
error LengthMismatch();

Expand Down
8 changes: 4 additions & 4 deletions src/interfaces/IParam.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ pragma solidity ^0.8.0;
interface IParam {
/// @notice LogicBatch is signed by a signer using EIP-712
struct LogicBatch {
Logic[] logics; // An array of logics to be executed
Fee[] fees; // An array of fees to be charged
Logic[] logics; // An array of `Logic` structs to be executed
Fee[] fees; // An array of `Fee` structs to be charged
uint256 deadline; // The deadline for a signer's signature
}

/// @notice Logic represents a single action to be executed
struct Logic {
address to; // The target address for the execution
bytes data; // Encoded function call data
Input[] inputs; // An array of inputs for amount calculation and token approval
bytes data; // Encoded function calldata
Input[] inputs; // An array of `Input` structs for amount calculation and token approval
WrapMode wrapMode; // Determines if wrap or unwrap native
address approveTo; // The address to approve tokens for if different from `to` such as a spender contract
address callback; // The address allowed to make a one-time call to the agent
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/MakerUtility.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {IMakerGemJoin} from '../interfaces/maker/IMaker.sol';
import {ApproveHelper} from '../libraries/ApproveHelper.sol';

/// @title Maker utility contract
/// @notice Perform additional actions after interacting with Maker
/// @notice Perform additional actions when interacting with Maker
contract MakerUtility is IMakerUtility {
using SafeERC20 for IERC20;

Expand Down

0 comments on commit ef23c9e

Please sign in to comment.