Giter Site home page Giter Site logo

eurc-eth's Introduction

EUR-ETH

EUR is an ERC-20 stablecoin - Smart contract of digital EUR on Ethereum Blockchain

Overview

The EURC smart contract used OpenZeppelin which is library for secure smart contract development.

Installation

The guides in the OpenZeppelin docs site will teach how to deploy and interaction to smart contract.

Step by Step Installation using Truffle

  1. Make sure you have node v12.8.3 or higher, check it with
node --version
  1. Install packages
npm install
  1. Download, install and open Ganache

  2. Compile solidity with truffle

npx truffle compile
  1. Deploy smart contracts to your localhost Ethereum Ganache
npx truffle migrate --network development

result of your deployment:

Starting migrations...
======================
> Network name:    'development'
> Network id:      5777
> Block gas limit: 6721975 (0x6691b7)


1_initial_migration.js
======================

Replacing 'Migrations'
----------------------
> transaction hash:    0x22f3d8f6b36baa7d55484e497119ae494c226b2ac0868ff8f149cf46c613035f
> Blocks: 0            Seconds: 0
> contract address:    0x0569F5E69aaD81a62d91D927995621EF13AA2d7F
> block number:        1
> block timestamp:     1611340650
> account:             0x7904bF7aC4EdC845b2057d2F44A1D19e33468ce5
> balance:             99.99626074
> gas used:            186963 (0x2da53)
> gas price:           20 gwei
> value sent:          0 ETH
> total cost:          0.00373926 ETH


> Saving migration to chain.
> Saving artifacts
   -------------------------------------
> Total cost:          0.00373926 ETH


2_deploy_contracts.js
=====================

Replacing 'Euro'
----------------
> transaction hash:    0x6df413a4b34331bc5ab4f4366ad57dcbc60fcfb1da2c72e94c79cb9e8bc4e9a6
> Blocks: 0            Seconds: 0
> contract address:    0x6E01BF5B1003833DFB4D6237821FD49a48b1446D
> block number:        3
> block timestamp:     1611340650
> account:             0x7904bF7aC4EdC845b2057d2F44A1D19e33468ce5
> balance:             99.95791582
> gas used:            1874911 (0x1c9bdf)
> gas price:           20 gwei
> value sent:          0 ETH
> total cost:          0.03749822 ETH


> Saving migration to chain.
> Saving artifacts
   -------------------------------------
> Total cost:          0.03749822 ETH


Summary
=======
> Total deployments:   2
> Final cost:          0.04123748 ETH

Interacting from the Console

$ npx truffle console --network development
truffle(development)> Euro = await Euro.deployed()
undefined

Minting Euro coin

Use Owner adres for examample:0x7904bF7aC4EdC845b2057d2F44A1D19e33468ce5 Minting 500 Euro coins: We are using 6 decimals which means 500000000 to mint

$ truffle(development)> await Euro.mint("0x7904bF7aC4EdC845b2057d2F44A1D19e33468ce5", 500000000)

Sending Euro coin to User

See also OpenZeppelin documentation transfer(address recipient, uint256 amount)

User adress example: 0xd7ab3436414E7412c004811ec960c908d34704ef

$ truffle(development)> await Euro.transfer("0xd7ab3436414E7412c004811ec960c908d34704ef", 500000000)

Import Account to metamask

See also this medium blog

Add Euro coin to metamask

Make sure you change your network to Ganache Development in Metamask and read this blog

Testing and linting

Running unit test

npm run test

Running test coverage

npm run coverage

Lint solidity

npm run lint:sol

Connecting to public test networks

see also Connecting to public test networks

Create a new account

To send transactions in a testnet, you will need a new Ethereum account using mnemonics package

npx mnemonics
drama film snack motion ...

Copy and change secrets

cp secrets.json.example secrets.json

Copy your mnemonics words to secret.json

Get Alchemyapi Key and copy your API KEY

https://www.alchemyapi.io/ Copy your API KEY to secret.json

Get funds

Using Rinkeby Authenticated Faucet or using MetaMask’s faucet

Deploy and migrate to rinkeby

npx truffle migrate --network rinkeby

Security

If you find a security issue, please join our Discord

Developer Resources

  • Ask for help and follow progress at: Discord

Interested in contributing to EURC?

License

Code released under the MIT License.

eurc-eth's People

Contributors

iam-dev avatar

Watchers

 avatar  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.