Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. ---
  2.  
  3. ## 1. contract address
  4. 1. Every Contract Account has a **unique address** determined when the contract was created.
  5. 2. The address is derived from the sender address and the transaction nonce (=number of transactions sent from that address)
  6. 3. Can receive **transactions** and processes them exactly as programmed to govern and advance its account **storage**, **balance**, **event log** and to send **message calls** (="internal transactions") to other accounts.
  7.  
  8. ---
  9.  
  10. ## 2. binary code
  11. Every Contract Account is controlled by the **binary code** which resulted from the processed transaction that created it.
  12.  
  13. It represents the EVM assembly code that was compiled from a corresponding **contract template**
  14.  
  15. ---
  16.  
  17. ## 3. value balance
  18. Every Contract Account has a **value balance** in wei
  19. * 1 ether is `10**18` wei
  20. * can be modified by sending transactions that include value
  21.  
  22. ---
  23.  
  24. ## 4. storage
  25. Every Contract Account has a persistant non-enumerable key-val-**STORAGE**
  26. * **`256bit word`** keys => **`256bit word`** values
  27. * costly to read
  28. * more costly to initialize or modify
  29. * can only be read and written to directly by the controlling contract
  30.  
  31. ---
  32.  
  33. ## 5. memory
  34. Every Contract Account has a **MEMORY** per "message call"
  35. * linear and byte adressable
  36. * width of 256 bits
  37. * writes either 8bits or 256 bits wide
  38. * reads or writes expand memory by 256bit words when accesing ountouched memory word
  39. * expansion costs gas
  40. * expansion costs scale quadratically
  41.  
  42. ---
  43.  
  44. ## 6. stack
  45. Every Contract Account has a **STACK** machine data area
  46. * max 1024 elements of 256bit words
  47. * can copy element of top 16 to the top
  48. * can swap top with any of top 16
  49. * all other operations take from top and push result on top
  50. * possible to move stack elements to storage or memory to get deeper access
  51.  
  52. ---
  53.  
  54. ## 7. event log
  55. Every Contract Account has an event log.
  56. * events can not be accessed by contracts after they have been created
  57. * special indexed data structure mapping all the way up to block level
  58. * allows efficient access from outside the blockchain (e.g. by Dapps)
  59.  
  60. ---
  61.  
  62. ## 8. transaction history
  63. Every Contract Account has a **transaction history** associated with its unique **`"smart" contract account address`**.
  64.  
  65. ---
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement