Skip to content

Commit

Permalink
refactor: utils repository (#104)
Browse files Browse the repository at this point in the history
* forge install: utils

* refactor: use utils repository for addresses and other utils functions

* chore: install node_modules in ci

* chore: update ci-deep to install node_modules

* feat: updqte vanity script to write to json and ageur more globally

* feat: use CHQIN_SOURCE instead of CHAIN_ETHEREUM

* feat: use CHAIN_SORUCE everywhere and fix wrong imports
  • Loading branch information
0xtekgrinder authored Feb 2, 2024
1 parent addb648 commit 61d9be3
Show file tree
Hide file tree
Showing 39 changed files with 1,186 additions and 399 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci-deep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ jobs:
with:
version: nightly

- name: Install node_modules
run: yarn install

- name: Compile foundry
run: yarn compile --sizes

Expand All @@ -65,6 +68,7 @@ jobs:
path: |
cache-forge
out
node_modules
- name: "Add build summary"
run: |
Expand All @@ -85,6 +89,7 @@ jobs:
path: |
cache-forge
out
node_modules
key: "build-${{ github.sha }}"

- name: Install Foundry
Expand All @@ -109,6 +114,7 @@ jobs:
path: |
cache-forge
out
node_modules
key: "build-${{ github.sha }}"

- name: Install Foundry
Expand Down Expand Up @@ -136,6 +142,7 @@ jobs:
path: |
cache-forge
out
node_modules
key: "build-${{ github.sha }}"

- name: Install Foundry
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ jobs:
with:
version: nightly

- name: Install node_modules
run: yarn install

- name: Compile foundry
run: yarn compile --sizes

Expand All @@ -54,6 +57,7 @@ jobs:
path: |
cache-forge
out
node_modules
- name: "Add build summary"
run: |
Expand All @@ -74,6 +78,7 @@ jobs:
path: |
cache-forge
out
node_modules
key: "build-${{ github.sha }}"

- name: Install Foundry
Expand All @@ -98,6 +103,7 @@ jobs:
path: |
cache-forge
out
node_modules
key: "build-${{ github.sha }}"

- name: Install Foundry
Expand Down Expand Up @@ -125,6 +131,7 @@ jobs:
path: |
cache-forge
out
node_modules
key: "build-${{ github.sha }}"

- name: Install Foundry
Expand All @@ -145,6 +152,15 @@ jobs:
with:
submodules: "recursive"

- uses: actions/cache/restore@v3
with:
fail-on-cache-miss: true
path: |
cache-forge
out
node_modules
key: "build-${{ github.sha }}"

- name: "Install Foundry"
uses: "foundry-rs/foundry-toolchain@v1"

Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/utils"]
path = lib/utils
url = https://github.com/AngleProtocol/utils
1 change: 1 addition & 0 deletions lib/utils
Submodule utils added at e33f4b
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,7 @@
"solhint": "^3.5.1",
"solhint-plugin-prettier": "^0.0.5"
},
"dependencies": {}
"dependencies": {
"@angleprotocol/sdk": "^3.0.129"
}
}
1 change: 1 addition & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ oz-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/
mock/=test/mock/
prb/math/=lib/prb-math/src/
borrow/=lib/borrow-contracts/contracts
utils/=lib/utils
13 changes: 3 additions & 10 deletions scripts/Constants.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,16 @@
pragma solidity ^0.8.19;

import "contracts/utils/Constants.sol";
import { CHAIN_ETHEREUM } from "utils/src/Constants.sol";

