forked from LayerZero-Labs/endpoint-v1-solidity-examples
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: COBE deployment, minDstGas fixes
- Loading branch information
Showing
19 changed files
with
9,554 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const LZ_ENDPOINTS = require("../constants/layerzeroEndpoints.json") | ||
const TOKEN_CONFIG = require("../constants/tokenConfig") | ||
|
||
const CONTRACT_NAME = "CastleOfBlackwaterOFT" | ||
|
||
module.exports = async function ({ deployments, getNamedAccounts }) { | ||
const { deploy } = deployments | ||
const { deployer, proxyOwner } = await getNamedAccounts() | ||
|
||
let lzEndpointAddress, lzEndpoint, LZEndpointMock | ||
if (hre.network.name === "hardhat") { | ||
LZEndpointMock = await ethers.getContractFactory("LZEndpointMock") | ||
lzEndpoint = await LZEndpointMock.deploy(1) | ||
lzEndpointAddress = lzEndpoint.address | ||
} else { | ||
lzEndpointAddress = LZ_ENDPOINTS[hre.network.name] | ||
} | ||
|
||
const tokenConfig = TOKEN_CONFIG[hre.network.name][CONTRACT_NAME] | ||
if (!tokenConfig.name || !tokenConfig.symbol) { | ||
console.error("No configuration found for target network.") | ||
return | ||
} | ||
|
||
await deploy(CONTRACT_NAME, { | ||
from: deployer, | ||
log: true, | ||
waitConfirmations: 1, | ||
proxy: { | ||
owner: proxyOwner, | ||
proxyContract: "OptimizedTransparentProxy", | ||
execute: { | ||
init: { | ||
methodName: "initialize", | ||
args: [ | ||
tokenConfig.name, | ||
tokenConfig.symbol, | ||
tokenConfig.sharedDecimals != null ? tokenConfig.sharedDecimals : 6, | ||
lzEndpointAddress, | ||
], | ||
}, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
module.exports.tags = [CONTRACT_NAME] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
const LZ_ENDPOINTS = require("../constants/layerzeroEndpoints.json") | ||
const TOKEN_CONFIG = require("../constants/tokenConfig") | ||
|
||
const CONTRACT_NAME = "CastleOfBlackwaterProxyOFT" | ||
|
||
module.exports = async function ({ deployments, getNamedAccounts }) { | ||
const { deploy } = deployments | ||
const { deployer, proxyOwner } = await getNamedAccounts() | ||
|
||
let lzEndpointAddress, lzEndpoint, LZEndpointMock | ||
if (hre.network.name === "hardhat") { | ||
LZEndpointMock = await ethers.getContractFactory("LZEndpointMock") | ||
lzEndpoint = await LZEndpointMock.deploy(1) | ||
lzEndpointAddress = lzEndpoint.address | ||
} else { | ||
lzEndpointAddress = LZ_ENDPOINTS[hre.network.name] | ||
} | ||
|
||
const tokenConfig = TOKEN_CONFIG[hre.network.name][CONTRACT_NAME] | ||
|
||
if (!tokenConfig.address) { | ||
console.error("No configured token address found for target network.") | ||
return | ||
} | ||
|
||
await deploy(CONTRACT_NAME, { | ||
from: deployer, | ||
log: true, | ||
waitConfirmations: 1, | ||
proxy: { | ||
owner: proxyOwner, | ||
proxyContract: "OptimizedTransparentProxy", | ||
execute: { | ||
init: { | ||
methodName: "initialize", | ||
args: [tokenConfig.address, tokenConfig.sharedDecimals != null ? tokenConfig.sharedDecimals : 6, lzEndpointAddress], | ||
}, | ||
}, | ||
}, | ||
}) | ||
} | ||
|
||
module.exports.tags = [CONTRACT_NAME] |
Oops, something went wrong.