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

Team fights #1812

Closed
poshdan opened this issue Dec 3, 2022 · 1 comment
Closed

Team fights #1812

poshdan opened this issue Dec 3, 2022 · 1 comment

Comments

@poshdan
Copy link
Collaborator

poshdan commented Dec 3, 2022

Goal

There is the potential to save up to ~60k gas by doing one fight transaction per 4 characters.
That amounts to about 9 cents saved across the team, or 2 cents per character average. That could be roughly 13% in savings.

Description

The player would select which characters to fight with (4 is not always available and not everyone has 4 characters), and select targets for each character individually before the transaction is initiated.

Technical requirements

Solidity

  • Create teamFight functions in both tokensManager and cryptoBlades contracts, make it take an array of character IDs for parameters, and an array of targets
  • Iterate through them and call the fight function for each character etc

Frontend

  • Create a way to display targets per character, make it known to the user they can queue character/target pairs up
  • Call getTarget separately per character and display them when choices are being made
  • Send the collective data into the transaction to the teamFight function in either contract depending on whether the gas tax is enabled or not (tokensmanager = yes tax)
  • If only one character has actions queued up, call the regular fight function instead, for lower gas overhead.
  • Anticipate an equivalent number of fight result events as many characters had fought, and display them in the usual fight result modal (this will require expanding it)

This idea should be built on recent changes by Equipment Manager #1763 and the TokensManager gas saving skip #1795

@remocwenn
Copy link

remocwenn commented Dec 12, 2022

This should be moved to the idea board
https://github.com/CryptoBlades/cryptoblades/projects/2#card-87302623

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants