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

feat: v3.0.3 #201

Merged
merged 20 commits into from
Sep 24, 2024
Merged

feat: v3.0.3 #201

merged 20 commits into from
Sep 24, 2024

Conversation

Schlagonia
Copy link
Collaborator

@Schlagonia Schlagonia commented Aug 2, 2024

Description

  • Allow for max uint to be passed to deposit that will pull all of the senders asset. 830ea11
  • Allow for name and symbol to be updated. 8b62b3f
  • Pass current_debt to asses_unrealised_losses_shares to not repull from storage. cbc66dc
  • Allow the vault address to be passed into process_report in order to account for airdropped tokens d2c57b2
  • Add an auto_allocate flag that if true will push as much debt as possible to the first strategy in the queue 5bc4ad5
  • Update VaultFactory interface to match Periphery Governance contract d268bbd
  • Simplify deposit and mint flow into one path 42afe0c

Checklist

  • I have run vyper and solidity linting
  • I have run the tests on my machine
  • I have followed commitlint guidelines
  • I have rebased my changes to the latest version of the main branch

Schlagonia and others added 2 commits August 2, 2024 12:21
* build: allow max uint

* fix: lint version

* forge install: openzeppelin-contracts

v4.9.5

* chore: oz sub module

* forge install: tokenized-strategy

v3.0.2

* test: fix foundry tests
@Schlagonia Schlagonia changed the title chore: upgrade ape feat: v3.0.3 Sep 4, 2024
Schlagonia and others added 10 commits September 6, 2024 12:20
* feat: set name and symbol

* chore: spech
* fix: config override

* chore: manual setup

* fix: requirements

* fix: ape version

* chore: rebase
* feat: report on self

* chore: comment

* chore: add back
* build: auto allocate

* build: dont revert debt increase

* chore: remove decrease revert

* chore: update spech

* chore: spech

* chore: comments

* fix: event
contracts/VaultV3.vy Outdated Show resolved Hide resolved
@param name The new name for the vault.
"""
assert msg.sender == self.role_manager, "not allowed"
self.name = name
Copy link
Contributor

Choose a reason for hiding this comment

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

I would emit the event here: UpdateName() so we can tract changes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

event seems unnecessary since the name is not expected to be updated often or needed to be stored locally. Understanding the current state is also not dependent on knowing when the name was updated.

@param symbol The new name for the vault.
"""
assert msg.sender == self.role_manager, "not allowed"
self.symbol = symbol
Copy link
Contributor

Choose a reason for hiding this comment

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

Add event: UpdateSymbol

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

same here #201 (comment)

self.name = name

@external
def setSymbol(symbol: String[32]):
Copy link
Contributor

Choose a reason for hiding this comment

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

Could changing the symbol value break portfolio trackers like debank? I hope they track everything by address but maybe they cache symbol and name. Just to keep in mind if we get questions after changing the symbol.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It may break some setups, but should be easy to fix.

It is the same functionality as the v2 vaults have and has been used in the past so i would assume people have a way to deal with it.

Comment on lines 1330 to 1331
else:
self.total_idle -= loss
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this case possible? It means that: self.total_idle > ERC20(_asset).balanceOf(self)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It should not be no. Since we always update total_idle based on the actual amounts even in the case of rounding problems

But seems we might as well add it in just in case.

Schlagonia and others added 2 commits September 16, 2024 21:38
Co-authored-by: spalen0 <[email protected]>
* feat: pack pf config

* chore: remove event

* chore: formatting

* test: interface updates

* chore: comments
Schlagonia and others added 2 commits September 19, 2024 15:04
* forge install: openzeppelin-contracts

v4.9.5

* chore: oz sub module

* test: fix foundry tests

* fix: deposit flow

* fix: zero total assets

* fix: flow

* test: full loss

* chore: comment

* test: add invariants

* fix: comments

* fix: user msg sender

* fix: comments

* fix: comment
@Schlagonia Schlagonia merged commit 92716ed into master Sep 24, 2024
8 checks passed
@Schlagonia Schlagonia deleted the 3_0_3 branch September 24, 2024 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants