Giter Site home page Giter Site logo

advancedavax's Introduction

Solidity by Example ERC-20 Token Contract

Overview

This contract represents a basic implementation of the ERC-20 token standard in the Solidity programming language. It provides functionalities for token transfers, approvals, and a basic minting and burning mechanism.

SPDX-License-Identifier

This contract is licensed under the MIT License. Please refer to the MIT License for the full text.

Prerequisites

  • Solidity version: ^0.8.17

ERC-20 Token Details

  • Name: Solidity by Example
  • Symbol: SOLBYEX
  • Decimals: 18

Functions

transfer

solidity function transfer(address recipient, uint amount) external returns (bool); Transfers a specified amount of tokens from the sender's account to the recipient's account.

approve

function approve(address spender, uint amount) external returns (bool); Approves the spender to spend a specified amount of tokens on behalf of the owner.

transferFrom

function transferFrom(address sender, address recipient, uint amount) external returns (bool); Transfers a specified amount of tokens from the sender's account to the recipient's account, provided the sender has been approved by the owner.

mint

function mint(uint amount) external; Mints a specified amount of new tokens, adding them to the total supply and the sender's balance.

burn

function burn(uint amount) external; Burns a specified amount of tokens, reducing the total supply and the sender's balance.

Vault Contract for ERC-20 Tokens

Overview

The Vault contract is designed to securely manage deposits and withdrawals of ERC-20 tokens while issuing and redeeming corresponding shares to participants. This implementation follows the ERC-20 interface for compatibility and transparency.

SPDX-License-Identifier

This contract is licensed under the MIT License. Please refer to the MIT License for the full text.

ERC-20 Interface

This contract includes the standard ERC-20 interface as specified by the IERC20 interface. This allows seamless interaction with the ERC-20 ecosystem.

Vault Contract

The Vault contract manages deposits and withdrawals of ERC-20 tokens while issuing and redeeming shares to participants.

Constructor

constructor(address _token) {
    token = IERC20(_token);
}

advancedavax's People

Contributors

mujibat avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.