Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pm/zap token to pt #230

Merged
merged 102 commits into from
Dec 20, 2021
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
142126a
update all packages
Padraic-O-Mhuiris Nov 4, 2021
101eb7c
remove invalid awaits
Padraic-O-Mhuiris Nov 4, 2021
35a6658
removed incorrect string
Padraic-O-Mhuiris Nov 4, 2021
13c4fbc
fix cspell
Padraic-O-Mhuiris Nov 4, 2021
9af7358
cleanup some soft warnings
Padraic-O-Mhuiris Nov 4, 2021
d20f299
using joinPoolRequestStruct
Padraic-O-Mhuiris Nov 4, 2021
19221e8
fixed batchSwap
Padraic-O-Mhuiris Nov 4, 2021
8b3e7fb
fixed module aliasing bug
Padraic-O-Mhuiris Nov 5, 2021
019f819
removed console.logs
Padraic-O-Mhuiris Nov 5, 2021
27c790d
update hardhat ethers
Padraic-O-Mhuiris Nov 8, 2021
223cbfa
update
Padraic-O-Mhuiris Nov 8, 2021
36c08f4
added typecheck ci step
Padraic-O-Mhuiris Nov 8, 2021
b7519e2
bumped hardhat to latest
Padraic-O-Mhuiris Nov 8, 2021
cb6777b
revert hardhat to previous
Padraic-O-Mhuiris Nov 8, 2021
4f0baca
fix coverage
Padraic-O-Mhuiris Nov 8, 2021
d7a0449
remove typechecking
Padraic-O-Mhuiris Nov 8, 2021
57e69b6
fix typecheck
Padraic-O-Mhuiris Nov 8, 2021
2625aab
init
Padraic-O-Mhuiris Nov 9, 2021
ba66db4
Update packages to latest (#227)
Padraic-O-Mhuiris Nov 9, 2021
b54ac42
update all packages
Padraic-O-Mhuiris Nov 9, 2021
1c6fda3
fix cspell
Padraic-O-Mhuiris Nov 4, 2021
fc3f311
cleanup some soft warnings
Padraic-O-Mhuiris Nov 4, 2021
36d110d
fixed module aliasing bug
Padraic-O-Mhuiris Nov 9, 2021
f902fdd
removed console.logs
Padraic-O-Mhuiris Nov 5, 2021
5909651
update
Padraic-O-Mhuiris Nov 9, 2021
4a11dfd
added typecheck ci step
Padraic-O-Mhuiris Nov 8, 2021
b0b75b0
fix coverage
Padraic-O-Mhuiris Nov 8, 2021
9b6b290
reset
Padraic-O-Mhuiris Nov 9, 2021
2f0c988
Merge branch 'main' of github.com:element-fi/elf-contracts into pm/za…
Padraic-O-Mhuiris Nov 9, 2021
f59e70f
readd deployer
Padraic-O-Mhuiris Nov 9, 2021
be774e7
update block to latest
Padraic-O-Mhuiris Nov 9, 2021
519dd70
ckwejhbc
Padraic-O-Mhuiris Nov 10, 2021
f0eac38
cwlekn
Padraic-O-Mhuiris Nov 11, 2021
fe77443
pushing latest
Padraic-O-Mhuiris Nov 15, 2021
84fd001
cjbiec
Padraic-O-Mhuiris Nov 15, 2021
a496676
pushing latest
Padraic-O-Mhuiris Nov 17, 2021
975b132
pushing latest
Padraic-O-Mhuiris Nov 23, 2021
13ccdb4
updating to latest
Padraic-O-Mhuiris Nov 23, 2021
14c1ddd
bkjb
Padraic-O-Mhuiris Nov 25, 2021
81d8ab1
update
Padraic-O-Mhuiris Nov 26, 2021
ab91cd7
simplified deploy process
Padraic-O-Mhuiris Nov 27, 2021
0a195c8
cached addLiquidity func call
Padraic-O-Mhuiris Nov 27, 2021
f005b18
hv
Padraic-O-Mhuiris Nov 28, 2021
4b2fb7f
zapOut
Padraic-O-Mhuiris Nov 29, 2021
dbcf1f7
pushing latest
Padraic-O-Mhuiris Nov 30, 2021
3cbf31c
pushing latest
Padraic-O-Mhuiris Nov 30, 2021
67781ce
ldeqwk
Padraic-O-Mhuiris Nov 30, 2021
42a556f
refactored bootstrapping of tests
Padraic-O-Mhuiris Dec 2, 2021
d7fb144
pushing latest of estimation work
Padraic-O-Mhuiris Dec 2, 2021
c6e8960
remove dependencies
Padraic-O-Mhuiris Dec 2, 2021
c14f082
removed comment
Padraic-O-Mhuiris Dec 2, 2021
eb1654b
Merge branch 'main' of github.com:element-fi/elf-contracts into pm/za…
Padraic-O-Mhuiris Dec 2, 2021
d39e28d
pushing latest
Padraic-O-Mhuiris Dec 2, 2021
5256640
finalized tests
Padraic-O-Mhuiris Dec 3, 2021
5878c5d
fix convergentCurvePool test
Padraic-O-Mhuiris Dec 3, 2021
3c31cd6
rename function
Padraic-O-Mhuiris Dec 6, 2021
2928648
simplified zapIn
Padraic-O-Mhuiris Dec 6, 2021
cbb9e8a
comments on the zap contract
Padraic-O-Mhuiris Dec 6, 2021
2c1bd99
more comments
Padraic-O-Mhuiris Dec 6, 2021
57ffab2
update
Padraic-O-Mhuiris Dec 7, 2021
215e039
utilise userProxy permitCall modifier
Padraic-O-Mhuiris Dec 8, 2021
8fa139b
update
Padraic-O-Mhuiris Dec 8, 2021
e23c7e4
added permit tests for zapIn and zapOut
Padraic-O-Mhuiris Dec 9, 2021
7f18e10
relabel test
Padraic-O-Mhuiris Dec 9, 2021
cd4b4dc
reenabled hardhat-gas reporting
Padraic-O-Mhuiris Dec 9, 2021
bd8e7e4
reset config blocknumber
Padraic-O-Mhuiris Dec 9, 2021
a193ff7
remove .only
Padraic-O-Mhuiris Dec 9, 2021
9fc3494
fixed events out of order?
Padraic-O-Mhuiris Dec 9, 2021
2616ea3
spell-check
Padraic-O-Mhuiris Dec 9, 2021
f82785a
spellings
Padraic-O-Mhuiris Dec 9, 2021
be81d4a
more spellings
Padraic-O-Mhuiris Dec 10, 2021
2eea391
fixup
Padraic-O-Mhuiris Dec 10, 2021
d7f7cfc
Revert "fixed events out of order?"
Padraic-O-Mhuiris Dec 10, 2021
e3028d1
fix permit
Padraic-O-Mhuiris Dec 10, 2021
c698d3e
add sanity-check for setApprovals function
Padraic-O-Mhuiris Dec 10, 2021
da87430
declared custom interfaces in separate file
Padraic-O-Mhuiris Dec 10, 2021
580b368
fixup
Padraic-O-Mhuiris Dec 10, 2021
821e9c6
increase memory to fix coverage issues
Padraic-O-Mhuiris Dec 10, 2021
e247f01
bump memory
Padraic-O-Mhuiris Dec 10, 2021
159354c
using node option for memory
Padraic-O-Mhuiris Dec 10, 2021
8f5ba38
remove zaps from coverage
Padraic-O-Mhuiris Dec 10, 2021
ccef6cf
Merge branch 'main' of github.com:element-fi/elf-contracts into pm/za…
Padraic-O-Mhuiris Dec 11, 2021
7a2d024
Comments
Padraic-O-Mhuiris Dec 13, 2021
bcab0cd
more comments
Padraic-O-Mhuiris Dec 13, 2021
02ce019
fix array length sanity check
Padraic-O-Mhuiris Dec 13, 2021
35fede8
comments
Padraic-O-Mhuiris Dec 13, 2021
7d714d3
spelling
Padraic-O-Mhuiris Dec 13, 2021
b43d32d
refactor for loop in _zapCurveLpIn
Padraic-O-Mhuiris Dec 13, 2021
381a3ff
add min amount for curve add_liquidity
Padraic-O-Mhuiris Dec 13, 2021
d0a6d40
Improved explanation of swapping lpToken -> rootToken
Padraic-O-Mhuiris Dec 13, 2021
38033fb
added minBaseToken amount for zapOut
Padraic-O-Mhuiris Dec 13, 2021
1c61d51
spelling
Padraic-O-Mhuiris Dec 13, 2021
0ce880d
added differential token amounts considerations
Padraic-O-Mhuiris Dec 13, 2021
5e33315
spelling
Padraic-O-Mhuiris Dec 13, 2021
cfa5df5
Made short-circuit logic clearer
Padraic-O-Mhuiris Dec 14, 2021
8ee2db6
tidying up
Padraic-O-Mhuiris Dec 14, 2021
749e014
TODO comment on possible validation improvements and problem which
Padraic-O-Mhuiris Dec 14, 2021
50d8df7
spelling
Padraic-O-Mhuiris Dec 14, 2021
aeb8bd6
comment
Padraic-O-Mhuiris Dec 16, 2021
89dac38
some rearrangement and security patches (#236)
satyamakgec Dec 17, 2021
7a8e265
fix for change in permit struct
Padraic-O-Mhuiris Dec 17, 2021
38c4200
include receive function
Padraic-O-Mhuiris Dec 17, 2021
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 .github/workflows/cov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Coverage
run: npm run build && npm run coverage
- name: Edit lcov.info
run: cat coverage/lcov.info | sed '/.*\/balancer-core-v2\/.*/,/TN:/d' | sed '/.*\/test\/.*/,/TN:/d' > coverage/tmp.info && mv coverage/tmp.info coverage/lcov.info
run: cat coverage/lcov.info | sed '/.*\/balancer-core-v2\/.*/,/TN:/d' | sed '/.*\/test\/.*/,/TN:/d' | sed '/.*\/zaps\/.*/,/TN:/d' > coverage/tmp.info && mv coverage/tmp.info coverage/lcov.info
- name: Coveralls
uses: coverallsapp/[email protected]
with:
Expand Down
7 changes: 6 additions & 1 deletion cSpell.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
"destinatary",
"ecsign",
"EIP",
"ePyvCurveLUSD",
"ePyvcrv3crypto",
"ePyvcrvSTETH",
"ERC",
"ethersproject",
"exitswap",
Expand All @@ -37,6 +40,7 @@
"IWETH",
"joinswap",
"keccak",
"LUSD",
"mixedcase",
"mkdirp",
"mload",
Expand All @@ -55,6 +59,7 @@
"returndatasize",
"secp",
"selfdestruct",
"Sighash",
"sload",
"sloads",
"solhint",
Expand Down Expand Up @@ -120,4 +125,4 @@
"contracts/balancer-core-v2/**/*"
],
"allowCompoundWords": false
}
}
3 changes: 3 additions & 0 deletions contracts/interfaces/IAsset.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pragma solidity ^0.8.0;

interface IAsset {}
44 changes: 44 additions & 0 deletions contracts/interfaces/IVault.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
pragma solidity ^0.8.0;

import "./IAsset.sol";

interface IVault {
enum SwapKind {
GIVEN_IN,
GIVEN_OUT
}

enum PoolSpecialization {
GENERAL,
MINIMAL_SWAP_INFO,
TWO_TOKEN
}

struct SingleSwap {
bytes32 poolId;
SwapKind kind;
IAsset assetIn;
IAsset assetOut;
uint256 amount;
bytes userData;
}

struct FundManagement {
address sender;
bool fromInternalBalance;
address payable recipient;
bool toInternalBalance;
}

function swap(
SingleSwap memory singleSwap,
FundManagement memory funds,
uint256 limit,
uint256 deadline
) external payable returns (uint256);

function getPool(bytes32 poolId)
external
view
returns (address, PoolSpecialization);
}
Loading