-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: deploy base contracts at pre-deterministic address (#758)
* build: deploy base contracts at pre-deterministic address * build: use pre-defined salt
- Loading branch information
Showing
11 changed files
with
74 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
import { ethers } from 'hardhat'; | ||
import { SALT } from './salt'; | ||
|
||
const deployUniversalReceiverDelegateUP: DeployFunction = async ({ | ||
const deployUniversalReceiverDelegateUPDeterministic: DeployFunction = async ({ | ||
deployments, | ||
getNamedAccounts, | ||
}: HardhatRuntimeEnvironment) => { | ||
const { deploy } = deployments; | ||
const { owner } = await getNamedAccounts(); | ||
const { owner: deployer } = await getNamedAccounts(); | ||
|
||
await deploy('LSP1UniversalReceiverDelegateUP', { | ||
from: owner, | ||
from: deployer, | ||
gasPrice: ethers.BigNumber.from(20_000_000_000), // in wei | ||
log: true, | ||
deterministicDeployment: SALT, | ||
}); | ||
}; | ||
|
||
export default deployUniversalReceiverDelegateUP; | ||
deployUniversalReceiverDelegateUP.tags = ['LSP1UniversalReceiverDelegateUP']; | ||
export default deployUniversalReceiverDelegateUPDeterministic; | ||
deployUniversalReceiverDelegateUPDeterministic.tags = ['LSP1UniversalReceiverDelegateUP']; |
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 |
---|---|---|
@@ -1,20 +1,22 @@ | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
import { ethers } from 'hardhat'; | ||
import { SALT } from './salt'; | ||
|
||
const deployUniversalReceiverDelegateVault: DeployFunction = async ({ | ||
const deployUniversalReceiverDelegateVaultDeterministic: DeployFunction = async ({ | ||
deployments, | ||
getNamedAccounts, | ||
}: HardhatRuntimeEnvironment) => { | ||
const { deploy } = deployments; | ||
const { owner } = await getNamedAccounts(); | ||
const { owner: deployer } = await getNamedAccounts(); | ||
|
||
await deploy('LSP1UniversalReceiverDelegateVault', { | ||
from: owner, | ||
from: deployer, | ||
gasPrice: ethers.BigNumber.from(20_000_000_000), // in wei | ||
log: true, | ||
deterministicDeployment: SALT, | ||
}); | ||
}; | ||
|
||
export default deployUniversalReceiverDelegateVault; | ||
deployUniversalReceiverDelegateVault.tags = ['LSP1UniversalReceiverDelegateVault']; | ||
export default deployUniversalReceiverDelegateVaultDeterministic; | ||
deployUniversalReceiverDelegateVaultDeterministic.tags = ['LSP1UniversalReceiverDelegateVault']; |
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 |
---|---|---|
@@ -1,20 +1,22 @@ | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
import { ethers } from 'hardhat'; | ||
import { SALT } from './salt'; | ||
|
||
const deployBaseUniversalProfile: DeployFunction = async ({ | ||
const deployBaseUniversalProfileDeterministic: DeployFunction = async ({ | ||
deployments, | ||
getNamedAccounts, | ||
}: HardhatRuntimeEnvironment) => { | ||
const { deploy } = deployments; | ||
const { owner } = await getNamedAccounts(); | ||
const { owner: deployer } = await getNamedAccounts(); | ||
|
||
await deploy('UniversalProfileInit', { | ||
from: owner, | ||
from: deployer, | ||
log: true, | ||
gasPrice: ethers.BigNumber.from(20_000_000_000), // in wei | ||
deterministicDeployment: SALT, | ||
}); | ||
}; | ||
|
||
export default deployBaseUniversalProfile; | ||
deployBaseUniversalProfile.tags = ['UniversalProfileInit', 'base']; | ||
export default deployBaseUniversalProfileDeterministic; | ||
deployBaseUniversalProfileDeterministic.tags = ['UniversalProfileInit', 'base']; |
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 |
---|---|---|
@@ -1,21 +1,23 @@ | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
import { ethers } from 'hardhat'; | ||
import { SALT } from './salt'; | ||
|
||
const deployBaseKeyManager: DeployFunction = async ({ | ||
const deployBaseKeyManagerDeterministic: DeployFunction = async ({ | ||
deployments, | ||
getNamedAccounts, | ||
}: HardhatRuntimeEnvironment) => { | ||
const { deploy } = deployments; | ||
const { owner } = await getNamedAccounts(); | ||
const { owner: deployer } = await getNamedAccounts(); | ||
|
||
await deploy('LSP6KeyManagerInit', { | ||
from: owner, | ||
from: deployer, | ||
log: true, | ||
gasLimit: 5_000_000, | ||
gasPrice: ethers.BigNumber.from(20_000_000_000), // in wei | ||
deterministicDeployment: SALT, | ||
}); | ||
}; | ||
|
||
export default deployBaseKeyManager; | ||
deployBaseKeyManager.tags = ['LSP6KeyManagerInit', 'base']; | ||
export default deployBaseKeyManagerDeterministic; | ||
deployBaseKeyManagerDeterministic.tags = ['LSP6KeyManagerInit', 'base']; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
import { ethers } from 'hardhat'; | ||
import { SALT } from './salt'; | ||
|
||
const deployBaseLSP7Mintable: DeployFunction = async ({ | ||
const deployBaseLSP7MintableDeterministic: DeployFunction = async ({ | ||
deployments, | ||
getNamedAccounts, | ||
}: HardhatRuntimeEnvironment) => { | ||
const { deploy } = deployments; | ||
const { owner } = await getNamedAccounts(); | ||
const { owner: deployer } = await getNamedAccounts(); | ||
|
||
await deploy('LSP7MintableInit', { | ||
from: owner, | ||
from: deployer, | ||
gasPrice: ethers.BigNumber.from(20_000_000_000), // in wei, | ||
log: true, | ||
deterministicDeployment: SALT, | ||
}); | ||
}; | ||
|
||
export default deployBaseLSP7Mintable; | ||
deployBaseLSP7Mintable.tags = ['LSP7MintableInit', 'base']; | ||
export default deployBaseLSP7MintableDeterministic; | ||
deployBaseLSP7MintableDeterministic.tags = ['LSP7MintableInit', 'base']; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
import { ethers } from 'hardhat'; | ||
import { SALT } from './salt'; | ||
|
||
const deployBaseVault: DeployFunction = async ({ | ||
const deployBaseVaultDeterministic: DeployFunction = async ({ | ||
deployments, | ||
getNamedAccounts, | ||
}: HardhatRuntimeEnvironment) => { | ||
const { deploy } = deployments; | ||
const { owner } = await getNamedAccounts(); | ||
const { owner: deployer } = await getNamedAccounts(); | ||
|
||
await deploy('LSP9VaultInit', { | ||
from: owner, | ||
from: deployer, | ||
log: true, | ||
gasPrice: ethers.BigNumber.from(20_000_000_000), // in wei | ||
deterministicDeployment: SALT, | ||
}); | ||
}; | ||
|
||
export default deployBaseVault; | ||
deployBaseVault.tags = ['LSP9VaultInit', 'base']; | ||
export default deployBaseVaultDeterministic; | ||
deployBaseVaultDeterministic.tags = ['LSP9VaultInit', 'base']; |
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 @@ | ||
export const SALT = '0xfeedfeedfeedfeedfeedfeedfeedfeedfeedfeedfeedfeedfeedfeedfeedfeed'; |
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