Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9c25276
dev: enable prettier for unified formatting in solidity files
bergben Aug 31, 2022
91a2c31
feat(flash-mint): implement FlashMintWrapped issuance
bergben Aug 31, 2022
330cd70
feat(flash-mint): implement flash mint wrapped redemption and finaliz…
bergben Aug 31, 2022
f049d20
feat: wrap calldata instead of adapters; add wrapCallTarget with allo…
bergben Sep 12, 2022
4cdc427
fix(DEXAdapter): fix multi path uniswap v2 swaps return value
bergben Sep 12, 2022
c64265b
tests(flashMintWrapped): implement unit tests for flash mint wrapped,…
bergben Sep 12, 2022
e21c237
tests(flashMintWrapped): implement integration tests
bergben Sep 12, 2022
905e8c0
docs: expand readme with info for integration tests
bergben Sep 12, 2022
98832e9
fix(DEXAdapter): fix _swapTokensForExactTokensUniV2 return value
bergben Sep 12, 2022
acd3a3a
chore(compoundWrapAdapter): clean up console logs
bergben Sep 12, 2022
ca0441d
feat(flashMintWrapped): reintroduce wrap adapters directly instead of…
bergben Sep 15, 2022
e3f9678
feat(flashMintWrapped): rename debtIssuanceModule to issuanceModule, …
bergben Sep 15, 2022
dd145f8
test(flashMintWrapped): adjust tests for direct wrap data instead of …
bergben Sep 15, 2022
bf5a352
docs: add note for yarn chain requirement to run yarn test
bergben Sep 15, 2022
0285bc1
docs(DEXAdapter): add note about changes
bergben Sep 20, 2022
ee28c18
dev(prettier): set bracket spacing true
bergben Sep 20, 2022
83ffa6e
tests(flash-mint-wrapped-integration): fix spelling
bergben Sep 20, 2022
d4833cb
feat(flash-mint-wrapped): use ownable and custom code instead of with…
bergben Sep 20, 2022
8592e86
tests(flash-mint-wrapped): implement unwrapped and mixed test cases
bergben Sep 20, 2022
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
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

15 changes: 14 additions & 1 deletion .prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,18 @@
"parser": "typescript",
"tabWidth": 2,
"trailingComma": "all",
"arrowParens": "always"
"arrowParens": "always",
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false,
"explicitTypes": "always"
}
}
]
}
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,18 @@ yarn

### Run Contract Tests

`yarn test` to run compiled contracts
`yarn test` to run compiled contracts (executes on network localhost, you need to have `yarn chain` running)

OR `yarn test:clean` if contracts have been typings need to be updated
OR `yarn test:clean` if contract typings need to be updated

### Run Integration Tests

`yarn chain:fork:ethereum` in one terminal to run chain fork. replace ethereum with polygon or optimism if needed, see package.json

`yarn test:integration:ethereum` in another terminal, replace chain again as needed

To run an individual test on e.g. a later block, use (replace path):
`LATESTBLOCK=15508111 INTEGRATIONTEST=true VERBOSE=true npx hardhat test ./test/integration/ethereum/flashMintWrappedIntegration.spec.ts --network localhost`

### Run Coverage Report for Tests

Expand Down
5 changes: 4 additions & 1 deletion contracts/exchangeIssuance/DEXAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,10 @@ library DEXAdapter {
returns (uint256)
{
_safeApprove(IERC20(_path[0]), address(_router), _amountIn);
return _router.swapExactTokensForTokens(_amountIn, _minAmountOut, _path, address(this), block.timestamp)[1];
uint256[] memory result = _router.swapExactTokensForTokens(_amountIn, _minAmountOut, _path, address(this), block.timestamp);
// result = uint[] memory The input token amount and all subsequent output token amounts.
// we are usually only interested in the actual amount of the output token (so result element at the last place)
return result[result.length-1];
}

/**
Expand Down
Loading