This repository has been archived by the owner on Oct 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
[WIP] Endowment Allowlists as Iterable Mappings #321
Merged
SovereignAndrey
merged 23 commits into
daf-endowment-type
from
allowlists-iterablemappings
Aug 14, 2023
Merged
[WIP] Endowment Allowlists as Iterable Mappings #321
SovereignAndrey
merged 23 commits into
daf-endowment-type
from
allowlists-iterablemappings
Aug 14, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…der; move allowlist checks before final transfer; clean up comment lines;
SovereignAndrey
added a commit
that referenced
this pull request
Aug 17, 2023
* DAF Type added + logic to restrict withdrawals to Endowments + mapping to track DAF Approved Endows; * update tests for withdraws & create; add tests for UpdateDafApprovedEndowment endpoint; * fees refactored; exempt all endowment<>endowment transfers; fix tests; * update fee calculation logic: check combined withdraw fees @ each level; calc Endow-level fees after Protocol-level fees are deducted; Add non-Charity Deposit fee; Simplify Fees for Charity vs all other Types; Don't apply fees on Endowment<>Endowment transfers; * withdraw fee fixed * move checks up for better gas * closing an endowment now applies withdraws now (sans index fund beneficiaries, for now) * add tokens for locked/liquid into arrays for withdraw msgs sending * minor fixes; switch gasManager facet to IterableMapping for token balances; * small fixes * fix test * yarn format * refactor tests - first pass * break out fee calculation/transfers into separate internal function * clean-up new function * check for Endow<>Endow before fee calc function; * fix bug with deposit AP fee; Split refactoring; Tests reworked; * clean up fee settings & split to liquid @ creation time; * bug fixed * more tests added and refinements * add clear way to signify internal Endow<>Endow transfers; Tests work; * transfer logic moved to own internal function; * more withdraw tests work; * merge && update AccountStrategy + GasFwd; * SafeMath swapped out for FixedPointMath lib * getter/setter for DafApprovedEndowments mapping in Accounts Test Facet; * DAF tests; Other test tweaks; * refactor and simplify fees logic; DRY up code; * remove redundant zero fee setting steps in tests; * pull withdraw fees function back into main function; * more withdraw tests clean up; * lint * check amountLefterover > 0 before doing transfers * fix fee type applied in deposit tests * move withdraw fees logic into internal function * merge changes * deposit tests cleaned up & ready; deposit fees code tweaks; * withdraw tests clean up work; * withdraw tests clean up work; * await all teh things; no async describe; add erc20 zero deposit amount test; * dial back awaits * fix merge dups * lint * more tests added & fixes to contract logic * Allowlist Checks Helpers + Clean Up (#314) * contributor allowlist checks on deposit * beneficiary allowlist checks done against Beneficiary Address not sender; move allowlist checks before final transfer; clean up comment lines; * fix maturity check logic * allowlist check code moved into generic internal function * allowances allowlist checks use helper fnct; moved helper function to LibAccounts; * refactor helper function into address lib; * remove async for allowance test describes * tests added for deposit reversion @ maturity & checks of allowlistedContributors; * PR nit fix * remove unused function --------- Co-authored-by: Andrey <SovereignAndrey> * check index fund sender; fixes for tests; * charity >> charity-type transfers only; add test for this scenario; * [WIP] Endowment Allowlists as Iterable Mappings (#321) * contributor allowlist checks on deposit * beneficiary allowlist checks done against Beneficiary Address not sender; move allowlist checks before final transfer; clean up comment lines; * fix maturity check logic * allowlist check code moved into generic internal function * allowances allowlist checks use helper fnct; moved helper function to LibAccounts; * refactor helper function into address lib; * remove async for allowance test describes * tests added for deposit reversion @ maturity & checks of allowlistedContributors; * PR nit fix * Endowment Allowlists as Iterable Mappings * add tests for new AllowList Update endpoint; Minor tweaks to contract logic; * yarn format --------- Co-authored-by: Andrey <SovereignAndrey> * test fixes for allowances * remove allowlists from default endowment struct * fix create endowment tests * fix index fund tests * yarn format * test fixes & typescript clean up * yarn format * refactor allowlist mappings to use AllowlistType; * fix query facet tests * closing logic work; * refactor closing + withdraw logic to allow for withdraws from closed endowments, but only to beneficiary of record; * fix donation match tests * first round of PR review fixes * tighter incr/decr IterableMappingAddr logic + errors added * move charity fee corrections to applications multisig * remove unused function again * fix ts errors * Endow mapping refactor and namings sync'd-up (#325) * balances moved to nested mapping w/ VaultType key * activeStrategies mapping moved out of STATES * mapping namings synced to CamelCase * remove vaultType checks for balances and use the type itself in mapping; * fix test param --------- Co-authored-by: Andrey <SovereignAndrey> * little fixes * gasManager bug fix * more tests clean up * non-iterable balances; Allowlists mappings use bool not uint; fixes to closing logic & add more tests; check Daf Approved endow != AST on add & add test; EndowType Normal >> AST; * tsc fixes * update utils enum for FeeTypes; Add test for fee type combined withdraw fees & single fees cannot meet/exceed 100%; * test name fix --------- Co-authored-by: Andrey <SovereignAndrey>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Explanation of the solution
Make Allowlists as iterable mappings. Creates
EndowmentResponse
for use where we would previously return the rawEndowment
struct (allows minimal changes for downstream consumers of the EndowmentDetails query endpoint as AllowLists are popluated in there from Mapping Keys lists).Instructions on making this work
yarn
oryarn install
to install npm dependencies