Bet Architecture
This transaction is responsible for setting up a bet with various attributes such as its name, start date, end date, description, image link, category, and the date when accepting bets stops.
Within the prepare
block of the transaction, the code performs the following steps:
It retrieves the admin resource's reference by borrowing the admin capability from the authenticated account.
A new bet is created by invoking the
createBet
function on the admin resource, passing the specified attributes for the bet.The newly created bet resource is stored in the smart contract's storage using its storage path.
A public link is established between the bet's public path and its storage path to ensure access to the bet from other accounts.
By executing this transaction, users with the necessary authorization can create new bets within the FlowBetPalace application. The code ensures the proper storage of the bet resource and establishes a public link for easy access by other accounts.
Last updated