Skip to content

Commit 0a332fe

Browse files
committed
update token deploy task
1 parent c24426b commit 0a332fe

File tree

2 files changed

+32
-9
lines changed

2 files changed

+32
-9
lines changed

contracts/contracts/l2/token/MorphPlacementToken.sol

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@ contract MorphPlacementToken is IMorphPlacementToken, OwnableUpgradeable, Pausab
3838
* Initialize *
3939
**************/
4040

41-
/// @notice constructor
41+
/// @notice constructor
4242
constructor() {
43-
_disableInitializers();
43+
_disableInitializers();
4444
}
4545

46-
4746
/// @dev See {IMorphToken-initialize}.
4847
function initialize(
4948
string memory name_,
@@ -227,7 +226,7 @@ contract MorphPlacementToken is IMorphPlacementToken, OwnableUpgradeable, Pausab
227226
/// - `from` cannot be the zero address.
228227
/// - `to` cannot be the zero address.
229228
/// - `from` must have a balance of at least `amount`.
230-
function _transfer(address from, address to, uint256 amount) whenNotPaused internal {
229+
function _transfer(address from, address to, uint256 amount) internal whenNotPaused {
231230
require(from != address(0), "transfer from the zero address");
232231
require(to != address(0), "transfer to the zero address");
233232

@@ -251,7 +250,7 @@ contract MorphPlacementToken is IMorphPlacementToken, OwnableUpgradeable, Pausab
251250
/// Requirements:
252251
///
253252
/// - `account` cannot be the zero address.
254-
function _mint(address account, uint256 amount) whenNotPaused internal {
253+
function _mint(address account, uint256 amount) internal whenNotPaused {
255254
require(account != address(0), "mint to the zero address");
256255
_totalSupply += amount;
257256
unchecked {
@@ -271,7 +270,7 @@ contract MorphPlacementToken is IMorphPlacementToken, OwnableUpgradeable, Pausab
271270
* - `account` cannot be the zero address.
272271
* - `account` must have at least `amount` tokens.
273272
*/
274-
function _burn(address account, uint256 amount) whenNotPaused internal {
273+
function _burn(address account, uint256 amount) internal whenNotPaused {
275274
require(account != address(0), "ERC20: burn from the zero address");
276275

277276
uint256 accountBalance = _balances[account];
@@ -296,7 +295,7 @@ contract MorphPlacementToken is IMorphPlacementToken, OwnableUpgradeable, Pausab
296295
///
297296
/// - `owner` cannot be the zero address.
298297
/// - `spender` cannot be the zero address.
299-
function _approve(address owner, address spender, uint256 amount) whenNotPaused internal {
298+
function _approve(address owner, address spender, uint256 amount) internal whenNotPaused {
300299
require(owner != address(0), "approve from the zero address");
301300
require(spender != address(0), "approve to the zero address");
302301

contracts/tasks/mainnet_upgrade.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import "@nomiclabs/hardhat-waffle";
44

55
import { task } from "hardhat/config";
66
import { ContractFactoryName } from "../src/types";
7+
import { predeploys } from "../src"
8+
import { assertContractVariable } from "../src/deploy-utils";
79

810
task("rollup-upgrade-hc")
911
.addParam("l2cid")
@@ -32,6 +34,28 @@ task("deploy-morph-placement-token")
3234
await morphPlacementToken.deployed();
3335

3436
let blockNumber = await hre.ethers.provider.getBlockNumber();
35-
console.log(`MorphPlacementToken deployed at ${morphPlacementToken.address} and initialized at block ${blockNumber}`);
37+
console.log(`MorphPlacementToken deployed at ${morphPlacementToken.address} at block ${blockNumber}`);
38+
});
39+
40+
41+
task("init-morph-placement-token")
42+
.setAction(async (taskArgs, hre) => {
43+
const MorphPlacementTokenFactory = await hre.ethers.getContractFactory("MorphPlacementToken");
44+
const token = MorphPlacementTokenFactory.attach(predeploys.MorphToken)
45+
46+
let res = await token.initialize(
47+
"morph placement token",
48+
"mphp",
49+
"0x716173f5BBE0b4B51AaDF5A5840fA9A79D01636E",
50+
hre.ethers.utils.parseEther("10000000000")
51+
)
52+
let rec = await res.wait()
53+
54+
console.log(`MorphPlacementToken init at ${token.address} and initialized ${rec.status == 1}, at blockNum ${rec.blockNumber}`);
55+
56+
let name = await token.name()
57+
let symbol = await token.symbol()
58+
let totalSupply = await token.totalSupply()
59+
let owner = await token.owner()
60+
console.log(`init name ${name}, symbol ${symbol}, totalSupply ${totalSupply}, owner ${owner}`)
3661
});
37-

0 commit comments

Comments
 (0)