Skip to content

Commit

Permalink
dev: altered rebasing logic curvefi#2
Browse files Browse the repository at this point in the history
  • Loading branch information
heswithme committed Sep 27, 2024
1 parent 526f34c commit f65736a
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions contracts/mocks/ERC20Rebasing.vy
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,8 @@ def allowance(_owner: address, _spender: address) -> uint256:

@external
def transfer(_to: address, _value: uint256) -> bool:
self._rebase()
_shares: uint256 = self._get_shares_by_coins(_value)

if _shares > 0:
# only rebase on nonzero transfers
self._rebase()

self.shares[msg.sender] -= _shares
self.shares[_to] += _shares
log Transfer(msg.sender, _to, _value)
Expand Down

0 comments on commit f65736a

Please sign in to comment.