Giter Site home page Giter Site logo

tokenized-ballot's Introduction

Solidity Project: MyToken and TokenizedBallot

This project demonstrates the integration of Solidity smart contracts with the Ethereum blockchain, featuring an ERC20 token (MyToken) and a voting system (TokenizedBallot). It includes a TypeScript script for deploying and interacting with these contracts on the Ethereum blockchain using the Viem library.

Smart Contracts

  • MyToken.sol: An ERC20 token that implements the ERC20Permit and ERC20Votes extensions, enabling operations like minting tokens and voting with token holdings.
  • TokenizedBallot.sol: A contract for creating a token-based voting system where token holders can vote for proposals using their tokens.

Deployment and Interaction

To deploy the MyToken and TokenizedBallot contracts and interact with them, run the TypeScript script provided in the project. This script demonstrates how to mint tokens, transfer tokens to another account, delegate votes, and cast votes.

Running the Script

Use the following command to deploy the contracts and interact with them on the Ethereum blockchain:

npx ts-node --files ./scripts/DeployWithViemAndContractInteraction.ts

This will deploy the MyToken and TokenizedBallot contracts, perform operations such as token minting, transferring tokens to a second account, delegating voting power, casting a vote, and displaying the winning proposal.

Output

Running the script will output the process of deploying the contracts, minting and transferring tokens, delegating votes, voting, and announcing the winning proposal in the terminal.

Considerations

  • Make sure you have sufficient ETH in your wallet to cover the gas costs associated with deploying and interacting with the contracts.
  • This project is configured to use the Sepolia test network. Ensure you have test ETH for this network.
  • Familiarize yourself with the functionality of each smart contract and the deployment/interaction script before executing any transactions on the Ethereum blockchain.

tokenized-ballot's People

Contributors

alireza-sharifpour 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.