Skip to content

Instantly share code, notes, and snippets.

View shreyakqss's full-sized avatar

Shreyak Chakaborty shreyakqss

View GitHub Profile
@shreyakqss
shreyakqss / simple_dex.sol
Created May 12, 2022 08:01
Simple DEX smart contract for swapping ETH and an ERC20 token
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./TrainingToken.sol";
contract DEX {
TrainingToken token;
address public tokenAddress;
event TokensBought(uint256 amount,uint256 etherAmount,address _buyer);