Skip to content

Commit

Permalink
smart contract doc changes for erc-20 (#695)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyzooghost authored Feb 18, 2025
1 parent 1edc38b commit a72a7e9
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion contracts/src/_testing/mocks/tokens/TestERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import "@openzeppelin/contracts/access/Ownable.sol";

/**
* @title TestERC20
* @dev Simple ERC20 Token example.
* @dev Simple ERC-20 Token example.
*/

contract TestERC20 is ERC20, Ownable {
Expand Down
4 changes: 2 additions & 2 deletions contracts/src/bridging/token/BridgedToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ERC20PermitUpgradeable } from "@openzeppelin/contracts-upgradeable/toke

/**
* @title BridgedToken Contract
* @notice ERC20 token created when a native token is bridged to a target chain.
* @notice ERC-20 token created when a native token is bridged to a target chain.
* @custom:security-contact security-report@linea.build
*/
contract BridgedToken is ERC20PermitUpgradeable {
Expand Down Expand Up @@ -61,7 +61,7 @@ contract BridgedToken is ERC20PermitUpgradeable {
}

/**
* @dev Overrides ERC20 default function to support tokens with different decimals.
* @dev Overrides ERC-20 default function to support tokens with different decimals.
* @return The number of decimal.
*/
function decimals() public view override returns (uint8) {
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/bridging/token/CustomBridgedToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BridgedToken } from "./BridgedToken.sol";

/**
* @title Custom BridgedToken Contract
* @notice Custom ERC20 token manually deployed for the Linea TokenBridge.
* @notice Custom ERC-20 token manually deployed for the Linea TokenBridge.
*/
contract CustomBridgedToken is BridgedToken {
function initializeV2(
Expand Down
20 changes: 10 additions & 10 deletions contracts/src/bridging/token/TokenBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { PermissionsManager } from "../../security/access/PermissionsManager.sol
import { EfficientLeftRightKeccak } from "../../libraries/EfficientLeftRightKeccak.sol";
/**
* @title Linea Canonical Token Bridge
* @notice Contract to manage cross-chain ERC20 bridging.
* @notice Contract to manage cross-chain ERC-20 bridging.
* @author ConsenSys Software Inc.
* @custom:security-contact security-report@linea.build
*/
Expand Down Expand Up @@ -221,7 +221,7 @@ contract TokenBridge is
/**
* @notice This function is the single entry point to bridge tokens to the
* other chain, both for native and already bridged tokens. You can use it
* to bridge any ERC20. If the token is bridged for the first time an ERC20
* to bridge any ERC-20. If the token is bridged for the first time an ERC-20
* (BridgedToken.sol) will be automatically deployed on the target chain.
* @dev User should first allow the bridge to transfer tokens on his behalf.
* Alternatively, you can use BridgeTokenWithPermit to do so in a single
Expand All @@ -233,7 +233,7 @@ contract TokenBridge is
* Linea can pause the bridge for security reason. In this case new bridge
* transaction would revert.
* @dev Note: If, when bridging an unbridged token and decimals are unknown,
* the call will revert to prevent mismatched decimals. Only those ERC20s,
* the call will revert to prevent mismatched decimals. Only those ERC-20s,
* with a decimals function are supported.
* @param _token The address of the token to be bridged.
* @param _amount The amount of the token to be bridged.
Expand Down Expand Up @@ -291,7 +291,7 @@ contract TokenBridge is

/**
* @notice Similar to `bridgeToken` function but allows to pass additional
* permit data to do the ERC20 approval in a single transaction.
* permit data to do the ERC-20 approval in a single transaction.
* @notice _permit can fail silently, don't rely on this function passing as a form
* of authentication
* @dev There is no need for validation at this level as the validation on pausing,
Expand Down Expand Up @@ -482,7 +482,7 @@ contract TokenBridge is
}

/**
* @dev Linea can set a custom ERC20 contract for specific ERC20.
* @dev Linea can set a custom ERC-20 contract for specific ERC-20.
* For security purpose, Linea can only call this function if the token has
* not been bridged yet.
* @dev SET_CUSTOM_CONTRACT_ROLE is required to execute.
Expand Down Expand Up @@ -521,7 +521,7 @@ contract TokenBridge is
// https://github.com/traderjoe-xyz/joe-core/blob/main/contracts/MasterChefJoeV3.sol#L55-L95

/**
* @dev Provides a safe ERC20.name version which returns 'NO_NAME' as fallback string.
* @dev Provides a safe ERC-20.name version which returns 'NO_NAME' as fallback string.
* @param _token The address of the ERC-20 token contract
* @return tokenName Returns the string of the token name.
*/
Expand All @@ -531,7 +531,7 @@ contract TokenBridge is
}

/**
* @dev Provides a safe ERC20.symbol version which returns 'NO_SYMBOL' as fallback string
* @dev Provides a safe ERC-20.symbol version which returns 'NO_SYMBOL' as fallback string
* @param _token The address of the ERC-20 token contract
* @return symbol Returns the string of the symbol.
*/
Expand All @@ -541,7 +541,7 @@ contract TokenBridge is
}

/**
* @notice Provides a safe ERC20.decimals version which reverts when decimals are unknown
* @notice Provides a safe ERC-20.decimals version which reverts when decimals are unknown
* Note Tokens with (decimals > 255) are not supported
* @param _token The address of the ERC-20 token contract
* @return Returns the token's decimals value.
Expand Down Expand Up @@ -592,9 +592,9 @@ contract TokenBridge is
}

/**
* @notice Call the token permit method of extended ERC20
* @notice Call the token permit method of extended ERC-20
* @notice Only support tokens implementing ERC-2612
* @param _token ERC20 token address
* @param _token ERC-20 token address
* @param _permitData Raw data of the call `permit` of the token
*/
function _permit(address _token, bytes calldata _permitData) internal {
Expand Down
4 changes: 2 additions & 2 deletions contracts/src/bridging/token/interfaces/ITokenBridge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ interface ITokenBridge {

/**
* @notice Similar to `bridgeToken` function but allows to pass additional
* permit data to do the ERC20 approval in a single transaction.
* permit data to do the ERC-20 approval in a single transaction.
* @param _token The address of the token to be bridged.
* @param _amount The amount of the token to be bridged.
* @param _recipient The address that will receive the tokens on the other chain.
Expand Down Expand Up @@ -307,7 +307,7 @@ interface ITokenBridge {
function removeReserved(address _token) external;

/**
* @dev Linea can set a custom ERC20 contract for specific ERC20.
* @dev Linea can set a custom ERC-20 contract for specific ERC-20.
* For security purpose, Linea can only call this function if the token has
* not been bridged yet.
* @param _nativeToken address of the token on the source chain.
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/tokens/LineaSurgeXP.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol";

/**
* @title ERC20 contract for Linea Surge XP (LXP-L) tokens.
* @title ERC-20 contract for Linea Surge XP (LXP-L) tokens.
* @author ConsenSys Software Inc.
* @custom:security-contact security-report@linea.build
*/
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/tokens/LineaVoyageXP.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol";

/**
* @title Soulbound ERC20 contract for Linea Voyage XP tokens.
* @title Soulbound ERC-20 contract for Linea Voyage XP tokens.
* @author ConsenSys Software Inc.
* @custom:security-contact security-report@linea.build
*/
Expand Down

0 comments on commit a72a7e9

Please sign in to comment.