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

Contract Architecture for GIVsavings #863

Open
divine-comedian opened this issue Mar 22, 2023 · 5 comments
Open

Contract Architecture for GIVsavings #863

divine-comedian opened this issue Mar 22, 2023 · 5 comments
Assignees
Labels
GIVfi GIVfi related - development, design, research and deployment!

Comments

@divine-comedian
Copy link

divine-comedian commented Mar 22, 2023

@KurtMerbeth began work on Vault wrapper token

https://github.com/KurtMerbeth/vault-wrapper/blob/main/contracts/ExtendedYVaultAssetProxy.sol

@divine-comedian began work on GIVsavings simulator to define math
https://docs.google.com/spreadsheets/d/1C2KAui26ur1p23rv-SsRo9I6pJAvnB4JPRqQf1pQb-E/edit?usp=sharing

This is more or less the current MVP logic:
image

@divine-comedian divine-comedian added the GIVfi GIVfi related - development, design, research and deployment! label Mar 22, 2023
@divine-comedian
Copy link
Author

Make contract upgradable?

Then we can add more fee logic in the future, or even to add a multi-vault GIVfi

or we make it non-upgradable and users need to migrate when we want to implement post-MVP features

could also use transition function that is written into yearn vaults
https://github.com/KurtMerbeth/vault-wrapper/blob/main/contracts/YVaultAssetProxy.sol

Verify the fee application method matches the GIVsavings simulator

  • go through GIVsavings simulator and contract again and check gas efficiency - make sure methods match up @KurtMerbeth
  • test cases - how to mock the yield generation - check if yearn has test cases
  • figure out upgradability later, we can deploy to testnets with non-upgradable contracts to at least begin testing

what do we do in the donation handler?

  • token recipient whitelist
  • can receive donations and can be claimed from donation handler
  • if a project wants to receive donations directly to their GIVsavings the donor donates it directly on the contract to a projects GIVsavings contract
  • we handle two lists - one for peer to peer donaitons, another for donations going into GIVsavings
  • multicall that handles a single donation made to many projects
  • cheaper gas for users
  • easier for front-end since they are dealing with only one contract

@divine-comedian
Copy link
Author

@KurtMerbeth

Contracts are pretty much ready to go.
will deploy this weekend using a mock on optimism-goerli

we can fine tune our APY calculations on a production network but for testing and FE development we should stick to using a test network

Kurt will also check on the feasibility on rDAI and how much code changes it would require

@divine-comedian
Copy link
Author

divine-comedian commented May 25, 2023

@KurtMerbeth

Deployed test contracts to optimis-goerli

info found here:
https://www.notion.so/giveth/GIVfi-Directory-3d926f00e13c4bf492746b3bb3f12f9a?pvs=4#c9c76288f8f548f9ada16dd9bff24a71

  • Verify contracts on Optimism Goerli
  • Provide details of contracts that need to be audited
  • investigate rDAI

@divine-comedian
Copy link
Author

Contracts to be audited: Mainly these two: https://github.com/Giveth/GIVfi/blob/main/WrappedVaults/contracts/GIVfiWrappedBeefyV6VaultUpgradeable.sol https://github.com/Giveth/GIVfi/blob/main/WrappedVaults/contracts/BeefyV6AssetProxyUpgradeable.sol

And the ones i made upgradeable: https://github.com/Giveth/GIVfi/tree/main/WrappedVaults/contracts/element-fi

TBD @divine-comedian should i remove all not-upgradeable contracts?

If you don't need them then yes, let's try to use only upgradable contracts as much as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GIVfi GIVfi related - development, design, research and deployment!
Projects
None yet
Development

No branches or pull requests

2 participants