Skip to content

Commit

Permalink
feat: gho testnet (#506)
Browse files Browse the repository at this point in the history
* feat: add default gas estimation for borrow and vote (#492)

* feat: add default gas estimation for borrow

* chore: add default estimation for vote

* chore(release): publish [ci skip]

 - @aave/contract-helpers@1.13.0
 - @aave/math-utils@1.13.0

* fix: apply default gas limit estimations (#499)

* fix: apply default gas limit estimations

* chore: update vote estimate

* fix: update remaining actions

* chore: update gas limit tests for v3 pool

* chore: update gas limits tests for v2 pool

* chore: update gas limits tests for voting

* chore: revert v3 pool rollup changes

* chore(release): publish [ci skip]

 - @aave/contract-helpers@1.13.1
 - @aave/math-utils@1.13.1

* chore: change migration on v3 from flash loan to use credit delegation (#493)

* feat: v3 migration services added

* feat: erc20-2612 export and test for v3 migration added

* feat: migration service types

* feat: migrate no borrow without permits

* feat: migrate v3 with borrow continue

* fix: pass permits to flashloan v3

* fix: added test for migrateV3 and fixed some types

* fix: remove approval tx if permits passed

* fix: approve txs in migrate with permits

* fix: added 100% coverage

* fix: fixed ingores

* feat: add migrate method

* fix: add tests

* fix: added credit delegation approval

* fix: separate v3 variable debt approval for migraiton v3

* fix: updated tests

* feat: add get migration supply method added

* fix: get migration supply test added

* fix: get migration supply test

Co-authored-by: sendra <polsendra@gmail.com>

* chore(release): publish [ci skip]

 - @aave/contract-helpers@1.13.2
 - @aave/math-utils@1.13.2

* fix: typechain structure (#501)

* fix: typechain structure

* chore: disable typescript linting for migration service

* chore: add type to permit mapping

* fix: migration typechain import and unused config

* fix: factory typechain import

* chore(release): publish [ci skip]

 - @aave/contract-helpers@1.13.3
 - @aave/math-utils@1.13.3

* fix: check for liq threshold in place of ltv for user collateral check (#505)

* chore(release): publish [ci skip]

 - @aave/contract-helpers@1.13.4
 - @aave/math-utils@1.13.4

* fix: Fix typos (#486)

* chore(release): publish [ci skip]

 - @aave/contract-helpers@1.13.5
 - @aave/math-utils@1.13.5

* feat: decentralize the readme header image

* chore: remove legacy files

* feat: update uighodataprovider typechain and references (#507)

* feat: custom version for gho beta [skip ci]

* chore(release): [skip ci]

 - @aave/contract-helpers@1.0.0-gho-beta.0
 - @aave/math-utils@1.0.0-gho-beta.0

* chore: remove readme line

* chore: revert attempt for custom custom version

---------

Co-authored-by: GitHub Actions Build <developers@aave.com>
Co-authored-by: Dmitry Petrov <satanworker@gmail.com>
Co-authored-by: sendra <polsendra@gmail.com>
Co-authored-by: Dimitris Apostolou <dimitris.apostolou@icloud.com>
  • Loading branch information
5 people authored Feb 7, 2023
1 parent 2121fd5 commit 0cd0222
Show file tree
Hide file tree
Showing 53 changed files with 1,520 additions and 9,684 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ coverage/
packages/*/dist/
node_modules
package-lock.json
.idea/
.idea
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,5 @@ also in the package.json paste these in:
"types": "./dist/esm/index.d.ts",
```

Thats it now start writing your logic, you must write your typescript code in
That's it. Now start writing your logic. You must write your typescript code in
the `src` folder in your package.
159 changes: 81 additions & 78 deletions README.md

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ module.exports = {
'packages/contract-helpers/src/paraswap-repayWithCollateralAdapter-contract/typechain',
'packages/contract-helpers/src/lendingPool-contract/typechain',
'packages/contract-helpers/src/v3-migration-contract/typechain',
'packages/contract-helpers/src/v3-migration-contract/typechain/factories',
'packages/contract-helpers/src/index.ts',
'packages/math-utils/src/formatters/reserve/index.ts', // TODO: remove
],
Expand Down
88 changes: 72 additions & 16 deletions packages/contract-helpers/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,99 @@
All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 1.12.2 (2023-01-12)
## 1.13.5 (2023-02-03)

**Note:** Version bump only for package @aave/contract-helpers
### Bug Fixes

- Fix typos ([#486](https://github.com/aave/aave-utilities/issues/486))
([db4cef5](https://github.com/aave/aave-utilities/commit/db4cef584a68f951183df25ffa2e8f2042893d21))

## 1.13.4 (2023-02-03)

### Bug Fixes

- check for liq threshold in place of ltv for user collateral check
([#505](https://github.com/aave/aave-utilities/issues/505))
([7c776d2](https://github.com/aave/aave-utilities/commit/7c776d23c50ff0d5240151a922c64e837818283d))

## 1.12.1 (2023-01-10)
## 1.13.3 (2023-01-26)

### Bug Fixes

- typechain structure
([#501](https://github.com/aave/aave-utilities/issues/501))
([70f3c4f](https://github.com/aave/aave-utilities/commit/70f3c4f4b066676a37636ed1be913e3056a70766))

## 1.13.2 (2023-01-25)

**Note:** Version bump only for package @aave/contract-helpers

# Change Log

All notable changes to this project will be documented in this file. See
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 1.13.1 (2023-01-24)

### Bug Fixes

* change flashloan parameters to have variable debt on v3 instead of stable and variable ([#490](https://github.com/aave/aave-utilities/issues/490)) ([9b8a726](https://github.com/aave/aave-utilities/commit/9b8a7261ba9c3e123798d781312a5388271cef3b))
<<<<<<< HEAD

- imports and file loaders
([#477](https://github.com/aave/aave-utilities/issues/477))
([42e8530](https://github.com/aave/aave-utilities/commit/42e853041820a35696c1017eb2fb082aeb9e3c89))
=======

* apply default gas limit estimations
([#499](https://github.com/aave/aave-utilities/issues/499))
([b377452](https://github.com/aave/aave-utilities/commit/b37745255194cc2f8c713bc3451a05dc8bab20a1))

> > > > > > > master
# 1.13.0 (2023-01-23)

# 1.12.0 (2023-01-03)
<<<<<<< HEAD

# 1.10.0 (2022-12-14)

### Features

* add V3Faucet service ([#475](https://github.com/aave/aave-utilities/issues/475)) ([1608398](https://github.com/aave/aave-utilities/commit/160839863a83955d54a4a1e727bb4a22f111c13e))
=======

### Features

- add default gas estimation for borrow and vote
([#492](https://github.com/aave/aave-utilities/issues/492))
([713ad36](https://github.com/aave/aave-utilities/commit/713ad361215f0fcbaaf07f7e374489459d1874ae))
> > > > > > > master
* add default gas estimation for permit actions
([#461](https://github.com/aave/aave-utilities/issues/461))
([7342763](https://github.com/aave/aave-utilities/commit/734276326b1d6b0b2b9aa9965bbd3f310ae0ec37))

# 1.9.0 (2022-10-14)

## 1.12.2 (2023-01-12)

**Note:** Version bump only for package @aave/contract-helpers

## 1.12.1 (2023-01-10)

### Bug Fixes

- change flashloan parameters to have variable debt on v3 instead of stable and
variable ([#490](https://github.com/aave/aave-utilities/issues/490))
([9b8a726](https://github.com/aave/aave-utilities/commit/9b8a7261ba9c3e123798d781312a5388271cef3b))

# 1.12.0 (2023-01-03)

### Features

# <<<<<<< HEAD

- add V3Faucet service
([#475](https://github.com/aave/aave-utilities/issues/475))
([1608398](https://github.com/aave/aave-utilities/commit/160839863a83955d54a4a1e727bb4a22f111c13e))

## 1.11.2 (2022-12-29)

Expand All @@ -45,20 +109,12 @@ All notable changes to this project will be documented in this file. See

**Note:** Version bump only for package @aave/contract-helpers

# 1.10.0 (2022-12-14)

### Features

- add default gas estimation for permit actions
([#461](https://github.com/aave/aave-utilities/issues/461))
([7342763](https://github.com/aave/aave-utilities/commit/734276326b1d6b0b2b9aa9965bbd3f310ae0ec37))

# 1.11.0 (2022-12-21)

# 1.9.0 (2022-10-14)

### Features

> > > > > > > master
- v3 migration ([#465](https://github.com/aave/aave-utilities/issues/465))
([ac9197f](https://github.com/aave/aave-utilities/commit/ac9197f6a2237b34e917d23bc79798efe3e04cb1))

Expand Down
2 changes: 1 addition & 1 deletion packages/contract-helpers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aave/contract-helpers",
"version": "1.12.2",
"version": "1.13.5",
"sideEffects": false,
"license": "MIT",
"description": "",
Expand Down
4 changes: 2 additions & 2 deletions packages/contract-helpers/src/commons/BaseService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('BaseService', () => {
afterEach(() => {
jest.clearAllMocks();
});
it('Expects to initalize new instance', () => {
it('Expects to initialize new instance', () => {
const spy = jest.spyOn(Test__factory, 'connect');

const baseService = new BaseService(provider, Test__factory);
Expand Down Expand Up @@ -90,7 +90,7 @@ describe('BaseService', () => {
expect(tx.value).toEqual(DEFAULT_NULL_VALUE_ON_TX);
expect(tx.gasLimit).toEqual(BigNumber.from(1));
});
it('Expects a tx object with recomended gas limit', async () => {
it('Expects a tx object with recommended gas limit', async () => {
const txCallback = baseService.generateTxCallback({
rawTxMethod,
from,
Expand Down
2 changes: 1 addition & 1 deletion packages/contract-helpers/src/commons/BaseService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default class BaseService<T extends Contract> {
const { gasLimit, gasPrice: gasPriceProv }: transactionType =
await txCallback();
if (!gasLimit) {
// If we don't recieve the correct gas we throw a error
// If we don't receive the correct gas we throw an error
throw new Error('Transaction calculation error');
}

Expand Down
2 changes: 2 additions & 0 deletions packages/contract-helpers/src/commons/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export enum eEthereumTxType {
export enum ProtocolAction {
default = 'default',
supply = 'supply',
borrow = 'borrow',
withdraw = 'withdraw',
deposit = 'deposit',
liquidationCall = 'liquidationCall',
Expand All @@ -110,6 +111,7 @@ export enum ProtocolAction {
repayWithPermit = 'repayWithPermit',
stake = 'stake',
stakeWithPermit = 'stakeWithPermit',
vote = 'vote',
}

export enum GovernanceVote {
Expand Down
8 changes: 8 additions & 0 deletions packages/contract-helpers/src/commons/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ export const gasLimitRecommendations: GasRecommendationType = {
limit: '300000',
recommended: '300000',
},
[ProtocolAction.borrow]: {
limit: '400000',
recommended: '400000',
},
[ProtocolAction.withdraw]: {
limit: '230000',
recommended: '300000',
Expand Down Expand Up @@ -98,6 +102,10 @@ export const gasLimitRecommendations: GasRecommendationType = {
limit: '400000',
recommended: '400000',
},
[ProtocolAction.vote]: {
limit: '125000',
recommended: '125000',
},
};

export const mintAmountsPerToken: Record<string, string> = {
Expand Down
113 changes: 0 additions & 113 deletions packages/contract-helpers/src/gho/GhoDiscountRateStrategyService.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/contract-helpers/src/gho/GhoService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class GhoService implements IGhoService {
);

return {
userGhoDiscountRate: ghoUserData.userGhoDiscountRate.toString(),
userGhoDiscountPercent: ghoUserData.userGhoDiscountPercent.toString(),
userDiscountTokenBalance: ghoUserData.userDiscountTokenBalance.toString(),
userGhoScaledBorrowBalance:
ghoUserData.userGhoScaledBorrowBalance.toString(),
Expand Down
Loading

0 comments on commit 0cd0222

Please sign in to comment.