Last active
January 6, 2023 00:46
-
-
Save kien-ngo/9640c8d6e01c29faa49b6a2b8dc4caf9 to your computer and use it in GitHub Desktop.
USDC (Polygon) Receiver Contract (Hard-coded version)
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
| pragma solidity ^0.8.17; | |
| import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/utils/SafeERC20.sol"; | |
| contract USDCPolygonReceiver { | |
| SafeERC20 public token; // Syntax is wrong here | |
| // This is the USDC contract address on Polygon, hard-coded | |
| address public usdcContractAddress = 0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174; | |
| // MOME receiving address | |
| address public desiredAddress = 0xbc70651e0cbaa2433f382b03b650a13d37877673; | |
| constructor() public { | |
| token = SafeERC20(usdcContractAddress); | |
| } | |
| function transfer(uint256 _value) public { | |
| require(_value > 0, "Cannot transfer 0 or negative value"); | |
| token.transfer(desiredAddress, _value); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment