Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
604514b
testing around with replacing contracts
ControlCplusControlV Jul 5, 2023
58835ab
update tests
ControlCplusControlV Jul 7, 2023
be8f1c0
conflicts gone maybe???
ControlCplusControlV Jul 9, 2023
4c4f449
tests go green
ControlCplusControlV Jul 9, 2023
12fafe3
first pass at impl tests
ControlCplusControlV Jul 10, 2023
97ecab5
added advanceWithYield for sDAI+ completed openShort tests
ControlCplusControlV Jul 10, 2023
43cf71e
steth issues
ControlCplusControlV Jul 11, 2023
db094de
steth issues
ControlCplusControlV Jul 11, 2023
aef77cb
added Aave-V3
ControlCplusControlV Jul 11, 2023
87a94f6
updated code, still some issues with steth
ControlCplusControlV Jul 12, 2023
d2a01f3
fixed lido??
ControlCplusControlV Jul 12, 2023
dc5c021
progress on validation
ControlCplusControlV Jul 14, 2023
037b321
fix conflict
ControlCplusControlV Jul 14, 2023
d069274
added tests
ControlCplusControlV Jul 14, 2023
6063fcf
added more comments
ControlCplusControlV Jul 15, 2023
dd07828
remove createUser
ControlCplusControlV Jul 15, 2023
055980a
Update test/integrations/ERC4626Validation.t.sol
ControlCplusControlV Jul 15, 2023
97ddc08
move min
ControlCplusControlV Jul 15, 2023
2b3764f
remove console import
ControlCplusControlV Jul 15, 2023
cd29ba4
Merge branch 'main' into controlc/erc4626_consolidation
ControlCplusControlV Jul 17, 2023
f55e1d7
fixed naming issue
ControlCplusControlV Jul 17, 2023
ce71b32
fix function name
ControlCplusControlV Jul 17, 2023
5e8c85e
Merge branch 'controlc/erc4626_consolidation' of https://github.com/d…
ControlCplusControlV Jul 17, 2023
fe2945f
renamed balances
ControlCplusControlV Jul 17, 2023
2ef6116
used correct values
ControlCplusControlV Jul 17, 2023
f7c9bcf
cleaned up comments
ControlCplusControlV Jul 17, 2023
ee13095
consolidated setup logic
ControlCplusControlV Jul 17, 2023
1ab7422
undo lock file commit
ControlCplusControlV Jul 17, 2023
1922931
documented use of yield daddy
ControlCplusControlV Jul 17, 2023
bb47fd4
documented dependencies in the README
ControlCplusControlV Jul 17, 2023
adb6e73
more checks
ControlCplusControlV Jul 17, 2023
2396261
Revert "documented dependencies in the README"
ControlCplusControlV Jul 17, 2023
c979601
added more assertions
ControlCplusControlV Jul 17, 2023
c328f77
added more assertions
ControlCplusControlV Jul 17, 2023
0da9e4a
Update package.json
ControlCplusControlV Jul 18, 2023
ac7423c
Update test/integrations/StethERC4626.t.sol
ControlCplusControlV Jul 18, 2023
3fba8b7
Update test/integrations/sDai.t.sol
ControlCplusControlV Jul 18, 2023
5173e3b
Update test/integrations/ERC4626Validation.t.sol
ControlCplusControlV Jul 18, 2023
0692875
Update test/integrations/AaveV3ERC4626.t.sol
ControlCplusControlV Jul 18, 2023
575241e
Update test/integrations/AaveV3ERC4626.t.sol
ControlCplusControlV Jul 18, 2023
38bae20
fixed a minor rounding issue
ControlCplusControlV Jul 18, 2023
ad1353b
ooops
ControlCplusControlV Jul 18, 2023
86bb663
Update test/integrations/ERC4626Validation.t.sol
ControlCplusControlV Jul 18, 2023
0b419c9
comment
ControlCplusControlV Jul 18, 2023
e3e0518
Merge branch 'controlc/erc4626_consolidation' of https://github.com/d…
ControlCplusControlV Jul 18, 2023
0ab48c2
remove payable initialization flow
ControlCplusControlV Jul 18, 2023
860e83d
remove payable initialization flow
ControlCplusControlV Jul 18, 2023
426642a
added Aave comment
ControlCplusControlV Jul 18, 2023
f576432
more style nits
ControlCplusControlV Jul 18, 2023
2b82349
Update test/integrations/ERC4626Validation.t.sol
ControlCplusControlV Jul 18, 2023
2cdf77f
Update test/integrations/ERC4626Validation.t.sol
ControlCplusControlV Jul 18, 2023
742035f
consistent naming
ControlCplusControlV Jul 18, 2023
5e5302a
Merge branch 'controlc/erc4626_consolidation' of https://github.com/d…
ControlCplusControlV Jul 18, 2023
fcd210f
added rate assertions
ControlCplusControlV Jul 18, 2023
557f08c
oops comment
ControlCplusControlV Jul 18, 2023
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@
[submodule "lib/solmate"]
path = lib/solmate
url = https://github.com/transmissions11/solmate
[submodule "lib/yield-daddy"]
path = lib/yield-daddy
url = https://github.com/timeless-fi/yield-daddy
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ practices and style, prettier is a Solidity formatter that checks for formatting
and style, and cSpell is a spell checker. To run all three, run `yarn lint`.
If you want to automatically format the code, run `yarn prettier`.

