Skip to content

Instantly share code, notes, and snippets.

@matYang
Last active April 25, 2023 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matYang/07d0a7c18af4feda32a9721c8669e34d to your computer and use it in GitHub Desktop.
Save matYang/07d0a7c18af4feda32a9721c8669e34d to your computer and use it in GitHub Desktop.
// 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