Introduction to Smart Contract: Lecture 8b Flashcards
1
Q
Smart Contract Example
A
pragma solidity ^0.4.24
Contract Muffin {
uint private people = 0;
function eats() public"public,private,external,internal" "view,pure" returns (uint) { people = people + 1 return people; } }
eat()
2
Q
Payable
A
Where wallet is an Ethereum wallet or contract address:
wallet.transfer(value);
Find out balance in wallet:
address a = 0x0
uint balanceA = a.balance;