Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link
Hello World

Icon LinkHello World

This level will guide you through how to play the Fuelnaut game.

  1. Download the Fuel Wallet Icon Link extension, setup an account, and use the "Faucet" button to get some testnet funds.
  2. Press the "Connect Your Wallet" button below to connect your wallet if you haven't already.
  3. Open up the developer console in your browser window. You can play the game from here! Try typing in help() in the console to see a full list of helper variables and functions.
  4. Click the "Deploy New Instance" button to deploy a new instance of the level contract. Note: you will have to approve 2 transactions for this to work!
  5. Take a look at the level contract. To beat a level in the game, you'll need to make sure the attack_success function returns true. For this level, you'll have to call the hello_world function to set the value variable in the storage block to true.
  6. In the developer console, use the instance variable to call the hello_world function. (Hint: take a look at the fuels TypeScript docs ).
  7. Once you think you've beat the level, click the "Check If Completed" button to confirm.
contract;
 
abi MyContract {
    #[storage(write)]
    fn hello_world();
 
    #[storage(read)]
    fn attack_success() -> bool;
}
 
storage {
    value: bool = false,
}
 
impl MyContract for Contract {
    #[storage(write)]
    fn hello_world(){
        storage.value.write(true);
    }
 
    #[storage(read)]
    fn attack_success() -> bool{
        storage.value.read()
    }
}