Ethereum and Smart Contracts Flashcards
Ethereum 1.0
Different network propagation layer than Bitcoin
Different mean to deal with uncle blocks
Smart Contracts
Ethereum Network propagation
Upon recieving a new block the node verifies it before propagating it further
For n neighbours:
root of n neighbours get the block directly
n - root of n neighbours get the hash of the block
Eth uncle rewards
Uncle blocks are not part of the main chain but receive fraction of the reward for fairness purpose
Smart contract reentrancy
Can be used to reenter calling contract for it to receive funds for example. However if reentrancy is happening unexpectly it can be exploited
Is ethereum specific problem
Cross function reentrancy
Function A calls contract which then fallsback to calling contract and calls function B
Delegated reentrancy
Victim contract function is called and uses library contract which then allows to call the attacker contract again
create based reentrancy
malfunctioning function calls function a which creates a new contract that then calls the mal function again
Update smart contract
Create proxy contract which uses delegatecall to call the buisness logic.
If the contract is supposed to be updated change the address of the buisness logic contract
EVMPatch