vdAMM - Dependencies
SafeERC20.sol
This is a Solidity library file that provides a safe way to interact with ERC20 operations. It wraps around the operations and throws an error in case of failure. It also supports tokens that do not return a value, but instead revert or throw an error. The library provides a number of methods like safeTransfer, safeTransferFrom, safeApprove, safeIncreaseAllowance, and safeDecreaseAllowance.
SafeERC20
A library that provides safer operations around ERC20 tokens. It throws errors on failure and supports tokens that do not return a value but instead revert or throw on failure.
safeTransfer
safeTransfer(IERC20 token, address to, uint256 value)
Safely transfers the specified value of the token to the given address.
Parameters
- token IERC20: The instance of the token to be transferred.
- to address: The address to transfer the tokens to.
- value uint256: The amount of tokens to be transferred.
safeTransferFrom
safeTransferFrom(IERC20 token, address from, address to, uint256 value)
Safely transfers the specified value of the token from a given address to another address.
Parameters
- token IERC20: The instance of the token to be transferred.
- from address: The address to transfer the tokens from.
- to address: The address to transfer the tokens to.
- value uint256: The amount of tokens to be transferred.