-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/deposit-max-balance-savings (#26)
* feat: deposit whole balance into vault if max amount provided * tests: add test with max balance * feat: max amount for mint, withdraw and redeem * tests: max balance * feat: remove mint with max balance * tests: add referral deposit test and remove max mint one * feat: remove useless console inside BaserRouter * feat: upgradeRouter script * style: prettier script * feat: broadcast inside script * chore: new rpc endpoints and etherscan keys
- Loading branch information
1 parent
60c1c95
commit 8d1699b
Showing
8 changed files
with
260 additions
and
6 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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "lib/utils"] | ||
path = lib/utils | ||
url = https://github.com/AngleProtocol/utils |
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
Submodule forge-std
updated
64 files
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.17; | ||
|
||
import "forge-std/Script.sol"; | ||
import "utils/src/CommonUtils.sol"; | ||
import { AngleRouterMainnet } from "contracts/implementations/mainnet/AngleRouterMainnet.sol"; | ||
import { AngleRouterArbitrum } from "contracts/implementations/arbitrum/AngleRouterArbitrum.sol"; | ||
import { AngleRouterOptimism } from "contracts/implementations/optimism/AngleRouterOptimism.sol"; | ||
import { AngleRouterAvalanche } from "contracts/implementations/avalanche/AngleRouterAvalanche.sol"; | ||
import { AngleRouterBase } from "contracts/implementations/base/AngleRouterBase.sol"; | ||
import { AngleRouterCelo } from "contracts/implementations/celo/AngleRouterCelo.sol"; | ||
import { AngleRouterGnosis } from "contracts/implementations/gnosis/AngleRouterGnosis.sol"; | ||
import { AngleRouterLinea } from "contracts/implementations/linea/AngleRouterLinea.sol"; | ||
import { AngleRouterPolygon } from "contracts/implementations/polygon/AngleRouterPolygon.sol"; | ||
|
||
contract UpgradeRouterScript is Script, CommonUtils { | ||
function run() public { | ||
uint256 chainId = vm.envUint("CHAIN_ID"); | ||
|
||
uint256 deployerPrivateKey = vm.deriveKey(vm.envString("MNEMONIC_MAINNET"), 0); | ||
address deployer = vm.addr(deployerPrivateKey); | ||
console.log("Address: %s", deployer); | ||
vm.startBroadcast(deployerPrivateKey); | ||
|
||
address routerImpl; | ||
if (chainId == CHAIN_ETHEREUM) { | ||
routerImpl = address(new AngleRouterMainnet()); | ||
} else if (chainId == CHAIN_ARBITRUM) { | ||
routerImpl = address(new AngleRouterArbitrum()); | ||
} else if (chainId == CHAIN_OPTIMISM) { | ||
routerImpl = address(new AngleRouterOptimism()); | ||
} else if (chainId == CHAIN_AVALANCHE) { | ||
routerImpl = address(new AngleRouterAvalanche()); | ||
} else if (chainId == CHAIN_BASE) { | ||
routerImpl = address(new AngleRouterBase()); | ||
} else if (chainId == CHAIN_CELO) { | ||
routerImpl = address(new AngleRouterCelo()); | ||
} else if (chainId == CHAIN_GNOSIS) { | ||
routerImpl = address(new AngleRouterGnosis()); | ||
} else if (chainId == CHAIN_LINEA) { | ||
routerImpl = address(new AngleRouterLinea()); | ||
} else if (chainId == CHAIN_POLYGON) { | ||
routerImpl = address(new AngleRouterPolygon()); | ||
} | ||
|
||
console.log("Deployed router implementation at address: %s", routerImpl); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
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