Last active
April 25, 2023 21:50
-
-
Save matYang/07d0a7c18af4feda32a9721c8669e34d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.15; | |
import {IPool} from "../interfaces/pools/IPool.sol"; | |
import {IERC165} from "../../vendor/IERC165.sol"; | |
abstract contract TokenPool is IPool, OwnerIsCreator, Pausable, IERC165 { | |
...... | |
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { | |
return interfaceId == type(IPool).interfaceId || interfaceId == type(IERC165).interfaceId; | |
} | |
} | |
import {TokenPool} from "./TokenPool.sol"; | |
contract USDCTokenPool is TokenPool { | |
...... | |
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { | |
return | |
interfaceId == "USDC" || | |
super.supportsInterface(interfaceId); | |
} | |
} | |
import {TokenPool} from "./TokenPool.sol"; | |
contract USDCTokenPoolWithSelector is TokenPool { | |
...... | |
function usdcSpecificFunction() { | |
} | |
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { | |
return | |
interfaceId == this.usdcSpecificFunction.selector || | |
super.supportsInterface(interfaceId); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment