Challenge 7: PTBs
In response to the recent pizza challenge, the city of Venice has implemented a smart contract to efficiently manage ingredients and prevent hoarding. Participants are invited to utilize these perishable ingredients, which must be used immediately to create dough.
Your objective is to gather the necessary ingredients—flour, water, yeast, and salt—and craft the dough required to capture the flag. This challenge can be solved using the Move CLI and the iota client ptb
command.
Deployed Contract Addresses:
Package: 0x2fce22869e453ec5bb6de2b3bee4cb94b2c3605abad9e9bbda477a75306bef2c
Contracts
ptb.move
module ctf::ptb {
public struct Flour has copy, drop {}
public struct Water has copy, drop {}
public struct Yeast has copy, drop {}
public struct Salt has copy, drop {}
public struct Dough has copy, drop {}
public struct Flag has key, store {
id: UID,
user: address
}
public fun get_ingredients(): (Flour, Water, Yeast, Salt) {
(Flour{}, Water{}, Yeast{}, Salt{})
}
public fun make_dough(_: Flour, _: Water, _: Yeast, _: Salt): Dough {
Dough{}
}
#[allow(lint(self_transfer))]
public fun get_flag(_: Dough, ctx: &mut TxContext) {
transfer::public_transfer(Flag {
id: object::new(ctx),
user: tx_context::sender(ctx)
}, tx_context::sender(ctx));
}
}
Related Articles
This challenge will introduce you to the PTB standard and how to use the Move CLI to interact with it. You should be familiar with the PTB standard and how to use the Move CLI to call the ptb
function.
Good luck in capturing your seventh flag!
Feedback Form