├── README.md ├── .gitignore ├── hardhat.config.js ├── contracts ├── OceanToken.sol ├── ERC4626Strategy.sol ├── Vault.sol └── ERC4626Fees.sol ├── package.json ├── scripts └── deploy.js └── test └── Lock.js /README.md: -------------------------------------------------------------------------------- 1 | # ERC4626 Tokenized Vault tutorial 2 | 3 | Basic vault implementation using ERC4626 standard for tokenized vaults. 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .env 3 | coverage 4 | coverage.json 5 | typechain 6 | typechain-types 7 | .vscode 8 | 9 | # Hardhat files 10 | cache 11 | artifacts 12 | 13 | -------------------------------------------------------------------------------- /hardhat.config.js: -------------------------------------------------------------------------------- 1 | require("@nomicfoundation/hardhat-toolbox"); 2 | 3 | /** @type import('hardhat/config').HardhatUserConfig */ 4 | module.exports = { 5 | solidity: "0.8.20", 6 | }; 7 | -------------------------------------------------------------------------------- /contracts/OceanToken.sol: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: MIT 2 | 3 | pragma solidity ^0.8.20; 4 | 5 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; 6 | 7 | contract OceanToken is ERC20 { 8 | constructor() ERC20("OceanToken", "OCT") { 9 | _mint(msg.sender, 1000000 * (10 ** decimals())); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "vault_smart_contract_poc", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "devDependencies": { 12 | "@nomicfoundation/hardhat-toolbox": "^3.0.0", 13 | "hardhat": "^2.17.3" 14 | }, 15 | "dependencies": { 16 | "@openzeppelin/contracts": "^4.9.3" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /scripts/deploy.js: -------------------------------------------------------------------------------- 1 | // We require the Hardhat Runtime Environment explicitly here. This is optional 2 | // but useful for running the script in a standalone fashion through `node