-
Notifications
You must be signed in to change notification settings - Fork 10
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
create the CanvasOnchain contract and write the test #31
Conversation
@Abidoyesimze is attempting to deploy a commit to the BuidlGuidl Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very Nice! I am impressed on how good this is! I love the tests! :)
I've just added a discussion on a subject, I am not saying what you did is incorrect, just a concern.
/** | ||
* @dev Reset a specific pixel (only owner) | ||
* @param x X-coordinate of the pixel | ||
* @param y Y-coordinate of the pixel | ||
*/ | ||
function resetPixel(uint256 x, uint256 y) external onlyOwner { | ||
require(x < CANVAS_WIDTH, "X coordinate out of bounds"); | ||
require(y < CANVAS_HEIGHT, "Y coordinate out of bounds"); | ||
|
||
delete canvas[x][y]; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little bit authoritary, don't you think? Why the owner has the rights to erase a pixel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, we could override a pixel anyway, but, why erase? And without an event...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay will make changes for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little bit authoritary, don't you think? Why the owner has the rights to erase a pixel?
Well, that's true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, we could override a pixel anyway, but, why erase? And without an event...
I have remove the reset pixel functionality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need the deployment script, right?
@Abidoyesimze Nice, a smart contract, thanks! Please ensure you include a description for your PR. As a rule of thumb, always provide a proper description when creating a PR, it’s essential for collaboration. Please give the branch always a dedicated name, what you want to implement. Sorry to stress that, but thats what we try to teach you here in the batch program. Pls fix this first, then I will have a look at your code. And a deployment script would be nice. As soon as you have it deployed you can add the ABI to the |
Ohhhh yes but i don't know if we are deploying it to optimism mainnet that's why i haven't deploy it yet |
Sure, i'll make changes to the branch name but are we deploying the contract to optimism mainnet |
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: