# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://davidjosearaujo.gitbook.io/online-courses/blockchain-security/smart-contract-security/quiz.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