/*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
MAINNET CONSTANTS
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/

address constant ACCESS_CONTROL_MANAGER = 0x5bc6BEf80DA563EBf6Df6D6913513fa9A7ec89BE;
address constant CHAIN_AGEUR = 0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8;
address constant GOVERNOR = 0xdC4e6DFe07EFCa50a197DF15D9200883eF4Eb1c8;
address constant GUARDIAN = 0x0C2553e4B9dFA9f83b1A6D3EAB96c4bAaB42d430;
address constant PROXY_ADMIN = 0x1D941EF0D3Bba4ad67DBfBCeE5262F4CEE53A32b;
address constant PROXY_ADMIN_GUARDIAN = 0xD9F1A8e00b0EEbeDddd9aFEaB55019D55fcec017;
address constant TREASURY_EUR = 0x8667DBEBf68B0BFa6Db54f550f41Be16c4067d60;
address constant TREASURY_USD = 0xf8588520E760BB0b3bDD62Ecb25186A28b0830ee;
uint256 constant CHAIN_SOURCE = CHAIN_ETHEREUM;

address constant IMMUTABLE_CREATE2_FACTORY_ADDRESS = 0x0000000000FFe8B47B3e2130213B802212439497;
address constant DEPLOYER = 0xfdA462548Ce04282f4B6D6619823a7C64Fdc0185;
address constant TRANSMUTER_EUR = 0x00253582b2a3FE112feEC532221d9708c64cEFAb;
address constant TRANSMUTER_USD = 0x222222fD79264BBE280b4986F6FEfBC3524d0137;

address constant EUROC = 0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c;
address constant EUROE = 0x820802Fa8a99901F52e39acD21177b0BE6EE2974;
Expand Down
22 changes: 0 additions & 22 deletions scripts/ConstantsArbitrum.s.sol

This file was deleted.

17 changes: 0 additions & 17 deletions scripts/ConstantsAvalanche.s.sol

This file was deleted.

17 changes: 0 additions & 17 deletions scripts/ConstantsBSC.s.sol

This file was deleted.

17 changes: 0 additions & 17 deletions scripts/ConstantsBase.s.sol

This file was deleted.

18 changes: 0 additions & 18 deletions scripts/ConstantsCelo.s.sol

This file was deleted.

17 changes: 0 additions & 17 deletions scripts/ConstantsGnosis.s.sol

This file was deleted.

11 changes: 0 additions & 11 deletions scripts/ConstantsLinea.s.sol

This file was deleted.

18 changes: 0 additions & 18 deletions scripts/ConstantsOptimism.s.sol

This file was deleted.

18 changes: 0 additions & 18 deletions scripts/ConstantsPolygon.s.sol

This file was deleted.

17 changes: 0 additions & 17 deletions scripts/ConstantsPolygonZkEVM.s.sol

This file was deleted.

6 changes: 3 additions & 3 deletions scripts/DeployRebalancer.s.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;

import { Utils } from "./utils/Utils.s.sol";
import "./utils/Utils.s.sol";
import { console } from "forge-std/console.sol";
import { Rebalancer } from "contracts/helpers/Rebalancer.sol";
import { IAccessControlManager } from "contracts/utils/AccessControl.sol";
Expand All @@ -18,8 +18,8 @@ contract DeployRebalancer is Utils {
address deployer = vm.addr(deployerPrivateKey);
console.log("Deployer address: ", deployer);
Rebalancer rebalancer = new Rebalancer(
IAccessControlManager(ACCESS_CONTROL_MANAGER),
ITransmuter(TRANSMUTER_EUR)
IAccessControlManager(_chainToContract(CHAIN_SOURCE, ContractType.CoreBorrow)),
ITransmuter(_chainToContract(CHAIN_SOURCE, ContractType.TransmuterAgEUR))
);
console.log("Rebalancer deployed at: ", address(rebalancer));

Expand Down
2 changes: 1 addition & 1 deletion scripts/DeployRedeemer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ contract DeployRedeemer is Utils {
address oldRedeemer = 0x8E669F6eF8485694196F32d568BA4Ac268b9FE8f;

function run() external {
// vm.startPrank(GOVERNOR);
// vm.startPrank(_chainToContract(CHAIN_SOURCE, ContractType.GovernorMultisig);

uint256 deployerPrivateKey = vm.deriveKey(vm.envString("MNEMONIC_FORK"), 0);
address deployer = vm.addr(deployerPrivateKey);
Expand Down
Loading

0 comments on commit 61d9be3

Please sign in to comment.