Question: Write a smart contract, with three functions. Function calculate should take two parameters a and b of type uint256. It should return the result of
Function “calculate” should take two parameters a and b of type uint256. It should return the result of a + b.
A user must pay a small fee to be allowed to use the function calculate.
During deployment, the user can specify the fee. The user that deployed the contract should be able to withdraw the fees. It should be possible to specify the amount to be withdrawn. Code this into a function named “withdraw”.
For convenience, add a function that returns the balance of the contract. Call this function “getBalance”.
Add screenshots of your working code and output in form of a PDF document.
Step by Step Solution
3.40 Rating (172 Votes )
There are 3 Steps involved in it
Answer Step 1 Please refer below for all three functions asked and screenshot of output since accord... View full answer
Get step-by-step solutions from verified subject matter experts
