Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement dynamic balanceOf and totalSupply in stETH (Aragon-way) #28

Closed
ongrid opened this issue Sep 28, 2020 · 0 comments · Fixed by #70
Closed

Implement dynamic balanceOf and totalSupply in stETH (Aragon-way) #28

ongrid opened this issue Sep 28, 2020 · 0 comments · Fixed by #70
Assignees
Labels
enhancement New feature or request

Comments

@ongrid
Copy link
Contributor

ongrid commented Sep 28, 2020

Keeping the Aragon approach, implement dynamic outputs of balanceOf and totalSupply and related functions as specified in stETH token specification.

@ongrid ongrid self-assigned this Sep 28, 2020
ongrid added a commit that referenced this issue Sep 28, 2020
* link DePool and stETH
* implement basic getters
* minimal tests
ongrid added a commit that referenced this issue Sep 29, 2020
* link DePool and stETH
* implement basic getters
* minimal tests
ongrid added a commit that referenced this issue Sep 29, 2020
* link DePool and stETH
* implement basic getters
* minimal tests
ongrid added a commit that referenced this issue Sep 29, 2020
* Add DePool mock with initializer
* Add shares and totalShares vars to stETH
* Add shares-related getter
* Link math to totalControlledEthers of DePool
* Fix minimal tests
ongrid added a commit that referenced this issue Sep 29, 2020
* Add DePool mock with initializer
* Add shares and totalShares vars to stETH
* Add shares-related getter
* Link math to totalControlledEthers of DePool
* Fix minimal tests
ongrid added a commit that referenced this issue Sep 29, 2020
* Add tests for share-related getters (w. 0 shares)
* Mock DePool's totalControlledEther method
@ongrid ongrid added the enhancement New feature or request label Sep 30, 2020
ongrid added a commit that referenced this issue Oct 1, 2020
Issues: #3 and #28
* Remove mint
* Add processSubmission

Todo:
* Expose share getters via Mock
* Mock dePool contract
* share and balances unit-tests (on Mocks)
ongrid added a commit that referenced this issue Oct 1, 2020
Issues: #3 and #28
* Remove mint
* Add processSubmission

Todo:
* Expose share getters via Mock
* Mock dePool contract
* share and balances unit-tests (on Mocks)
ongrid added a commit that referenced this issue Oct 1, 2020
Issues: #3 and #28
* Remove mint
* Add processSubmission

Todo:
* Expose share getters via Mock
* Mock dePool contract
* share and balances unit-tests (on Mocks)
ongrid added a commit that referenced this issue Oct 5, 2020
Issues: #3 and #28
* Remove mint
* Add processSubmission
ongrid added a commit that referenced this issue Oct 5, 2020
* Split tests for zero- and non-zero supply

Issues: #3 and #28

ToDo:
* mint via processSubmission
* Mock token to expose totalShares
* Check effects on totalShares
* Double-check math
ongrid added a commit that referenced this issue Oct 5, 2020
* Split tests for zero- and non-zero supply
Issues: #3 and #28
ongrid added a commit that referenced this issue Oct 5, 2020
ongrid added a commit that referenced this issue Oct 6, 2020
Since stETH implements dynamic balances behavior
we rename the corresponding state variables.
Note: Still keeping traditional behavior - storing individual balances.

Related issies: #3 #28
ongrid added a commit that referenced this issue Oct 6, 2020
Since stETH implements dynamic balances behavior, rename the
conventional state variables and use _shares and _totalShares instead.
Note: Still keeping traditional behavior - storing individual balances
in newly-named vars -> subject to change.

Related issies: #3 #28
ongrid added a commit that referenced this issue Oct 6, 2020
Since stETH implements dynamic balances behavior, rename the
conventional state variables and use _shares and _totalShares instead.
Note: Still keeping traditional behavior - storing individual balances
in newly-named vars -> subject to change.

