-
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.
Goodbye Hardhat (+ Foundry Deployment Scripts)
- Loading branch information
1 parent
46e48ad
commit 58fa91d
Showing
10 changed files
with
704 additions
and
6,297 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 |
---|---|---|
|
@@ -26,3 +26,6 @@ node_modules | |
/coverage | ||
/coverage.json | ||
/lcov.info | ||
|
||
# secrets | ||
.seed |
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,6 +1,3 @@ | ||
{ | ||
"typescript.tsdk": "node_modules\\typescript\\lib", | ||
"solidity.compileUsingRemoteVersion": "v0.8.24+commit.e11b9ed9", | ||
"evenBetterToml.formatter.indentEntries": true, | ||
"solidity.defaultCompiler": "localFile" | ||
"evenBetterToml.formatter.indentEntries": true | ||
} |
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 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 |
---|---|---|
|
@@ -11,7 +11,9 @@ | |
"size": "forge build --sizes --force", | ||
"clean": "rm -rf ./cache ./out ./artifacts ./cache ./lcov.info", | ||
"format": "prettier --write \"./**/*.{js,ts,json,md,sol,yaml,yml}\"", | ||
"anvil": "anvil --fork-url https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161 --chain-id 31337 --balance 1000" | ||
"anvil": "anvil --fork-url https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161 --chain-id 31337 --balance 1000", | ||
"deploy:rewards-vault": "forge script scripts/deploy/GenericMultiRewardsVault.s.sol:GenericMultiRewardsVaultDeployer --broadcast --rpc-url http://127.0.0.1:8545", | ||
"deploy:staking-vault": "forge script scripts/deploy/GenericStakedAppreciatingVault.s.sol:GenericStakedAppreciatingVaultDeployer --broadcast --rpc-url http://127.0.0.1:8545" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
|
@@ -22,33 +24,13 @@ | |
}, | ||
"dependencies": { | ||
"@openzeppelin/contracts": "^5.0.2", | ||
"forge-std": "github:foundry-rs/forge-std#v1.8.1", | ||
"hardhat": "^2.22.2" | ||
"forge-std": "github:foundry-rs/forge-std#v1.8.1" | ||
}, | ||
"devDependencies": { | ||
"@nomicfoundation/hardhat-ignition": "^0.15.1", | ||
"@nomicfoundation/hardhat-ignition-viem": "^0.15.1", | ||
"@nomicfoundation/hardhat-network-helpers": "^1.0.10", | ||
"@nomicfoundation/hardhat-toolbox-viem": "^3.0.0", | ||
"@nomicfoundation/hardhat-verify": "^2.0.5", | ||
"@nomicfoundation/hardhat-viem": "^2.0.0", | ||
"@nomicfoundation/ignition-core": "^0.15.1", | ||
"@types/chai": "^4.3.14", | ||
"@types/chai-as-promised": "^7.1.8", | ||
"@types/mocha": "^10.0.6", | ||
"@types/node": "^20.12.7", | ||
"chai": "^4.4.1", | ||
"hardhat-contract-sizer": "^2.10.0", | ||
"hardhat-gas-reporter": "^1.0.10", | ||
"prettier": "^3.2.5", | ||
"prettier-plugin-solidity": "^1.3.1", | ||
"solhint": "^4.5.4", | ||
"solhint-plugin-prettier": "^0.1.0", | ||
"solidity-coverage": "^0.8.12", | ||
"ts-node": "^10.9.2", | ||
"tsconfig-paths": "^4.2.0", | ||
"typescript": "~5.3.3", | ||
"viem": "^2.9.17" | ||
"solhint-plugin-prettier": "^0.1.0" | ||
}, | ||
"author": "Akshat Mittal <[email protected]>" | ||
} |
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,28 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
import { Script } from "forge-std/Script.sol"; | ||
import { GenericMultiRewardsVault, IERC20, IERC20Metadata } from "@src/rewards/GenericMultiRewardsVault.sol"; | ||
|
||
contract GenericMultiRewardsVaultDeployer is Script { | ||
function setUp() public {} | ||
|
||
function run() public { | ||
string memory seedPhrase = vm.readFile(".seed"); | ||
uint256 privateKey = vm.deriveKey(seedPhrase, 0); | ||
address walletAddress = vm.rememberKey(privateKey); | ||
|
||
vm.startBroadcast(privateKey); | ||
|
||
IERC20Metadata asset = IERC20Metadata(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); // TODO: REPLACE THIS!!!! | ||
|
||
GenericMultiRewardsVault vault = new GenericMultiRewardsVault( | ||
string(abi.encodePacked("Rewardable ", asset.name())), | ||
string(abi.encodePacked("r", asset.symbol())), | ||
IERC20(address(asset)), | ||
walletAddress | ||
); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
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,29 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.24; | ||
|
||
import { Script } from "forge-std/Script.sol"; | ||
import { IERC20Metadata } from "@src/rewards/GenericMultiRewardsVault.sol"; | ||
import { GenericStakedAppreciatingVault, IERC20 } from "@src/staking/GenericStakedAppreciatingVault.sol"; | ||
|
||
contract GenericStakedAppreciatingVaultDeployer is Script { | ||
function setUp() public {} | ||
|
||
function run() public { | ||
string memory seedPhrase = vm.readFile(".seed"); | ||
uint256 privateKey = vm.deriveKey(seedPhrase, 0); | ||
address walletAddress = vm.rememberKey(privateKey); | ||
|
||
vm.startBroadcast(privateKey); | ||
|
||
IERC20Metadata asset = IERC20Metadata(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); // TODO: REPLACE THIS!!!! | ||
|
||
GenericStakedAppreciatingVault vault = new GenericStakedAppreciatingVault( | ||
string(abi.encodePacked("Staked ", asset.name())), | ||
string(abi.encodePacked("s", asset.symbol())), | ||
IERC20(address(asset)), | ||
14 days | ||
); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.