Initial commit with 🏗️ create-eth @ 2.0.4

This commit is contained in:
han
2026-01-12 10:42:14 +07:00
commit fd53a8187a
126 changed files with 27771 additions and 0 deletions

View 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 {}
}

View 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") {}
}