Skip to content

Commit

Permalink
🔀 Merge pull request #49 from arcadia-finance/dev
Browse files Browse the repository at this point in the history
Sync dev in main
  • Loading branch information
Thomas-Smets committed Nov 27, 2023
2 parents b6c48ce + 617397c commit 03f930c
Show file tree
Hide file tree
Showing 134 changed files with 4,392 additions and 4,279 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches:
- main
- dev
- AF-33-Partial-Liquidation
- AF*

env:
FOUNDRY_PROFILE: ci
Expand All @@ -21,8 +23,7 @@ jobs:
- name: Main Checkout
env:
SSH_KEY_FOR_SUBMODULE: ${{secrets.ACCOUNT_V2_DEPLOY_KEY}}
run:
mkdir $HOME/.ssh && echo "$SSH_KEY_FOR_SUBMODULE" > $HOME/.ssh/id_rsa && chmod 600 $HOME/.ssh/id_rsa && git submodule update --init --recursive
run: mkdir $HOME/.ssh && echo "$SSH_KEY_FOR_SUBMODULE" > $HOME/.ssh/id_rsa && chmod 600 $HOME/.ssh/id_rsa && git submodule update --init --recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
Expand Down
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
[submodule "lib/accounts-v2"]
path = lib/accounts-v2
url = git@github.com:arcadia-finance/accounts-v2.git
branch = dev
8 changes: 8 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ optimizer = true
optimizer_runs = 200
fuzz = { runs = 50, max_test_rejects = 100_000_000}

[profile.lite]
src = 'src'
out = 'out'
test = 'test'
libs = ['lib']
optimizer = false
fuzz = { runs = 50, max_test_rejects = 100_000_000}

[fmt]
bracket_spacing = true
int_types = "long"
Expand Down
2 changes: 1 addition & 1 deletion lib/accounts-v2
Submodule accounts-v2 updated 310 files
2 changes: 1 addition & 1 deletion lib/forge-std
Submodule forge-std updated 6 files
+1 −1 package.json
+11 −3 src/StdChains.sol
+25 −0 src/Vm.sol
+2 −6 test/StdChains.t.sol
+1 −1 test/StdCheats.t.sol
+2 −2 test/Vm.t.sol
2 changes: 1 addition & 1 deletion lib/solmate
Submodule solmate updated 3 files
+122 −121 .gas-snapshot
+26 −1 src/test/CREATE3.t.sol
+5 −1 src/utils/CREATE3.sol
2 changes: 1 addition & 1 deletion script/Constants/DeployConstants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created by Pragma Labs
* SPDX-License-Identifier: BUSL-1.1
*/
pragma solidity 0.8.19;
pragma solidity 0.8.22;

