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()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly