Skip to content

Commit

Permalink
Merge pull request #125 from zodahu/feature/deploy_protocolink_to_bnb
Browse files Browse the repository at this point in the history
Deploy Protocolink contracts to BNB Chain
  • Loading branch information
zodahu authored May 13, 2024
2 parents 9fce488 + 9a921bd commit ff1a56a
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 23 deletions.
1 change: 0 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@ optimizer_runs = 10_000

[rpc_endpoints]
ethereum = "https://cloudflare-eth.com"
goerli = "https://rpc.ankr.com/eth_goerli"

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
2 changes: 1 addition & 1 deletion script/DeployArbitrum.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ contract DeployArbitrum is
address public constant DEPLOYER = 0xBcb909975715DC8fDe643EE44b89e3FD6A35A259;
address public constant OWNER = 0x64585922a9703d9EdE7d353a6522eb2970f75066;
address public constant PAUSER = 0x660Cc6D82925Cc804aC4EBD1d5870Fa32C9aBDb8;
address public constant DEFAULT_COLLECTOR = 0x3EBe4dfaF95cd320BF34633B3BDf773FbE732E63;
address public constant DEFAULT_COLLECTOR = 0xFB20753f85f89be6F42D228667D70e62D1Ba5f75;
address public constant CREATE3_FACTORY = 0xFa3e9a110E6975ec868E9ed72ac6034eE4255B64;

/// @notice Set up deploy parameters and deploy contracts whose `deployedAddress` equals `UNDEPLOYED`.
Expand Down
2 changes: 1 addition & 1 deletion script/DeployAvalanche.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ contract DeployAvalanche is
address public constant DEPLOYER = 0xBcb909975715DC8fDe643EE44b89e3FD6A35A259;
address public constant OWNER = 0xBb91D028cAD3D67e3AFBAC2De9159DBE98467a9e;
address public constant PAUSER = 0x04950cDF995425f353fe3c6E10Cf63047eaD29DE;
address public constant DEFAULT_COLLECTOR = 0x168608B226ef4E59Db5E61359509656a51BAe090;
address public constant DEFAULT_COLLECTOR = 0xFB20753f85f89be6F42D228667D70e62D1Ba5f75;
address public constant CREATE3_FACTORY = 0xFa3e9a110E6975ec868E9ed72ac6034eE4255B64;

/// @notice Set up deploy parameters and deploy contracts whose `deployedAddress` equals `UNDEPLOYED`.
Expand Down
2 changes: 1 addition & 1 deletion script/DeployBase.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ contract DeployBase is DeployRouter, DeployAaveV3FlashLoanCallback, DeployBalanc
address public constant DEPLOYER = 0xBcb909975715DC8fDe643EE44b89e3FD6A35A259;
address public constant OWNER = 0x19Bb1986F0d57D0315CF9c42F7fa1d4Ba9C0798F;
address public constant PAUSER = 0xFC0351FAC21f4828086F2f4298103A37AD07EA8E;
address public constant DEFAULT_COLLECTOR = 0x50Df7c73bA1B4bb74934E50298de73F265260Ea4;
address public constant DEFAULT_COLLECTOR = 0xFB20753f85f89be6F42D228667D70e62D1Ba5f75;
address public constant CREATE3_FACTORY = 0xFa3e9a110E6975ec868E9ed72ac6034eE4255B64;

/// @notice Set up deploy parameters and deploy contracts whose `deployedAddress` equals `UNDEPLOYED`.
Expand Down
20 changes: 10 additions & 10 deletions script/DeployGoerli.s.sol → script/DeployBnb.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
pragma solidity ^0.8.0;

import {DeployRouter} from './DeployRouter.s.sol';
import {DeployMorphoFlashLoanCallback} from './callbacks/DeployMorphoFlashLoanCallback.s.sol';
import {DeployRadiantV2FlashLoanCallback} from './callbacks/DeployRadiantV2FlashLoanCallback.s.sol';

contract DeployGoerli is DeployRouter, DeployMorphoFlashLoanCallback {
contract DeployBnb is DeployRouter, DeployRadiantV2FlashLoanCallback {
address public constant DEPLOYER = 0xBcb909975715DC8fDe643EE44b89e3FD6A35A259;
address public constant OWNER = 0xBcb909975715DC8fDe643EE44b89e3FD6A35A259;
address public constant PAUSER = 0xBcb909975715DC8fDe643EE44b89e3FD6A35A259;
address public constant DEFAULT_COLLECTOR = 0xBcb909975715DC8fDe643EE44b89e3FD6A35A259;
address public constant OWNER = 0x681B7d3470156a8fA6DAf282979d3864b5007b5d;
address public constant PAUSER = 0x2A57fA8Ec5681a7A96f6070ee360BfD85dFC5bd4;
address public constant DEFAULT_COLLECTOR = 0xFB20753f85f89be6F42D228667D70e62D1Ba5f75;
address public constant CREATE3_FACTORY = 0xFa3e9a110E6975ec868E9ed72ac6034eE4255B64;

/// @notice Set up deploy parameters and deploy contracts whose `deployedAddress` equals `UNDEPLOYED`.
function setUp() external {
routerConfig = RouterConfig({
deployedAddress: 0xDec80E988F4baF43be69c13711453013c212feA8,
wrappedNative: 0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6,
wrappedNative: 0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c,
permit2: 0x000000000022D473030F116dDEE9F6B43aC78BA3,
deployer: DEPLOYER,
owner: OWNER,
Expand All @@ -25,9 +25,9 @@ contract DeployGoerli is DeployRouter, DeployMorphoFlashLoanCallback {
feeRate: 20
});

morphoFlashLoanCallbackConfig = MorphoFlashLoanCallbackConfig({
deployedAddress: 0x24D5b6b712D1f0D0B628E21E39dBaDde3f28C56e,
morpho: 0x64c7044050Ba0431252df24fEd4d9635a275CB41,
radiantV2FlashLoanCallbackConfig = RadiantV2FlashLoanCallbackConfig({
deployedAddress: 0x6bfCE075A1c4F0fD4067A401dA8f159354e1a916,
radiantV2Provider: 0x63764769dA006395515c3f8afF9c91A809eF6607,
feeRate: 5
});
}
Expand All @@ -37,6 +37,6 @@ contract DeployGoerli is DeployRouter, DeployMorphoFlashLoanCallback {
address deployedRouterAddress = _deployRouter(CREATE3_FACTORY);

// callback
_deployMorphoFlashLoanCallback(CREATE3_FACTORY, deployedRouterAddress);
_deployRadiantV2FlashLoanCallback(CREATE3_FACTORY, deployedRouterAddress);
}
}
2 changes: 1 addition & 1 deletion script/DeployEthereum.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ contract DeployEthereum is
address public constant DEPLOYER = 0xBcb909975715DC8fDe643EE44b89e3FD6A35A259;
address public constant OWNER = 0xA7248F4B85FB6261c314d08e7938285d1d86cd61;
address public constant PAUSER = 0x4d2D634Bf4b271f74bBf3A30f50497EC3D90024e;
address public constant DEFAULT_COLLECTOR = 0x6304EB1B1eC2135a64a90bA901B12Cf769657579;
address public constant DEFAULT_COLLECTOR = 0xFB20753f85f89be6F42D228667D70e62D1Ba5f75;
address public constant CREATE3_FACTORY = 0xFa3e9a110E6975ec868E9ed72ac6034eE4255B64;

/// @notice Set up deploy parameters and deploy contracts whose `deployedAddress` equals `UNDEPLOYED`.
Expand Down
2 changes: 1 addition & 1 deletion script/DeployGnosis.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ contract DeployGnosis is
address public constant DEPLOYER = 0xBcb909975715DC8fDe643EE44b89e3FD6A35A259;
address public constant OWNER = 0x13D09F09EF1f201D18d6b2fD4578D8feBf1c774d;
address public constant PAUSER = 0x23535221bC116F3b8a17b768806C5d7Cd36b020D;
address public constant DEFAULT_COLLECTOR = 0x4207b828b673EDC01d7f0020E8e8A99D8b454136;
address public constant DEFAULT_COLLECTOR = 0xFB20753f85f89be6F42D228667D70e62D1Ba5f75;
address public constant CREATE3_FACTORY = 0xFa3e9a110E6975ec868E9ed72ac6034eE4255B64;

/// @notice Set up deploy parameters and deploy contracts whose `deployedAddress` equals `UNDEPLOYED`.
Expand Down
2 changes: 1 addition & 1 deletion script/DeployMetis.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ contract DeployMetis is DeployRouter, DeployAaveV3FlashLoanCallback {
address public constant DEPLOYER = 0xBcb909975715DC8fDe643EE44b89e3FD6A35A259;
address public constant OWNER = 0xcE245455a34a57548F7c1F427233DFC1E84Ce1b3;
address public constant PAUSER = 0xcE245455a34a57548F7c1F427233DFC1E84Ce1b3;
address public constant DEFAULT_COLLECTOR = 0x75Ce960F2FD5f06C83EE034992362e593dcf7722;
address public constant DEFAULT_COLLECTOR = 0xFB20753f85f89be6F42D228667D70e62D1Ba5f75;
address public constant CREATE3_FACTORY = 0xFa3e9a110E6975ec868E9ed72ac6034eE4255B64;

/// @notice Set up deploy parameters and deploy contracts whose `deployedAddress` equals `UNDEPLOYED`.
Expand Down
2 changes: 1 addition & 1 deletion script/DeployOptimism.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ contract DeployOptimism is DeployRouter, DeployAaveV3FlashLoanCallback, DeployBa
address public constant DEPLOYER = 0xBcb909975715DC8fDe643EE44b89e3FD6A35A259;
address public constant OWNER = 0xBb91D028cAD3D67e3AFBAC2De9159DBE98467a9e;
address public constant PAUSER = 0xFC8c51c35F69FD85F745dFB49b1dC8a448AD8694;
address public constant DEFAULT_COLLECTOR = 0x168608B226ef4E59Db5E61359509656a51BAe090;
address public constant DEFAULT_COLLECTOR = 0xFB20753f85f89be6F42D228667D70e62D1Ba5f75;
address public constant CREATE3_FACTORY = 0xFa3e9a110E6975ec868E9ed72ac6034eE4255B64;

/// @notice Set up deploy parameters and deploy contracts whose `deployedAddress` equals `UNDEPLOYED`.
Expand Down
2 changes: 1 addition & 1 deletion script/DeployPolygon.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ contract DeployPolygon is
address public constant DEPLOYER = 0xBcb909975715DC8fDe643EE44b89e3FD6A35A259;
address public constant OWNER = 0x64585922a9703d9EdE7d353a6522eb2970f75066;
address public constant PAUSER = 0x90923059eE32AcF4EBdf8E7864E7724Cf11649f3;
address public constant DEFAULT_COLLECTOR = 0x3EBe4dfaF95cd320BF34633B3BDf773FbE732E63;
address public constant DEFAULT_COLLECTOR = 0xFB20753f85f89be6F42D228667D70e62D1Ba5f75;
address public constant CREATE3_FACTORY = 0xFa3e9a110E6975ec868E9ed72ac6034eE4255B64;

/// @notice Set up deploy parameters and deploy contracts whose `deployedAddress` equals `UNDEPLOYED`.
Expand Down
2 changes: 1 addition & 1 deletion test/callbacks/MorphoFlashLoanCallback.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ contract MorphoFlashLoanCallbackTest is Test {
DataType.Input[] public inputsEmpty;

function setUp() external {
vm.createSelectFork(vm.rpcUrl('goerli'), 10310460);
vm.createSelectFork(vm.rpcUrl('ethereum'), 19850000);

user = makeAddr('User');
defaultCollector = makeAddr('defaultCollector');
Expand Down
6 changes: 3 additions & 3 deletions test/integration/Morpho.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {DataType} from 'src/libraries/DataType.sol';
import {MorphoFlashLoanCallback, IMorphoFlashLoanCallback, IMorpho} from 'src/callbacks/MorphoFlashLoanCallback.sol';

contract MorphoIntegrationTest is Test {
address public constant MORPHO = 0x64c7044050Ba0431252df24fEd4d9635a275CB41;
IERC20 public constant USDC = IERC20(0x62bD2A599664D421132d7C54AB4DbE3233f4f0Ae);
address public constant MORPHO = 0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb;
IERC20 public constant USDC = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48);

address public user;
IRouter public router;
Expand All @@ -23,7 +23,7 @@ contract MorphoIntegrationTest is Test {
bytes[] public permit2DatasEmpty;

function setUp() external {
vm.createSelectFork(vm.rpcUrl('goerli'), 10310460);
vm.createSelectFork(vm.rpcUrl('ethereum'), 19850000);

user = makeAddr('User');
router = new Router(makeAddr('WrappedNative'), makeAddr('Permit2'), address(this));
Expand Down

0 comments on commit ff1a56a

Please sign in to comment.