Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions contracts/IonicToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ contract IonicToken is XERC20Upgradeable {
__ProposedOwnable_init();

_setOwner(msg.sender);

emit Transfer(address(0), address(0), 0);
}

function reinitialize() external reinitializer(2) {
emit Transfer(address(0), address(0), 0);
}

function isBridge(address _bridge) external view returns (bool) {
Expand Down
57 changes: 37 additions & 20 deletions deploy/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,48 @@ const func: DeployFunction = async ({ ethers, getNamedAccounts, deployments, get
const HARDHAT_ID = 1337;
const MUMBAI_ID = 80001;
const ARBI_GOERLI_ID = 421613;
// const ARBI_ID = 42161;
const ARBI_ID = 42161;
//const POLYGON_ID = 137;

let lockedTokenAddress;
if (chainId === HARDHAT_ID || chainId === CHAPEL_ID || chainId === MUMBAI_ID || chainId === ARBI_GOERLI_ID) {
const ionicToken = await deployments.deploy("IonicToken", {
contract: "IonicToken",
from: deployer,
args: [],
log: true,
waitConfirmations: 1,
proxy: {
execute: {
init: {
methodName: "initializeIon",
args: []
}
const ionicToken = await deployments.deploy("IonicToken", {
contract: "IonicToken",
from: deployer,
args: [],
log: true,
waitConfirmations: 1,
proxy: {
execute: {
init: {
methodName: "initializeIon",
args: []
},
owner: deployer,
proxyContract: "OpenZeppelinTransparentProxy"
}
});
console.log(`IonicToken deployed at ${ionicToken.address}`);
onUpgrade: {
methodName: "reinitialize",
args: []
}
},
owner: deployer,
proxyContract: "OpenZeppelinTransparentProxy"
}
});
console.log(`IonicToken deployed at ${ionicToken.address}`);

let lockedTokenAddress;
if (chainId === HARDHAT_ID || chainId === CHAPEL_ID || chainId === MUMBAI_ID || chainId === ARBI_GOERLI_ID) {
// lock ION for testing
lockedTokenAddress = ionicToken.address;
} else if (chainId == ARBI_ID) {
// make the owner a minter on Arbitrum
const ion = (await ethers.getContract("IonicToken")) as IonicToken;

const isOwnerMinter = await ion.callStatic.isBridge(deployer);
if (!isOwnerMinter) {
const tx = await ion.addBridge(deployer);
await tx.wait();
console.log(`added the deployer ${deployer} as a minter`);
} else {
console.log(`the deployer ${deployer} is already a minter`);
}
} else {
// lockedTokenAddress = BAL8020;
}
Expand Down
1 change: 1 addition & 0 deletions deployments/arbitrum/.chainId
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
42161
259 changes: 259 additions & 0 deletions deployments/arbitrum/DefaultProxyAdmin.json

Large diffs are not rendered by default.

Loading