45 min tutorials Advanced level

Creating a Simple DeFi Smart Contract

This guide walks through creating a basic ERC20 token and deploying it on Ethereum using Solidity.

DeFi_smart_contract.sol SOLIDITY
pragma solidity ^0.8.0;

contract MyToken {
    string public name = 'MyToken';
    string public symbol = 'MTK';
    uint256 public totalSupply = 1000000;
    mapping(address => uint256) public balanceOf;

    constructor() {
        balanceOf[msg.sender] = totalSupply;
    }

    function transfer(address _to, uint256 _value) public returns (bool success) {
        require(balanceOf[msg.sender] >= _value, 'Insufficient balance');
        balanceOf[msg.sender] -= _value;
        balanceOf[_to] += _value;
        return true;
    }
}

About This Guide

This guide walks through creating a basic ERC20 token and deploying it on Ethereum using Solidity.

Guide Information

Duration

45 min

Difficulty

Advanced

Tags

DeFi, Ethereum, Solidity, smart contracts

Connect With Us
Empowering the future.

Copyright © 2026 Atragate IT Ltd. All Rights Reserved.