2025-08-26 17:34:32 +02:00
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
pragma solidity >=0.8.19 <0.9.0;
|
|
|
|
|
|
|
|
|
|
import { BaseScript } from "./Base.s.sol";
|
|
|
|
|
import { TestStableToken } from "../test/TestStableToken.sol";
|
|
|
|
|
import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
|
|
|
|
|
|
|
|
|
|
contract DeployTokenWithProxy is BaseScript {
|
|
|
|
|
function run() public broadcast returns (address) {
|
|
|
|
|
return address(deploy());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function deploy() public returns (ERC1967Proxy) {
|
|
|
|
|
// Deploy the initial implementation
|
|
|
|
|
address implementation = address(new TestStableToken());
|
|
|
|
|
|
|
|
|
|
// Encode the initialize call
|
2025-09-11 10:45:43 +02:00
|
|
|
bytes memory data = abi.encodeCall(TestStableToken.initialize, (1_000_000 * 10 ** 18));
|
2025-08-26 17:34:32 +02:00
|
|
|
|
|
|
|
|
// Deploy the proxy with initialization data
|
|
|
|
|
return new ERC1967Proxy(implementation, data);
|
|
|
|
|
}
|
|
|
|
|
}
|