Ethereum Classic
Both developers and users need accounts with little ETC for gas. Metamask for ETC is supported for both developers and users.
See the dapp in action
DEMO: A voting dappStep 1
Open the BUIDL IDE tool in any browser. http://buidl.secondstate.io/etc
Step 2
Open the Accounts tab and send a little ETC to your default account. If you do not have ETC, you can ask for some from [email protected]
Step 3
3.1 Copy and paste the following code to the contract section of BUIDL.
The smart contract is very simple. It provides the text and image url to be voted on, and keeps a record of votes. The vote() method is called by voters to vote thumb up or down. The contract is to be compiled by Solidity 0.4.2, and hence the syntax is a little dated.
pragma solidity >= 0.4.0;
contract Vote {
string public greeting;
string public photoUrl;
mapping (address => int) votes;
uint ups;
uint downs;
function Vote (string _greeting, string _photoUrl) public {
greeting = _greeting;
photoUrl = _photoUrl;
}
function vote (int _choice) public {
if (votes[msg.sender] != 0) { throw; }
if (_choice != 1 && _choice != -1) { throw; }
votes[msg.sender] = _choice;
if (_choice == 1) ups++;
if (_choice == -1) downs++;
}
function getVotes () public constant returns (uint, uint) {
return (ups, downs);
}
function getVote (address _addr) public constant returns (int) {
return votes[_addr];
}
}3.2 Click on Compile and you will see the following. Enter your text and image URL to be voted on, and then click on deploy on chain.

The contract is now deployed on the ETC blockchain, and you can call its functions directly from inside BUIDL.

3.3 Go to the dapp section. Click on the Resources tab, and add the following as resources.
JavaScript: https://code.jquery.com/jquery-3.4.1.min.js
3.4 Next, copy and paste the following HTML code into the HTML editor.
3.5 Copy and paste the following JavaScript code into the JS editor.
3.6 Click on Run to see the dapp in action! You can now vote thumb up or down inside BUIDL.

3.7 Finally, you can publish the dapp.
Just click on the Publish button and give the dapp a name. Once published, you can share the published URL to the public to vote on your issue!
Last updated
Was this helpful?