Skip to content

Commit

Permalink
feat: deduce stableType from STABLE_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
0xtekgrinder committed Jun 17, 2024
1 parent 8504eb2 commit 7eceaaf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scripts/DeploySavings.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@ contract DeploySavings is Script, CommonUtils {
function run() external {
/** TODO complete */
string memory stableName = vm.envString("STABLE_NAME");
ContractType stableType = ContractType.AgEUR;
/** END complete */

ContractType stableType;
if (keccak256(abi.encodePacked(stableName)) == keccak256("USD")) {
stableType = ContractType.AgUSD;
}
if (keccak256(abi.encodePacked(stableName)) == keccak256("EUR")) {
stableType = ContractType.AgEUR;
}

uint256 deployerPrivateKey = vm.deriveKey(vm.envString("MNEMONIC_MAINNET"), "m/44'/60'/0'/0/", 0);
string memory jsonVanity = vm.readFile(string.concat(JSON_VANITY_PATH, "Savings", stableName, ".json"));
bytes32 salt = jsonVanity.readBytes32("$.salt");
Expand Down

0 comments on commit 7eceaaf

Please sign in to comment.