Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a claim_starter_pack() to provide Beasts with free setup of starting consumables #25

Open
loothero opened this issue Oct 16, 2024 · 0 comments
Assignees

Comments

@loothero
Copy link
Member

loothero commented Oct 16, 2024

1 extra life
10 attack potions
10 revival potions

These will need to be added to the ERC20 Consumables and client will need a claim button

Summit and ERC20Consumables will provide a claim_free_consumables() endpoint. This endpoint will not need to provide an ownership check as anyone will be able to claim the free consumables but they will always be sent to the owner of the Beast.

When claim_free_consumables is called from Summit, it'll just call the claims on each of the ERC20s and update

fn claim_starter_kit(beast_token_ids: Span<u64>)
        {
            // IERC20RevivalDispatcher.has_claimed_starter_kit(beast_token_id) -> bool
            // IERC20ExtraLifeDispatcher.has_claimed_starter_kit(beast_token_id) -> bool
            // IERC20AttackPotionDispatcher.has_claimed_starter_kit(beast_token_id) -> bool
            // If one of these is false, we need to issue the claim to that ERC20 Consumable Contract
            if true {
                let has_claimed = get!(self.world(), token_id, LiveBeastStats).has_claimed_starter_kit;
                if !has_claimed {
                    // check if we have this data in torri, if not, add it
                }
            } flase {
                // IERC20ConsumableDispatcher.claim_starter_kit(beast_token_id) -> bool
                // set the has_claimed_starter_kit to true
            }
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants