Merge branch 'solc-0.7' into solc-0.8
This commit is contained in:
@ -46,7 +46,7 @@ abstract contract EIP712 {
|
||||
constructor(string memory name, string memory version) {
|
||||
bytes32 hashedName = keccak256(bytes(name));
|
||||
bytes32 hashedVersion = keccak256(bytes(version));
|
||||
bytes32 typeHash = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
|
||||
bytes32 typeHash = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
|
||||
_HASHED_NAME = hashedName;
|
||||
_HASHED_VERSION = hashedVersion;
|
||||
_CACHED_CHAIN_ID = block.chainid;
|
||||
@ -92,7 +92,7 @@ abstract contract EIP712 {
|
||||
* address signer = ECDSA.recover(digest, signature);
|
||||
* ```
|
||||
*/
|
||||
function _hashTypedDataV4(bytes32 structHash) internal view returns (bytes32) {
|
||||
function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
|
||||
return keccak256(abi.encodePacked("\x19\x01", _domainSeparatorV4(), structHash));
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {
|
||||
/**
|
||||
* @dev See {IERC20Permit-permit}.
|
||||
*/
|
||||
function permit(address owner, address spender, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public virtual override {
|
||||
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public virtual override {
|
||||
// solhint-disable-next-line not-rely-on-time
|
||||
require(block.timestamp <= deadline, "ERC20Permit: expired deadline");
|
||||
|
||||
@ -44,7 +44,7 @@ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {
|
||||
_PERMIT_TYPEHASH,
|
||||
owner,
|
||||
spender,
|
||||
amount,
|
||||
value,
|
||||
_nonces[owner].current(),
|
||||
deadline
|
||||
)
|
||||
@ -56,7 +56,7 @@ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 {
|
||||
require(signer == owner, "ERC20Permit: invalid signature");
|
||||
|
||||
_nonces[owner].increment();
|
||||
_approve(owner, spender, amount);
|
||||
_approve(owner, spender, value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -12,7 +12,7 @@ pragma solidity ^0.8.0;
|
||||
*/
|
||||
interface IERC20Permit {
|
||||
/**
|
||||
* @dev Sets `amount` as the allowance of `spender` over `owner`'s tokens,
|
||||
* @dev Sets `value` as the allowance of `spender` over `owner`'s tokens,
|
||||
* given `owner`'s signed approval.
|
||||
*
|
||||
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
|
||||
@ -32,7 +32,7 @@ interface IERC20Permit {
|
||||
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
|
||||
* section].
|
||||
*/
|
||||
function permit(address owner, address spender, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
|
||||
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;
|
||||
|
||||
/**
|
||||
* @dev Returns the current nonce for `owner`. This value must be
|
||||
|
||||
Reference in New Issue
Block a user