58 lines
2.1 KiB
Solidity
58 lines
2.1 KiB
Solidity
|
|
// SPDX-License-Identifier: MIT
|
||
|
|
pragma solidity ^0.8.19;
|
||
|
|
|
||
|
|
import {Script, console} from "forge-std/Script.sol";
|
||
|
|
import {WETH} from "../contracts/tokens/WETH.sol";
|
||
|
|
import {Multicall} from "../contracts/utils/Multicall.sol";
|
||
|
|
import {CREATE2Factory} from "../contracts/utils/CREATE2Factory.sol";
|
||
|
|
import {Aggregator} from "../contracts/oracle/Aggregator.sol";
|
||
|
|
import {Proxy} from "../contracts/oracle/Proxy.sol";
|
||
|
|
|
||
|
|
contract Deploy is Script {
|
||
|
|
function run() external {
|
||
|
|
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
|
||
|
|
address deployer = vm.addr(deployerPrivateKey);
|
||
|
|
|
||
|
|
console.log("Deploying contracts with address:", deployer);
|
||
|
|
console.log("Chain ID:", block.chainid);
|
||
|
|
|
||
|
|
vm.startBroadcast(deployerPrivateKey);
|
||
|
|
|
||
|
|
// Deploy WETH
|
||
|
|
WETH weth = new WETH();
|
||
|
|
console.log("WETH deployed at:", address(weth));
|
||
|
|
|
||
|
|
// Deploy Multicall
|
||
|
|
Multicall multicall = new Multicall();
|
||
|
|
console.log("Multicall deployed at:", address(multicall));
|
||
|
|
|
||
|
|
// Deploy CREATE2 Factory
|
||
|
|
CREATE2Factory create2Factory = new CREATE2Factory();
|
||
|
|
console.log("CREATE2Factory deployed at:", address(create2Factory));
|
||
|
|
|
||
|
|
// Deploy Oracle Aggregator
|
||
|
|
Aggregator aggregator = new Aggregator(
|
||
|
|
"ETH/USD Price Feed",
|
||
|
|
deployer,
|
||
|
|
60, // heartbeat: 60 seconds
|
||
|
|
50 // deviationThreshold: 0.5% (50 basis points)
|
||
|
|
);
|
||
|
|
console.log("Aggregator deployed at:", address(aggregator));
|
||
|
|
|
||
|
|
// Deploy Proxy for Aggregator
|
||
|
|
Proxy proxy = new Proxy(address(aggregator), deployer);
|
||
|
|
console.log("Proxy deployed at:", address(proxy));
|
||
|
|
|
||
|
|
vm.stopBroadcast();
|
||
|
|
|
||
|
|
// Log deployment addresses
|
||
|
|
console.log("\n=== Deployment Summary ===");
|
||
|
|
console.log("WETH:", address(weth));
|
||
|
|
console.log("Multicall:", address(multicall));
|
||
|
|
console.log("CREATE2Factory:", address(create2Factory));
|
||
|
|
console.log("Aggregator:", address(aggregator));
|
||
|
|
console.log("Proxy:", address(proxy));
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|