Skip to content

A Smart Contract called SimpleDEX which helps in decentralised exchange between two custom ERC-20 tokens TokenA and TokenB for a fixed exchange rate.

Notifications You must be signed in to change notification settings

Cioraz/ERC-20-Task

Repository files navigation

ERC-20 Task

Legend

  • 0x0ff3726ff76AFdAD513885F49F1601A8E4bB75f7 : SimpleDEX deployed address
  • 0xB1Ccc1d09721D695233DcD688F59814Bae4b9464 : TokenB deployed address
  • 0x838F9b8228a5C95a7c431bcDAb58E289f5D2A4DC : TokenA deployed address
  • 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4 : Address of account 1 responsible for deploying TokenA
  • 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2 : Address of account 2 responsible for deploying TokenB

Procedure and Analysis

  • Created two ERC-20 tokens tokenA and tokenB each having 1000 initial mint.

  • Created a contract called SimpleDEX which handles the functionality of exchanging these tokens (A to B for a provided exchange Rate).

  • The below picture showing all the deployed contracts which include the 2 ERC-20 tokens along with the SimpleDEX contract

Screenshot from 2024-05-23 21-59-59

  • Below picture showing me fund the contract for 5 out of the 1000 minted tokens of B to ensure we can exchange via the SimpleDEX contract, some tokens of A to tokens of B provided a given exchange rate

Screenshot from 2024-05-23 21-57-50

  • Below picture approving the SimpleDEX contract to spend given number of tokensA (for exchange of A to B)

Screenshot from 2024-05-23 22-01-42

  • Below logs confirming successful transaction of tokens A to tokens B for given fixed exchange rate which here is given 1 for easy debugging

Screenshot from 2024-05-23 22-06-08

About

A Smart Contract called SimpleDEX which helps in decentralised exchange between two custom ERC-20 tokens TokenA and TokenB for a fixed exchange rate.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published