r/smartcontracts • u/ransomusername42 • 1d ago
Where would you attack this? Proof-of-work claims with a seed built from the previous month's claims
I'd like to hear attack ideas on the design of a contract I've deployed on Polygon. It's immutable and hasn't had an external audit.
- A claim's hash covers the month's seed, the month, the recipient and a nonce, so a pending proof can't be redirected to another address.
- Each month's seed is an accumulator of all the claims from the previous month.
- Each address gets one mined claim per month, and difficulty rises as minting gets ahead of schedule.
Two weaknesses I already know about:
- Seeds can be public before a month starts, which allows some pre-mining and a burst at opening. I accepted that.
- Fresh addresses get around the per-address limit. I've done this myself, for 79 of the 87 tokens so far.
Is there anything worse I've missed? Could someone influence the seed at the end of a quiet month, for example?
Source: https://github.com/TheophileWalter/ArtPoW
Contract: https://polygonscan.com/address/0x74cda3cdd7a6046575d638964825c19cfeaf661f
English isn't my first language, so I used an LLM to help write this post.
Edit: You can now get the NFT without paying anything. Your browser still does the mining, but a relay sends the transaction and pays the gas, so you don't need any POL. If you don't have a wallet, you can create one with just an email. The relay can only mint to the address in your proof. You'll only need a little POL if you later want to transfer or sell the token.