Git Product home page Git Product logo

community-challenges's People

Contributors

arbazkiraak avatar dependabot[bot] avatar duncancmt avatar fbitti avatar revmischa avatar zpano avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

community-challenges's Issues

RareNFT and nonce issue

The POC for the RareNFT assumes that the nonce doesn't change between the off-chain reading and the on-chain attack but that's unrealistic when there are other users.
Luckily, the nonce and the latest token id are in sync, and the latest id can be deduced on-chain in O(logN) time, where N is the number of users who called mint after we read nonce.
edit: Actually, MockERC721.nftId is public so we can just read it in O(1).

Challenge 6 description and POC are inaccurate/misleading

Challenge 6 (KYC) is not about signature malleability, which would consist in changing the signature without invalidating it. (Something is malleable if you can change its shape without breaking it.)
In this challenge, any invalid signature will do. There's no need to start from a valid signature and alter the last byte. In a minimal POC a user deploys an app and the attacker calls onboardWithSig using a 0 signature. That's it!

wipeout of Staking2Attack.sol in Challenge 5 is puzzling

Taking the situation of feeExempt as an example:
wipeout = uint248((tokenBalance * rewardBalance + lastReward * stake) / (stake - tokenBalance))
The above expression is equivalent to:
(wipeout + rewardBalance) = (wipeout - lastReward) * stake / tokenBalance
The left side of the equation represents the total reward(including we added) we need to receive, which is correct.
But there seems to be a issue on the right side of the equation, it should be the actual reward through calling sendReward function.
It is calculated through the following code:

amount = _tokenInfo.totalReward - _stakerInfo.lastReward; // line-1
if (balance != 0) {
    amount = (amount * staked) / balance; 
}

As line-1 shows, actually wipeout shouldn't be _TokenInfo.totalReward, which should be _TokenInfo.totalReward -_ StacerInfo.lastReward. _tokenInfo.totalReward - _stakerInfo.lastReward means the value added by calling function addReward, which is wipeout.
So I think the correct equation may be (wipeout + rewardBalance) = wipeout * stake / tokenBalance, which can be used to derive the actual expression of wideout as (tokenBalance * rewardBalance) / (staked - tokenBalance).
Of course, it's also possible that I misunderstood. Please help me correct it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.