Content
@
0 reply
0 recast
0 reaction
Vitalik Buterin
@vitalik.eth
The contract here is a sublinear staking contract: if you are in the whitelist (specified as an ERC1155 collection), then you can stake N coins, and get a return of N ** 0.75 coins per slot, for as long as the contract has coins to pay for it. There is a fundedUntil mechanism that ensures that if the contract runs out of money, every staker gets rewarded for every slot up to the fundedUntil timestamp, and the mechanism doesn't turn into a fractional reserve. https://github.com/ethereum/research/blob/master/sublinear_staking/code.vy Bounty of total 2 ETH for identifying any bugs / vulnerabilities in the contract and proposing specific fixes, if multiple issues are found the bounty will be split based on severity. Amount: 2 ETH @bountybot
24 replies
202 recasts
907 reactions
Евгений
@ratnik
External Contract Calls Check: Ensure that all external contract calls are checked for successful execution: python success: bool = extcall STAKED_TOKEN_ADDRESS.transfer(msg.sender, totalOut, default_return_value=True) assert success Suggested Fixes: Using Safe Mathematical Operations: It is recommended to use safe functions for arithmetic operations to avoid overflows, such as safeMath. Adding Checks for Minting: python @external def mint(_to: address, _value: uint256): assert _value > 0, "Mint value should be greater than zero" self.balances[_to] += _value self.total_supply += _value Improving Whitelist Check: python @view def isEligible(user: address) -> bool: balance: uint256 = staticcall UNIQUEID_TOKEN_ADDRESS.balanceOf(user, UNIQUEID_TOKEN_COLLECTION) return balance > 0
0 reply
0 recast
0 reaction