## Yield Sources

The current suggested way of integrating your yield source with hyperdrive is through the [ERC-4626 standard](https://eips.ethereum.org/EIPS/eip-4626) although accomodations can be made if this is not possible. Hyperdrive currently makes use of [Yield Daddy](https://github.com/timeless-fi/yield-daddy) to wrap many existing yield sources into this standard.

# Disclaimer

The language used in this codebase is for coding convenience only, and is not
Expand Down
57 changes: 0 additions & 57 deletions contracts/src/factory/AaveHyperdriveDeployer.sol

This file was deleted.

116 changes: 0 additions & 116 deletions contracts/src/factory/AaveHyperdriveFactory.sol

This file was deleted.

52 changes: 0 additions & 52 deletions contracts/src/factory/DsrHyperdriveDeployer.sol

This file was deleted.

77 changes: 0 additions & 77 deletions contracts/src/factory/DsrHyperdriveFactory.sol

This file was deleted.

45 changes: 17 additions & 28 deletions contracts/src/factory/HyperdriveFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,9 @@ abstract contract HyperdriveFactory {
}

/// @notice Deploys a copy of hyperdrive with the given params
/// @dev Function is declared payable to allow payable overrides
/// for accepting Ether on initialization, but not supported
/// by default within this instance.
/// @param _config The configuration of the Hyperdrive pool.
/// @param _extraData The extra data is used by some factories
/// @param _contribution Base token to call init with
Expand All @@ -206,6 +209,9 @@ abstract contract HyperdriveFactory {
uint256 _contribution,
uint256 _apr
) public payable virtual returns (IHyperdrive) {
if (msg.value > 0) {
revert IHyperdrive.NonPayableInitialization();
}
// Overwrite the governance and fees field of the config.
_config.feeCollector = feeCollector;
_config.governance = address(this);
Expand All @@ -230,35 +236,18 @@ abstract contract HyperdriveFactory {
)
);

// We only do ERC20 transfers when we deploy an ERC20 pool
if (address(_config.baseToken) != ETH) {
// Initialize the Hyperdrive instance.
_config.baseToken.transferFrom(
msg.sender,
address(this),
_contribution
);
if (
!_config.baseToken.approve(
address(hyperdrive),
type(uint256).max
)
) {
revert IHyperdrive.ApprovalFailed();
}
hyperdrive.initialize(_contribution, _apr, msg.sender, true);
} else {
// Require the caller sent value
if (msg.value != _contribution) {
revert IHyperdrive.TransferFailed();
}
hyperdrive.initialize{ value: _contribution }(
_contribution,
_apr,
msg.sender,
true
);
// Initialize the Hyperdrive instance.
_config.baseToken.transferFrom(
msg.sender,
address(this),
_contribution
);
if (
!_config.baseToken.approve(address(hyperdrive), type(uint256).max)
) {
revert IHyperdrive.ApprovalFailed();
}
hyperdrive.initialize(_contribution, _apr, msg.sender, true);

// Setup the pausers roles from the default array
for (uint256 i = 0; i < defaultPausers.length; i++) {
Expand Down
Loading