Initial commit with 🏗️ create-eth @ 2.0.4
This commit is contained in:
43
packages/hardhat/contracts/Vendor.sol
Normal file
43
packages/hardhat/contracts/Vendor.sol
Normal file
@@ -0,0 +1,43 @@
|
||||
pragma solidity 0.8.20; //Do not change the solidity version as it negatively impacts submission grading
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import "@openzeppelin/contracts/access/Ownable.sol";
|
||||
import "./YourToken.sol";
|
||||
|
||||
contract Vendor is Ownable {
|
||||
/////////////////
|
||||
/// Errors //////
|
||||
/////////////////
|
||||
|
||||
// Errors go here...
|
||||
|
||||
//////////////////////
|
||||
/// State Variables //
|
||||
//////////////////////
|
||||
|
||||
YourToken public immutable yourToken;
|
||||
|
||||
////////////////
|
||||
/// Events /////
|
||||
////////////////
|
||||
|
||||
// Events go here...
|
||||
|
||||
///////////////////
|
||||
/// Constructor ///
|
||||
///////////////////
|
||||
|
||||
constructor(address tokenAddress) Ownable(msg.sender) {
|
||||
yourToken = YourToken(tokenAddress);
|
||||
}
|
||||
|
||||
///////////////////
|
||||
/// Functions /////
|
||||
///////////////////
|
||||
|
||||
function buyTokens() external payable {}
|
||||
|
||||
function withdraw() public onlyOwner {}
|
||||
|
||||
function sellTokens(uint256 amount) public {}
|
||||
}
|
||||
10
packages/hardhat/contracts/YourToken.sol
Normal file
10
packages/hardhat/contracts/YourToken.sol
Normal file
@@ -0,0 +1,10 @@
|
||||
pragma solidity 0.8.20; //Do not change the solidity version as it negatively impacts submission grading
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
||||
|
||||
// learn more: https://docs.openzeppelin.com/contracts/5.x/erc20
|
||||
|
||||
contract YourToken is ERC20 {
|
||||
constructor() ERC20("Gold", "GLD") {}
|
||||
}
|
||||
Reference in New Issue
Block a user