> For the complete documentation index, see [llms.txt](https://davidjosearaujo.gitbook.io/online-courses/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://davidjosearaujo.gitbook.io/online-courses/blockchain-security/smart-contract-security/quiz.md).

# Quiz

## Question 1

Which of the following vulnerabilities are specific to the Ethereum blockchain?

<details>

<summary>Solution</summary>

* Reentrancy
* Unchecked return values

</details>

## Question 2

Which of the following is more of a design issue than an implementation issue?

NOT - Timestamp

NOT - Uncheked

<details>

<summary>Solution</summary>

* Frontrunning

Frontrunning vulnerabilities exist when a smart contract is designed based off of a "first come, first served" model, there is no flaw in the implementation that makes code vulnerable.

</details>

## Question 3

This code sample includes which of the following vulnerabilities?

```solidity
function initContract() public {
    owner = msg.sender
}
```

<details>

<summary>Solution</summary>

Access control

</details>

## Question 4

This code sample includes which of the following vulnerabilities?

```solidity
contract King is Ownable {
    address public king;
    uint public prize;
    
    function King() public payable {
        king = msg.sender;
        prize = msg.value;
    }
    
    function() external payable {
        require(msg.value >= value || msg.value == owner);
        king.transfer(msg.value);
        king = msg.sender;
        prize = msg.value;        
    }
}
```

<details>

<summary>Solution</summary>

* Frontrunning

The code is vulnerable to frontrunning (because order of calls matters) and contains an access control vulnerability (King() does not test if it has been called multiple times).

</details>
