Hi
I was just wondering how to use the DAI permit and compared it with ERC20Permit contract. What is the difference? I just saw that DAI contract has a permit function but with more parameters. I guess it will not work with the permit from ERC20Permit contract?
Does USDT not have a permit function?
Regarding DAI, you can see the section in the EIP about Backwards Compatibility.
USDT doesn't seem to have a permit function. The contract predates the development of permit and it is not upgradeable.
Thanks for your answer. I want to send Dai token to a contract and I wrote the following function for that. The permit function for dai is called on UI site daiToken.permit(...args);
I am thinking if this maybe not be better to add the daiToken.permit(...args);
into the sendToken function before instead of permitting over the UI.
function sendToken(
address _token,
address _to,
uint256 _amountIn,
uint256 _merchantID,
uint256 _orderID,
uint256 _deadline
) public override ensure(_deadline) {
IERC20 token = IERC20(_token);
require(token.balanceOf(msg.sender) > _amountIn, "Not enough balance");
require(_amountIn > 0, "amount should be > 0");
require(_orderID != 0, "sendToken: orderID is empty");
require(_merchantID != 0, "sendToken: merchandID is empty");
address _merchantUID = PaymentLibrary.merchantFor(
factory,
_to,
_merchantID
);
uint256 _amountInMinusFee = PaymentLibrary.getAmountOut(
_amountIn
);
// msg.sender is router
token.safeTransferFrom(msg.sender, _merchantUID, _amountIn);
uint256 _fees = _amountIn.sub(_amountInMinusFee);
// pass amount && fees
IMerchant(_merchantUID).mint(
msg.sender,
_to,
_amountIn,
_fees,
_orderID
);
}