---
description: https://app.hackthebox.com/challenges/Survival%20of%20the%20Fittest
---

# Survival of the Fittest

<figure><img src="https://content.gitbook.com/content/KdaWjtRJTpQ2jgzGIr4R/blobs/vpBaIG8njeg6CI3uI2lg/grafik.png" alt=""><figcaption></figcaption></figure>

At the Home site we got different links and a small game with two buttons Restart calls /restart and Attack calls the /flag

The Files are two sol smart contracts, one is Setup.sol and one is Creature.sol . In Setup.sol we find the function isSolved() which is satisfied when the Target-Address is 0 and in the Creature.sol we got the constructor with lifePoints of 20. Moreover the function punch deals 1  Damage but the strongAttack function is depending on the parameter \_damage. So in conclusion we need to transfer(Damage) 20 to the address to solve the Challange.

<figure><img src="https://content.gitbook.com/content/KdaWjtRJTpQ2jgzGIr4R/blobs/bIfKx5La7rrA1sO9pK3W/grafik.png" alt=""><figcaption></figcaption></figure>

The Documentation provides the needed information how to make some calls with cast

<figure><img src="https://content.gitbook.com/content/KdaWjtRJTpQ2jgzGIr4R/blobs/PUglrdCGEwLHrP8vKAih/grafik.png" alt=""><figcaption></figcaption></figure>

Furthermore at the connection we got the last missing informations

<figure><img src="https://content.gitbook.com/content/KdaWjtRJTpQ2jgzGIr4R/blobs/FnfDuHPBzBIweAjMFAkH/grafik.png" alt=""><figcaption></figcaption></figure>

Let's send the two cast calls

<figure><img src="https://content.gitbook.com/content/KdaWjtRJTpQ2jgzGIr4R/blobs/Mb669JYe49JFzGxqFyef/grafik.png" alt=""><figcaption></figcaption></figure>

At last call the flag by presing Attack and quickly copy+paste the flag.
