Skip to content

Commit

Permalink
Feat/migration (#401)
Browse files Browse the repository at this point in the history
* feat: adds initial account abstraction implementation

* feat: adds the ParaAccount and complete the initial functionality

* feat: a working version with ERC721 verification

* feat: initialize migration

Signed-off-by: GopherJ <[email protected]>

* feat: support different recipient address

Signed-off-by: GopherJ <[email protected]>

* feat: refactor account abstraction to a simple one

* feat: remove not needed contracts

* feat: remove not needed contracts

* chore: adds tests for AA

* chore: adds account address to the accountCreated event

* chore: adds AA deployment step

* chore: adds test for account upgrade

* chore: adds values array to executeBatch

* fix: aa must belong to user

Signed-off-by: GopherJ <[email protected]>

* chore: tiny optimization

Signed-off-by: GopherJ <[email protected]>

* chore: revert unecessary changes

Signed-off-by: GopherJ <[email protected]>

* chore: adds ERC1271 comp

* chore: remove signature encoding for contracts

* chore: replace signature checker.

* fix: hvmtl supplycap

Signed-off-by: GopherJ <[email protected]>

* feat: update admin account

Signed-off-by: GopherJ <[email protected]>

* fix: add missing claimMoonbirds

Signed-off-by: GopherJ <[email protected]>

* chore: update config

Signed-off-by: GopherJ <[email protected]>

* chore: add more aggregators

Signed-off-by: GopherJ <[email protected]>

* chore: add more aggregators

Signed-off-by: GopherJ <[email protected]>

* chore: fixes owner.code

* chore: add missing items

Signed-off-by: GopherJ <[email protected]>

* chore: improve

Signed-off-by: GopherJ <[email protected]>

* chore: catch error

Signed-off-by: GopherJ <[email protected]>

* fix: revert for usdt

Signed-off-by: GopherJ <[email protected]>

* fix: verification

Signed-off-by: GopherJ <[email protected]>

* fix: lint

Signed-off-by: GopherJ <[email protected]>

* chore: revert modification

Signed-off-by: GopherJ <[email protected]>

---------

Signed-off-by: GopherJ <[email protected]>
Co-authored-by: 0xwalid <[email protected]>
Co-authored-by: zhoujia6139 <[email protected]>
  • Loading branch information
3 people authored Aug 23, 2023
1 parent a509180 commit 840da50
Show file tree
Hide file tree
Showing 32 changed files with 2,629 additions and 1,940 deletions.
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

0 comments on commit 840da50

Please sign in to comment.