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

Dev #17

Merged
merged 149 commits into from
Feb 17, 2024
Merged

Dev #17

merged 149 commits into from
Feb 17, 2024

Conversation

0xwetzo
Copy link
Contributor

@0xwetzo 0xwetzo commented Feb 6, 2024

Description

Concise description of proposed changes, We recommend using screenshots and videos for better description

Additional Information

Related Issues

Closes #{issue number}

Note: If your changes are small and straightforward, you may skip the creation of an issue beforehand and remove this section. However, for medium-to-large changes, it is recommended to have an open issue for discussion and approval prior to submitting a pull request.

Your ENS/address:

* @notice Allows the players to stake their LP token to register for the tournament
*/
function stakeLPToken() public {
require(!isPlayer(msg.sender), "You have already staked");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider of changing to modifier.
More gas efficient is using if statement and revert with some predefined error like:

error AlreadyStaked();
..
..
if({condition}
{
revert AlreadyStaked();
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, good to know

* @param _storedMove The move the stored player made
*/
function resolveGame(address _senderAddr, uint8 _senderMove, address _storedAddr, uint8 _storedMove) internal {
if(_senderMove == _storedMove) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be just counting the score

* @param _points 0 = lost, 1 = draw, 2 = won
*/
function updateScore(address _player, uint8 _points) internal {
if(_player == address(0)) return; // We don't update VRF score

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most code could be done in a front end

@0xwetzo 0xwetzo merged commit 829e8e4 into main Feb 17, 2024
1 check failed
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

Successfully merging this pull request may close these issues.

4 participants