-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add GOhmTokenEscrow * Add ALE * Add Cvx Crv feed and escrow * Add Cvx Fxs feed and escrow * Add DAI feed and escrow * Add wstETH feed * Add st-yETH feed * Add wBTC feed * Add GovToken escrow * Add DbrDistributor ------------------------------------------------------------------------------------------------------------------ Co-authored-by: webmass <[email protected]> Co-authored-by: Nour Haridy <[email protected]> Co-authored-by: lacoop6tu <[email protected]> Co-authored-by: lacoop6tu <[email protected]> Co-authored-by: 0xtj24 <[email protected]> Co-authored-by: 0xtj24 <[email protected]>
- Loading branch information
Showing
159 changed files
with
34,828 additions
and
1,503 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the main and dev branch | ||
push: | ||
branches: [main, dev] | ||
pull_request: | ||
branches: [main, dev] | ||
name: test | ||
|
||
jobs: | ||
check: | ||
name: Foundry project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
|
||
- name: Run tests | ||
env: | ||
RPC_MAINNET: ${{ secrets.RPC_MAINNET }} | ||
run: forge test -vvv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,10 @@ | ||
cache/ | ||
out/ | ||
|
||
lcov.info | ||
broadcast/ | ||
coverage/ | ||
foundry.toml | ||
lcov.info | ||
.env | ||
*.sh | ||
*.info | ||
temp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "lib/openzeppelin-contracts"] | ||
path = lib/openzeppelin-contracts | ||
url = https://github.com/OpenZeppelin/openzeppelin-contracts | ||
[submodule "lib/solmate"] | ||
path = lib/solmate | ||
url = https://github.com/transmissions11/solmate.git |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
[profile.default] | ||
src = 'src' | ||
out = 'out' | ||
evm_version = "cancun" | ||
libs = ['lib'] | ||
optimizer = true | ||
optimizer_runs = 10000 | ||
out = 'out' | ||
solc = "0.8.20" | ||
src = 'src' | ||
[rpc_endpoints] | ||
mainnet = "${RPC_MAINNET}" | ||
[etherscan] | ||
mainnet = {key = "${ETHERSCAN_API_KEY}"} | ||
|
||
# See more config options https://github.com/foundry-rs/foundry/tree/master/config | ||
# See more config options https://github.com/foundry-rs/foundry/tree/master/config |
Submodule forge-std
updated
63 files
Submodule openzeppelin-contracts
added at
a241f0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ | ||
ds-test/=lib/forge-std/lib/ds-test/src/ | ||
erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/ | ||
forge-std/=lib/forge-std/src/ | ||
openzeppelin-contracts/=lib/openzeppelin-contracts/ | ||
solmate/=lib/solmate/src/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.13; | ||
|
||
import {Script, console2} from "forge-std/Script.sol"; | ||
import {ERC4626Helper} from "src/util/ERC4626Helper.sol"; | ||
import {ConfigAddr} from "test/ConfigAddr.sol"; | ||
|
||
contract Deploy is Script, ConfigAddr { | ||
function run() public { | ||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); | ||
vm.createSelectFork(vm.envString("RPC_MAINNET")); | ||
vm.broadcast(deployerPrivateKey); | ||
ERC4626Helper helper = new ERC4626Helper(gov, pauseGuardian); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
pragma solidity ^0.8.13; | ||
import "forge-std/Script.sol"; | ||
import {Market} from "src/Market.sol"; | ||
import {BorrowController} from "src/BorrowController.sol"; | ||
import "src/DBR.sol"; | ||
|
||
interface IBorrowController { | ||
function setDailyLimit(address market, uint newLimit) external; | ||
function dailyLimits(address market) external returns(uint); | ||
function allow(address market) external; | ||
function setOperator(address gov) external; | ||
} | ||
|
||
|
||
contract borrowControllerSetup is Script { | ||
address gov = 0x926dF14a23BE491164dCF93f4c468A50ef659D5B; | ||
address deployerAddress = 0x11EC78492D53c9276dD7a184B1dbfB34E50B710D; | ||
IBorrowController oldBorrowController = IBorrowController(0x20C7349f6D6A746a25e66f7c235E96DAC880bc0D); | ||
BorrowController newBorrowController; // = BorrowController(0x81ff13c46f363D13fC25FB801a4335c6097B7862); | ||
DolaBorrowingRights DBR = DolaBorrowingRights(0xAD038Eb671c44b853887A7E32528FaB35dC5D710); | ||
address[] markets = | ||
[ | ||
0x93685185666c8D34ad4c574B3DBF41231bbfB31b, //cvxFxs | ||
0x3474ad0e3a9775c9F68B415A7a9880B0CAB9397a, //cvxCrv | ||
0x63fAd99705a255fE2D500e498dbb3A9aE5AA1Ee8, //crv | ||
0x7Cd3ab8354289BEF52c84c2BF0A54E3608e66b37, //gohm | ||
0xb516247596Ca36bf32876199FBdCaD6B3322330B, //inv | ||
0x743A502cf0e213F6FEE56cD9C6B03dE7Fa951dCf, //steth | ||
0x63Df5e23Db45a2066508318f172bA45B9CD37035, //weth | ||
0x27b6c301Fd441f3345d61B7a4245E1F823c3F9c4 //stycrv | ||
]; | ||
|
||
function run() external { | ||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); | ||
vm.broadcast(deployerPrivateKey); | ||
newBorrowController = new BorrowController(deployerAddress, address(DBR)); | ||
|
||
for(uint i; i < markets.length; ++i){ | ||
address market = markets[i]; | ||
require(DBR.markets(market), "Not a market"); | ||
uint oldLimit = oldBorrowController.dailyLimits(market); | ||
vm.broadcast(deployerPrivateKey); | ||
newBorrowController.setDailyLimit(market, oldLimit); | ||
} | ||
|
||
//Add helper contract to allowList | ||
vm.broadcast(deployerPrivateKey); | ||
newBorrowController.allow(0xae8165f37FC453408Fb1cd1064973df3E6499a76); | ||
|
||
//Transfer ownership to gov | ||
vm.broadcast(deployerPrivateKey); | ||
newBorrowController.setOperator(gov); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.