-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathFrxUSD3.sol
More file actions
56 lines (46 loc) · 2.05 KB
/
Copy pathFrxUSD3.sol
File metadata and controls
56 lines (46 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
import { ERC20Permit, ERC20, EIP712, Nonces } from "@openzeppelin/contracts-5.2.0/token/ERC20/extensions/ERC20Permit.sol";
import { FrxUSD2 } from "src/contracts/fraxtal/frxUSD/versioning/FrxUSD2.sol";
import { PermitModule } from "src/contracts/shared/core/modules/PermitModule.sol";
import { EIP3009Module, SignatureModule } from "src/contracts/shared/core/modules/EIP3009Module.sol";
/// @title FrxUSD v3.0.0
/// @notice Frax USD Stablecoin by Frax Finance
/// @dev v3.0.0 adds ERC-1271 and EIP-3009 support
contract FrxUSD3 is FrxUSD2, EIP3009Module, PermitModule {
function version() public pure override returns (string memory) {
return "3.0.0";
}
constructor() FrxUSD2() {}
/*//////////////////////////////////////////////////////////////
Module Overrides
//////////////////////////////////////////////////////////////*/
function __transfer(address from, address to, uint256 amount) internal override returns (bool) {
ERC20._transfer(from, to, amount);
return true;
}
function __hashTypedDataV4(bytes32 structHash) internal view override(SignatureModule) returns (bytes32) {
return EIP712._hashTypedDataV4(structHash);
}
function __approve(address owner, address spender, uint256 amount) internal override(PermitModule) {
ERC20._approve(owner, spender, amount);
}
function __useNonce(address owner) internal override(PermitModule) returns (uint256) {
return Nonces._useNonce(owner);
}
function __domainSeparatorV4() internal view override(PermitModule) returns (bytes32) {
return EIP712._domainSeparatorV4();
}
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) public override(ERC20Permit, PermitModule) {
return
PermitModule.permit({ owner: owner, spender: spender, value: value, deadline: deadline, v: v, r: r, s: s });
}
}