-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
601a16b
commit aa5c672
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
//SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.13; | ||
|
||
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.0.0/contracts/token/ERC20/IERC20.sol"; | ||
|
||
|
||
contract marketplaceItem1{ | ||
mapping(address => bool) public alreadyBought; | ||
uint public price = 10; | ||
address public owner = payable(msg.sender); | ||
|
||
IERC20 public usdcFToken = IERC20(0xd9145CCE52D386f254917e481eB44e9943F39138); | ||
IERC20 public usdtFToken = IERC20(0xD7ACd2a9FD159E69Bb102A1ca21C9a3e3A5F771B); | ||
|
||
function payInUSDC() public returns(bool){ | ||
require(alreadyBought[msg.sender]==false,"you already bought"); | ||
usdcFToken.transferFrom(msg.sender,owner,price); | ||
alreadyBought[msg.sender] = true; | ||
return alreadyBought[msg.sender]; | ||
} | ||
|
||
function payInUSDT() public returns(bool){ | ||
require(alreadyBought[msg.sender]==false,"you already bought"); | ||
usdtFToken.transferFrom(msg.sender,owner,price); | ||
alreadyBought[msg.sender] = true; | ||
return alreadyBought[msg.sender]; | ||
} | ||
|
||
function payInETH() public returns(bool){ | ||
//get chainlink data | ||
return true; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.13; | ||
|
||
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.0.0/contracts/token/ERC20/ERC20.sol"; | ||
contract usdc is ERC20("testUSDC","testUSDC"){ | ||
|
||
function mintTwenty() public{ | ||
_mint(msg.sender,20); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//SPDX-License-Identifier: MIT | ||
|
||
pragma solidity ^0.8.13; | ||
|
||
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.0.0/contracts/token/ERC20/ERC20.sol"; | ||
contract usdt is ERC20("testUSDT","testUSDT"){ | ||
|
||
function mintTwenty() public{ | ||
_mint(msg.sender,20); | ||
} | ||
} |