Content pfp
Content
@
https://warpcast.com/~/channel/vyper
0 reply
0 recast
0 reaction

Vitalik Buterin pfp
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
163 recasts
603 reactions

Евгений pfp
Евгений
@ratnik
Eliminating Possible Overflows: Add overflow checks during calculations: python @view def getReturnPerSlot(x: uint256) -> uint256: return isqrt(x * isqrt(x)) // REWARD_DENOMINATOR Zero Address Checks: python @external def transfer(_to: address, _value: uint256) -> bool: assert _to != address(0), "Transfer to the zero address" assert self.balances[msg.sender] >= _value, "Insufficient balance" self.balances[msg.sender] -= _value self.balances[_to] += _value return True These changes will help improve the reliability and security of your smart contract.
0 reply
0 recast
0 reaction