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
Projectscodes 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 wei from Account to the contract using the function "deposit".
c Check contract balance using the "getContractBalance" function.
d Send wei from Account to Account using the function
"send".
e Check the balance of Account using the "getBalance" function.
Voting:
a Deploy the contract using your first account Main Account Name three proposals
to be voted as and Note: the input for proposals should be:
b Give voting rights to two additional accounts Accounts and
c Use Account to vote for proposal
d Use Account to delegate the vote to the Main Account
e Use Main Account to vote for proposal
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 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 now.
c Use the main Account to fund some amount to the crowdsale
d Use Account 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 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 ;
contract SimpleStorage
uint public storedData;
function setuint x public
storedData x;
function get public constant returns uint
return storedData;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
