-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cd7b873
commit 026fbf0
Showing
11 changed files
with
386 additions
and
1 deletion.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
protocol/scripts/deploys/b13_testnet/templegold/01-temple-token.ts
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,23 @@ | ||
import '@nomiclabs/hardhat-ethers'; | ||
import { ethers } from 'hardhat'; | ||
import { TempleERC20Token, TempleERC20Token__factory } from '../../../../typechain'; | ||
import { deployAndMine, ensureExpectedEnvvars } from '../../helpers'; | ||
|
||
async function main() { | ||
ensureExpectedEnvvars(); | ||
const [owner] = await ethers.getSigners(); | ||
|
||
const templeFactory = new TempleERC20Token__factory(owner); | ||
const TEMPLE: TempleERC20Token = await deployAndMine( | ||
'TEMPLE', templeFactory, templeFactory.deploy, | ||
); | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
43 changes: 43 additions & 0 deletions
43
protocol/scripts/deploys/b13_testnet/templegold/02-temple-gold.ts
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 @@ | ||
import '@nomiclabs/hardhat-ethers'; | ||
import { ethers } from 'hardhat'; | ||
import { TempleGold__factory } from '../../../../typechain'; | ||
import { | ||
deployAndMine, | ||
ensureExpectedEnvvars, | ||
} from '../../helpers'; | ||
import { getDeployedTempleGoldContracts } from '../../mainnet/templegold/contract-addresses'; | ||
|
||
async function main() { | ||
ensureExpectedEnvvars(); | ||
const [owner] = await ethers.getSigners(); | ||
const ownerAddress = await owner.getAddress(); | ||
const TEMPLEGOLD_ADDRESSES = getDeployedTempleGoldContracts(); | ||
const B13_TESTNET_CHAIN_ID = 80000; | ||
const B13_TESTNET_LZ_EID = 40346; | ||
const _initArgs = { | ||
// Changed in transfer ownership to TempleAdmin | ||
executor: ownerAddress, // executor is also used as delegate in LayerZero Endpoint. | ||
layerZeroEndpoint: TEMPLEGOLD_ADDRESSES.EXTERNAL.LAYER_ZERO.ENDPOINT, // local endpoint address | ||
mintChainId: B13_TESTNET_CHAIN_ID, | ||
mintChainLzEid: B13_TESTNET_LZ_EID, | ||
name: "TEMPLE GOLD", | ||
symbol: "TGLD" | ||
}; | ||
const factory = new TempleGold__factory(owner); | ||
await deployAndMine( | ||
'TEMPLE_GOLD', | ||
factory, | ||
factory.deploy, | ||
_initArgs | ||
); | ||
|
||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
35 changes: 35 additions & 0 deletions
35
protocol/scripts/deploys/b13_testnet/templegold/03-temple-teleporter.ts
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,35 @@ | ||
import '@nomiclabs/hardhat-ethers'; | ||
import { ethers } from 'hardhat'; | ||
import { TempleTeleporter__factory } from '../../../../typechain'; | ||
import { | ||
deployAndMine, | ||
ensureExpectedEnvvars, | ||
} from '../../helpers'; | ||
import { getDeployedTempleGoldContracts } from '../../mainnet/templegold/contract-addresses'; | ||
import { getDeployedContracts } from '../../mainnet/v2/contract-addresses'; | ||
|
||
async function main() { | ||
ensureExpectedEnvvars(); | ||
const [owner] = await ethers.getSigners(); | ||
const TEMPLEGOLD_ADDRESSES = getDeployedTempleGoldContracts(); | ||
const CORE_ADDRESSES = getDeployedContracts(); | ||
|
||
const factory = new TempleTeleporter__factory(owner); | ||
await deployAndMine( | ||
'TEMPLE_TELEPORTER', | ||
factory, | ||
factory.deploy, | ||
CORE_ADDRESSES.CORE.EXECUTOR_MSIG, | ||
CORE_ADDRESSES.CORE.TEMPLE_TOKEN, | ||
TEMPLEGOLD_ADDRESSES.EXTERNAL.LAYER_ZERO.ENDPOINT | ||
); | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
35 changes: 35 additions & 0 deletions
35
protocol/scripts/deploys/b13_testnet/templegold/04-temple-gold-admin.ts
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,35 @@ | ||
import '@nomiclabs/hardhat-ethers'; | ||
import { ethers } from 'hardhat'; | ||
import { TempleGoldAdmin__factory } from '../../../../typechain'; | ||
import { | ||
deployAndMine, | ||
ensureExpectedEnvvars, | ||
} from '../../helpers'; | ||
import { getDeployedTempleGoldContracts } from '../../mainnet/templegold/contract-addresses'; | ||
import { getDeployedContracts } from '../../mainnet/v2/contract-addresses'; | ||
|
||
async function main() { | ||
ensureExpectedEnvvars(); | ||
const [owner] = await ethers.getSigners(); | ||
const TEMPLEGOLD_ADDRESSES = getDeployedTempleGoldContracts(); | ||
const CORE_ADDRESSES = getDeployedContracts(); | ||
|
||
const factory = new TempleGoldAdmin__factory(owner); | ||
await deployAndMine( | ||
'TEMPLE_GOLD_ADMIN', | ||
factory, | ||
factory.deploy, | ||
CORE_ADDRESSES.CORE.RESCUER_MSIG, | ||
CORE_ADDRESSES.CORE.EXECUTOR_MSIG, | ||
TEMPLEGOLD_ADDRESSES.TEMPLE_GOLD.TEMPLE_GOLD | ||
); | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
43 changes: 43 additions & 0 deletions
43
protocol/scripts/deploys/b13_testnet/templegold/999-transfer-ownership.ts
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 @@ | ||
import { ethers } from 'hardhat'; | ||
import { | ||
ensureExpectedEnvvars, | ||
mine, | ||
} from '../../helpers'; | ||
import { connectToContracts, getDeployedTempleGoldContracts } from '../../mainnet/templegold/contract-addresses'; | ||
import { getDeployedContracts } from "../../mainnet/v2/contract-addresses"; | ||
|
||
async function main() { | ||
ensureExpectedEnvvars(); | ||
const [owner] = await ethers.getSigners(); | ||
const TEMPLE_GOLD_ADDRESSES = getDeployedTempleGoldContracts(); | ||
const V2_ADDRESSES = getDeployedContracts(); | ||
const TEMPLE_GOLD_INSTANCES = connectToContracts(owner); | ||
|
||
// Transfer ownership to the temple gold admin | ||
await mine( | ||
TEMPLE_GOLD_INSTANCES.TEMPLE_GOLD.TEMPLE_GOLD.transferOwnership( | ||
TEMPLE_GOLD_ADDRESSES.TEMPLE_GOLD.TEMPLE_GOLD_ADMIN | ||
) | ||
); | ||
// temple token | ||
await mine( | ||
TEMPLE_GOLD_INSTANCES.CORE.TEMPLE_TOKEN.transferOwnership( | ||
V2_ADDRESSES.CORE.EXECUTOR_MSIG | ||
) | ||
); | ||
// temple teleporter | ||
await mine( | ||
TEMPLE_GOLD_INSTANCES.TEMPLE_GOLD.TEMPLE_TELEPORTER.transferOwnership( | ||
V2_ADDRESSES.CORE.EXECUTOR_MSIG | ||
) | ||
); | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
43 changes: 43 additions & 0 deletions
43
protocol/scripts/deploys/berachain/templegold/01-temple-gold.ts
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 @@ | ||
import '@nomiclabs/hardhat-ethers'; | ||
import { ethers } from 'hardhat'; | ||
import { TempleGold__factory } from '../../../../typechain'; | ||
import { | ||
deployAndMine, | ||
ensureExpectedEnvvars, | ||
} from '../../helpers'; | ||
import { getDeployedTempleGoldContracts } from '../../mainnet/templegold/contract-addresses'; | ||
|
||
async function main() { | ||
ensureExpectedEnvvars(); | ||
const [owner] = await ethers.getSigners(); | ||
const ownerAddress = await owner.getAddress(); | ||
const TEMPLEGOLD_ADDRESSES = getDeployedTempleGoldContracts(); | ||
const BERACHAIN_CHAIN_ID = ""; | ||
const BERACHAIN_LZ_EID = ""; | ||
const _initArgs = { | ||
// Changed in transfer ownership to TempleAdmin | ||
executor: ownerAddress, // executor is also used as delegate in LayerZero Endpoint. | ||
layerZeroEndpoint: TEMPLEGOLD_ADDRESSES.EXTERNAL.LAYER_ZERO.ENDPOINT, // local endpoint address | ||
mintChainId: BERACHAIN_CHAIN_ID, | ||
mintChainLzEid: BERACHAIN_LZ_EID, | ||
name: "TEMPLE GOLD", | ||
symbol: "TGLD" | ||
}; | ||
const factory = new TempleGold__factory(owner); | ||
await deployAndMine( | ||
'TEMPLE_GOLD', | ||
factory, | ||
factory.deploy, | ||
_initArgs | ||
); | ||
|
||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
23 changes: 23 additions & 0 deletions
23
protocol/scripts/deploys/berachain/templegold/02-temple-token.ts
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,23 @@ | ||
import '@nomiclabs/hardhat-ethers'; | ||
import { ethers } from 'hardhat'; | ||
import { TempleERC20Token, TempleERC20Token__factory } from '../../../../typechain'; | ||
import { deployAndMine, ensureExpectedEnvvars } from '../../helpers'; | ||
|
||
async function main() { | ||
ensureExpectedEnvvars(); | ||
const [owner] = await ethers.getSigners(); | ||
|
||
const templeFactory = new TempleERC20Token__factory(owner); | ||
const TEMPLE: TempleERC20Token = await deployAndMine( | ||
'TEMPLE', templeFactory, templeFactory.deploy, | ||
); | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
35 changes: 35 additions & 0 deletions
35
protocol/scripts/deploys/berachain/templegold/03-temple-teleporter.ts
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,35 @@ | ||
import '@nomiclabs/hardhat-ethers'; | ||
import { ethers } from 'hardhat'; | ||
import { TempleTeleporter__factory } from '../../../../typechain'; | ||
import { | ||
deployAndMine, | ||
ensureExpectedEnvvars, | ||
} from '../../helpers'; | ||
import { getDeployedTempleGoldContracts } from '../../mainnet/templegold/contract-addresses'; | ||
import { getDeployedContracts } from '../../mainnet/v2/contract-addresses'; | ||
|
||
async function main() { | ||
ensureExpectedEnvvars(); | ||
const [owner] = await ethers.getSigners(); | ||
const TEMPLEGOLD_ADDRESSES = getDeployedTempleGoldContracts(); | ||
const CORE_ADDRESSES = getDeployedContracts(); | ||
|
||
const factory = new TempleTeleporter__factory(owner); | ||
await deployAndMine( | ||
'TEMPLE_TELEPORTER', | ||
factory, | ||
factory.deploy, | ||
CORE_ADDRESSES.CORE.EXECUTOR_MSIG, | ||
CORE_ADDRESSES.CORE.TEMPLE_TOKEN, | ||
TEMPLEGOLD_ADDRESSES.EXTERNAL.LAYER_ZERO.ENDPOINT | ||
); | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
35 changes: 35 additions & 0 deletions
35
protocol/scripts/deploys/berachain/templegold/04-temple-gold-admin.ts
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,35 @@ | ||
import '@nomiclabs/hardhat-ethers'; | ||
import { ethers } from 'hardhat'; | ||
import { TempleGoldAdmin__factory } from '../../../../typechain'; | ||
import { | ||
deployAndMine, | ||
ensureExpectedEnvvars, | ||
} from '../../helpers'; | ||
import { getDeployedTempleGoldContracts } from '../../mainnet/templegold/contract-addresses'; | ||
import { getDeployedContracts } from '../../mainnet/v2/contract-addresses'; | ||
|
||
async function main() { | ||
ensureExpectedEnvvars(); | ||
const [owner] = await ethers.getSigners(); | ||
const TEMPLEGOLD_ADDRESSES = getDeployedTempleGoldContracts(); | ||
const CORE_ADDRESSES = getDeployedContracts(); | ||
|
||
const factory = new TempleGoldAdmin__factory(owner); | ||
await deployAndMine( | ||
'TEMPLE_GOLD_ADMIN', | ||
factory, | ||
factory.deploy, | ||
CORE_ADDRESSES.CORE.RESCUER_MSIG, | ||
CORE_ADDRESSES.CORE.EXECUTOR_MSIG, | ||
TEMPLEGOLD_ADDRESSES.TEMPLE_GOLD.TEMPLE_GOLD | ||
); | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
43 changes: 43 additions & 0 deletions
43
protocol/scripts/deploys/berachain/templegold/999-transfer-ownership.ts
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 @@ | ||
import { ethers } from 'hardhat'; | ||
import { | ||
ensureExpectedEnvvars, | ||
mine, | ||
} from '../../helpers'; | ||
import { connectToContracts, getDeployedTempleGoldContracts } from '../../mainnet/templegold/contract-addresses'; | ||
import { getDeployedContracts } from "../../mainnet/v2/contract-addresses"; | ||
|
||
async function main() { | ||
ensureExpectedEnvvars(); | ||
const [owner] = await ethers.getSigners(); | ||
const TEMPLE_GOLD_ADDRESSES = getDeployedTempleGoldContracts(); | ||
const V2_ADDRESSES = getDeployedContracts(); | ||
const TEMPLE_GOLD_INSTANCES = connectToContracts(owner); | ||
|
||
// Transfer ownership to the temple gold admin | ||
await mine( | ||
TEMPLE_GOLD_INSTANCES.TEMPLE_GOLD.TEMPLE_GOLD.transferOwnership( | ||
TEMPLE_GOLD_ADDRESSES.TEMPLE_GOLD.TEMPLE_GOLD_ADMIN | ||
) | ||
); | ||
// temple token | ||
await mine( | ||
TEMPLE_GOLD_INSTANCES.CORE.TEMPLE_TOKEN.transferOwnership( | ||
V2_ADDRESSES.CORE.EXECUTOR_MSIG | ||
) | ||
); | ||
// temple teleporter | ||
await mine( | ||
TEMPLE_GOLD_INSTANCES.TEMPLE_GOLD.TEMPLE_TELEPORTER.transferOwnership( | ||
V2_ADDRESSES.CORE.EXECUTOR_MSIG | ||
) | ||
); | ||
} | ||
|
||
// We recommend this pattern to be able to use async/await everywhere | ||
// and properly handle errors. | ||
main() | ||
.then(() => process.exit(0)) | ||
.catch(error => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
Oops, something went wrong.