Skip to content
Merged
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
2 changes: 1 addition & 1 deletion examples/05-invest-aave-idle-balance/manifest.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 1.0.0
name: Invest in a AAVE idle balance
name: Invest in AAVE idle balance
description: Automated task to invest in AAVE idle balance above certain threshold in USD
inputs:
- chainId: uint32
Expand Down
3 changes: 3 additions & 0 deletions examples/13-bridge-and-invest-aave/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
PRIVATE_KEY=
INVEST_CID=
SMART_ACCOUNT=
89 changes: 89 additions & 0 deletions examples/13-bridge-and-invest-aave/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import eslintPluginTypeScript from "@typescript-eslint/eslint-plugin"
import eslintParserTypeScript from "@typescript-eslint/parser"
import eslintPluginImport from "eslint-plugin-import"
import eslintPluginSimpleImportSort from "eslint-plugin-simple-import-sort"
import eslintConfigPrettier from "eslint-config-prettier"
import eslintPluginPrettier from "eslint-plugin-prettier"

export default [
{
ignores: ["node_modules/**", "**/dist/**", "**/build/**", "**/.prettierrc.*", "./src/types/**"]
},
{
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
parser: eslintParserTypeScript,
parserOptions: {
project: "./tsconfig.json"
}
},
plugins: {
"@typescript-eslint": eslintPluginTypeScript,
prettier: eslintPluginPrettier,
import: eslintPluginImport,
"simple-import-sort": eslintPluginSimpleImportSort
},
rules: {
...eslintPluginTypeScript.configs.recommended.rules,
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/no-explicit-any": "error",

"prettier/prettier": [
"error",
{
"semi": false,
"singleQuote": true,
"trailingComma": "es5",
"arrowParens": "always",
"bracketSpacing": true,
"printWidth": 120,
"tabWidth": 2,
"useTabs": false
}
],

"simple-import-sort/imports": [
"error",
{
groups: [
["^@?\\w"],
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"]
]
}
],
"simple-import-sort/exports": "error",

"comma-spacing": ["error", { before: false, after: true }],
"no-multiple-empty-lines": ["error", { max: 1, maxEOF: 1 }]
},
settings: {
"import/resolver": {
typescript: {
alwaysTryTypes: true,
project: "./tsconfig.json"
}
}
}
},
// configuration for test files
{
files: ["tests/**/*.{ts,tsx}", "**/*.spec.{ts,tsx}", "**/*.test.{ts,tsx}"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
parser: eslintParserTypeScript,
parserOptions: {
project: "./tests/tsconfig.json"
}
},
rules: {
"@typescript-eslint/no-unused-expressions": "off"
}
},
eslintConfigPrettier
]
11 changes: 11 additions & 0 deletions examples/13-bridge-and-invest-aave/manifest.bridge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 1.0.0
name: Bridge USDC and emit an event
description: Bridge USDC between Arbitrum, Base and Optimism, and emit a custom event to trigger another task
inputs:
- sourceChain: uint32
- destinationChain: uint32
- smartAccount: address # Important: The smart account should exist in both chains
- amount: string
- minAmountOut: string
- feeToken: address
- maxFee: string
12 changes: 12 additions & 0 deletions examples/13-bridge-and-invest-aave/manifest.invest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 1.0.0
name: Deposit USDC in Aave (event trigger)
description: Deposit in Aave USDC tokens that were bridged from another chain
inputs:
- chainId: uint32
- smartAccount: address
- feeToken: address
- maxFee: string
abis:
- AavePool: ./src/abis/AavePool.json
- ERC20: ./src/abis/ERC20.json
- Settler: ./src/abis/Settler.json
43 changes: 43 additions & 0 deletions examples/13-bridge-and-invest-aave/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "@mimicprotocol/13-bridge-and-invest-aave",
"version": "0.0.1",
"license": "Unlicensed",
"private": true,
"type": "module",
"scripts": {
"build": "yarn codegen && yarn compile",
"codegen": "yarn codegen:bridge && yarn codegen:invest",
"codegen:bridge": "yarn mimic codegen -m manifest.bridge.yaml -o ./src/types/bridge",
"codegen:invest": "yarn mimic codegen -m manifest.invest.yaml -o ./src/types/invest",
"compile": "yarn compile:bridge && yarn compile:invest",
"compile:bridge": "mimic compile -t src/bridge.ts -m manifest.bridge.yaml -o ./build/bridge",
"compile:invest": "mimic compile -t src/invest.ts -m manifest.invest.yaml -o ./build/invest",
"deploy:bridge": "yarn codegen:bridge && yarn compile:bridge && mimic deploy --input ./build/bridge --output ./build/bridge --skip-compile",
"deploy:invest": "yarn codegen:invest && yarn compile:invest && mimic deploy --input ./build/invest --output ./build/invest --skip-compile",
"test": "yarn build && mimic test --skipCompile",
"create-config:invest": "tsc -p tsconfig.create-config.json && tsx src/create-config.invest.ts",
"lint": "eslint ."
},
"dependencies": {
"dotenv": "^17.0.0",
"ethers": "^6.13.5",
"semver": "^7.7.3"
},
"devDependencies": {
"@mimicprotocol/cli": "latest",
"@mimicprotocol/lib-ts": "latest",
"@mimicprotocol/sdk": "latest",
"@mimicprotocol/test-ts": "latest",
"@types/chai": "^5.2.2",
"@types/mocha": "^10.0.10",
"@types/node": "^22.10.5",
"assemblyscript": "0.27.36",
"chai": "^4.3.7",
"eslint": "^9.10.0",
"json-as": "1.1.7",
"mocha": "^10.2.0",
"tsx": "^4.20.3",
"typescript": "^5.8.3",
"visitor-as": "0.11.4"
}
}
Loading