Skip to content

Commit

Permalink
finish usda setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sogipec committed Mar 22, 2024
1 parent dc3ea06 commit a1bf19d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
7 changes: 4 additions & 3 deletions scripts/SetupDeployedTransmuter.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ contract SetupDeployedTransmuter is Utils {

bytes memory oracleConfig;
{
// TODO: replace with Morpho steakUSDC/USD oracle address
bytes memory readData = abi.encode(0x8fFfFfd4AfB6115b954Bd326cbe7B4BA576818f6, BASE_18);
bytes memory readData = abi.encode(0x025106374196586E8BC91eE8818dD7B0Efd2B78B, BASE_18);
// Current price is 1.012534 -> we take a small margin
uint256 startPrice = IERC4626(STEAK_USDC).previewRedeem(1e30);
bytes memory targetData = abi.encode(
Expand Down Expand Up @@ -211,11 +210,13 @@ contract SetupDeployedTransmuter is Utils {
// Set whitelist status for bIB01
bytes memory whitelistData = abi.encode(
Storage.WhitelistType.BACKED,
// TODO: Keyring whitelist check
abi.encode(address(0x9391B14dB2d43687Ea1f6E546390ED4b20766c46))
);
usdaTransmuter.setWhitelistStatus(BIB01, 1, whitelistData);

usdaTransmuter.toggleTrusted(NEW_DEPLOYER, Storage.TrustedType.Seller);
usdaTransmuter.toggleTrusted(NEW_KEEPER, Storage.TrustedType.Seller);

console.log("Transmuter setup");
vm.stopBroadcast();
}
Expand Down
13 changes: 7 additions & 6 deletions test/scripts/UpdateTransmuterFacetsUSDATest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,7 @@ contract UpdateTransmuterFacetsUSDATest is Helpers, Test {

bytes memory oracleConfig;
{
// TODO: replace with Morpho steakUSDC/USD oracle address
MockMorphoOracle morphoOracle = new MockMorphoOracle(1013000000000000000);
bytes memory readData = abi.encode(address(morphoOracle), 1);
bytes memory readData = abi.encode(0x025106374196586E8BC91eE8818dD7B0Efd2B78B, BASE_18);
// Current price is 1.012534 -> we take a small margin
bytes memory targetData = abi.encode(
1013000000000000000,
Expand Down Expand Up @@ -313,11 +311,14 @@ contract UpdateTransmuterFacetsUSDATest is Helpers, Test {
bytes memory whitelistData = abi.encode(
WhitelistType.BACKED,
// Keyring whitelist check
abi.encode(address(0x4954c61984180868495D1a7Fb193b05a2cbd9dE3))
abi.encode(address(0x9391B14dB2d43687Ea1f6E546390ED4b20766c46))
);
transmuter.setWhitelistStatus(BIB01, 1, whitelistData);
transmuter.toggleWhitelist(Storage.WhitelistType.BACKED, WHALE_USDA);

transmuter.toggleTrusted(NEW_DEPLOYER, Storage.TrustedType.Seller);
transmuter.toggleTrusted(NEW_KEEPER, Storage.TrustedType.Seller);

vm.stopPrank();
}

Expand Down Expand Up @@ -459,11 +460,11 @@ contract UpdateTransmuterFacetsUSDATest is Helpers, Test {
assertEq(transmuter.isTrusted(DEPLOYER), false);
assertEq(transmuter.isTrustedSeller(DEPLOYER), false);
assertEq(transmuter.isTrusted(NEW_DEPLOYER), false);
assertEq(transmuter.isTrustedSeller(NEW_DEPLOYER), false);
assertEq(transmuter.isTrustedSeller(NEW_DEPLOYER), true);
assertEq(transmuter.isTrusted(KEEPER), false);
assertEq(transmuter.isTrustedSeller(KEEPER), false);
assertEq(transmuter.isTrusted(NEW_KEEPER), false);
assertEq(transmuter.isTrustedSeller(NEW_KEEPER), false);
assertEq(transmuter.isTrustedSeller(NEW_KEEPER), true);
}

function testUnit_UpgradeUSDA_IsWhitelistedForCollateral() external {
Expand Down

0 comments on commit a1bf19d

Please sign in to comment.