Skip to content

Commit

Permalink
Merge pull request #158 from raid-guild/feat/YnEigen-Deployer
Browse files Browse the repository at this point in the history
script for deploying and verifying yneigen
  • Loading branch information
danoctavian authored Aug 28, 2024
2 parents fd46c1b + 55aa1d9 commit a6de395
Show file tree
Hide file tree
Showing 22 changed files with 1,001 additions and 631 deletions.
7 changes: 6 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ STAKING_ADMIN_ADDRESS=
STAKING_NODES_ADMIN_ADDRESS=
VALIDATOR_MANAGER_ADDRESS=
REWARDS_DISTRIBUTOR_ADDRESS=
PROXY_OWNER
PROXY_OWNER=

# for deploying the contracts
RPC_URL=
# for use with cast wallet. store the deployer private key in the keystore and put the public address here.
DEPLOYER_ADDRESS=
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,17 @@ deploy-protocol :; forge script script/DeployYieldNest.s.sol:DeployYieldNest --
# Verify

verify-roles :; forge script script/Verify.s.sol --rpc-url ${rpc}

# to set up cast wallet run: cast wallet import yieldnestDeployerKey --interactive
# then import the private key with which you wish to deploy, create a password and add the public address of that key to the .env under DEPLOYER_ADDRESS.

# make ynEigen path=script/ynEigen/input/lsd-mainnet.json rpc=your-rpc-here deployer=0xYourPublicAddressThatCorrespondsToYourSavedPrivateKeyInyieldnestDeployerKey api=etherscanApiKey
deployerAccountName ?= yieldnestDeployerKey
ynEigen :; forge script script/ynEigen/YnEigenScript.s.sol:YnEigenScript --rpc-url ${rpc} --sig "run(string)" ${path} --account ${deployerAccountName} --sender ${deployer} --broadcast --etherscan-api-key ${api} --verify

# make ynEigen-verify path=script/ynEigen/input/lsd-mainnet.json rpc=your-rpc-here
ynEigen-verify :; forge script script/ynEigen/YnEigenScript.s.sol:YnEigenScript --rpc-url ${rpc} --sig "verify(string)" ${path} --broadcast

# alternative bash script with less inputs
# make ynEigen-bash path=script/ynEigen/input/lsd-mainnet.json
ynEigen-bash :; ./script/ynEigen/bash/deployYnEigen.sh ${path}
10 changes: 7 additions & 3 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ src = 'src'
out = 'out'
libs = ['lib']
test = 'test'
cache_path = 'cache'
cache_path = 'cache'

fs_permissions = [{ access = "read-write", path = "./deployments"}, { access = "read", path = "./"}]
fs_permissions = [
{ access = "read-write", path = "./deployments" },
{ access = "read", path = "./" },
]

optimizer = true
optimizer-runs = 200
evm_version = "cancun"
solc_version = "0.8.24"
prompt_timeout = 120

ignored_error_codes = [5159,2018,5574,3860]
ignored_error_codes = [5159, 2018, 5574, 3860]
2 changes: 1 addition & 1 deletion lib/forge-std
Submodule forge-std updated 2 files
+10 −0 src/Vm.sol
+1 −1 test/Vm.t.sol
14 changes: 13 additions & 1 deletion script/BaseScript.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ import {ynETH} from "src/ynETH.sol";
import {Script} from "lib/forge-std/src/Script.sol";
import {Utils} from "script/Utils.sol";
import {ActorAddresses} from "script/Actors.sol";
import {ContractAddresses} from "script/ContractAddresses.sol";
import {console} from "lib/forge-std/src/console.sol";

abstract contract BaseScript is Script, Utils {
using stdJson for string;

ActorAddresses private _actorAddresses = new ActorAddresses();
ContractAddresses private _contractAddresses = new ContractAddresses();

function serializeActors(string memory json) public {
ActorAddresses.Actors memory actors = getActors();
vm.serializeAddress(json, "DEFAULT_SIGNER", address(actors.eoa.DEFAULT_SIGNER));
Expand Down Expand Up @@ -42,6 +46,14 @@ abstract contract BaseScript is Script, Utils {
}

function getActors() public returns (ActorAddresses.Actors memory actors) {
return (new ActorAddresses()).getActors(block.chainid);
return _actorAddresses.getActors(block.chainid);
}

function getChainAddresses() public returns (ContractAddresses.ChainAddresses memory chainAddresses) {
return _contractAddresses.getChainAddresses(block.chainid);
}

function isSupportedChainId(uint256 chainId) public returns (bool) {
return _contractAddresses.isSupportedChainId(chainId);
}
}
4 changes: 4 additions & 0 deletions script/ContractAddresses.sol
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,8 @@ contract ContractAddresses {
function getChainAddresses(uint256 chainId) external view returns (ChainAddresses memory) {
return addresses[chainId];
}

function isSupportedChainId(uint256 chainId) external view returns (bool) {
return chainId == chainIds.mainnet || chainId == chainIds.holeksy;
}
}
Loading

0 comments on commit a6de395

Please sign in to comment.