{"id":16099982,"url":"https://github.com/fooock/optify-beefy-adapter","last_synced_at":"2025-04-05T23:33:33.559Z","repository":{"id":128382982,"uuid":"399213245","full_name":"fooock/optify-beefy-adapter","owner":"fooock","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-26T17:23:54.000Z","size":1736,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-12T05:56:56.963Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fooock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-23T18:41:47.000Z","updated_at":"2021-08-26T17:24:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"a3a9187e-b4ef-43a2-bb05-82a9a1078765","html_url":"https://github.com/fooock/optify-beefy-adapter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":"Opty-Fi/defi-adapters","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fooock%2Foptify-beefy-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fooock%2Foptify-beefy-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fooock%2Foptify-beefy-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fooock%2Foptify-beefy-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fooock","download_url":"https://codeload.github.com/fooock/optify-beefy-adapter/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415826,"owners_count":20935384,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T18:44:41.752Z","updated_at":"2025-04-05T23:33:33.528Z","avatar_url":"https://github.com/fooock.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg src=\"https://avatars.githubusercontent.com/u/71294241?s=400\u0026u=0b62a061c11a7536c27b1d53760152b5e9bd40f5\u0026v=4\" alt=\"Header\" style=\"width:200px;align=center;float: right;\" /\u003e\n\n## DeFi Adapter Kit\n\nStarter kit for defi adapter development compatible with Opty-Fi's earn-protocol\n\n### Prerequisites\n\n- Install [Node JS](https://nodejs.org/en/download/) \u003e= v12.0.0\n- Learn [Javascript](https://developer.mozilla.org/en-US/docs/Web/JavaScript) and [Typescript](https://www.typescriptlang.org/)\n- Learn [Solidity](https://docs.soliditylang.org/en/latest/) \u003e=v0.6.12.\n- Learn smart contract development environment like [Hardhat](https://hardhat.org/getting-started/)\n- Learn testing framework like [mocha](https://mochajs.org/)\n- Learn assertion library like [chai](https://www.chaijs.com/)\n\nAnd passion for financial freedom...\n\n## Getting started\n\n### Development Setup\n\n- Create a `.env` file and set a BIP-39 compatible mnemonic as an environment variable. Follow the example in `.env.example`. If you don't already have a mnemonic, use this [website](https://iancoleman.io/bip39/) to generate one.\n- You will require access to archive Node URL for forking the mainnet.\n\nProceed with installing dependencies:\n\n```sh\nyarn install\n```\n\n### What is a DeFiAdapter\n\n- DeFi adapter is a vital building block for executing [opty.fi](https://opty.fi)'s network of strategies.\n- Specifications for DeFi adapter help perform :\n  - transactions like deposit, withdraw, staking, un-staking, adding liquidity, claim reward and harvesting of the reward.\n  - read calls for liquidity pool token contract address, liquidity pool token balance, staked token balance, balance in underlying token of both staked and non-staked liquidity pool token, unclaimed reward tokens and reward token contract address\n- A DeFi Adapter smart contract requires implementation of following interfaces :\n  - [IAdapter.sol](./contracts/interfaces/opty/IAdapter.sol) **(Mandatory)**\n  - [IAdapterHarvestReward.sol](./contracts/interfaces/opty/IAdapterHarvestReward.sol) **(Optional)**\n  - [IAdapterStaking.sol](./contracts/interfaces/opty/IAdapterStaking.sol) **(Optional)**\n  - [IAdapterBorrow.sol](./contracts/interfaces/opty/IAdapterBorrow.sol) **(Optional)**\n  - [IAdapterInvestmentLimit.sol](./contracts/interfaces/opty/IAdapterInvestmentLimit.sol) **(Optional)**\n\n\u003e Pro Tip : Inherit IAdapterFull interface from [IAdapterFull.sol](./contracts/interfaces/opty/IAdapterFull.sol) to Adapter Contract if the protocol you choose required implementation of all the above interfaces.\n\n### Developing DeFiAdapter\n\n#### Step #1 - Use this template\n\n- This is a GitHub template, so click on green button \"Use this template\" on the top-right corner of the page to create new defi adapter.\n\n#### Step #2 - Pool, LP token and underlying token(s) address gathering\n\n- Choose a DeFi protocol and gather the pool contract addresses similar to [harvest.finance-pools.json](./test/harvest.finance-pools.json).\n\n#### Step #3 - Implementing `IAdapter` interface\n\n- Implement an adapter contract using above interface(s) similar to [HarvestFinanceAdapter.sol](./contracts/adapters/HarvestFinanceAdapters.sol)\n\n#### Step #4 - Unit Tests\n\n- Write unit tests for all the functions across all the pool contracts gathered in Step 1.\n- You might want to use a test utility contract like [TestDeFiAdapter](./contracts/mock/TestDeFiAdapter.sol) for creating a sandbox environment to execute the transaction based on function signature and target address returned from `getCodes()`-style functions from DeFiAdapter.\n- All other functions can be directly tested from the DeFiAdapter contract.\n- The unit test for `HarvestFinanceAdapter.sol` can be found in [HarvestFinanceAdapter.ts](./test/adapters/HarvestFinanceAdapter.ts)\n\n#### Useful commands\n\n| Usage                                                                           | Command            |\n| ------------------------------------------------------------------------------- | ------------------ |\n| Compile the smart contracts with Hardhat                                        | `$ yarn compile`   |\n| Compile the smart contracts and generate TypeChain artifacts                    | `$ yarn typechain` |\n| Lint the Solidity Code                                                          | `$ yarn lint:sol`  |\n| Lint the TypeScript Code                                                        | `$ yarn lint:ts`   |\n| Run the Mocha tests                                                             | `$ yarn test`      |\n| Generate the code coverage report                                               | `$ yarn coverage`  |\n| Delete the smart contract artifacts, the coverage reports and the Hardhat cache | `$ yarn clean`     |\n| Deploy the adapter to Hardhat Network                                           | `$ yarn deploy`    |\n\n#### Syntax Highlighting\n\nIf you use VSCode, you can enjoy syntax highlighting for your Solidity code via the\n[vscode-solidity](https://github.com/juanfranblanco/vscode-solidity) extension. The recommended approach to set the\ncompiler version is to add the following fields to your VSCode user settings:\n\n```json\n{\n  \"solidity.compileUsingRemoteVersion\": \"v0.6.12+commit.27d51765\",\n  \"solidity.defaultCompiler\": \"remote\"\n}\n```\n\nWhere of course `v0.6.12+commit.27d51765` can be replaced with any other version.\n\n### References\n\n- [Hardhat](https://hardhat.org/getting-started/)\n- [Ethereum Development Documentation](https://ethereum.org/en/developers/docs/)\n- [Harvest Finance Docs](https://harvest-finance.gitbook.io/harvest-finance/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffooock%2Foptify-beefy-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffooock%2Foptify-beefy-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffooock%2Foptify-beefy-adapter/lists"}