logos-messaging-rlnv2-contract/script/DeployTokenWithProxy.s.sol

24 lines
799 B
Solidity
Raw Normal View History

2025-08-13 11:00:45 +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";
2025-08-13 13:50:40 +02:00
import { ERC1967Proxy } from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";
2025-08-13 11:00:45 +02:00
contract DeployTokenWithProxy is BaseScript {
2025-08-13 13:50:40 +02:00
function run() public broadcast returns (address) {
return address(deploy());
}
function deploy() public returns (ERC1967Proxy) {
2025-08-13 11:00:45 +02:00
// Deploy the initial implementation
2025-08-13 13:50:40 +02:00
address implementation = address(new TestStableToken());
2025-08-18 08:39:17 +02:00
2025-08-13 13:50:40 +02:00
// Encode the initialize call
bytes memory data = abi.encodeCall(TestStableToken.initialize, ());
2025-08-18 08:39:17 +02:00
2025-08-13 13:50:40 +02:00
// Deploy the proxy with initialization data
return new ERC1967Proxy(implementation, data);
2025-08-13 11:00:45 +02:00
}
2025-08-18 08:39:17 +02:00
}