Question: This homework can be completed during and after the class lab session. Please follow the instructions below and include the required information in your lab

This homework can be completed during and after the class lab session. Please follow the
instructions below and include the required information in your lab report. The homework is due
in iCollege by the date specified on the Assignment in iCollege.
Start a virtual blockchain following the handout "Guide to Using the Remix Ethereum
Environment" and deploy the following Solidity contracts on your private blockchain (codes are
in the programming folder on iCollege). Please note that you need to take screen shots of the
contract status (input or output) after each step and include in your report. Also, include any
modified codes in your report. All the contract files are available in the "Homework and
Projects/codes" subfolder on iCollege.
Simple Storage
a. Deploy the contract.
b. Set the storedData variable to a value other than zero.
c. Check the value using the get function.
TransferMoney
a. Deploy the contract
b. Send 100,000,000 wei from Account 1 to the contract using the function "deposit".
c. Check contract balance using the "getContractBalance" function.
d. Send 1,000,000,000,000 wei from Account 1 to Account 2 using the function
"send".
e. Check the balance of Account 2 using the "getBalance" function.
Voting:
a. Deploy the contract using your first account (Main Account). Name three proposals
to be voted as 0,1, and 2. Note: the input for proposals should be: 0,1,2
b. Give voting rights to two additional accounts (Accounts 2 and 3)
c. Use Account 2 to vote for proposal 1
d. Use Account 3 to delegate the vote to the Main Account
e. Use Main Account to vote for proposal 2
f. Can you add a constant function to the Voting contract to show the winning
proposal? Include your code and results.
Crowdfunding
a. Deploy the contract using your Account 2. Set deadline (in number of minutes) and
funding goal in number of eithers. The funding goal should be a small number so
that funds from your accounts can reach the goal.
b. Record the balance in your Account 2 now.
c. Use the main Account to fund some amount to the crowdsale
d. Use Account 3 to fund some additional amount to the crowdsale so that the total
funds are more than the funding goal.
e. Run the CheckGoalReached function.
f. What is the balance in your Account 2 now?
g. Can you modify the codes to only accept the amount stated in the funding goal if
the funding succeeds and refund the excess money to the backers (roughly
proportional to how much they contribute)? Include your code and results.
Back
SimpleStorage
pragma solidity ^0.4.0;
contract SimpleStorage {
uint public storedData;
function set(uint x) public {
storedData = x;
}
function get() public constant returns (uint){
return storedData;
}
}
This homework can be completed during and after

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!