-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from yieldnest/feat/deploy-script
updated deployment scripts
- Loading branch information
Showing
17 changed files
with
3,637 additions
and
4,369 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,5 +1,10 @@ | ||
API_KEY_ALCHEMY="YOUR_API_KEY_ALCHEMY" | ||
API_KEY_ETHERSCAN="YOUR_API_KEY_ETHERSCAN" | ||
API_KEY_INFURA="YOUR_API_KEY_INFURA" | ||
# for verifying contracts | ||
ETHERSCAN_API_KEY= | ||
|
||
FOUNDRY_PROFILE="default" | ||
# for testing and deploying the contracts please use full arhcival nodes | ||
MAINNET_RPC_URL= | ||
HOLEKSY_RPC_URL= | ||
|
||
# for use with cast wallet. store the deployer private key in the keystore and put the public address here. | ||
DEPLOYER_ACCOUNT_NAME= | ||
DEPLOYER_ADDRESS= |
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
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 was deleted.
Oops, something went wrong.
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,42 +1,51 @@ | ||
// SPDX-License-Identifier: BSD 3-Clause License | ||
pragma solidity ^0.8.24; | ||
pragma solidity >=0.8.25 <0.9.0; | ||
|
||
import { Script } from "forge-std/Script.sol"; | ||
|
||
contract BaseData is Script { | ||
struct AirdropAddresses { | ||
address REWARDS_MULTISIG; | ||
address EIGEN_TOKEN; | ||
address B_EIGEN_TOKEN; | ||
address STRATEGY_MANAGER_ADDRESS; | ||
address RESTAKING_STRATEGY; | ||
struct Data { | ||
address airdropOwner; | ||
address proxyAdmin; | ||
address rewardsSafe; | ||
address eigenToken; | ||
address bEigenToken; | ||
address strategyManager; | ||
address strategy; | ||
} | ||
|
||
struct ChainIds { | ||
uint256 mainnet; | ||
uint256 holeksy; | ||
} | ||
|
||
mapping(uint256 => AirdropAddresses) public addresses; | ||
mapping(uint256 chainId => Data data) private __data; | ||
|
||
ChainIds public chainIds = ChainIds({ mainnet: 1, holeksy: 17_000 }); | ||
|
||
constructor() { | ||
addresses[chainIds.mainnet] = AirdropAddresses({ | ||
REWARDS_MULTISIG: 0xCCB2FEB7d8e081dcedFe1CFbefC9d46Eb383E389, | ||
EIGEN_TOKEN: 0xec53bF9167f50cDEB3Ae105f56099aaaB9061F83, | ||
B_EIGEN_TOKEN: 0xec53bF9167f50cDEB3Ae105f56099aaaB9061F83, | ||
STRATEGY_MANAGER_ADDRESS: 0xdfB5f6CE42aAA7830E94ECFCcAd411beF4d4D5b6, // double check this got this | ||
// from the protocol addresses | ||
RESTAKING_STRATEGY: 0xaCB55C530Acdb2849e6d4f36992Cd8c9D50ED8F7 | ||
address private TEMP_AIRDROP_OWNER; | ||
address private TEMP_PROXY_CONTROLLER; | ||
|
||
function setUp() public virtual { | ||
TEMP_AIRDROP_OWNER = makeAddr("airdrop-owner"); | ||
TEMP_PROXY_CONTROLLER = makeAddr("proxy-controller"); | ||
|
||
__data[chainIds.mainnet] = Data({ | ||
airdropOwner: TEMP_AIRDROP_OWNER, | ||
proxyAdmin: TEMP_PROXY_CONTROLLER, | ||
rewardsSafe: 0xCCB2FEB7d8e081dcedFe1CFbefC9d46Eb383E389, | ||
eigenToken: 0xec53bF9167f50cDEB3Ae105f56099aaaB9061F83, | ||
bEigenToken: 0xec53bF9167f50cDEB3Ae105f56099aaaB9061F83, | ||
strategyManager: 0x858646372CC42E1A627fcE94aa7A7033e7CF075A, | ||
strategy: 0xaCB55C530Acdb2849e6d4f36992Cd8c9D50ED8F7 | ||
}); | ||
} | ||
|
||
function getAddresses(uint256 chainId) external view returns (AirdropAddresses memory) { | ||
return addresses[chainId]; | ||
function getData(uint256 chainId) internal view returns (Data memory) { | ||
return __data[chainId]; | ||
} | ||
|
||
function isSupportedChainId(uint256 chainId) external view returns (bool) { | ||
function isSupportedChainId(uint256 chainId) internal view returns (bool) { | ||
return chainId == chainIds.mainnet || chainId == chainIds.holeksy; | ||
} | ||
} |
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,63 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity >=0.8.25 <0.9.0; | ||
|
||
import { BaseData } from "./BaseData.s.sol"; | ||
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | ||
import { console } from "forge-std/console.sol"; | ||
|
||
struct EigenPoints { | ||
address addr; | ||
uint256 points; | ||
} | ||
|
||
contract BaseScript is BaseData { | ||
/// @dev Needed for the deterministic deployments. | ||
bytes32 internal constant _SALT = bytes32("[email protected]"); | ||
|
||
Data public data; | ||
uint256 public initialSafeBalance; | ||
EigenPoints[] public eigenPoints; | ||
|
||
error ChainIdNotSupported(uint256 chainId); | ||
error InvalidInput(); | ||
error NoAirdrop(); | ||
|
||
function setUp() public override { | ||
super.setUp(); | ||
|
||
if (!isSupportedChainId(block.chainid)) { | ||
revert ChainIdNotSupported(block.chainid); | ||
} | ||
|
||
data = getData(block.chainid); | ||
|
||
initialSafeBalance = IERC20(data.eigenToken).balanceOf(data.rewardsSafe); | ||
if (initialSafeBalance == 0) { | ||
revert NoAirdrop(); | ||
} | ||
} | ||
|
||
function _loadInput(string memory _path) internal { | ||
string memory path = string(abi.encodePacked(vm.projectRoot(), "/", _path)); | ||
string memory json = vm.readFile(path); | ||
|
||
bytes memory parsedEigenPoints = vm.parseJson(json, ".eigenPoints"); | ||
EigenPoints[] memory ePoints = abi.decode(parsedEigenPoints, (EigenPoints[])); | ||
uint256 totalYnETHHolderEigenPoints = vm.parseJsonUint(json, ".totalYnETHHolderEigenPoints"); | ||
|
||
delete eigenPoints; | ||
|
||
uint256 totalPoints; | ||
for (uint256 i; i < ePoints.length; i++) { | ||
eigenPoints.push(ePoints[i]); | ||
totalPoints += ePoints[i].points; | ||
} | ||
|
||
console.log("Total Parsed Eigen Points: ", totalPoints); | ||
console.log("Total Input Eigen Points: ", totalYnETHHolderEigenPoints); | ||
|
||
// if (totalPoints != totalYnETHHolderEigenPoints) { | ||
// revert InvalidInput(); | ||
// } | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.