library DeployAddresses {
address public constant eth_base = 0x4200000000000000000000000000000000000006;
Expand Down
2 changes: 1 addition & 1 deletion script/Constants/TransferOwnershipConstants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created by Pragma Labs
* SPDX-License-Identifier: BUSL-1.1
*/
pragma solidity 0.8.19;
pragma solidity 0.8.22;

library ArcadiaContractAddresses {
// Todo: Update these addresses
Expand Down
58 changes: 24 additions & 34 deletions script/DeployLending.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* SPDX-License-Identifier: BUSL-1.1
*/
pragma solidity 0.8.19;
pragma solidity 0.8.22;

import "../lib/forge-std/src/Test.sol";
import { DeployAddresses } from "./Constants/DeployConstants.sol";
Expand All @@ -13,9 +13,9 @@ import { Factory } from "../lib/accounts-v2/src/Factory.sol";
import { Liquidator } from "../src/Liquidator.sol";

import { ERC20, DebtToken } from "../src/DebtToken.sol";
import { LendingPool, InterestRateModule } from "../src/LendingPool.sol";
import { LendingPool } from "../src/LendingPool.sol";
import { Tranche } from "../src/Tranche.sol";
import { TrustedCreditor } from "../src/TrustedCreditor.sol";
import { Creditor } from "../lib/accounts-v2/src/abstracts/Creditor.sol";

contract ArcadiaLendingDeployment is Test {
Factory public factory;
Expand All @@ -40,50 +40,40 @@ contract ArcadiaLendingDeployment is Test {
vm.startBroadcast(deployerPrivateKey);

factory = new Factory();
liquidator = new Liquidator(address(factory));
liquidator = new Liquidator();

pool_weth =
new LendingPool(vm.addr(deployerPrivateKey), ERC20(address(weth)), DeployAddresses.treasury_base, address(factory), address(liquidator));
pool_weth = new LendingPool(
vm.addr(deployerPrivateKey),
ERC20(address(weth)),
DeployAddresses.treasury_base,
address(factory),
address(liquidator)
);
srTranche_weth = new Tranche(address(pool_weth), "Senior", "sr");

pool_weth.setOriginationFee(10);
pool_weth.setMaxInitiatorFee(3 * 10 ** 18);
pool_weth.setLiquidationParameters(100, 500, 50, 3 * 10 ** 18, 3 * 10 ** 18);
pool_weth.setFixedLiquidationCost(0.002 * 10 ** 18);
pool_weth.addTranche(address(srTranche_weth), 85, 10);
pool_weth.setTreasuryInterestWeight(15);
pool_weth.setTreasuryLiquidationWeight(90);
pool_weth.setSupplyCap(10_000 * 10 ** 18);
pool_weth.setBorrowCap(1000 * 10 ** 18);
pool_weth.setInterestConfig(
InterestRateModule.InterestRateConfiguration({
baseRatePerYear: 15_000_000_000_000_000,
lowSlopePerYear: 70_000_000_000_000_000,
highSlopePerYear: 1_250_000_000_000_000_000,
utilisationThreshold: 70_000
})
);
pool_weth.setTreasuryWeights(15, 90);
pool_weth.setInterestParameters(15_000_000_000_000_000, 70_000_000_000_000_000, 1_250_000_000_000_000_000, 7000);
pool_weth.changeGuardian(vm.addr(deployerPrivateKey));

pool_usdc =
new LendingPool(vm.addr(deployerPrivateKey), ERC20(address(usdc)), DeployAddresses.treasury_base, address(factory), address(liquidator));
pool_usdc = new LendingPool(
vm.addr(deployerPrivateKey),
ERC20(address(usdc)),
DeployAddresses.treasury_base,
address(factory),
address(liquidator)
);
srTranche_usdc = new Tranche(address(pool_usdc), "Senior", "sr");

pool_usdc.setOriginationFee(10);
pool_usdc.setMaxInitiatorFee(5000 * 10 ** 6);
pool_weth.setLiquidationParameters(100, 500, 50, 5000 * 10 ** 6, 5000 * 10 ** 6);
pool_usdc.setFixedLiquidationCost(2 * 10 ** 6);
pool_usdc.addTranche(address(srTranche_usdc), 85, 10);
pool_usdc.setTreasuryInterestWeight(15);
pool_usdc.setTreasuryLiquidationWeight(90);
pool_usdc.setSupplyCap(15_000_000 * 10 ** 6);
pool_usdc.setBorrowCap(1_000_000 * 10 ** 6);
pool_usdc.setInterestConfig(
InterestRateModule.InterestRateConfiguration({
baseRatePerYear: 10_000_000_000_000_000,
lowSlopePerYear: 55_000_000_000_000_000,
highSlopePerYear: 1_000_000_000_000_000_000,
utilisationThreshold: 80_000
})
);
pool_usdc.setTreasuryWeights(15, 90);
pool_usdc.setInterestParameters(10_000_000_000_000_000, 55_000_000_000_000_000, 1_000_000_000_000_000_000, 8000);
pool_usdc.changeGuardian(vm.addr(deployerPrivateKey));

vm.stopBroadcast();
Expand Down
2 changes: 1 addition & 1 deletion script/TransferOwnership.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Created by Pragma Labs
* SPDX-License-Identifier: BUSL-1.1
*/
pragma solidity 0.8.19;
pragma solidity 0.8.22;

import { ArcadiaAddresses, ArcadiaContractAddresses } from "./Constants/TransferOwnershipConstants.sol";
import "../lib/forge-std/src/Script.sol";
Expand Down

0 comments on commit 03f930c

Please sign in to comment.