Related issies: #3 #28
ongrid added a commit that referenced this issue Oct 7, 2020
ongrid added a commit that referenced this issue Oct 7, 2020
ongrid added a commit that referenced this issue Oct 8, 2020
* Remove mint and burn interfaces
* Comment out DePool mint ext calls (user and treasury)
* Remove conventional mint and burn (not relevant)
* Remove processSubmission (will use mintShares..)
* Fix getPooledEthByShares
* Update tests (still broken)

ToDo:
* ISTETH: add mint- and burn-related interfaces
* Move share calculation to StETH token
* Fix tests
ongrid added a commit that referenced this issue Oct 8, 2020
* Get totalSupply from dePool.totalControlledEthers
* Return balanceOf in PooledEth
* Share calculation in mint
* Share calculation in burn (WIP, broken)
* Set totalControlledEther in unittests
ongrid added a commit that referenced this issue Oct 9, 2020
* Get totalSupply from dePool.totalControlledEthers
* Return balanceOf in PooledEth
* Share calculation in mint
* Share calculation in burn (WIP, broken)
* Set totalControlledEther in unittests
ongrid added a commit that referenced this issue Oct 9, 2020
* Change transfer math to share-based
* Additional checks in _transfer
ongrid added a commit that referenced this issue Oct 9, 2020
Since mint logic changed to share-based, there is no need to preserve
OZ's approach of logic/interface separation.

* Remove internal _mint function
* Move _mint's logic inside mint
* Update docstrings
ongrid added a commit that referenced this issue Oct 9, 2020
Replaced by mint(...) function that has more conventional name
lxzrv pushed a commit that referenced this issue Oct 15, 2020
* Add DePool mock with initializer
* Add shares and totalShares vars to stETH
* Add shares-related getter
* Link math to totalControlledEthers of DePool
* Fix minimal tests
lxzrv pushed a commit that referenced this issue Oct 15, 2020
* Add tests for share-related getters (w. 0 shares)
* Mock DePool's totalControlledEther method
lxzrv pushed a commit that referenced this issue Oct 15, 2020
Issues: #3 and #28
* Remove mint
* Add processSubmission
lxzrv pushed a commit that referenced this issue Oct 15, 2020
* Split tests for zero- and non-zero supply
Issues: #3 and #28
ongrid added a commit that referenced this issue Oct 16, 2020
* Switch to minting calculator located inside the token
* Rename _rewards to _totalRewards in distributeRewards func
* Add getRewardBase() public getter

ToDos:
* Fix getSPs().distributeRewards reverts
* zero feeBasePoint breaks mint (DePool.sol:535)
ongrid added a commit that referenced this issue Oct 18, 2020
* Switch to minting calculator located inside the token
* Rename _rewards to _totalRewards in distributeRewards func
* Add getRewardBase() public getter
* balanceOf calls getPooledEthByHolder for clarity
* simplify share calculation in mint function

Broken: StakingProvidersRegistry.sol:312 reverts in integration tests with stETH
ongrid added a commit that referenced this issue Oct 18, 2020
* Switch to minting calculator located inside the token
* Rename _rewards to _totalRewards in distributeRewards func
* Add getRewardBase() public getter
* balanceOf calls getPooledEthByHolder for clarity
* simplify share calculation in mint function

Broken: StakingProvidersRegistry.sol:312 reverts in integration tests with stETH
@ongrid ongrid linked a pull request Oct 22, 2020 that will close this issue
ongrid added a commit that referenced this issue Oct 22, 2020
* Add DePool mock with initializer
* Add shares and totalShares vars to stETH
* Add shares-related getter
* Link math to totalControlledEthers of DePool
* Fix minimal tests
ongrid added a commit that referenced this issue Oct 22, 2020
* Add tests for share-related getters (w. 0 shares)
* Mock DePool's totalControlledEther method
ongrid added a commit that referenced this issue Oct 22, 2020
Issues: #3 and #28
* Remove mint
* Add processSubmission
ongrid added a commit that referenced this issue Oct 22, 2020
* Split tests for zero- and non-zero supply
Issues: #3 and #28
ongrid added a commit that referenced this issue Oct 22, 2020
ongrid added a commit that referenced this issue Oct 22, 2020
Since stETH implements dynamic balances behavior, rename the
conventional state variables and use _shares and _totalShares instead.
Note: Still keeping traditional behavior - storing individual balances
in newly-named vars -> subject to change.

Related issies: #3 #28
ongrid added a commit that referenced this issue Oct 22, 2020
ongrid added a commit that referenced this issue Oct 22, 2020
* Get totalSupply from dePool.totalControlledEthers
* Return balanceOf in PooledEth
* Share calculation in mint
* Share calculation in burn (WIP, broken)
* Set totalControlledEther in unittests
ongrid added a commit that referenced this issue Oct 22, 2020
* Change transfer math to share-based
* Additional checks in _transfer
ongrid added a commit that referenced this issue Oct 22, 2020
Since mint logic changed to share-based, there is no need to preserve
OZ's approach of logic/interface separation.

* Remove internal _mint function
* Move _mint's logic inside mint
* Update docstrings
ongrid added a commit that referenced this issue Oct 22, 2020
Replaced by mint(...) function that has more conventional name
ongrid added a commit that referenced this issue Oct 22, 2020
* Switch to minting calculator located inside the token
* Rename _rewards to _totalRewards in distributeRewards func
* Add getRewardBase() public getter
* balanceOf calls getPooledEthByHolder for clarity
* simplify share calculation in mint function

Broken: StakingProvidersRegistry.sol:312 reverts in integration tests with stETH
dechjo pushed a commit to dechjo/lido-dao that referenced this issue Jan 26, 2021
* Add DePool mock with initializer
* Add shares and totalShares vars to stETH
* Add shares-related getter
* Link math to totalControlledEthers of DePool
* Fix minimal tests
dechjo pushed a commit to dechjo/lido-dao that referenced this issue Jan 26, 2021
* Add tests for share-related getters (w. 0 shares)
* Mock DePool's totalControlledEther method
dechjo pushed a commit to dechjo/lido-dao that referenced this issue Jan 26, 2021
Issues: #3 and lidofinance#28
* Remove mint
* Add processSubmission
dechjo pushed a commit to dechjo/lido-dao that referenced this issue Jan 26, 2021
* Split tests for zero- and non-zero supply
Issues: #3 and lidofinance#28
dechjo pushed a commit to dechjo/lido-dao that referenced this issue Jan 26, 2021
dechjo pushed a commit to dechjo/lido-dao that referenced this issue Jan 26, 2021
Since stETH implements dynamic balances behavior, rename the
conventional state variables and use _shares and _totalShares instead.
Note: Still keeping traditional behavior - storing individual balances
in newly-named vars -> subject to change.

Related issies: #3 lidofinance#28
dechjo pushed a commit to dechjo/lido-dao that referenced this issue Jan 26, 2021
dechjo pushed a commit to dechjo/lido-dao that referenced this issue Jan 26, 2021
* Get totalSupply from dePool.totalControlledEthers
* Return balanceOf in PooledEth
* Share calculation in mint
* Share calculation in burn (WIP, broken)
* Set totalControlledEther in unittests
dechjo pushed a commit to dechjo/lido-dao that referenced this issue Jan 26, 2021
* Change transfer math to share-based
* Additional checks in _transfer
dechjo pushed a commit to dechjo/lido-dao that referenced this issue Jan 26, 2021
Since mint logic changed to share-based, there is no need to preserve
OZ's approach of logic/interface separation.

* Remove internal _mint function
* Move _mint's logic inside mint
* Update docstrings
dechjo pushed a commit to dechjo/lido-dao that referenced this issue Jan 26, 2021
Replaced by mint(...) function that has more conventional name
dechjo pushed a commit to dechjo/lido-dao that referenced this issue Jan 26, 2021
* Switch to minting calculator located inside the token
* Rename _rewards to _totalRewards in distributeRewards func
* Add getRewardBase() public getter
* balanceOf calls getPooledEthByHolder for clarity
* simplify share calculation in mint function

Broken: StakingProvidersRegistry.sol:312 reverts in integration tests with stETH
tamtamchik added a commit that referenced this issue Nov 17, 2024
test: integration tests on devnet 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant