Skip to content

Sc 720 expand unit tests for topos related modules#676

Merged
FHieser merged 10 commits intofeature/ToposFundingManagerfrom
sc-720-expand-unit-tests-for-topos-related-modules
Oct 22, 2024
Merged

Sc 720 expand unit tests for topos related modules#676
FHieser merged 10 commits intofeature/ToposFundingManagerfrom
sc-720-expand-unit-tests-for-topos-related-modules

Conversation

@FHieser
Copy link
Contributor

@FHieser FHieser commented Oct 16, 2024

@Zitzak there is still a todo in there. Can you take a look, because I didnt quite understand why I couldnt increase the testvalue here.
Otherwise the Buy, buyFor, Sell and SellFor of the Restricted_Repayer_seizable are not tested, didnt know if we wanted to do that still or not
The coverage is still over 96% fyi

Zitzak and others added 7 commits October 15, 2024 11:21
The tokenvault cant be set during init because is created simultaneously to the BondingCurve contract.
It has to be added via Dependency Injection
@FHieser FHieser requested a review from Zitzak October 16, 2024 13:40
@linear
Copy link

linear bot commented Oct 16, 2024

bondingCurveFundingManager.withdrawProjectCollateralFee(address(0), 0);
}

function testWithdrawProjectCollateralFee_revertsGivenCallerIsOrchestratorAdmin(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also modifier in place test right? Function name is not reflecting this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope
This revert is not bound to a modifier, but the function in general should revert if called
technically we could remove the modifier that restricts calling the function in general.

└── and it should emit an event
*/

function testTransferOrchestratorToken_OnlyPaymentClientModifierSet(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function name different than the other tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed to Modifier in Position test
Thats what you had in mind here right?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes ser

Copy link
Collaborator

@Zitzak Zitzak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@FHieser FHieser merged commit 283388f into feature/ToposFundingManager Oct 22, 2024
@FHieser FHieser deleted the sc-720-expand-unit-tests-for-topos-related-modules branch October 22, 2024 12:49
Zitzak added a commit that referenced this pull request Feb 24, 2025
* [SC-213] Feat: Reserve Vault (#665)

* Create Reservepool Contract

* Rename and adapt

* Create FM_EXT_ReservePool_v1.t.sol

* Rename to TokenVault

* Adapt to not send native token

* Address comments

* Add:
- Internal function to modifier
- Trailing underscore to parameters
- Gherkin to test
- Cleaned up tests

* Update FM_EXT_TokenVault_v1.t.sol

---------

Co-authored-by: Zitzak <marvin88gr@gmail.com>
Co-authored-by: Marvin <43185740+Zitzak@users.noreply.github.com>

* Chore: Clean up TokenVault

* Feat: Add FM_BC_BondingSurface_Redeemable_Repayer_Seizable_v1 (#666)

* Create Reservepool Contract

* Rename and adapt

* Create FM_EXT_ReservePool_v1.t.sol

* Topos FM

* remove liquidity vault controller contracts

* Rename to TokenVault

* Adapt to not send native token

* Rename to Token Vault

* Address comments

* Outcomment Burn tests for now

* Create setTokenVault

* Fix most Burn functions

* AddSpentAllowance to ERC20Issuance

* Add _spendAllowance to BondingCurveBase

* Add _spendAllowance to BurnIssuanceFor

* Fix Dependency Issue

* Rename Redeemable to Redeeming

* Create FM_BC_BondingSurface_Redeeming_v1.sol

* WIP

* Add:
- Internal function to modifier
- Trailing underscore to parameters
- Gherkin to test
- Cleaned up tests

* restructure contracts

* Add tag for testing file split

* Setup seperate Tests

* Update Base BondingSurface test

* Rename Mock

* Remove Tests that are included in the base contract

* Remove parameters from BondingSurface Struct

* Go over comments

* Address comments

* Address Comments

* Adapt Naming of events

* Adding Restricted to the name

* Update comments

* resolve comments in implementations

* Fix: Finalize moving of error into funding manager base

* Fix: Typos in ERC20Issuance

* Chore: Start cleanup of FM_BC's

* Fix: Resolve failing test

Was mismatched with implementation, didn't cover the address(this) case.

---------

Co-authored-by: FHieser <felix_hieser@web.de>
Co-authored-by: Felix Hieser <47272854+FHieser@users.noreply.github.com>
Co-authored-by: Marvin Kruse <marvinkruse@users.noreply.github.com>

* Sc 720 expand unit tests for topos related modules (#676)

* Add empty BondingSurface test file

* Remove tokenVault from init

The tokenvault cant be set during init because is created simultaneously to the BondingCurve contract.
It has to be added via Dependency Injection

* Remove unnecessary overrides

* Add and adapt tests

* Adapt inheritance of functions

* Update Comments

* Update Tests

* Update fmt

* Add event to projectFeeCollected

* Address comments of PR

---------

Co-authored-by: Zitzak <marvin88gr@gmail.com>

* Sc 828 address omega review comments (#680)

* Add empty BondingSurface test file

* Remove tokenVault from init

The tokenvault cant be set during init because is created simultaneously to the BondingCurve contract.
It has to be added via Dependency Injection

* Remove unnecessary overrides

* Add and adapt tests

* Adapt inheritance of functions

* Update Comments

* Update Tests

* Update fmt

* Add event to projectFeeCollected

* Address comments of PR

* Revert if redeemamount reaches Min Reserve

* Check for Min Reserve in TransferOrchestrator Token

* Add MinReserveCheck to transferRepayment

* Rename Modifier

* Remove time casting

* Enable BuyFee

* Use function that can be overriden

* Add gap

* Make Min_Reserves variable based on Token Decimals

* Use SpotPrice to get StaticPrice

* adapt based on comments

* Update FM_BC_BondingSurface_Redeeming_v1.t.sol

---------

Co-authored-by: Zitzak <marvin88gr@gmail.com>

* Refactor Update the BondingSurface implementation to represent the code of conduct

* Add empty BondingSurface test file

* Remove tokenVault from init

The tokenvault cant be set during init because is created simultaneously to the BondingCurve contract.
It has to be added via Dependency Injection

* Remove unnecessary overrides

* Add and adapt tests

* Adapt inheritance of functions

* Update Comments

* Update Tests

* Update fmt

* Add event to projectFeeCollected

* Address comments of PR

* Revert if redeemamount reaches Min Reserve

* Check for Min Reserve in TransferOrchestrator Token

* Add MinReserveCheck to transferRepayment

* Rename Modifier

* Remove time casting

* Enable BuyFee

* Use function that can be overriden

* Add gap

* Make Min_Reserves variable based on Token Decimals

* Use SpotPrice to get StaticPrice

* adapt based on comments

* Update FM_BC_BondingSurface_Redeeming_v1.t.sol

* WIP push

* Rename seizable

* Make state internal

* Rename Parameters and Return Values

* Rename Contracts

* Adapt to code of conduct

* Adapting Interfaces to have Contract Overview Documentation

* Adapt Sectioning

* Adapt Mocks and Tests to parameter conventions

* Remove Todos/notes

* Adapt merge aftermath

* Update BondingSurface.sol

* Rename to prevent shadow

* Adapt remapping

* Address comments

* Adapt init

* Update inverter standard versioning

* Delete FM_BC_BondingSurface_RedeemingV1_exposed.sol

* Adapt Contract Naming Standards

* Fix naming references

* Fix test

* Update naming reference

* Adapt modifier to call internal function

* Adapt naming of internal function

* update modifier Naming

* Adapt tests

* Adapt naming internal functions

* Adapt Parameters

* Adapt naming of function state

* Adapt sections

* Update Interface Inheritance

* Update versioning

* Update natspec to be rule compliant

* Fix naming

* Delete ILiquidityVaultProviderWhitelist_v1.sol

* Remove Liquidity Vault Controller Interface

* Rename Modifier

* Add solmate as lib

* Revert "Add solmate as lib"

This reverts commit 050b9d2.

* Remove comment

* Adapt natspec

* Apply comment suggestions from code review

Co-authored-by: Marvin Kruse <marvinkruse@users.noreply.github.com>

* Adapt internal function state

* Add . to comments

* Adapt spacing in natspec comments

* Adapt spacing

* Replace @dev with @notice

* Adapt comment length

* Adapt naming

* Address Comments

* Adapt Version

* Reposition MIN_RESERVE

* Adapt sectioning

* Update more sectioning

* Add title section and increment version

---------

Co-authored-by: Zitzak <marvin88gr@gmail.com>
Co-authored-by: Marvin Kruse <marvinkruse@users.noreply.github.com>

* Add before and afterSell functionalities

* Add new contracts to scripts

* Rename Files to contain .t

* Add BondingSurface E2E

* Use ModuleRole

* Finish e2e tests

* Add Documentation

* Adapt the Deployment Parameters

* Create Contract Template.md

* 4/5 tests passing

* Create BondingSurface.md

* Fix missing tests

* update comment about eror tolerance

* refactor: resolve renaming mismatch in contracts

* fix: resolve RPC issue on tests

---------

Co-authored-by: Felix Hieser <47272854+FHieser@users.noreply.github.com>
Co-authored-by: Zitzak <marvin88gr@gmail.com>
Co-authored-by: Marvin <43185740+Zitzak@users.noreply.github.com>
Co-authored-by: FHieser <felix_hieser@web.de>
Co-authored-by: 0xNuggan <82726722+0xNuggan@users.noreply.github.com>
0xNuggan added a commit that referenced this pull request Apr 8, 2025
* [SC-213] Feat: Reserve Vault (#665)

* Create Reservepool Contract

* Rename and adapt

* Create FM_EXT_ReservePool_v1.t.sol

* Rename to TokenVault

* Adapt to not send native token

* Address comments

* Add:
- Internal function to modifier
- Trailing underscore to parameters
- Gherkin to test
- Cleaned up tests

* Update FM_EXT_TokenVault_v1.t.sol

---------

Co-authored-by: Zitzak <marvin88gr@gmail.com>
Co-authored-by: Marvin <43185740+Zitzak@users.noreply.github.com>

* Chore: Clean up TokenVault

* Feat: Add FM_BC_BondingSurface_Redeemable_Repayer_Seizable_v1 (#666)

* Create Reservepool Contract

* Rename and adapt

* Create FM_EXT_ReservePool_v1.t.sol

* Topos FM

* remove liquidity vault controller contracts

* Rename to TokenVault

* Adapt to not send native token

* Rename to Token Vault

* Address comments

* Outcomment Burn tests for now

* Create setTokenVault

* Fix most Burn functions

* AddSpentAllowance to ERC20Issuance

* Add _spendAllowance to BondingCurveBase

* Add _spendAllowance to BurnIssuanceFor

* Fix Dependency Issue

* Rename Redeemable to Redeeming

* Create FM_BC_BondingSurface_Redeeming_v1.sol

* WIP

* Add:
- Internal function to modifier
- Trailing underscore to parameters
- Gherkin to test
- Cleaned up tests

* restructure contracts

* Add tag for testing file split

* Setup seperate Tests

* Update Base BondingSurface test

* Rename Mock

* Remove Tests that are included in the base contract

* Remove parameters from BondingSurface Struct

* Go over comments

* Address comments

* Address Comments

* Adapt Naming of events

* Adding Restricted to the name

* Update comments

* resolve comments in implementations

* Fix: Finalize moving of error into funding manager base

* Fix: Typos in ERC20Issuance

* Chore: Start cleanup of FM_BC's

* Fix: Resolve failing test

Was mismatched with implementation, didn't cover the address(this) case.

---------

Co-authored-by: FHieser <felix_hieser@web.de>
Co-authored-by: Felix Hieser <47272854+FHieser@users.noreply.github.com>
Co-authored-by: Marvin Kruse <marvinkruse@users.noreply.github.com>

* Sc 720 expand unit tests for topos related modules (#676)

* Add empty BondingSurface test file

* Remove tokenVault from init

The tokenvault cant be set during init because is created simultaneously to the BondingCurve contract.
It has to be added via Dependency Injection

* Remove unnecessary overrides

* Add and adapt tests

* Adapt inheritance of functions

* Update Comments

* Update Tests

* Update fmt

* Add event to projectFeeCollected

* Address comments of PR

---------

Co-authored-by: Zitzak <marvin88gr@gmail.com>

* Sc 828 address omega review comments (#680)

* Add empty BondingSurface test file

* Remove tokenVault from init

The tokenvault cant be set during init because is created simultaneously to the BondingCurve contract.
It has to be added via Dependency Injection

* Remove unnecessary overrides

* Add and adapt tests

* Adapt inheritance of functions

* Update Comments

* Update Tests

* Update fmt

* Add event to projectFeeCollected

* Address comments of PR

* Revert if redeemamount reaches Min Reserve

* Check for Min Reserve in TransferOrchestrator Token

* Add MinReserveCheck to transferRepayment

* Rename Modifier

* Remove time casting

* Enable BuyFee

* Use function that can be overriden

* Add gap

* Make Min_Reserves variable based on Token Decimals

* Use SpotPrice to get StaticPrice

* adapt based on comments

* Update FM_BC_BondingSurface_Redeeming_v1.t.sol

---------

Co-authored-by: Zitzak <marvin88gr@gmail.com>

* Refactor Update the BondingSurface implementation to represent the code of conduct

* Add empty BondingSurface test file

* Remove tokenVault from init

The tokenvault cant be set during init because is created simultaneously to the BondingCurve contract.
It has to be added via Dependency Injection

* Remove unnecessary overrides

* Add and adapt tests

* Adapt inheritance of functions

* Update Comments

* Update Tests

* Update fmt

* Add event to projectFeeCollected

* Address comments of PR

* Revert if redeemamount reaches Min Reserve

* Check for Min Reserve in TransferOrchestrator Token

* Add MinReserveCheck to transferRepayment

* Rename Modifier

* Remove time casting

* Enable BuyFee

* Use function that can be overriden

* Add gap

* Make Min_Reserves variable based on Token Decimals

* Use SpotPrice to get StaticPrice

* adapt based on comments

* Update FM_BC_BondingSurface_Redeeming_v1.t.sol

* WIP push

* Rename seizable

* Make state internal

* Rename Parameters and Return Values

* Rename Contracts

* Adapt to code of conduct

* Adapting Interfaces to have Contract Overview Documentation

* Adapt Sectioning

* Adapt Mocks and Tests to parameter conventions

* Remove Todos/notes

* Adapt merge aftermath

* Update BondingSurface.sol

* Rename to prevent shadow

* Adapt remapping

* Address comments

* Adapt init

* Update inverter standard versioning

* Delete FM_BC_BondingSurface_RedeemingV1_exposed.sol

* Adapt Contract Naming Standards

* Fix naming references

* Fix test

* Update naming reference

* Adapt modifier to call internal function

* Adapt naming of internal function

* update modifier Naming

* Adapt tests

* Adapt naming internal functions

* Adapt Parameters

* Adapt naming of function state

* Adapt sections

* Update Interface Inheritance

* Update versioning

* Update natspec to be rule compliant

* Fix naming

* Delete ILiquidityVaultProviderWhitelist_v1.sol

* Remove Liquidity Vault Controller Interface

* Rename Modifier

* Add solmate as lib

* Revert "Add solmate as lib"

This reverts commit 050b9d2.

* Remove comment

* Adapt natspec

* Apply comment suggestions from code review

Co-authored-by: Marvin Kruse <marvinkruse@users.noreply.github.com>

* Adapt internal function state

* Add . to comments

* Adapt spacing in natspec comments

* Adapt spacing

* Replace @dev with @notice

* Adapt comment length

* Adapt naming

* Address Comments

* Adapt Version

* Reposition MIN_RESERVE

* Adapt sectioning

* Update more sectioning

* Add title section and increment version

---------

Co-authored-by: Zitzak <marvin88gr@gmail.com>
Co-authored-by: Marvin Kruse <marvinkruse@users.noreply.github.com>

* Add before and afterSell functionalities

* Add new contracts to scripts

* Rename Files to contain .t

* Add BondingSurface E2E

* Use ModuleRole

* Finish e2e tests

* Add Documentation

* Adapt the Deployment Parameters

* Create Contract Template.md

* 4/5 tests passing

* Create BondingSurface.md

* Fix missing tests

* update comment about eror tolerance

* refactor: resolve renaming mismatch in contracts

* fix: resolve RPC issue on tests

---------

Co-authored-by: Felix Hieser <47272854+FHieser@users.noreply.github.com>
Co-authored-by: Zitzak <marvin88gr@gmail.com>
Co-authored-by: Marvin <43185740+Zitzak@users.noreply.github.com>
Co-authored-by: FHieser <felix_hieser@web.de>
Co-authored-by: 0xNuggan <82726722+0xNuggan@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants