Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fork Fixes #1073

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions scripts/deploy-fork.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ npx hardhat registry:add --name RETH_30_DAY --value 1 --network mainnet_fork --c

# Extract the deployed contract addresses to `artifacts/addresses.json`
# for use with the delvtech/infra address server.
cat ./deployments.local.json | jq ".mainnet_fork | {
cat ./deployments.local.json | jq '.mainnet_fork | {
dai14Day: .DAI_14_DAY.address,
dai30Day: .DAI_30_DAY.address,
steth14Day: .STETH_14_DAY.address,
steth30Day: .STETH_30_DAY.address,
reth14Day: .RETH_14_DAY.address,
reth30Day: .RETH_30_DAY.address,
factory: .FACTORY.address,
hyperdriveRegistry: .MAINNET_FORK_REGISTRY.address,
}" >./artifacts/addresses.json
hyperdriveRegistry: .["DELV Hyperdrive Registry"].address,
}' >./artifacts/addresses.json
cp ./deployments.local.json ./artifacts/
2 changes: 1 addition & 1 deletion scripts/format-devnet-addresses.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ cat deployments.local.json | jq '.anvil | {
erc4626Hyperdrive: .ERC4626_HYPERDRIVE.address,
stethHyperdrive: .STETH_HYPERDRIVE.address,
factory: .FACTORY.address,
hyperdriveRegistry: .ANVIL_REGISTRY.address,
hyperdriveRegistry: .["DELV Hyperdrive Registry"].address,
}' >./artifacts/addresses.json
10 changes: 8 additions & 2 deletions scripts/fund-anvil-accounts-fork.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
set -e

