Last active
December 15, 2023 12:37
-
-
Save hughpearse/d03f00b5fd7683ed5015c8bed91e5b25 to your computer and use it in GitHub Desktop.
Openzeppelin solidity smart contract for HughCoin tokens pegged to ETH
This file contains hidden or 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 | |
// Author: Hugh Pearse | |
pragma solidity ^0.8.20; | |
import {ERC20} from "@openzeppelin/[email protected]/token/ERC20/ERC20.sol"; | |
/// @custom:security-contact [email protected] | |
contract HughCoin is ERC20 { | |
address public owner; | |
constructor() | |
ERC20("HughCoin", "HUGH") | |
{ | |
owner = msg.sender; | |
} | |
function deposit() public payable { | |
require(msg.value > 0, "Deposit value must be greater than 0"); | |
_mint(msg.sender, msg.value); | |
} | |
function withdraw(uint256 amount) public { | |
require(balanceOf(msg.sender) >= amount, "Not enough tokens to withdraw"); | |
_burn(msg.sender, amount); | |
payable(msg.sender).transfer(amount); | |
} | |
receive() external payable { | |
deposit(); | |
} | |
} |
Author
hughpearse
commented
Dec 14, 2023
Sepolia Test Network
- Token - https://sepolia.etherscan.io/token/0xC5b1bF53F36a099106A8a6FeE12540d91f10EA56
- Contract - https://sepolia.etherscan.io/address/0xC5b1bF53F36a099106A8a6FeE12540d91f10EA56
- Liquidity Pool - https://sepolia.etherscan.io/tx/0x673a0e1d9b41765716a839aa0e56e7dc4fa746df90a47b32e558fe4a685788ef
- Uniswap - https://app.uniswap.org/pools/6609?chain=sepolia
Arbitrum Goerli Test Network
- Token - https://goerli.arbiscan.io/token/0xC5b1bF53F36a099106A8a6FeE12540d91f10EA56
- Liquidity Pool - https://goerli.arbiscan.io/tx/0x6b1d024054f054e3c92769edc0f93343b991ed4bd2ee0569df96662751eac3b8
Arbitrum Sepolia Test Network
Token - https://sepolia.arbiscan.io/token/0xC5b1bF53F36a099106A8a6FeE12540d91f10EA56
Contract - https://sepolia.arbiscan.io/address/0xC5b1bF53F36a099106A8a6FeE12540d91f10EA56
Arbitrum One Main Network
- Token - https://arbiscan.io/token/0xC5b1bF53F36a099106A8a6FeE12540d91f10EA56
- Contract - https://arbiscan.io/address/0xc5b1bf53f36a099106a8a6fee12540d91f10ea56
- Liquidity Pool - https://arbiscan.io/tx/0x6f44909fa554314e1e3ef0ea879ea7b9b5270c7b01deb2ac94f9233a1018c375
- Uniswap - https://app.uniswap.org/pools/1006832?chain=arbitrum
- Sourcify Verification - https://repo.sourcify.dev/contracts/full_match/42161/0xC5b1bF53F36a099106A8a6FeE12540d91f10EA56/sources/contracts/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment