Skip to content

Commit

Permalink
build!: upgrade all packages + root to latest Hardhat version and eth…
Browse files Browse the repository at this point in the history
…ers v6 (#889)
  • Loading branch information
CJ42 authored Feb 29, 2024
1 parent 81da8de commit d41145c
Show file tree
Hide file tree
Showing 199 changed files with 8,308 additions and 10,918 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ jobs:
test-suites:
strategy:
matrix:
lsp:
[
lsp: [
"up",
"upinit",
"lsp1",
Expand All @@ -85,7 +84,9 @@ jobs:
"lsp11",
"lsp11init",
"lsp17",
"lsp17extensions",
# Deploying NickFactory currently fails with latest Hardhat version. Commenting out temporarily until resolved
# See following issue: https://github.com/NomicFoundation/hardhat/issues/4939
# "lsp17extensions",
"lsp20",
"lsp20init",
"lsp23",
Expand Down
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ forge-cache/
gas_benchmark.md

# Exclude build output folders
/common
/module
/contracts.ts
/**/contracts.ts
/devdocs
/userdocs

Expand Down
2 changes: 1 addition & 1 deletion constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Set of constants values as defined in each LUKSO Standards Proposals (LSPs).
* @see https://github.com/lukso-network/LIPs/tree/main/LSPs
*/
export * from './contracts';
// export * from './contracts';

import { INTERFACE_ID_LSP0ERC725Account, LSP0_TYPE_IDS } from '@lukso/lsp0-contracts';
import { INTERFACE_ID_LSP1, LSP1DataKeys } from '@lukso/lsp1-contracts';
Expand Down
28 changes: 28 additions & 0 deletions contracts/Mocks/LSP20Owners/BothCallReturnMagicValue.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.4;

/**
* @title sample contract used for testing
*/
contract BothCallReturnMagicValue {
function lsp20VerifyCall(
address /*caller*/,
uint256 /*value*/,
bytes memory /*data*/
) external pure returns (bytes4 magicValue) {
return
bytes4(
abi.encodePacked(
bytes3(BothCallReturnMagicValue.lsp20VerifyCall.selector),
hex"01"
)
);
}

function lsp20VerifyCallResult(
bytes32 /*callHash*/,
bytes memory /*result*/
) external pure returns (bytes4) {
return BothCallReturnMagicValue.lsp20VerifyCallResult.selector;
}
}
31 changes: 31 additions & 0 deletions contracts/Mocks/LSP20Owners/FirstCallReturnMagicValue.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.4;

/**
* @title sample contract used for testing
*/
contract FirstCallReturnMagicValue {
function lsp20VerifyCall(
address /*caller*/,
uint256 /*value*/,
bytes memory /*data*/
) external pure returns (bytes4 magicValue) {
return
bytes4(
abi.encodePacked(
bytes3(FirstCallReturnMagicValue.lsp20VerifyCall.selector),
hex"00"
)
);
}

/**
* @dev should not be called
*/
function lsp20VerifyCallResult(
bytes32 /*callHash*/,
bytes memory /*result*/
) external pure returns (bytes4) {
revert("This revert will not be triggered");
}
}
39 changes: 39 additions & 0 deletions contracts/Mocks/LSP20Owners/SecondCallReturnExpandedValue.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.4;

/**
* @title sample contract used for testing
*/
contract SecondCallReturnExpandedValue {
function lsp20VerifyCall(
address /*caller*/,
uint256 /*value*/,
bytes memory /*data*/
) external pure returns (bytes4 magicValue) {
return
bytes4(
abi.encodePacked(
bytes3(
SecondCallReturnExpandedValue.lsp20VerifyCall.selector
),
hex"01"
)
);
}

function lsp20VerifyCallResult(
bytes32 /*callHash*/,
bytes memory /*result*/
) external pure returns (bytes32) {
return
bytes32(
bytes.concat(
bytes4(
SecondCallReturnExpandedValue
.lsp20VerifyCallResult
.selector
)
)
);
}
}
4 changes: 0 additions & 4 deletions deploy/001_deploy_universal_profile.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { ethers } from 'hardhat';

const deployUniversalProfile: DeployFunction = async ({
deployments,
Expand All @@ -9,12 +8,9 @@ const deployUniversalProfile: DeployFunction = async ({
const { deploy } = deployments;
const { owner } = await getNamedAccounts();

const gasPrice = await ethers.provider.getGasPrice();

await deploy('UniversalProfile', {
from: owner,
args: [owner],
gasPrice,
log: true,
});
};
Expand Down
4 changes: 0 additions & 4 deletions deploy/002_deploy_key_manager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { ethers } from 'hardhat';

const deployKeyManager: DeployFunction = async ({
deployments,
Expand All @@ -11,12 +10,9 @@ const deployKeyManager: DeployFunction = async ({

const UniversalProfile = await deployments.get('UniversalProfile');

const gasPrice = await ethers.provider.getGasPrice();

await deploy('LSP6KeyManager', {
from: owner,
args: [UniversalProfile.address],
gasPrice,
log: true,
});
};
Expand Down
4 changes: 0 additions & 4 deletions deploy/003_deploy_universal_receiver_delegate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { ethers } from 'hardhat';
import { SALT } from './salt';

const deployUniversalReceiverDelegateUPDeterministic: DeployFunction = async ({
Expand All @@ -10,11 +9,8 @@ const deployUniversalReceiverDelegateUPDeterministic: DeployFunction = async ({
const { deploy } = deployments;
const { owner: deployer } = await getNamedAccounts();

const gasPrice = await ethers.provider.getGasPrice();

await deploy('LSP1UniversalReceiverDelegateUP', {
from: deployer,
gasPrice,
log: true,
deterministicDeployment: SALT,
});
Expand Down
4 changes: 0 additions & 4 deletions deploy/005_deploy_universal_receiver_delegate_vault.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { ethers } from 'hardhat';
import { SALT } from './salt';

const deployUniversalReceiverDelegateVaultDeterministic: DeployFunction = async ({
Expand All @@ -10,11 +9,8 @@ const deployUniversalReceiverDelegateVaultDeterministic: DeployFunction = async
const { deploy } = deployments;
const { owner: deployer } = await getNamedAccounts();

const gasPrice = await ethers.provider.getGasPrice();

await deploy('LSP1UniversalReceiverDelegateVault', {
from: deployer,
gasPrice,
log: true,
deterministicDeployment: SALT,
});
Expand Down
4 changes: 0 additions & 4 deletions deploy/006_deploy_base_universal_profile.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { ethers } from 'hardhat';
import { SALT } from './salt';

const deployBaseUniversalProfileDeterministic: DeployFunction = async ({
Expand All @@ -10,12 +9,9 @@ const deployBaseUniversalProfileDeterministic: DeployFunction = async ({
const { deploy } = deployments;
const { owner: deployer } = await getNamedAccounts();

const gasPrice = await ethers.provider.getGasPrice();

await deploy('UniversalProfileInit', {
from: deployer,
log: true,
gasPrice,
deterministicDeployment: SALT,
});
};
Expand Down
4 changes: 0 additions & 4 deletions deploy/007_deploy_base_key_manager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { ethers } from 'hardhat';
import { SALT } from './salt';

const deployBaseKeyManagerDeterministic: DeployFunction = async ({
Expand All @@ -10,13 +9,10 @@ const deployBaseKeyManagerDeterministic: DeployFunction = async ({
const { deploy } = deployments;
const { owner: deployer } = await getNamedAccounts();

const gasPrice = await ethers.provider.getGasPrice();

await deploy('LSP6KeyManagerInit', {
from: deployer,
log: true,
gasLimit: 5_000_000,
gasPrice,
deterministicDeployment: SALT,
});
};
Expand Down
6 changes: 1 addition & 5 deletions deploy/008_deploy_lsp7_mintable.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { ethers } from 'hardhat';
import { LSP4_TOKEN_TYPES } from '../constants';
import { LSP4_TOKEN_TYPES } from '@lukso/lsp4-contracts/constants';

const deployLSP7Mintable: DeployFunction = async ({
deployments,
Expand All @@ -10,12 +9,9 @@ const deployLSP7Mintable: DeployFunction = async ({
const { deploy } = deployments;
const { owner } = await getNamedAccounts();

const gasPrice = await ethers.provider.getGasPrice();

await deploy('LSP7Mintable', {
from: owner,
args: ['LSP7 Mintable', 'LSP7M', owner, LSP4_TOKEN_TYPES.TOKEN, false],
gasPrice,
log: true,
});
};
Expand Down
7 changes: 2 additions & 5 deletions deploy/009_deploy_lsp8_mintable.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { ethers } from 'hardhat';
import { LSP4_TOKEN_TYPES, LSP8_TOKEN_ID_FORMAT } from '../constants';
import { LSP4_TOKEN_TYPES } from '@lukso/lsp4-contracts/constants';
import { LSP8_TOKEN_ID_FORMAT } from '@lukso/lsp8-contracts/constants';

const deployLSP8MintableDeterministic: DeployFunction = async ({
deployments,
Expand All @@ -10,12 +10,9 @@ const deployLSP8MintableDeterministic: DeployFunction = async ({
const { deploy } = deployments;
const { owner: deployer } = await getNamedAccounts();

const gasPrice = await ethers.provider.getGasPrice();

await deploy('LSP8Mintable', {
from: deployer,
args: ['LSP8 Mintable', 'LSP8M', deployer, LSP4_TOKEN_TYPES.NFT, LSP8_TOKEN_ID_FORMAT.NUMBER],
gasPrice,
log: true,
});
};
Expand Down
4 changes: 0 additions & 4 deletions deploy/010_deploy_base_lsp7_mintable.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { ethers } from 'hardhat';
import { SALT } from './salt';

const deployBaseLSP7MintableDeterministic: DeployFunction = async ({
Expand All @@ -10,11 +9,8 @@ const deployBaseLSP7MintableDeterministic: DeployFunction = async ({
const { deploy } = deployments;
const { owner: deployer } = await getNamedAccounts();

const gasPrice = await ethers.provider.getGasPrice();

await deploy('LSP7MintableInit', {
from: deployer,
gasPrice,
log: true,
deterministicDeployment: SALT,
});
Expand Down
4 changes: 0 additions & 4 deletions deploy/011_deploy_base_lsp8_mintable.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { ethers } from 'hardhat';
import { SALT } from './salt';

const deployBaseLSP8Mintable: DeployFunction = async ({
Expand All @@ -10,11 +9,8 @@ const deployBaseLSP8Mintable: DeployFunction = async ({
const { deploy } = deployments;
const { owner } = await getNamedAccounts();

const gasPrice = await ethers.provider.getGasPrice();

await deploy('LSP8MintableInit', {
from: owner,
gasPrice,
log: true,
deterministicDeployment: SALT,
});
Expand Down
4 changes: 0 additions & 4 deletions deploy/012_deploy_vault.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { ethers } from 'hardhat';

const deployVault: DeployFunction = async ({
deployments,
Expand All @@ -9,12 +8,9 @@ const deployVault: DeployFunction = async ({
const { deploy } = deployments;
const { owner } = await getNamedAccounts();

const gasPrice = await ethers.provider.getGasPrice();

await deploy('LSP9Vault', {
from: owner,
args: [owner],
gasPrice,
log: true,
});
};
Expand Down
4 changes: 0 additions & 4 deletions deploy/013_deploy_base_vault.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { HardhatRuntimeEnvironment } from 'hardhat/types';
import { DeployFunction } from 'hardhat-deploy/types';
import { ethers } from 'hardhat';
import { SALT } from './salt';

const deployBaseVaultDeterministic: DeployFunction = async ({
Expand All @@ -10,12 +9,9 @@ const deployBaseVaultDeterministic: DeployFunction = async ({
const { deploy } = deployments;
const { owner: deployer } = await getNamedAccounts();

const gasPrice = await ethers.provider.getGasPrice();

await deploy('LSP9VaultInit', {
from: deployer,
log: true,
gasPrice,
deterministicDeployment: SALT,
});
};
Expand Down
Loading

0 comments on commit d41145c

Please sign in to comment.