Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build!: upgrade all packages + root to latest Hardhat version and ethers v6 #889

Merged
merged 27 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
49af5a2
build!: upgrade hardhat and ethers to v6
CJ42 Feb 14, 2024
131972c
chore: update test helper and fixtures to ethers v6
CJ42 Feb 15, 2024
19081a7
test: refactor tests for UP, LSP3, LSP14 and LSP17
CJ42 Feb 15, 2024
c4a9450
test: refactor LSP2 and LSP11 for ethers v6
CJ42 Feb 15, 2024
eff3f26
test: refactor tests to ethers v6 for LSP9 and LSP14
CJ42 Feb 15, 2024
2631961
test: refactor tests to ethers v6 for LSP7 and LSP8
CJ42 Feb 16, 2024
54296ee
test: refactor LSP11 tests to ethers v6
CJ42 Feb 17, 2024
1ade771
test: refactor LSP1 tests for ethers v6
CJ42 Feb 17, 2024
3771bd4
test: refactor LSP6 + LSP20 tests for ethers v6
CJ42 Feb 17, 2024
993f9d9
test: refactor Reentrancy tests for ethers v6
CJ42 Feb 17, 2024
3a772c8
test: refactor LSP1, Mocks and generic scripts
CJ42 Feb 17, 2024
83c1db1
chore: replace paths and `getSigHash` by `getFunction`
CJ42 Feb 18, 2024
07a60f9
test: fix more failing ethers v6 types and functions
CJ42 Feb 18, 2024
9dd9fc4
Merge branch 'lsp-monorepo' into build/upgrade-dependencies
CJ42 Feb 19, 2024
adb776e
chore: remove user/dev docs from `package.json`
CJ42 Feb 19, 2024
b88acfc
chore: fix remaining failing tests in CI
CJ42 Feb 19, 2024
462a5de
chore: fix remaining failing tests in CI
CJ42 Feb 19, 2024
f74db97
chore: fix tests for missing LSP1 Delegate permissions
CJ42 Feb 20, 2024
57f818d
chore: update incorrect path for contract artifact
CJ42 Feb 20, 2024
77bb2c5
chore: fix remaining tests
CJ42 Feb 20, 2024
4d7bf33
refactor: migrate `Create2Factory` to ethers v6
b00ste Feb 22, 2024
a16853e
Merge branch 'lsp-monorepo' into build/upgrade-dependencies
CJ42 Feb 27, 2024
f38759f
test: skip `lsp17extensions` test because of NickFactory deployment e…
CJ42 Feb 27, 2024
175ae97
chore: upgrade deployment scripts to ethers v6
CJ42 Feb 27, 2024
2a6c777
build: resolve dependency resolution for `hardhat-packager` and `@typ…
CJ42 Feb 28, 2024
17bba8d
chore: delete dev-dependency in packages to keep only those at root
CJ42 Feb 28, 2024
d4fa3cb
chore: import only ethers methods used + address review comments
CJ42 Feb 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
Loading