|
| 1 | +// SPDX-License-Identifier: MIT |
| 2 | + |
| 3 | +pragma solidity ^0.8.10; |
| 4 | + |
| 5 | +import "forge-std/Script.sol"; |
| 6 | +import {ATokenVaultFactory} from "../src/ATokenVaultFactory.sol"; |
| 7 | + |
| 8 | +contract DeployFactory is Script { |
| 9 | + // DEPLOYMENT PARAMETERS - CHANGE THESE FOR YOUR FACTORY |
| 10 | + // =================================================== |
| 11 | + address constant PROXY_ADMIN_ADDRESS = address(0); // Address of the factory proxy admin |
| 12 | + // =================================================== |
| 13 | + |
| 14 | + function getChainId() public view returns (uint256) { |
| 15 | + uint256 chainId; |
| 16 | + assembly { |
| 17 | + chainId := chainid() |
| 18 | + } |
| 19 | + return chainId; |
| 20 | + } |
| 21 | + |
| 22 | + function run() external { |
| 23 | + uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); |
| 24 | + |
| 25 | + address deployerAddress = vm.addr(deployerPrivateKey); |
| 26 | + console.log("Deployer address: ", deployerAddress); |
| 27 | + console.log("Deployer balance: ", deployerAddress.balance); |
| 28 | + console.log("BlockNumber: ", block.number); |
| 29 | + console.log("ChainId: ", getChainId()); |
| 30 | + console.log("Proxy admin for deployed vaults: ", PROXY_ADMIN_ADDRESS); |
| 31 | + console.log("Deploying vault factory..."); |
| 32 | + |
| 33 | + vm.startBroadcast(deployerPrivateKey); |
| 34 | + |
| 35 | + // Deploy the implementation, which disables initializers on construction |
| 36 | + ATokenVaultFactory factory = new ATokenVaultFactory({proxyAdmin: PROXY_ADMIN_ADDRESS}); |
| 37 | + console.log("Factory deployed at: ", address(factory)); |
| 38 | + |
| 39 | + vm.stopBroadcast(); |
| 40 | + } |
| 41 | +} |
0 commit comments