SafeTransfer

Git Source

provides minimalistic methods for safe transfers, e.g. ERC20 safeTransferFrom

Functions

safeTransferFrom

Transfer amount_ of token_ from from_ to to_, spending the approval given by from_ to the calling contract. If token_ returns no value, non-reverting calls are assumed to be successful. Minimally modified from Solmate SafeTransferLib (address as input param for token, Custom Error): https://github.com/transmissions11/solmate/blob/50e15bb566f98b7174da9b0066126a4c3e75e0fd/src/utils/SafeTransferLib.sol#L31-L63

function safeTransferFrom(address token_, address from_, address to_, uint256 amount_) internal;

safeTransfer

Transfer amount_ of token_ to to_. If token_ returns no value, non-reverting calls are assumed to be successful. Minimally modified from Solmate SafeTransferLib (address as input param for token, Custom Error): https://github.com/transmissions11/solmate/blob/50e15bb566f98b7174da9b0066126a4c3e75e0fd/src/utils/SafeTransferLib.sol#L65-L95

function safeTransfer(address token_, address to_, uint256 amount_) internal;

safeTransferNative

Transfer amount_ of native token toto_`. Minimally modified from Solmate SafeTransferLib (Custom Error): https://github.com/transmissions11/solmate/blob/50e15bb566f98b7174da9b0066126a4c3e75e0fd/src/utils/SafeTransferLib.sol#L15-L25

function safeTransferNative(address to_, uint256 amount_) internal;

Errors

FluidSafeTransferError

error FluidSafeTransferError(uint256 errorId_);