-
Notifications
You must be signed in to change notification settings - Fork 10
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
Refactor price logic #192
Merged
Merged
Refactor price logic #192
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
NunoAlexandre
approved these changes
Oct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGMT 👌
mapping(address liquidityPool => TrancheTokenPrice) prices; | ||
} | ||
|
||
struct TrancheTokenPrice { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
ilinzweilin
approved these changes
Oct 24, 2023
NunoAlexandre
approved these changes
Oct 24, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✨
hieronx
added a commit
that referenced
this pull request
Oct 26, 2023
* fix: add tranche (#180) * Align approval flow and interface with EIP draft (#178) * Explore new approval flow * Fix permit logic * Allowance checks * Remove fee-on-transfer support * Fix revert message * Fix tests * Remove unused function from interface * Fix comment * Naming * Remove console * Remove duplicate transfer from function * Fix balance check * Add operator param * Align naming of view functions * Address pr comments * disallow freezing the zero address (#181) * Fix permit fr with lower asset amounts (#183) * fix frontrunning with smaller asset amounts with permits * add test condition Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> * Make restrictionManagerFactory mutable on PoolManager (#182) * Make restrictionManagerFactory mutable on PoolManager * group RestrictionManagerFactory with other public vars * Preview methods should revert (#186) * Remove preview methods from investment mgr * Add comment * Format * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> --------- Co-authored-by: Adam Stox <[email protected]> * Add IERC7540 (#190) * Add IERC7540 * Update interface * Update ERC-20 interfaces * Fix comment * Skip slither step * Fix price calculation issue on decrease executions (#184) * Add test for failing price conversion on decrease * Attempt to fix conversions * Automatically claim deposits on trigger request redeem (#187) * Automatically claim deposits on trigger request redeem * trigger redemptions when user still has tokens in escrow (#189) * trigger redemptions when user still has tokens in escrow Signed-off-by: ilin <[email protected]> * fix comments Signed-off-by: ilin <[email protected]> * add fixes from review * add fixes from review * add fixes from review --------- Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> * fix permit (#195) * fix permit * consolidate code * fmt * remove redundant require from permitted deposit request * Refactor price logic (#192) * Refactor price logic * Remove redundant comments * Check transfer restriction on request redeem (#193) * Check transfer restriction on request redeem * Fix * Format * Freeze check both directions * Fix test * Change member checks * Update checks again * Revert cancel rely if no target is scheduled (#197) * Check price is newer (#198) --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> Co-authored-by: Adam Stox <[email protected]>
hieronx
added a commit
that referenced
this pull request
Oct 26, 2023
* fix: add tranche (#180) * Align approval flow and interface with EIP draft (#178) * Explore new approval flow * Fix permit logic * Allowance checks * Remove fee-on-transfer support * Fix revert message * Fix tests * Remove unused function from interface * Fix comment * Naming * Remove console * Remove duplicate transfer from function * Fix balance check * Add operator param * Align naming of view functions * Address pr comments * disallow freezing the zero address (#181) * Fix permit fr with lower asset amounts (#183) * fix frontrunning with smaller asset amounts with permits * add test condition Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> * Make restrictionManagerFactory mutable on PoolManager (#182) * Make restrictionManagerFactory mutable on PoolManager * group RestrictionManagerFactory with other public vars * Preview methods should revert (#186) * Remove preview methods from investment mgr * Add comment * Format * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> --------- Co-authored-by: Adam Stox <[email protected]> * Add IERC7540 (#190) * Add IERC7540 * Update interface * Update ERC-20 interfaces * Fix comment * Skip slither step * Fix price calculation issue on decrease executions (#184) * Add test for failing price conversion on decrease * Attempt to fix conversions * Automatically claim deposits on trigger request redeem (#187) * Automatically claim deposits on trigger request redeem * trigger redemptions when user still has tokens in escrow (#189) * trigger redemptions when user still has tokens in escrow Signed-off-by: ilin <[email protected]> * fix comments Signed-off-by: ilin <[email protected]> * add fixes from review * add fixes from review * add fixes from review --------- Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> * Add ERC165 support * fix permit (#195) * fix permit * consolidate code * fmt * remove redundant require from permitted deposit request * Refactor price logic (#192) * Refactor price logic * Remove redundant comments * Fix comments * Check transfer restriction on request redeem (#193) * Check transfer restriction on request redeem * Fix * Format * Freeze check both directions * Fix test * Change member checks * Update checks again * Change interfaces * Revert cancel rely if no target is scheduled (#197) * Check price is newer (#198) * Fix approve in test setup * Fix redundant investment mgr deployment * Update interface style * Format * Fix pool manager typo * Undo --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> Co-authored-by: Adam Stox <[email protected]>
hieronx
added a commit
that referenced
this pull request
Oct 30, 2023
* fix: add tranche (#180) * Align approval flow and interface with EIP draft (#178) * Explore new approval flow * Fix permit logic * Allowance checks * Remove fee-on-transfer support * Fix revert message * Fix tests * Remove unused function from interface * Fix comment * Naming * Remove console * Remove duplicate transfer from function * Fix balance check * Add operator param * Align naming of view functions * Address pr comments * disallow freezing the zero address (#181) * Fix permit fr with lower asset amounts (#183) * fix frontrunning with smaller asset amounts with permits * add test condition Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> * Make restrictionManagerFactory mutable on PoolManager (#182) * Make restrictionManagerFactory mutable on PoolManager * group RestrictionManagerFactory with other public vars * Preview methods should revert (#186) * Remove preview methods from investment mgr * Add comment * Format * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> --------- Co-authored-by: Adam Stox <[email protected]> * Add IERC7540 (#190) * Add IERC7540 * Update interface * Update ERC-20 interfaces * Fix comment * Skip slither step * Fix price calculation issue on decrease executions (#184) * Add test for failing price conversion on decrease * Attempt to fix conversions * Automatically claim deposits on trigger request redeem (#187) * Automatically claim deposits on trigger request redeem * trigger redemptions when user still has tokens in escrow (#189) * trigger redemptions when user still has tokens in escrow Signed-off-by: ilin <[email protected]> * fix comments Signed-off-by: ilin <[email protected]> * add fixes from review * add fixes from review * add fixes from review --------- Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> * Fix event callers (#191) * fix permit (#195) * fix permit * consolidate code * fmt * remove redundant require from permitted deposit request * Refactor price logic (#192) * Refactor price logic * Remove redundant comments * Check transfer restriction on request redeem (#193) * Check transfer restriction on request redeem * Fix * Format * Freeze check both directions * Fix test * Change member checks * Update checks again * Revert cancel rely if no target is scheduled (#197) * Check price is newer (#198) * PoolManager events * Add 7540 reference to readme * Update image * Reorganize methods in liquidity pool * Reorder more * Use inheritdoc to extend comments in liquidity pool contract * Public => external * Reordering --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> Co-authored-by: Adam Stox <[email protected]>
hieronx
added a commit
that referenced
this pull request
Jan 4, 2024
* Start adding convert invariant * Remove collect functions, remove sanity checks for incoming calls, fix price conversion * Remove deposit/redeem price calculations * Add redeem request internal method * Simplify convert methods * Remove some comments * Fix tests * More simplfications * Fix tests * Fix typo * Fixes * Simplify math * Simplify LP lookups * Remove internal touint128 in test * Consistent naming * Rename lp values / orderbook to investment state * Fix price type * Fix convert invariants, add maxdeposit/redeem invariants * Start adapting investor handler to support multiple investors * Set 2 investors * Set up base handler * fix: add tranche (#180) * Align approval flow and interface with EIP draft (#178) * Explore new approval flow * Fix permit logic * Allowance checks * Remove fee-on-transfer support * Fix revert message * Fix tests * Remove unused function from interface * Fix comment * Naming * Remove console * Remove duplicate transfer from function * Fix balance check * Add operator param * Align naming of view functions * Address pr comments * disallow freezing the zero address (#181) * Fix permit fr with lower asset amounts (#183) * fix frontrunning with smaller asset amounts with permits * add test condition Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> * Make restrictionManagerFactory mutable on PoolManager (#182) * Make restrictionManagerFactory mutable on PoolManager * group RestrictionManagerFactory with other public vars * Preview methods should revert (#186) * Remove preview methods from investment mgr * Add comment * Format * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> --------- Co-authored-by: Adam Stox <[email protected]> * Add IERC7540 (#190) * Add IERC7540 * Update interface * Update ERC-20 interfaces * Fix comment * Skip slither step * Fix price calculation issue on decrease executions (#184) * Add test for failing price conversion on decrease * Attempt to fix conversions * Automatically claim deposits on trigger request redeem (#187) * Automatically claim deposits on trigger request redeem * trigger redemptions when user still has tokens in escrow (#189) * trigger redemptions when user still has tokens in escrow Signed-off-by: ilin <[email protected]> * fix comments Signed-off-by: ilin <[email protected]> * add fixes from review * add fixes from review * add fixes from review --------- Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> * Work on multiple pools * Fix multiple pool setup * Fix investor handler * Start working on decrease * Work on executing decrease invest orders * Work on kv store in handler base * fix permit (#195) * fix permit * consolidate code * fmt * remove redundant require from permitted deposit request * Refactor price logic (#192) * Refactor price logic * Remove redundant comments * Check transfer restriction on request redeem (#193) * Check transfer restriction on request redeem * Fix * Format * Freeze check both directions * Fix test * Change member checks * Update checks again * Revert cancel rely if no target is scheduled (#197) * Check price is newer (#198) * Fix key type * Clean up * Reorganize unit tests * More renames * Rename invariant test folder * Fix imports * Add price invariants * Disable fork tests for now * Fix old imports, typo * Clean up * Currency setup * Remove handler * Fix build * Move tests * Env var for fork tests * Clean up fork & integration tests * Rename * Set up cross-chain fork tests * Add admin signer setup * Remove foundry rpc urls * Clean up * Move around * Add CI for fork tests * Update celo messages * Add deployment info * Move spells * Determinism check * Set up testnet support * Format * Remove redundant rpc urls * Cron job for fork tests * Remove duplicated code * Add mathlib and safetransferlib tests * Fix typo * Reorganize * Format * Clean up folder structure * More renames * Delete duplicate files * Remove xcm router * Remove old import * Remove unused param * Add forwarder test * Add BytesLib test * Typo * Revert * Add investment manager tests * Add more tests * Re-enable * Ad some more unit tests * 2 more * Add more sanity check tests * Rename * Add more * Add allowed currency for requestRedeem check * Fix compilation * Reduce params * Fix ci path * Fix another ci path * Remove unused ci code * Refactor shadow var handling * Format * Fix slow builds * Exclude invariant tests from code cov * Remove more merge conflict issues * Add old metadata check * Fix typo * Disable some invariants for now * Include invariant tests in coverage again --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> Co-authored-by: Adam Stox <[email protected]>
hieronx
added a commit
that referenced
this pull request
Jan 4, 2024
* Start adding convert invariant * Remove collect functions, remove sanity checks for incoming calls, fix price conversion * Remove deposit/redeem price calculations * Add redeem request internal method * Simplify convert methods * Remove some comments * Fix tests * More simplfications * Fix tests * Fix typo * Fixes * Simplify math * Simplify LP lookups * Remove internal touint128 in test * Consistent naming * Rename lp values / orderbook to investment state * Fix price type * Fix convert invariants, add maxdeposit/redeem invariants * Start adapting investor handler to support multiple investors * Set 2 investors * Set up base handler * fix: add tranche (#180) * Align approval flow and interface with EIP draft (#178) * Explore new approval flow * Fix permit logic * Allowance checks * Remove fee-on-transfer support * Fix revert message * Fix tests * Remove unused function from interface * Fix comment * Naming * Remove console * Remove duplicate transfer from function * Fix balance check * Add operator param * Align naming of view functions * Address pr comments * disallow freezing the zero address (#181) * Fix permit fr with lower asset amounts (#183) * fix frontrunning with smaller asset amounts with permits * add test condition Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> * Make restrictionManagerFactory mutable on PoolManager (#182) * Make restrictionManagerFactory mutable on PoolManager * group RestrictionManagerFactory with other public vars * Preview methods should revert (#186) * Remove preview methods from investment mgr * Add comment * Format * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> --------- Co-authored-by: Adam Stox <[email protected]> * Add IERC7540 (#190) * Add IERC7540 * Update interface * Update ERC-20 interfaces * Fix comment * Skip slither step * Fix price calculation issue on decrease executions (#184) * Add test for failing price conversion on decrease * Attempt to fix conversions * Automatically claim deposits on trigger request redeem (#187) * Automatically claim deposits on trigger request redeem * trigger redemptions when user still has tokens in escrow (#189) * trigger redemptions when user still has tokens in escrow Signed-off-by: ilin <[email protected]> * fix comments Signed-off-by: ilin <[email protected]> * add fixes from review * add fixes from review * add fixes from review --------- Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> * Work on multiple pools * Fix multiple pool setup * Fix investor handler * Start working on decrease * Work on executing decrease invest orders * Work on kv store in handler base * fix permit (#195) * fix permit * consolidate code * fmt * remove redundant require from permitted deposit request * Refactor price logic (#192) * Refactor price logic * Remove redundant comments * Check transfer restriction on request redeem (#193) * Check transfer restriction on request redeem * Fix * Format * Freeze check both directions * Fix test * Change member checks * Update checks again * Revert cancel rely if no target is scheduled (#197) * Check price is newer (#198) * Fix key type * Clean up * Reorganize unit tests * More renames * Rename invariant test folder * Fix imports * Add price invariants * Disable fork tests for now * Fix old imports, typo * Clean up * Currency setup * Remove handler * Fix build * Move tests * Env var for fork tests * Clean up fork & integration tests * Rename * Set up cross-chain fork tests * Add admin signer setup * Remove foundry rpc urls * Clean up * Move around * Add CI for fork tests * Update celo messages * Add deployment info * Move spells * Determinism check * Set up testnet support * Format * Remove redundant rpc urls * Cron job for fork tests * Remove duplicated code * Add mathlib and safetransferlib tests * Fix typo * Reorganize * Format * Clean up folder structure * More renames * Delete duplicate files * Remove xcm router * Remove old import * Remove unused param * Add forwarder test * Add BytesLib test * Typo * Revert * Add investment manager tests * Add more tests * Re-enable * Ad some more unit tests * 2 more * Add more sanity check tests * Rename * Add more * Add allowed currency for requestRedeem check * Fix compilation * Reduce params * Fix ci path * Fix another ci path * Remove unused ci code * Refactor shadow var handling * Format * Fix slow builds * Exclude invariant tests from code cov * Remove more merge conflict issues * Add old metadata check * Fix typo * Simplify Axelar router * Disable some invariants for now * Include invariant tests in coverage again --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> Co-authored-by: Adam Stox <[email protected]>
hieronx
added a commit
that referenced
this pull request
Jan 5, 2024
* Start adding convert invariant * Remove collect functions, remove sanity checks for incoming calls, fix price conversion * Remove deposit/redeem price calculations * Add redeem request internal method * Simplify convert methods * Remove some comments * Fix tests * More simplfications * Fix tests * Fix typo * Fixes * Simplify math * Simplify LP lookups * Remove internal touint128 in test * Consistent naming * Rename lp values / orderbook to investment state * Fix price type * Fix convert invariants, add maxdeposit/redeem invariants * Start adapting investor handler to support multiple investors * Set 2 investors * Set up base handler * fix: add tranche (#180) * Align approval flow and interface with EIP draft (#178) * Explore new approval flow * Fix permit logic * Allowance checks * Remove fee-on-transfer support * Fix revert message * Fix tests * Remove unused function from interface * Fix comment * Naming * Remove console * Remove duplicate transfer from function * Fix balance check * Add operator param * Align naming of view functions * Address pr comments * disallow freezing the zero address (#181) * Fix permit fr with lower asset amounts (#183) * fix frontrunning with smaller asset amounts with permits * add test condition Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> * Make restrictionManagerFactory mutable on PoolManager (#182) * Make restrictionManagerFactory mutable on PoolManager * group RestrictionManagerFactory with other public vars * Preview methods should revert (#186) * Remove preview methods from investment mgr * Add comment * Format * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> --------- Co-authored-by: Adam Stox <[email protected]> * Add IERC7540 (#190) * Add IERC7540 * Update interface * Update ERC-20 interfaces * Fix comment * Skip slither step * Fix price calculation issue on decrease executions (#184) * Add test for failing price conversion on decrease * Attempt to fix conversions * Automatically claim deposits on trigger request redeem (#187) * Automatically claim deposits on trigger request redeem * trigger redemptions when user still has tokens in escrow (#189) * trigger redemptions when user still has tokens in escrow Signed-off-by: ilin <[email protected]> * fix comments Signed-off-by: ilin <[email protected]> * add fixes from review * add fixes from review * add fixes from review --------- Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> * Work on multiple pools * Fix multiple pool setup * Fix investor handler * Start working on decrease * Work on executing decrease invest orders * Work on kv store in handler base * fix permit (#195) * fix permit * consolidate code * fmt * remove redundant require from permitted deposit request * Refactor price logic (#192) * Refactor price logic * Remove redundant comments * Check transfer restriction on request redeem (#193) * Check transfer restriction on request redeem * Fix * Format * Freeze check both directions * Fix test * Change member checks * Update checks again * Revert cancel rely if no target is scheduled (#197) * Check price is newer (#198) * Fix key type * Clean up * Reorganize unit tests * More renames * Rename invariant test folder * Fix imports * Add price invariants * Disable fork tests for now * Fix old imports, typo * Clean up * Currency setup * Remove handler * Fix build * Move tests * Env var for fork tests * Clean up fork & integration tests * Rename * Set up cross-chain fork tests * Add admin signer setup * Remove foundry rpc urls * Clean up * Move around * Add CI for fork tests * Update celo messages * Add deployment info * Move spells * Determinism check * Set up testnet support * Format * Remove redundant rpc urls * Cron job for fork tests * Remove duplicated code * Add mathlib and safetransferlib tests * Fix typo * Reorganize * Format * Clean up folder structure * More renames * Delete duplicate files * Remove xcm router * Remove old import * Remove unused param * Add forwarder test * Add BytesLib test * Typo * Revert * Add investment manager tests * Add more tests * Re-enable * Ad some more unit tests * 2 more * Add more sanity check tests * Rename * Add more * Add allowed currency for requestRedeem check * Fix compilation * Reduce params * Fix ci path * Fix another ci path * Remove unused ci code * Refactor shadow var handling * Format * Fix slow builds * Exclude invariant tests from code cov * Remove more merge conflict issues * Add old metadata check * Fix typo * Simplify Axelar router * Disable some invariants for now * Include invariant tests in coverage again * Remove LP.transferFrom and LP.decimals methods --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> Co-authored-by: Adam Stox <[email protected]>
hieronx
added a commit
that referenced
this pull request
Feb 15, 2024
* Start adding convert invariant * Remove collect functions, remove sanity checks for incoming calls, fix price conversion * Remove deposit/redeem price calculations * Add redeem request internal method * Simplify convert methods * Remove some comments * Fix tests * More simplfications * Fix tests * Fix typo * Fixes * Simplify math * Simplify LP lookups * Remove internal touint128 in test * Consistent naming * Rename lp values / orderbook to investment state * Fix price type * Fix convert invariants, add maxdeposit/redeem invariants * Start adapting investor handler to support multiple investors * Set 2 investors * Set up base handler * fix: add tranche (#180) * Align approval flow and interface with EIP draft (#178) * Explore new approval flow * Fix permit logic * Allowance checks * Remove fee-on-transfer support * Fix revert message * Fix tests * Remove unused function from interface * Fix comment * Naming * Remove console * Remove duplicate transfer from function * Fix balance check * Add operator param * Align naming of view functions * Address pr comments * disallow freezing the zero address (#181) * Fix permit fr with lower asset amounts (#183) * fix frontrunning with smaller asset amounts with permits * add test condition Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> * Make restrictionManagerFactory mutable on PoolManager (#182) * Make restrictionManagerFactory mutable on PoolManager * group RestrictionManagerFactory with other public vars * Preview methods should revert (#186) * Remove preview methods from investment mgr * Add comment * Format * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> --------- Co-authored-by: Adam Stox <[email protected]> * Add IERC7540 (#190) * Add IERC7540 * Update interface * Update ERC-20 interfaces * Fix comment * Skip slither step * Fix price calculation issue on decrease executions (#184) * Add test for failing price conversion on decrease * Attempt to fix conversions * Automatically claim deposits on trigger request redeem (#187) * Automatically claim deposits on trigger request redeem * trigger redemptions when user still has tokens in escrow (#189) * trigger redemptions when user still has tokens in escrow Signed-off-by: ilin <[email protected]> * fix comments Signed-off-by: ilin <[email protected]> * add fixes from review * add fixes from review * add fixes from review --------- Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> * Work on multiple pools * Fix multiple pool setup * Fix investor handler * Start working on decrease * Work on executing decrease invest orders * Work on kv store in handler base * fix permit (#195) * fix permit * consolidate code * fmt * remove redundant require from permitted deposit request * Refactor price logic (#192) * Refactor price logic * Remove redundant comments * Check transfer restriction on request redeem (#193) * Check transfer restriction on request redeem * Fix * Format * Freeze check both directions * Fix test * Change member checks * Update checks again * Revert cancel rely if no target is scheduled (#197) * Check price is newer (#198) * Fix key type * Clean up * Reorganize unit tests * More renames * Rename invariant test folder * Fix imports * Add price invariants * Disable fork tests for now * Fix old imports, typo * Clean up * Currency setup * Remove handler * Fix build * Move tests * Env var for fork tests * Clean up fork & integration tests * Rename * Set up cross-chain fork tests * Add admin signer setup * Remove foundry rpc urls * Clean up * Move around * Add CI for fork tests * Update celo messages * Add deployment info * Move spells * Determinism check * Set up testnet support * Format * Remove redundant rpc urls * Cron job for fork tests * Remove duplicated code * Add mathlib and safetransferlib tests * Fix typo * Reorganize * Format * Clean up folder structure * More renames * Delete duplicate files * Remove xcm router * Remove old import * Remove unused param * Add forwarder test * Add BytesLib test * Typo * Revert * Add investment manager tests * Add more tests * Re-enable * Ad some more unit tests * 2 more * Add more sanity check tests * Rename * Add more * Add allowed currency for requestRedeem check * Fix compilation * Reduce params * Fix ci path * Fix another ci path * Remove unused ci code * Refactor shadow var handling * Format * Fix slow builds * Exclude invariant tests from code cov * Remove more merge conflict issues * Add old metadata check * Fix typo * Simplify Axelar router * Disable some invariants for now * Include invariant tests in coverage again * First draft * WIP * Make it kind of work * Clean up * Format * Extend tests * File tess * Message proof test * Resend method * Comment * Add delayed admin method * Comment * Integrate in deployment * Comment * Update coments * Refactor storage * Label deployed contracts * Upgrade forge-std * Improve gas usage * Fix tests * Nicer * Add aggregation fuzz test * Update bounds * Add events and more * Rename * Clean up events * Wire delayed admin to aggregator * Add recovery tests * Use aggregation in integration tests * Format * Simplify axelar router * Missing event * Small cleanup * Improve storage and retrieval of confirmations * Uncomment * Comment * Remove unused code * Dont allow send before init * Clean up imports * Remove loop inits * Add router to execute msg event * Remove first router check * Remove quorum param * Adapt recover methods * Naming * Clean up and test filing routers * Create ARrayLib * Message recovery draft * Simplify * Clean up * Clean up * Remove wrong ward * Set up ArrayLib tests * Fix huge loophole :) * Simplify * Add recovery tests * Clean up * Decrease n value test * More tests * Allow disputing message recovery by admin * Remove double line * Clean up file * Fix missing root ward * Update src/gateway/routers/RouterAggregator.sol Co-authored-by: Adam Stox <[email protected]> --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> Co-authored-by: Adam Stox <[email protected]>
hieronx
added a commit
that referenced
this pull request
Feb 20, 2024
* Start cleaning up message parsing * Remove more code * Remove collect* mesages * Disallow recovering using invalid router * Set up CastLib * Extend cast lib, clean up * Rewrite many format methods * Remove more format methods * Fix tests * Remove another helper * More cleanup * Fix missing * Multi-router Message Aggregation (#235) * Start adding convert invariant * Remove collect functions, remove sanity checks for incoming calls, fix price conversion * Remove deposit/redeem price calculations * Add redeem request internal method * Simplify convert methods * Remove some comments * Fix tests * More simplfications * Fix tests * Fix typo * Fixes * Simplify math * Simplify LP lookups * Remove internal touint128 in test * Consistent naming * Rename lp values / orderbook to investment state * Fix price type * Fix convert invariants, add maxdeposit/redeem invariants * Start adapting investor handler to support multiple investors * Set 2 investors * Set up base handler * fix: add tranche (#180) * Align approval flow and interface with EIP draft (#178) * Explore new approval flow * Fix permit logic * Allowance checks * Remove fee-on-transfer support * Fix revert message * Fix tests * Remove unused function from interface * Fix comment * Naming * Remove console * Remove duplicate transfer from function * Fix balance check * Add operator param * Align naming of view functions * Address pr comments * disallow freezing the zero address (#181) * Fix permit fr with lower asset amounts (#183) * fix frontrunning with smaller asset amounts with permits * add test condition Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> * Make restrictionManagerFactory mutable on PoolManager (#182) * Make restrictionManagerFactory mutable on PoolManager * group RestrictionManagerFactory with other public vars * Preview methods should revert (#186) * Remove preview methods from investment mgr * Add comment * Format * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> --------- Co-authored-by: Adam Stox <[email protected]> * Add IERC7540 (#190) * Add IERC7540 * Update interface * Update ERC-20 interfaces * Fix comment * Skip slither step * Fix price calculation issue on decrease executions (#184) * Add test for failing price conversion on decrease * Attempt to fix conversions * Automatically claim deposits on trigger request redeem (#187) * Automatically claim deposits on trigger request redeem * trigger redemptions when user still has tokens in escrow (#189) * trigger redemptions when user still has tokens in escrow Signed-off-by: ilin <[email protected]> * fix comments Signed-off-by: ilin <[email protected]> * add fixes from review * add fixes from review * add fixes from review --------- Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> * Work on multiple pools * Fix multiple pool setup * Fix investor handler * Start working on decrease * Work on executing decrease invest orders * Work on kv store in handler base * fix permit (#195) * fix permit * consolidate code * fmt * remove redundant require from permitted deposit request * Refactor price logic (#192) * Refactor price logic * Remove redundant comments * Check transfer restriction on request redeem (#193) * Check transfer restriction on request redeem * Fix * Format * Freeze check both directions * Fix test * Change member checks * Update checks again * Revert cancel rely if no target is scheduled (#197) * Check price is newer (#198) * Fix key type * Clean up * Reorganize unit tests * More renames * Rename invariant test folder * Fix imports * Add price invariants * Disable fork tests for now * Fix old imports, typo * Clean up * Currency setup * Remove handler * Fix build * Move tests * Env var for fork tests * Clean up fork & integration tests * Rename * Set up cross-chain fork tests * Add admin signer setup * Remove foundry rpc urls * Clean up * Move around * Add CI for fork tests * Update celo messages * Add deployment info * Move spells * Determinism check * Set up testnet support * Format * Remove redundant rpc urls * Cron job for fork tests * Remove duplicated code * Add mathlib and safetransferlib tests * Fix typo * Reorganize * Format * Clean up folder structure * More renames * Delete duplicate files * Remove xcm router * Remove old import * Remove unused param * Add forwarder test * Add BytesLib test * Typo * Revert * Add investment manager tests * Add more tests * Re-enable * Ad some more unit tests * 2 more * Add more sanity check tests * Rename * Add more * Add allowed currency for requestRedeem check * Fix compilation * Reduce params * Fix ci path * Fix another ci path * Remove unused ci code * Refactor shadow var handling * Format * Fix slow builds * Exclude invariant tests from code cov * Remove more merge conflict issues * Add old metadata check * Fix typo * Simplify Axelar router * Disable some invariants for now * Include invariant tests in coverage again * First draft * WIP * Make it kind of work * Clean up * Format * Extend tests * File tess * Message proof test * Resend method * Comment * Add delayed admin method * Comment * Integrate in deployment * Comment * Update coments * Refactor storage * Label deployed contracts * Upgrade forge-std * Improve gas usage * Fix tests * Nicer * Add aggregation fuzz test * Update bounds * Add events and more * Rename * Clean up events * Wire delayed admin to aggregator * Add recovery tests * Use aggregation in integration tests * Format * Simplify axelar router * Missing event * Small cleanup * Improve storage and retrieval of confirmations * Uncomment * Comment * Remove unused code * Dont allow send before init * Clean up imports * Remove loop inits * Add router to execute msg event * Remove first router check * Remove quorum param * Adapt recover methods * Naming * Clean up and test filing routers * Create ARrayLib * Message recovery draft * Simplify * Clean up * Clean up * Remove wrong ward * Set up ArrayLib tests * Fix huge loophole :) * Simplify * Add recovery tests * Clean up * Decrease n value test * More tests * Allow disputing message recovery by admin * Remove double line * Clean up file * Fix missing root ward * Update src/gateway/routers/RouterAggregator.sol Co-authored-by: Adam Stox <[email protected]> --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> Co-authored-by: Adam Stox <[email protected]> * Fix most message parsing tests * Fix transfer test * Fix gateway test --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> Co-authored-by: Adam Stox <[email protected]>
hieronx
added a commit
that referenced
this pull request
Feb 20, 2024
* Start adding convert invariant * Remove collect functions, remove sanity checks for incoming calls, fix price conversion * Remove deposit/redeem price calculations * Add redeem request internal method * Simplify convert methods * Remove some comments * Fix tests * More simplfications * Fix tests * Fix typo * Fixes * Simplify math * Simplify LP lookups * Remove internal touint128 in test * Consistent naming * Rename lp values / orderbook to investment state * Fix price type * Fix convert invariants, add maxdeposit/redeem invariants * Start adapting investor handler to support multiple investors * Set 2 investors * Set up base handler * fix: add tranche (#180) * Align approval flow and interface with EIP draft (#178) * Explore new approval flow * Fix permit logic * Allowance checks * Remove fee-on-transfer support * Fix revert message * Fix tests * Remove unused function from interface * Fix comment * Naming * Remove console * Remove duplicate transfer from function * Fix balance check * Add operator param * Align naming of view functions * Address pr comments * disallow freezing the zero address (#181) * Fix permit fr with lower asset amounts (#183) * fix frontrunning with smaller asset amounts with permits * add test condition Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> * Make restrictionManagerFactory mutable on PoolManager (#182) * Make restrictionManagerFactory mutable on PoolManager * group RestrictionManagerFactory with other public vars * Preview methods should revert (#186) * Remove preview methods from investment mgr * Add comment * Format * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> * Update src/InvestmentManager.sol Co-authored-by: Adam Stox <[email protected]> --------- Co-authored-by: Adam Stox <[email protected]> * Add IERC7540 (#190) * Add IERC7540 * Update interface * Update ERC-20 interfaces * Fix comment * Skip slither step * Fix price calculation issue on decrease executions (#184) * Add test for failing price conversion on decrease * Attempt to fix conversions * Automatically claim deposits on trigger request redeem (#187) * Automatically claim deposits on trigger request redeem * trigger redemptions when user still has tokens in escrow (#189) * trigger redemptions when user still has tokens in escrow Signed-off-by: ilin <[email protected]> * fix comments Signed-off-by: ilin <[email protected]> * add fixes from review * add fixes from review * add fixes from review --------- Signed-off-by: ilin <[email protected]> --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> * Work on multiple pools * Fix multiple pool setup * Fix investor handler * Start working on decrease * Work on executing decrease invest orders * Work on kv store in handler base * fix permit (#195) * fix permit * consolidate code * fmt * remove redundant require from permitted deposit request * Refactor price logic (#192) * Refactor price logic * Remove redundant comments * Check transfer restriction on request redeem (#193) * Check transfer restriction on request redeem * Fix * Format * Freeze check both directions * Fix test * Change member checks * Update checks again * Revert cancel rely if no target is scheduled (#197) * Check price is newer (#198) * Fix key type * Clean up * Reorganize unit tests * More renames * Rename invariant test folder * Fix imports * Add price invariants * Disable fork tests for now * Fix old imports, typo * Clean up * Currency setup * Remove handler * Fix build * Move tests * Env var for fork tests * Clean up fork & integration tests * Rename * Set up cross-chain fork tests * Add admin signer setup * Remove foundry rpc urls * Clean up * Move around * Add CI for fork tests * Update celo messages * Add deployment info * Move spells * Determinism check * Set up testnet support * Format * Remove redundant rpc urls * Cron job for fork tests * Remove duplicated code * Add mathlib and safetransferlib tests * Fix typo * Reorganize * Format * Clean up folder structure * More renames * Delete duplicate files * Remove xcm router * Remove old import * Remove unused param * Add forwarder test * Add BytesLib test * Typo * Revert * Add investment manager tests * Add more tests * Re-enable * Ad some more unit tests * 2 more * Add more sanity check tests * Rename * Add more * Add allowed currency for requestRedeem check * Fix compilation * Reduce params * Fix ci path * Fix another ci path * Remove unused ci code * Refactor shadow var handling * Format * Fix slow builds * Exclude invariant tests from code cov * Remove more merge conflict issues * Add old metadata check * Fix typo * Simplify Axelar router * Disable some invariants for now * Include invariant tests in coverage again * First draft * WIP * Make it kind of work * Clean up * Format * Extend tests * File tess * Message proof test * Resend method * Comment * Add delayed admin method * Comment * Integrate in deployment * Comment * Update coments * Refactor storage * Label deployed contracts * Upgrade forge-std * Improve gas usage * Fix tests * Nicer * Add aggregation fuzz test * Update bounds * Add events and more * Rename * Clean up events * Wire delayed admin to aggregator * Add recovery tests * Use aggregation in integration tests * Format * Start cleaning up message parsing * Remove more code * Simplify axelar router * Missing event * Small cleanup * Remove collect* mesages * Improve storage and retrieval of confirmations * Uncomment * Comment * Remove unused code * Dont allow send before init * Clean up imports * Remove loop inits * Add router to execute msg event * Remove first router check * Remove quorum param * Adapt recover methods * Naming * Clean up and test filing routers * Create ARrayLib * Message recovery draft * Simplify * Clean up * Clean up * Remove wrong ward * Disallow recovering using invalid router * Set up CastLib * Extend cast lib, clean up * Rewrite many format methods * Remove more format methods * Fix tests * Remove another helper * More cleanup * Set up ArrayLib tests * Fix huge loophole :) * Simplify * Add recovery tests * Clean up * Decrease n value test * More tests * Allow disputing message recovery by admin * Remove double line * Clean up file * Fix missing root ward * Fix missing * Fix most message parsing tests * Fix transfer test * Fix gateway test --------- Signed-off-by: ilin <[email protected]> Co-authored-by: Alina Sinelnikova <[email protected]> Co-authored-by: Adam Stox <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.