# Mint tokens to all of the default anvil accounts.
addresses=('0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266' '0x70997970C51812dc3A010C7d01b50e0d17dc79C8' '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC' '0x90F79bf6EB2c4f870365E785982E1f101E93b906' '0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65' '0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc' '0x976EA74026E726554dB657fA54763abd0C3a0aa9' '0x14dC79964da2C08b23698B3D3cc7Ca32193d9955' '0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f' '0xa0Ee7A142d267C1f36714E4a8F75612F20a79720')
for address in ${addresses}
addresses=('0x042CAb2Ea353fC48C9491bDbF10a12Cfe9072B6C' '0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266' '0x70997970C51812dc3A010C7d01b50e0d17dc79C8' '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC' '0x90F79bf6EB2c4f870365E785982E1f101E93b906' '0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65' '0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc' '0x976EA74026E726554dB657fA54763abd0C3a0aa9' '0x14dC79964da2C08b23698B3D3cc7Ca32193d9955' '0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f' '0xa0Ee7A142d267C1f36714E4a8F75612F20a79720' '0x004dfC2dBA6573fa4dFb1E86e3723e1070C0CfdE' '0x005182C62DA59Ff202D53d6E42Cef6585eBF9617' '0x005BB73FddB8CE049eE366b50d2f48763E9Dc0De' '0x0065291E64E40FF740aE833BE2F68F536A742b70' '0x0076b154e60BF0E9088FcebAAbd4A778deC5ce2c' '0x00860d89A40a5B4835a3d498fC1052De04996de6' '0x00905A77Dc202e618d15d1a04Bc340820F99d7C4' '0x009ef846DcbaA903464635B0dF2574CBEE66caDd' '0x00D5E029aFCE62738fa01EdCA21c9A4bAeabd434' '0x020A6F562884395A7dA2be0b607Bf824546699e2' '0x020a898437E9c9DCdF3c2ffdDB94E759C0DAdFB6' '0x020b42c1E3665d14275E2823bCef737015c7f787' '0x02147558D39cE51e19de3A2E1e5b7c8ff2778829' '0x021f1Bbd2Ec870FB150bBCAdaaA1F85DFd72407C' '0x02237E07b7Ac07A17E1bdEc720722cb568f22840' '0x022ca016Dc7af612e9A8c5c0e344585De53E9667' '0x0235037B42b4c0575c2575D50D700dD558098b78' '0x0238811B058bA876Ae5F79cFbCAcCfA1c7e67879' '0x024c641B5F6C32a492B1520FE76251701b1d1AA7' '0x025d59829B0a2470C8175ac7F501a53E94D223Ac' '0x026143Ec99d915019B8666cb2Bf2ebA8261c5D46' '0x026483eC0deBbc4252372eEab8a53071ba83ffAF' '0x2C4F64C3BE604E7Ae00fd822CE5FC3131F30C3F0' '0x027de2B3095181C1B44ba401d0D8341dAAcA489E' '0x029154117EA657009a01a9778be20efDA203fA95' '0x0295aCB19B11ef429298C78d92Ec20A70E7da472' '0x029907c0c7b63dae567C45Dea77e804C0F567df0' '0x029cE100BC18Ed5D78b1359b114564F25Ef87673' '0x02A79FFab3b447a243327373e2958af2d6305BC7' '0x02B73Bb05Af09Ed35F327c9711dA676AED1e5512' '0x02BF9a114C29ed12d885f963593fcD2e1505B460' '0x02C0eD0DF2142459Ed220d3860c2a6AffB51cd3D' '0x02C96EF2c1dFE09223a0549cCbA9955307378AfC' '0x02Ca782d6Ff1dF9ED70eCA5F4860C1A0f86F4e5b' '0x02Ce145B96510ECa815C5ddb8C69D0304AF258AC' '0x02DFF5EF42EF7ba40Bdf049059DdC147eCe27233' '0x02E1769501e5491612bB37c45698eA4dC0D5d72b' '0x02F208E514bDAee6F0412D86628074F14Ca23bA8' '0x02FEf166ac43e5a81bB0e0D56cC58CeA4B686fF1' '0x02Faff249A85f304C4d4f4CDD133B6aebE543eAA' '0x02aDc6C8E017A5e6465C22eBDE4DcF7a3C477630' '0x02b9B98cE712b0d4259008388c04a11614Dbcd17' '0x02bd11C612a32dB2Ca0dA0Fdb0bbe3Ee0E9C203f' '0x02d3537230De86d5090d2Bae4D8084fBCdf5FbC1' '0x02dE93FAdf8626d29fbAc241676FbA3771A1f623' '0x02e3E392C81abaa7e7b31E87E12038BFBe89c6D5' '0x03086522fAA9685c1322905D1CA33af4022B4fcd' '0x0318Eb61C45F30cB2D5E3371dF72851C638aA4Cb' '0x032281f3501cFdD61e95BFbED738990f4D866cb9' '0x032DcE137A5d24cAebB4303c4bbA469db3dB0197' '0x0330af2D8d07F44C6e6cf5148431a09a67Cb5D6f' '0x033355c4Fa83B52C81061c93eb0E7F156dd740df' '0x033f7c8c4997d8f7A046434320424E1E7491AF35' '0x034076c7f368D81b8afA74219A4226017Fe7b251' '0x03408bed71777fC8623055941C2E4Dda597D2776' '0x0346caE47Ce48EF92b2b631655562Ef9900Ae493' '0x034870eD5321982a1c458637f046F945F0154348' '0x0352e3149cCE05fE6eB7Dfd3155e3A9443e75a54' '0x0353Be3a5131504434C9b63E4f1B13339d777Be3' '0x035760D400571770ae8076deFaf237a1F049d1C0' '0x0369F268EB4Dc1fC0e2846092A5D25aa331F57Ea' '0x03719fa1Bc3e0aAE1A998Fca2fd619D2f16b6aBB' '0x0371af19efD20986605cC7dbb4bb7E69FecCbAd1' '0x0373cD781D0884b32E2b68dd2799fCA90bf1395A' '0x037b344e4A3b0810F70AF7E8Be578C5c63BbB340' '0x03874883399cE56e438E41726975EbD033D0Ee63' '0x0389338879FE3cb062A933dd7f43C0Bb7f0f1520' '0x038a2aF6dC7724125884E74D9fc3F474B8a79943' '0x038e756d9E9FE13adBD96D4b81e6a05c5d2752A4' '0x039C43f3F887B8a0CF4C1529313a3392f6744D61' '0x039b567ed59A29b5d7a57354400544Ba6c35CFD3' '0x03A0baE872c0243E08f75426f5DCBc1CE4343C65' '0x03A321192854a4e8161c1f06fa9a99F37F075718' '0x03A3795cb5e43a57f95BBDB08DE6f293f92CE7Ab' '0x03A7F59dd1dd7ECF01BA22BeD091262D4289073f' '0x03AadFc86fcd720681e0EB8a11c57751A28Fb99a' '0x03Ba9f3ADb4B23C3332D8b68fa03dAf487f98D16' '0x03C322F4a90f3387333a44D7FF6109209De815Cf' '0x03D52a3403808323481CA80bEee09c639bEF4297' '0x03D97e0BC935FDaF076b284917Bebe91904B762A' '0x03Df13eCd08CC1bd5FF7F8E339FfABA716Cee334' '0x03a461045fE36815C41663819EBb47a49fF2d1e4' '0x03c8ADC46c02EC34D7065c97C85E352085E64aB3' '0x03d8FF639642441a16701bc49666c2f670EBD640' '0x03dD702256C0cFAd7D53FeFaddC51063A151c898' '0x03f581A203C30c838d2772D209F888BeE68d6805' '0x04032d4b73470f1c72F6c918b263B5B6CD696C35' '0x0405bfa774BC712c8141E627D292c0d6FB1F5A78' '0x0406863656EB235C7eAd4c4c7c22294A7450563a')
for address in "${addresses[@]}"
do
echo "funding ${address}..."
echo " - funding ${address} eth..."
npx hardhat fork:mint-eth --address ${address} --amount 1000 --network mainnet_fork --config hardhat.config.mainnet_fork.ts
echo " - funding ${address} steth..."
npx hardhat fork:mint-steth --address ${address} --amount 1000 --network mainnet_fork --config hardhat.config.mainnet_fork.ts
echo " - funding ${address} reth..."
npx hardhat fork:mint-reth --address ${address} --amount 1000 --network mainnet_fork --config hardhat.config.mainnet_fork.ts
echo " - funding ${address} dai..."
npx hardhat fork:mint-dai --address ${address} --amount 20000 --network mainnet_fork --config hardhat.config.mainnet_fork.ts
echo " - funding ${address} sdai..."
npx hardhat fork:mint-sdai --address ${address} --amount 20000 --network mainnet_fork --config hardhat.config.mainnet_fork.ts
done

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const MAINNET_FORK_CHECKPOINT_SUBREWARDER: HyperdriveCheckpointSubrewarde
MAINNET_FORK_CHECKPOINT_REWARDER_NAME,
).address,
(await hre.getNamedAccounts())["deployer"] as Address,
hre.hyperdriveDeploy.deployments.byName("MAINNET_FORK_REGISTRY")
hre.hyperdriveDeploy.deployments.byName("DELV Hyperdrive Registry")
.address,
MAINNET_DAI_ADDRESS,
parseEther("1"),
Expand Down
2 changes: 1 addition & 1 deletion tasks/fork/maintain-rate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ HyperdriveDeployBaseTask(
.addOptionalParam(
"rate",
"rate to set for all underlying vaults (scaled to 1e18)",
"0.05",
"0.03",
types.string,
)
.setAction(async ({ rate }, { viem }) => {
Expand Down
12 changes: 12 additions & 0 deletions tasks/fork/mint-dai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ HyperdriveDeployBaseTask(
{ address, amount }: Required<MintDAIParams>,
{ viem, artifacts },
) => {
let contract = await viem.getContractAt(
"solmate/tokens/ERC20.sol:ERC20",
MAINNET_DAI_ADDRESS,
);
let balance = await contract.read.balanceOf([MAINNET_DAI_WHALE]);
if (balance < parseEther(amount)) {
console.log(
"ERROR: insufficient funds in DAI whale account, skipping...",
);
return;
}

let transferData = encodeFunctionData({
abi: (
await artifacts.readArtifact(
Expand Down
14 changes: 13 additions & 1 deletion tasks/fork/mint-sdai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ HyperdriveDeployBaseTask(
{ address, amount }: Required<MintSDAIParams>,
{ viem, artifacts },
) => {
let contract = await viem.getContractAt(
"solmate/tokens/ERC20.sol:ERC20",
MAINNET_SDAI_ADDRESS,
);
let balance = await contract.read.balanceOf([MAINNET_SDAI_WHALE]);
if (balance < parseEther(amount)) {
console.log(
"ERROR: insufficient funds in SDAI whale account, skipping...",
);
return;
}

let pc = await viem.getPublicClient();
let transferData = encodeFunctionData({
abi: (await artifacts.readArtifact("ERC20Mintable")).abi,
functionName: "transfer",
Expand All @@ -45,7 +58,6 @@ HyperdriveDeployBaseTask(
to: MAINNET_SDAI_ADDRESS,
data: transferData,
});
let pc = await viem.getPublicClient();
await pc.waitForTransactionReceipt({ hash: tx });
},
);
Loading