Skip to content

Instantly share code, notes, and snippets.

View ShariqKhan2012's full-sized avatar

Shariq Hasan Khan ShariqKhan2012

View GitHub Profile
@ShariqKhan2012
ShariqKhan2012 / TokenShop.sol
Created July 16, 2025 14:35
A TokenShop implementation that demonstrates use of the ChainLink price feed to fetch ETH/USD prices
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {AggregatorV3Interface} from "@chainlink/[email protected]/src/v0.8/shared/interfaces/AggregatorV3Interface.sol";
import {Ownable} from "@openzeppelin/[email protected]/access/Ownable.sol";
import {MyERC20} from "./MyERC20_OpenZeppelin.sol";
contract TokenShop is Ownable {
@ShariqKhan2012
ShariqKhan2012 / NFTImplementingContract.sol
Created July 12, 2025 05:56
This gist contains an implementation of EIP-ERC721 (NFT) standard. It also implements the required ERC165 (supportsInterface) standard and the optional ERC721Enumerable, and ERC721Metadata extensions.
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external pure returns (bool);
}
/* ERC721 MUST implement ERC165 */
interface IERC721 is IERC165 {