Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions contracts/interfaces/ICoreFacet.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
pragma solidity 0.8.4;

interface ICoreFacet {
struct Vault {
address vaultOwner;
address backupAddress;
uint256 vaultID;
uint256 lastPing;
uint256 pingWindow;
string[] modules;
}

function ping() external;

function transferBackup(address _newBackupAddress) external;

function transferOwnership(address _newVaultOwner) external;

function claimOwnership(address _newBackupAddress) external;

function execute(address _target, bytes memory _data) external payable;

function getVault() external view returns (Vault memory vault_);
}
128 changes: 128 additions & 0 deletions contracts/interfaces/IDMSFacet.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
pragma solidity 0.8.4;

interface IDMSFacet {
struct VaultInfo {
address owner;
uint256 weiBalance;
uint256 lastPing;
uint256 id;
address backup;
address[] inheritors;
}

struct AllInheritorEtherAllocs {
address inheritor;
uint256 weiAlloc;
}

struct AllocatedERC1155Tokens {
uint256 tokenID;
uint256 amount;
}

struct AllAllocatedERC1155Tokens {
address token;
uint256 tokenID;
uint256 amount;
}

struct AllocatedERC721Tokens {
address token;
uint256[] tokenIDs;
}

struct AllocatedERC20Tokens {
address token;
uint256 amount;
}

function inspectVault() external view returns (VaultInfo memory info);

function allEtherAllocations()
external
view
returns (AllInheritorEtherAllocs[] memory eAllocs);

function inheritorEtherAllocation(
address _inheritor
) external view returns (uint256 _allocatedEther);

function getAllocatedEther() external view returns (uint256);

function getUnallocatedEther() external view returns (uint256 unallocated_);

function etherBalance() external view returns (uint256);

function getAllocatedERC20Tokens(
address _inheritor
) external view returns (AllocatedERC20Tokens[] memory tAllocs);

function inheritorERC20TokenAllocation(
address _inheritor,
address _token
) external view returns (uint256);

function getUnallocatedTokens(
address _token
) external view returns (uint256 unallocated_);

function getAllocatedERC721Tokens(
address _inheritor
) external view returns (AllocatedERC721Tokens[] memory allocated);

function getAllocatedERC721TokenIds(
address _inheritor,
address _token
) external view returns (uint256[] memory);

function getAllocatedERC721TokenAddresses(
address _inheritor
) external view returns (address[] memory);

function getAllocatedERC1155Tokens(
address _token,
address _inheritor
) external view returns (AllocatedERC1155Tokens[] memory alloc_);

function getAllAllocatedERC1155Tokens(
address _inheritor
) external view returns (AllAllocatedERC1155Tokens[] memory alloc_);

function getUnallocatedERC115Tokens(
address _token,
uint256 _tokenId
) external view returns (uint256 remaining_);

function addInheritors(
address[] calldata _newInheritors,
uint256[] calldata _weiShare
) external;

function removeInheritors(address[] calldata _inheritors) external;

function allocateEther(
address[] calldata _inheritors,
uint256[] calldata _ethShares
) external;

function allocateERC20Tokens(
address token,
address[] calldata _inheritors,
uint256[] calldata _shares
) external;

function allocateERC721Tokens(
address token,
address[] calldata _inheritors,
uint256[] calldata _tokenIDs
) external;

function allocateERC1155Tokens(
address token,
address[] calldata _inheritors,
uint256[] calldata _tokenIDs,
uint256[] calldata _amounts
) external;

function claimAllAllocations() external;
}
51 changes: 51 additions & 0 deletions contracts/interfaces/IERC1155Facet.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
pragma solidity 0.8.4;

