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

chore: re release #27

Merged
merged 6 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
[submodule "lib/tokenized-strategy"]
path = lib/tokenized-strategy
url = https://github.com/yearn/tokenized-strategy
branch = v3.0.1
branch = 3.0.1
[submodule "lib/yearn-vaults-v3"]
path = lib/yearn-vaults-v3
url = https://github.com/yearn/yearn-vaults-v3
branch = v3.0.1
branch = 3.0.1
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,21 @@ Run tests
make test
```

### Deployment

Deployment of periphery contracts such as the [Apr Oracle](https://github.com/yearn/tokenized-strategy-periphery/blob/master/src/AprOracle/AprOracle.sol) or [Common Report Trigger](https://github.com/yearn/tokenized-strategy-periphery/blob/master/src/ReportTrigger/CommonReportTrigger.sol) are done using a create2 factory in order to get a deterministic address that is the same on each EVM chain.

This can be done permissionlessly if the most recent contract has not yet been deployed on a chain you would like to use it on.

1. Add your deployers Private key under PRIVATE_KEY in your .env file.
- NOTE: make sure to add `0x` to the beginning of the key.
2. Run the deployment script
```sh
forge script script/Deploy.s.sol:Deploy --broadcast --rpc-url YOUR_RPC
```
- You can do a dry run before officially deploying by removing the `--broadcast` flag.
- For chains that don't support 1559 tx's you may need to add a `--legacy` flag.
3. The address the contract was deployed at will print in the console and should match any other chain the same version has been deployed on.
## Swapper helper contracts

For strategies that need to swap reward tokens back into 'asset' a series of 'swapper' contracts have been pre-developed to make your preferred method as easy as possible to use.
Expand Down
3 changes: 3 additions & 0 deletions src/AprOracle/AprOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ contract AprOracle {
) public view returns (uint256 apr) {
IVault vault = IVault(_vault);

// Check if the full profit has already been unlocked.
if (vault.fullProfitUnlockDate() <= block.timestamp) return 0;

// Need the total assets in the vault post delta.
uint256 assets = uint256(int256(vault.totalAssets()) + _delta);

Expand Down
2 changes: 1 addition & 1 deletion src/ReportTrigger/CommonReportTrigger.sol
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
// vaultAddress => strategyAddress => customBaseFee.
mapping(address => mapping(address => uint256)) public customVaultBaseFee;

constructor(address _governance) Governance(_governance) {}

Check warning on line 102 in src/ReportTrigger/CommonReportTrigger.sol

View workflow job for this annotation

GitHub Actions / solidity

Code contains empty blocks

/*//////////////////////////////////////////////////////////////
CUSTOM SETTERS
Expand Down Expand Up @@ -356,7 +356,7 @@
IVault vault = IVault(_vault);

// Don't report if the vault is shutdown.
if (vault.shutdown()) return (false, bytes("Shutdown"));
if (vault.isShutdown()) return (false, bytes("Shutdown"));

// Cache the strategy parameters.
IVault.StrategyParams memory params = vault.strategies(_strategy);
Expand Down
3 changes: 1 addition & 2 deletions src/test/utils/Setup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {VaultConstants, Roles} from "@yearn-vaults/interfaces/VaultConstants.sol
import {IVaultFactory} from "@yearn-vaults/interfaces/IVaultFactory.sol";

import {MockStrategy} from "../mocks/MockStrategy.sol";
import {Governance} from "../../utils/Governance.sol";

contract Setup is ExtendedTest {
VyperDeployer public vyperDeployer = new VyperDeployer();
Expand Down Expand Up @@ -189,7 +188,7 @@ contract Setup is ExtendedTest {
}

function setFees(uint16 _protocolFee, uint16 _performanceFee) public {
address gov = Governance(address(vaultFactory)).governance();
address gov = vaultFactory.governance();

// Need to make sure there is a protocol fee recipient to set the fee.
vm.prank(gov);
Expand Down
Loading