Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Updated Part 1(JS) #37

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions finished/Piggybank.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
pragma solidity ^0.4.0;

contract PiggyBank {
uint256 private balance;
address public owner;

function PiggyBank() public {
owner = msg.sender;
balance = 0;
}

function deposit() public payable returns (uint256) {
balance += msg.value;
return balance;
}

function withdraw(uint256 withdrawAmount)
public
returns (uint256 remainingBal)
{
require(msg.sender == owner);
balance -= withdrawAmount;

msg.sender.transfer(withdrawAmount);

return balance;
}
}
345 changes: 345 additions & 0 deletions finished/src/constants.json

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions finished/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,30 @@ header {
#encryptMessageInput {
margin-bottom: 1rem;
}

.error-div {
margin-bottom: 12px;
}

.error-message {
min-height: 32px;
border: 1px solid #e88f97;
color: #24292e;
background: #fcf2f3;
border-radius: 8px;
display: flex;
justify-content: flex-start;
align-items: center;
padding: 8px 10px;
}
.error-message-icon {
margin-right: 8px;
flex: 0 0 auto;
}
.error-message-text {
overflow: auto;
}

.warning-invisible {
display: none;
}
Loading