Close Menu
    Trending
    • Circle Says Stablecoin Infrastructure Updates to Spur Use
    • Solana (SOL) Crashes Back To $112, A Level That Could Decide Everything
    • Here’s Why The Ethereum Validator Network Is So Strong
    • Crypto Market Structure Bill Passes Through Senate Committee
    • SEC Sets Clear Rules for Tokenized Securities, Splitting Them Into Two Key Categories
    • 21Shares Lists JitoSOL-Backed Solana ETP in Europe
    • Solana Scores Major Institutional Adoption As WisdomTree Goes On-Chain
    • Ethereum Is Pivoting Into The AI Industry? Here’s What We Know So Far
    CryptoGate
    • Home
    • Bitcoin News
    • Cryptocurrency
    • Crypto Market Trends
    • Altcoins
    • Ethereum
    • Blockchain
    • en
      • en
      • fr
      • de
      • it
      • ja
    CryptoGate
    Home»Ethereum»Ethereum in practice part 2: how to build a better democracy in under a 100 lines of code
    Ethereum

    Ethereum in practice part 2: how to build a better democracy in under a 100 lines of code

    CryptoGateBy CryptoGateJanuary 16, 2026No Comments7 Mins Read
    Share
    Facebook Twitter LinkedIn Pinterest Email


    This can be a second submit on a collection on how one can use the present Ethereum instruments to construct sensible contracts while not having programming expertise. Download the latest version of the Ethereum Wallet, read the first part and let’s have enjoyable!

    Creating a token is fun, however what’s the worth of a token that does not do something new? We at the moment are going to create a brand new contract that makes use of the tokens we simply created. The contract will likely be a Democratic group that lives on the blockchain and that anybody holding a share token will have the ability to vote on proposals.

    So let’s return to “Contracts” after which “Deploy Contract” and paste the DAO source code on the “Solidity Supply” discipline. Select the contract “Democracy” on the Picker after which choose these parameters:

    • On the quantity discipline you may add any ether quantity you need your DAO to begin with. Since you may ship ether to it at any time sooner or later, if that is the primary time you have been doing this then hold the quantity at 0 and ship the cash later.
    • On the sharesAddress discipline, paste the handle of the token contract you simply created. Take note of the icon and coloration of the little circle that seems by the aspect of the handle. If it doesn’t match precisely the one for the contract you created beforehand, then there’s an error.
    • On minimumSharesForVoting decide what’s the minimal quorum of shareholders that have to vote on a problem earlier than it passes. Right here you need to put the integer variety of the minimal token potential, so should you created a token with 2 decimal locations, placing 500 right here will imply that to ensure that a proposal to be executed then the variety of votes have to be greater than 5% of the whole shares of the corporate.
    • minutesForDebating: that is the minimal time a proposal have to be mentioned and voted on earlier than the outcomes could be tallied up. Put a small quantity like 10 minutes in order for you simply to create one thing for testing, however put one thing like 20,000 if you wish to retailer massive quantities of ether, so all proposals should keep there for a minimum of two weeks.

     

    Your contract needs to be trying one thing like this:

     

    After a number of seconds you will be redirected to a the dashboard the place you will see your new contract being created:

    Ethereum Wallet Screenshot 2015-12-03 at 3.50.36 PM 13

    You can even see the hyperlink to the brand new contract on the “Contracts” tab. If it is not there (for instance: in case you are including a contract that you just did not create) then you definitely’ll have so as to add it manually. So as to add that you’re going to want the contract’s handle and it is JSON interface, a string of textual content that explains to the pockets how one can work together with the code. You’ll be able to decide any identify you need and press OK.

    Ethereum Wallet Screen Shot 2015-12-03 at 9.57.34 AM

    Click on your new contract field and you will see a contract web page. If you have not already deposited some ether on that contract, click on on deposit and put some small quantity of ether so you may take a look at how this explicit democracy works. If the contract already has some funds, click on the “present contract information” button.

    On the “learn from contract” you may see all of the features you may execute without spending a dime on the contract, as they’re simply studying info from the blockchain. Right here you may see, as an illustration, that the “sharesTokenAddress” is certainly the proper handle or that there are at the moment 0 proposals on the contract. Let’s change that.

    On the “Write to contract” you’ve an inventory of all of the features that can try to do some computation that saves information to the blockchain, and subsequently will price ether. Choose “newProposal” and it’ll present all of the choices choices for that perform.

    Ethereum Wallet Screen Shot 2015-12-01 at 6.10.32 PM

     

    For “beneficiary” add the handle of somebody you wish to ship ether to, then put what number of ethers you need on the “etherAmount” (have to be an integer) and eventually some textual content describing the rationale you wish to do that. Go away transactionByteCode clean for now. Click on execute and sort your password. After a number of seconds the numProposals will improve to 1 and the primary proposal, quantity 0, will seem on the left column. As you add extra proposals, you may see any of them by merely placing the proposal quantity on the “proposals” discipline and you may learn all about it.

    Voting on a proposal can also be quite simple. Select “vote” on the perform picker. Kind the proposal Quantity on the primary field and verify the “Sure” field should you agree with it (or depart it clean to vote in opposition to it). Click on “execute” to ship your vote.

     

    Screen Shot 2015-12-01 at 6.18.22 PM

    When the minimal voting time has handed, you may choose “executeProposal”. If the proposal was merely sending ether, then you may as well depart the “transactionBytecode” discipline clean. After urgent “execute” however earlier than typing your password, take note of the display screen that seems. If there’s a warning on the “estimated price consumption” discipline, then because of this for some purpose the perform referred to as won’t execute and will likely be abruptly terminated. It may well imply many issues, however within the context of this contract this warning will present up everytime you attempt to execute a contract earlier than its deadline has handed, or if the person is attempting to ship a distinct bytecode information than the unique proposal had. For safety causes if any of this stuff occurs, the contract execution is abruptly terminated and the person that tried the unlawful transaction will lose the all of the ether he despatched to pay transaction charges.


    Ethereum Wallet Screen Shot 2015-12-01 at 6.21.30 PM

    If every thing went effectively you must have the ability to see the outcomes of the vote in a number of seconds. The “openToVote” parameter on the primary field will flip to false whereas the proposalPassed will replicate if the proposal has been accepted or not. You also needs to have the ability to see that the Ether steadiness of the contract will go down and the equal ether will likely be despatched to the beneficiary of the ether you needed to ship.

    Now take a second to let that in: you simply created a corporation that solely exists on the blockchain, that obeys votes primarily based on utterly digital tokens, however but it might probably transfer actual worth round and create a really actual affect on the world. Additionally discover that the group will not be underneath your management anymore: it’s going to execute solely the precise code you used to create it, without end. You’ll be able to’t bribe it, you may’t earmark it and the identical guidelines apply both you might be transferring 0.01 or 1,000,000 ethers.

    Can it get any higher than this? Truly, it might probably. On our next post we will explore how you can use “transactionBytecode” to allow the DAO to execute any kind of ethereum transaction, even proudly owning or creating different contracts. We’ll additionally modify the token code to permit the DAO to regulate the quantity of a token that exists on circulation and how one can ship it ahead.



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    CryptoGate
    • Website
    • Pinterest

    Related Posts

    Here’s Why The Ethereum Validator Network Is So Strong

    January 30, 2026

    Ethereum Is Pivoting Into The AI Industry? Here’s What We Know So Far

    January 30, 2026

    Ethereum aims to stop rogue AI agents from stealing trust with new ERC-8004

    January 29, 2026

    Banks may lose up to $500B after Fidelity’s official token launches on Ethereum with freeze powers

    January 29, 2026
    Add A Comment
    Leave A Reply Cancel Reply

    Top Posts

    XRP Price Prediction: Is XRP Headed for a Rebound or Breakdown as Whale Accumulation Grows?

    December 14, 2025

    Will Prices Soar Or Face Continued Declines?

    January 3, 2026

    XRP Price Is Not Going To $100 By End Of Year, ‘You Need A Reality Check’

    December 16, 2025

    $14 to $28 Projections Ahead

    October 13, 2025

    SUI Breakout Could Lead to $8: Analyst Explains Why

    July 28, 2025
    Categories
    • Altcoins
    • Bitcoin News
    • Blockchain
    • Crypto Market Trends
    • Crypto Mining
    • Cryptocurrency
    • Ethereum
    About us

    Welcome to cryptogate.info — your trusted gateway to the latest and most reliable news in the world of cryptocurrency. Whether you’re a seasoned trader, a blockchain enthusiast, or just curious about the future of digital finance, we’re here to keep you informed and ahead of the curve.

    At cryptogate.info, we are passionate about delivering timely, accurate, and insightful updates on everything crypto — from market trends, new coin launches, and regulatory developments to expert analysis and educational content. Our mission is to empower you with knowledge that helps you navigate the fast-paced and ever-evolving crypto landscape with confidence.

    Top Insights

    Bittensor Ecosystem Surges With Subnet Expansion, Institutional Access

    September 13, 2025

    Ethereum Foundation Unveils Comprehensive Privacy Roadmap for 2025

    September 14, 2025

    To Infinity and Beyond! | Ethereum Foundation Blog

    December 23, 2025
    Categories
    • Altcoins
    • Bitcoin News
    • Blockchain
    • Crypto Market Trends
    • Crypto Mining
    • Cryptocurrency
    • Ethereum
    YouTube
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • Impressum
    • About us
    • Contact us
    Copyright © 2025 CryptoGate All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.