steemhunt / dixel-contract Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
Overall, we had 6 devs who participated in our community driven audit event.
@Nipol @junomonster @Jinmo @cryptocorgie @inmarelibero @assafom
I really appreciate everyone who participated in reviewing the code, and we successfully improved our contract in many ways:
We discussed about the fair reward distribution for the contributions considering the importance of the contribution and amount of work put into the reviewing process.
I hope you guys are okay with this distribution table below:
If you have any concerns or opinion on the distribution, please comment down here so we can discuss together.
I will distribute the reward (total $10,000 USDT) to the wallet address by the end of tomorrow if there are no issues brought up.
We were very satisfied with the result of this event, and we may have other bounty programs later on.
Let's keep in touch and hope to see you guys again soon! โค๏ธ
It causes a minting of a new edition of exactly the same pixels with the previous edition
updatePixels
if it has the same color data with the previous pixelOpenZeppelin's Context.sol and _msgSender()
are needed only if you plan to use meta-transactions, in which you'll pay for the user's gas fees. (reference)
Since most projects don't do that, I'm guessing that you won't do it either.
If that is so, you can consider removing Context.sol and replace all _msgSender()
s with msg.sender
. This will save a tiny bit of gas and perhaps be more clean.
Just checking - is this intended behavior?
#3 ensures updating pixel parameters are sorted ([0][0], [0][1], [0][2], [0][3] ... [15][15]) so it can prevent updating the same pixel multiple times in one transaction.
Let's check how much gas fee is added by this check when a user update all 256 pixels, and decide whether we allow this by design or not.
If we're going to add duplication checking,
not really an issue, opening just for discussion because I made a review on a closed PR and I wasn't sure it got viewed: #2 (review)
supposing that airdrop will be run only one tine, once closed it should not be reopenable
suggestion: add bool public airdropEnded
toDixelAirdrop.sol
, and a check before
dixel-contract/contracts/DixelAirdrop.sol
Line 60 in 07a6805
address[] public playerWallets;
in https://github.com/Steemhunt/dixel-contract/blob/main/contracts/Dixel.sol#L69 can accept multiple times the same wallet, because of use of playerWallets.push
if so, require(playerWallets.length < 0xffffffff, "MAX_USER_REACHED");
in https://github.com/Steemhunt/dixel-contract/blob/main/contracts/Dixel.sol#L95 behaves incorrectly, because playerWallets.length
would reach the limit also if it would contain 0xffffffff
times the same address
why don't use https://docs.openzeppelin.com/contracts/3.x/api/utils#EnumerableMap for address[] public playerWallets
?
Looks like running npx hardhat test
doesn't run all the tests anymore, but just one -
Contract: DixelArt
generate NFT
โ should revert tokenURI in JSON format generation if tokenId has not been minted yet
Dunno if I'm missing something. Running Dixel.test.js manually is working, but running DixelArt.test.js manually or just general hardhat test
just runs that one test. So far I haven't found the cause for the problem.
When the same user updates the pixels twice, the reward doesn't get accumulated.
Consider the following scenario:
Now let's say Alice and Bob claim their rewards.
Per my understanding, amount X will be lost in the contract (per design), but all of amounts Y+Z should get sent to Alice and Bob, as they are the only ones who minted so far.
However, when testing this scenario - after Alice and Bob claim their rewards - I see that there are more tokens in Dixel than amount X. These are tokens that are unclaimable as Alice and Bob, the only players, have already claimed their rewards, and they should have gotten all the rewards.
So this leads me to think that there is a fundamental error in the reward calculation, unless I'm missing something.
Here is a test file that will simulate this scenario and print Dixel's baseToken balance, so you can see there are more rewards than should be there.
Tomorrow I will try looking at this further and understand what's the root cause.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.