-
Notifications
You must be signed in to change notification settings - Fork 280
Expand file tree
/
Copy pathMyOFT.ts
More file actions
53 lines (42 loc) · 1.57 KB
/
Copy pathMyOFT.ts
File metadata and controls
53 lines (42 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import assert from 'assert'
import { type DeployFunction } from 'hardhat-deploy/types'
const contractName = 'MyOFT'
const deploy: DeployFunction = async (hre) => {
const { getNamedAccounts, deployments } = hre
const { deploy } = deployments
const { deployer } = await getNamedAccounts()
assert(deployer, 'Missing named deployer account')
console.log(`Network: ${hre.network.name}`)
console.log(`Deployer: ${deployer}`)
// This is an external deployment pulled in from @layerzerolabs/lz-evm-sdk-v2
//
// @layerzerolabs/toolbox-hardhat takes care of plugging in the external deployments
// from @layerzerolabs packages based on the configuration in your hardhat config
//
// For this to work correctly, your network config must define an eid property
// set to `EndpointId` as defined in @layerzerolabs/lz-definitions
//
// For example:
//
// networks: {
// 'optimism-testnet': {
// ...
// eid: EndpointId.OPTSEP_V2_TESTNET
// }
// }
const endpointV2Deployment = await hre.deployments.get('EndpointV2')
const { address } = await deploy(contractName, {
from: deployer,
args: [
'MyOFT', // name
'MOFT', // symbol
endpointV2Deployment.address, // LayerZero's EndpointV2 address
deployer, // owner
],
log: true,
skipIfAlreadyDeployed: false,
})
console.log(`Deployed contract: ${contractName}, network: ${hre.network.name}, address: ${address}`)
}
deploy.tags = [contractName]
export default deploy