Skip to content

Commit e9948d6

Browse files
committed
script: adds deployment script for Wsteth token
1 parent 0ee47cf commit e9948d6

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

script/DeployWsteth.sol

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// SPDX-License-Identifier: UNLICENSED
2+
3+
pragma solidity >=0.8.7 <0.9.0;
4+
5+
import {Script, console} from "forge-std/Script.sol";
6+
import {WstEthL2Token} from "../src/token/WstEthL2Token.sol";
7+
import {Upgrades} from "./lib/Upgrades.sol";
8+
9+
contract DeployToken is Script {
10+
function run() public {
11+
vm.startBroadcast();
12+
13+
address proxy = Upgrades.deployUUPSProxy(
14+
"out/ERC1967Proxy.sol/ERC1967Proxy.json",
15+
"WstEthL2Token.sol",
16+
abi.encodeCall(WstEthL2Token.initialize, ("Wrapped liquid staked Ether 2.0", "wstETH", msg.sender))
17+
);
18+
19+
WstEthL2Token token = WstEthL2Token(proxy);
20+
21+
console.log("WstEthL2Token deployed at: ");
22+
console.log(address(token));
23+
vm.stopBroadcast();
24+
}
25+
26+
function transferOwnership(address tokenAddress, address newOwner, address minter) public {
27+
vm.startBroadcast();
28+
29+
WstEthL2Token token = WstEthL2Token(tokenAddress);
30+
token.setMinter(minter);
31+
token.transferOwnership(newOwner);
32+
vm.stopBroadcast();
33+
}
34+
}

script/deployWsteth.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
forge script --broadcast --slow --verify ./script/DeployWsteth.sol $@

0 commit comments

Comments
 (0)