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/migration #401

Merged
merged 36 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7f56655
feat: adds initial account abstraction implementation
WalidOfNow Jul 21, 2023
e2381eb
feat: adds the ParaAccount and complete the initial functionality
WalidOfNow Jul 27, 2023
a900e9e
feat: a working version with ERC721 verification
WalidOfNow Aug 3, 2023
edd3fa1
feat: initialize migration
GopherJ Aug 8, 2023
06aa92e
feat: support different recipient address
GopherJ Aug 8, 2023
4f1b32a
feat: refactor account abstraction to a simple one
WalidOfNow Aug 8, 2023
d2e4d62
feat: remove not needed contracts
WalidOfNow Aug 8, 2023
e5d53b4
feat: remove not needed contracts
WalidOfNow Aug 8, 2023
3fe6c94
chore: adds tests for AA
WalidOfNow Aug 9, 2023
c241915
chore: adds account address to the accountCreated event
WalidOfNow Aug 9, 2023
8485fee
chore: adds AA deployment step
WalidOfNow Aug 9, 2023
7f4f368
chore: adds test for account upgrade
WalidOfNow Aug 9, 2023
287f51b
chore: adds values array to executeBatch
WalidOfNow Aug 10, 2023
78496b4
fix: aa must belong to user
GopherJ Aug 14, 2023
65ed8f2
chore: tiny optimization
GopherJ Aug 14, 2023
466eeb3
chore: revert unecessary changes
GopherJ Aug 15, 2023
287c70d
chore: adds ERC1271 comp
WalidOfNow Aug 17, 2023
9d24e3d
chore: remove signature encoding for contracts
WalidOfNow Aug 21, 2023
9512a95
chore: replace signature checker.
zhoujia6139 Aug 22, 2023
6858a22
fix: hvmtl supplycap
GopherJ Aug 22, 2023
df59d6f
feat: update admin account
GopherJ Aug 22, 2023
0e4b462
fix: add missing claimMoonbirds
GopherJ Aug 22, 2023
4224b1d
chore: update config
GopherJ Aug 22, 2023
f330321
chore: add more aggregators
GopherJ Aug 22, 2023
fe79dc8
chore: add more aggregators
GopherJ Aug 22, 2023
d0e7c96
chore: fixes owner.code
WalidOfNow Aug 22, 2023
46eddec
chore: add missing items
GopherJ Aug 23, 2023
4f6bc97
chore: improve
GopherJ Aug 23, 2023
8b721a5
chore: catch error
GopherJ Aug 23, 2023
ba1acbe
fix: revert for usdt
GopherJ Aug 23, 2023
ff6610e
fix: verification
GopherJ Aug 23, 2023
3a6d53c
Merge branch 'main' into account-abstraction
GopherJ Aug 23, 2023
2e866eb
Merge remote-tracking branch 'origin/account-abstraction' into feat/m…
GopherJ Aug 23, 2023
6258ac5
fix: lint
GopherJ Aug 23, 2023
fea1143
chore: revert modification
GopherJ Aug 23, 2023
3567d2a
Merge branch 'main' into feat/migration
GopherJ Aug 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions contracts/interfaces/IAccount.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

interface IAccount {
function owner() external view returns (address);
}
5 changes: 5 additions & 0 deletions contracts/interfaces/INToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,9 @@ interface INToken is
* @return The address of the underlying asset
**/
function UNDERLYING_ASSET_ADDRESS() external view returns (address);

function claimUnderlying(
address timeLockV1,
uint256[] calldata agreementIds
) external;
}
8 changes: 8 additions & 0 deletions contracts/interfaces/IPToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,12 @@ interface IPToken is
address to,
uint256 amount
) external;

function claimUnderlying(
address timeLockV1,
address cApeV1,
address cApeV2,
address apeCoin,
uint256[] calldata agreementIds
) external returns (uint256);
}
27 changes: 27 additions & 0 deletions contracts/interfaces/IPoolPositionMover.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,38 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import {DataTypes} from "../protocol/libraries/types/DataTypes.sol";
import {ApeCoinStaking} from "../dependencies/yoga-labs/ApeCoinStaking.sol";

/**
* @title IPool
*
* @notice Defines the basic interface for an ParaSpace Pool.
**/
interface IPoolPositionMover {
function movePositionFromBendDAO(uint256[] calldata loanIds) external;

//# Migration step
//
//0. User needs to breakup P2P orders on their own
//1. Repay Debt
// 1. if it's cAPE then deposit borrowed APE into old cAPE pool then repay
// 2. if it's not then just repay with borrowed tokens
//2. burn old NToken
// 1. move old NToken to new Pool, if it's staking BAYC/MAYC/BAKC it'll be automatically unstaked
// 2. withdrawERC721 and specify new NToken as recipient
// 3. mint new NToken
//3. burn old PToken
// 1. move old PToken to new Pool
// 2. withdraw and specify new PToken as recipient
// 3. mint new NToken
//4. Mint new debt
function movePositionFromParaSpace(
DataTypes.ParaSpacePositionMoveInfo calldata moveInfo
) external;

function claimUnderlying(
address[] calldata assets,
uint256[][] calldata agreementIds
) external;
}
5 changes: 5 additions & 0 deletions contracts/interfaces/ITimeLock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ interface ITimeLock {
*/
function claim(uint256[] calldata agreementIds) external;

/** @dev Function to claim MoonBird from time-lock agreements
* @param agreementIds Array of agreement IDs to be claimed
*/
function claimMoonBirds(uint256[] calldata agreementIds) external;

/** @dev Function to freeze a specific time-lock agreement
* @param agreementId ID of the agreement to be frozen
*/
Expand Down
Loading
Loading