interface IERC1155Facet {
function depositERC1155Token(
address _token,
uint256 _tokenID,
uint256 _amount
) external;

function batchDepositERC1155Tokens(
address _token,
uint256[] calldata _tokenIDs,
uint256[] calldata _amounts
) external;

function withdrawERC1155Token(
address _token,
uint256 _tokenID,
uint256 _amount,
address _to
) external;

function batchWithdrawERC1155Token(
address _token,
uint256[] calldata _tokenIDs,
uint256[] calldata _amount,
address _to
) external;

function approveERC1155Token(
address _token,
address _to,
bool _approved
) external;

function onERC1155Received(
address,
address,
uint256,
uint256,
bytes memory
) external pure returns (bytes4);

function onERC1155BatchReceived(
address,
address,
uint256[] memory,
uint256[] memory,
bytes memory
) external pure returns (bytes4);
}
28 changes: 28 additions & 0 deletions contracts/interfaces/IERC20Facet.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
pragma solidity 0.8.4;

interface IERC20Facet {
function depositERC20Token(address _token, uint256 _amount) external;

function depositERC20Tokens(
address[] calldata _tokens,
uint256[] calldata _amounts
) external;

function withdrawERC20Token(
address _token,
uint256 _amount,
address _to
) external;

function batchWithdrawERC20Token(
address[] calldata _tokens,
uint256[] calldata _amounts,
address _to
) external;

function approveERC20Token(
address _token,
address _to,
uint256 _amount
) external;
}
43 changes: 43 additions & 0 deletions contracts/interfaces/IERC721Facet.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
pragma solidity 0.8.4;

interface IERC721Facet {
function depositERC721Token(address _token, uint256 _tokenID) external;

function depositERC721Tokens(
address _token,
uint256[] calldata _tokenIDs
) external;

function safeDepositERC721Token(address _token, uint256 _tokenID) external;

function safeDepositERC721TokenAndCall(
address _token,
uint256 _tokenID,
bytes calldata data
) external;

function withdrawERC721Token(
address _token,
uint256 _tokenID,
address _to
) external;

function approveSingleERC721Token(
address _token,
address _to,
uint256 _tokenID
) external;

function approveAllERC721Token(
address _token,
address _to,
bool _approved
) external;

function onERC721Received(
address,
address,
uint256,
bytes memory
) external pure returns (bytes4);
}
7 changes: 7 additions & 0 deletions contracts/interfaces/IEtherFacet.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pragma solidity 0.8.4;

interface IEtherFacet {
function depositEther(uint256 _amount) external payable;

function withdrawEther(uint256 _amount, address _to) external;
}
7 changes: 6 additions & 1 deletion contracts/interfaces/IModuleData.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,10 @@ interface IModuleData {
}

function getActiveModules() external view returns (string[] memory);
function isActiveModule(string memory _name) external view returns (bool exists_);

function isActiveModule(
string memory _name
) external view returns (bool exists_);

function downgradeVaultWithModule(string calldata _name) external;
}
26 changes: 26 additions & 0 deletions contracts/interfaces/IModuleRegistryFacet.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
pragma solidity 0.8.4;
import {IModuleData} from "./IModuleData.sol";
import {IDiamondCut} from "./IDiamondCut.sol";

interface IModuleRegistryFacet {
function addModules(
IModuleData.ModuleData[] calldata _modules,
string[] calldata _names
) external;

function getModules(
string[] calldata _names
) external view returns (IModuleData.ModuleData[] memory modules_);

function getModule(
string calldata _name
) external view returns (IModuleData.ModuleData memory module_);

function getFacetCuts(
string memory _name
) external view returns (IDiamondCut.FacetCut[] memory cuts_);

function moduleExists(
string calldata _name
) external view returns (bool exists_);
}
5 changes: 5 additions & 0 deletions contracts/interfaces/IOwnershipFacet.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pragma solidity 0.8.4;

interface IOwnershipFacet {
function owner() external view returns (address owner_);
}
10 changes: 10 additions & 0 deletions contracts/interfaces/IVaultSpawnerFacet.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pragma solidity 0.8.4;

interface IVaultSpawnerFacet {
function createVault(
address _vaultOwner,
uint256 _startingBal,
address _backupAddress,
uint256 _backupDelay
) external payable returns (address addr);
}