Skip to content

Commit

Permalink
Update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
bxmmm1 committed Feb 20, 2024
1 parent 67c29c3 commit af3bfdf
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 116 deletions.
4 changes: 1 addition & 3 deletions script/AddLeafX509.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pragma solidity >=0.8.0 <0.9.0;
import { BaseScript } from "script/BaseScript.s.sol";
import { IEnclaveVerifier } from "puffer/interface/IEnclaveVerifier.sol";
import { stdJson } from "forge-std/StdJson.sol";
import { Strings } from "openzeppelin/utils/Strings.sol";

/**
* @title Deposit ETH script
Expand All @@ -15,8 +14,7 @@ import { Strings } from "openzeppelin/utils/Strings.sol";
*/
contract AddLeaftX509 is BaseScript {
function run(bytes calldata leafX509Cert) external broadcast {
string memory guardiansDeployment =
vm.readFile(string.concat("./output/", Strings.toString(block.chainid), "-guardians.json"));
string memory guardiansDeployment = vm.readFile("./output/puffer.json");
address payable enclaveVerifier = payable(stdJson.readAddress(guardiansDeployment, ".enclaveVerifier"));

IEnclaveVerifier(enclaveVerifier).addLeafX509(leafX509Cert);
Expand Down
1 change: 0 additions & 1 deletion script/DeployPuffer.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { UpgradeableBeacon } from "openzeppelin/proxy/beacon/UpgradeableBeacon.s
import { GuardiansDeployment, PufferProtocolDeployment } from "./DeploymentStructs.sol";
import { ValidatorTicket } from "puffer/ValidatorTicket.sol";
import { IPufferOracle } from "pufETH/interface/IPufferOracle.sol";
import { IWETH } from "pufETH/interface/Other/IWETH.sol";

/**
* @title DeployPuffer
Expand Down
6 changes: 3 additions & 3 deletions script/3_DepositETH.s.sol → script/DepositETH.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
pragma solidity >=0.8.0 <0.9.0;

import { BaseScript } from "script/BaseScript.s.sol";
import { IPufferPool } from "puffer/interface/IPufferPool.sol";
import { stdJson } from "forge-std/StdJson.sol";
import { PufferVaultMainnet } from "pufETH/PufferVaultMainnet.sol";

/**
* @title Deposit ETH script
Expand All @@ -18,8 +18,8 @@ contract DepositETH is BaseScript {
*/
function run(uint256 ethAmount) external broadcast {
string memory pufferDeployment = vm.readFile("./output/puffer.json");
address payable pool = payable(stdJson.readAddress(pufferDeployment, ".pufferPool"));
address payable vault = payable(stdJson.readAddress(pufferDeployment, ".PufferVault"));

IPufferPool(pool).depositETH{ value: ethAmount }();
PufferVaultMainnet(vault).depositETH{ value: ethAmount }(_broadcaster);
}
}
4 changes: 1 addition & 3 deletions script/SetGuardianEnclaveMeasurements.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pragma solidity >=0.8.0 <0.9.0;
import { BaseScript } from "script/BaseScript.s.sol";
import { GuardianModule } from "../src/GuardianModule.sol";
import { stdJson } from "forge-std/StdJson.sol";
import { Strings } from "openzeppelin/utils/Strings.sol";

/**
* @title Deposit ETH script
Expand All @@ -15,8 +14,7 @@ import { Strings } from "openzeppelin/utils/Strings.sol";
*/
contract SetEnclaveMeasurements is BaseScript {
function run(bytes32 mrenclave, bytes32 mrsigner) external broadcast {
string memory guardiansDeployment =
vm.readFile(string.concat("./output/", Strings.toString(block.chainid), "-guardians.json"));
string memory guardiansDeployment = vm.readFile("./output/puffer.json");

address payable module = payable(stdJson.readAddress(guardiansDeployment, ".guardianModule"));

Expand Down
6 changes: 6 additions & 0 deletions shell-scripts/deploy_puffer_protocol.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export IS_LOCAL_ANVIL=true
export MR_ENCLAVE=2f1488bd64b2c85fc3fe4fa535a89cfa5282ae960e902664ff5390909333e78c
export MR_SIGNER=83d719e77deaca1470f6baf62a4d774303c899db69020f9c70ee1dfc08c7ce9e

# 500 ETHER, replace with whatever amount you want to deposit
export ETH_AMOUNT=500000000000000000000

echo "DEPLOYING"
forge script script/DeployEverything.s.sol:DeployEverything --rpc-url=$RPC_URL --sig 'run(address[] calldata, uint256)' "[0xDDDeAfB492752FC64220ddB3E7C9f1d5CcCdFdF0]" 1 --broadcast

Expand All @@ -20,3 +23,6 @@ forge script script/AddLeafX509.s.sol:AddLeaftX509 --rpc-url=$RPC_URL --broadcas

# Send 10 ETH to PUFFER_SHARED_WALLET
cast send 0xDDDeAfB492752FC64220ddB3E7C9f1d5CcCdFdF0 --value 10ether --private-key $PK --rpc-url=$RPC_URL

echo "Deposit initial liquidity for PufferVault 500 ETH"
forge script script/DepositETH.s.sol:DepositETH --rpc-url=$RPC_URL --broadcast --sig "run(uint256)" $ETH_AMOUNT -vvvv --private-key $PK
5 changes: 3 additions & 2 deletions src/LibGuardianMessages.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ library LibGuardianMessages {
bytes32 depositDataRoot
) internal pure returns (bytes32) {
return keccak256(
//solhint-disable-next-line func-named-parameters
abi.encode(validatorIndex, vtBurnOffset, pubKey, withdrawalCredentials, signature, depositDataRoot)

Check failure on line 32 in src/LibGuardianMessages.sol

View workflow job for this annotation

GitHub Actions / solhint

Named parameters missing. MIN unnamed argumenst is 4
).toEthSignedMessageHash();
)
//solhint-disable-next-line func-named-parameters
.toEthSignedMessageHash();
}

/**
Expand Down
104 changes: 0 additions & 104 deletions src/interface/IPufferPool.sol

This file was deleted.

0 comments on commit af3bfdf

Please sign in to comment.