Skip to content

ERC4626 index vault for storing and managing ERC20s

Notifications You must be signed in to change notification settings

leeftk/index-vault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AIVault

Git Source

Inherits: ERC4626, Ownable

State Variables

uniswapRouter

IUniswapV2Router02 uniswapRouter;

allocations

Allocation[] public allocations;

Allowlist

mapping(address => bool) public Allowlist;

Functions

constructor

constructor(IERC20 asset, address _uniswapRouterAddress) ERC4626(asset);

receive

receive() external payable;

setAllocations

function setAllocations(Allocation[] calldata newAllocations) external onlyOwner;

addToAllowlist

function addToAllowlist(address token) external onlyOwner;

deposit

function deposit(uint256 assets, address receiver) public override returns (uint256 shares);

purchaseTokens

function purchaseTokens(uint256 amountETH) internal;

swapETHForTokens

https://github.com/leeftk/index-vault

function swapETHForTokens(address token, uint256 amountETH, uint256 amountOutMin) internal;

Structs

Allocation

struct Allocation {
    address token;
    uint256 percentage;
}

About

ERC4626 index vault for storing and managing ERC20s

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published