-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ccad4ab
commit 46d61a4
Showing
8 changed files
with
1,002 additions
and
981 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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
//SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.24; | ||
|
||
// import { IVault } from "@balancer-labs/v3-interfaces/contracts/vault/IVault.sol"; | ||
import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol"; | ||
|
||
import { PoolHelpers } from "./PoolHelpers.sol"; | ||
import { ScaffoldHelpers } from "./ScaffoldHelpers.sol"; | ||
import { DeployMockTokens } from "./DeployMockTokens.s.sol"; | ||
import { DeployConstantSumPool } from "./DeployConstantSumPool.s.sol"; | ||
import { DeployConstantProductPool } from "./DeployConstantProductPool.s.sol"; | ||
|
||
/** | ||
* @title Deploy Script | ||
* @notice Deploys mock tokens, a constant sum pool, and a constant product pool | ||
* @dev Run this script with `yarn deploy` | ||
*/ | ||
contract DeployScript is DeployMockTokens, DeployConstantSumPool, DeployConstantProductPool { | ||
function run() external virtual { | ||
// Deploy the mock tokens | ||
(IERC20 mockToken1, IERC20 mockToken2, IERC20 mockVeBAL) = deployMockTokens(); | ||
|
||
// Deploy a constant sum factory pool | ||
deployConstantSumPool(mockToken1, mockToken2); | ||
|
||
// Deploy a constant product pool | ||
deployConstantProductPool(mockToken1, mockToken2, mockVeBAL); | ||
|
||
/** | ||
* This function generates the file containing the contracts Abi definitions that are carried from /foundry to /nextjs. | ||
* These definitions are used to derive the types needed in the custom scaffold-eth hooks, for example. | ||
* This function should be called last. | ||
*/ | ||
exportDeployments(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.24; | ||
|
||
import { IVault } from "@balancer-labs/v3-interfaces/contracts/vault/IVault.sol"; | ||
import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol"; | ||
|
||
import { PoolHelpers } from "./PoolHelpers.sol"; | ||
import { ScaffoldHelpers, console } from "./ScaffoldHelpers.sol"; | ||
import { MockToken1 } from "../contracts/mocks/MockToken1.sol"; | ||
import { MockToken2 } from "../contracts/mocks/MockToken2.sol"; | ||
import { MockVeBAL } from "../contracts/mocks/MockVeBAL.sol"; | ||
|
||
/** | ||
* @title Deploy Mock Tokens | ||
* @notice Deploys mock tokens for use with pools and hooks | ||
*/ | ||
contract DeployMockTokens is PoolHelpers, ScaffoldHelpers { | ||
function deployMockTokens() internal returns (IERC20 mockToken1, IERC20 mockToken2, IERC20 mockVeBAL) { | ||
uint256 deployerPrivateKey = getDeployerPrivateKey(); | ||
|
||
vm.startBroadcast(deployerPrivateKey); | ||
|
||
// For use with pool contracts | ||
mockToken1 = new MockToken1("Mock Token 1", "MT1", 1000e18); | ||
mockToken2 = new MockToken2("Mock Token 2", "MT2", 1000e18); | ||
console.log("MockToken1 deployed at: %s", address(mockToken1)); | ||
console.log("MockToken2 deployed at: %s", address(mockToken2)); | ||
|
||
// For use with VeBALFeeDiscountHook | ||
mockVeBAL = new MockVeBAL("Vote-escrow BAL", "veBAL", 1000e18); | ||
console.log("Mock Vote-escrow BAL deployed at: %s", address(mockVeBAL)); | ||
|
||
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
Oops, something went wrong.