diff --git a/contracts/Mocks/FallbackContract.sol b/contracts/Mocks/FallbackContract.sol new file mode 100644 index 000000000..ef9ed20d7 --- /dev/null +++ b/contracts/Mocks/FallbackContract.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +/** + * @dev sample contract used for testing + */ +contract FallbackContract { + fallback() external payable {} +} diff --git a/contracts/Mocks/FallbackExtensions/AgeExtension.sol b/contracts/Mocks/FallbackExtensions/AgeExtension.sol new file mode 100644 index 000000000..816687486 --- /dev/null +++ b/contracts/Mocks/FallbackExtensions/AgeExtension.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +/** + * @dev This contract is used only for testing purposes + */ +contract AgeExtension { + function age() public view virtual returns (uint256) { + return 20; + } +} diff --git a/contracts/Mocks/FallbackExtensions/NameExtension.sol b/contracts/Mocks/FallbackExtensions/NameExtension.sol new file mode 100644 index 000000000..460a6ee79 --- /dev/null +++ b/contracts/Mocks/FallbackExtensions/NameExtension.sol @@ -0,0 +1,11 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +/** + * @dev This contract is used only for testing purposes + */ +contract NameExtension { + function name() public view virtual returns (string memory) { + return "LUKSO"; + } +} diff --git a/contracts/Mocks/LSP20Owners/BothCallReturnSuccessValue.sol b/contracts/Mocks/LSP20Owners/BothCallReturnSuccessValue.sol new file mode 100644 index 000000000..edc863e4e --- /dev/null +++ b/contracts/Mocks/LSP20Owners/BothCallReturnSuccessValue.sol @@ -0,0 +1,30 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +/** + * @title sample contract used for testing + */ +contract BothCallReturnSuccessValue { + function lsp20VerifyCall( + address /* requestor */, + address /* targetContract */, + address /* caller */, + uint256 /* value */, + bytes memory /* data */ + ) external pure returns (bytes4 magicValue) { + return + bytes4( + abi.encodePacked( + bytes3(BothCallReturnSuccessValue.lsp20VerifyCall.selector), + hex"01" + ) + ); + } + + function lsp20VerifyCallResult( + bytes32 /*callHash*/, + bytes memory /*result*/ + ) external pure returns (bytes4) { + return BothCallReturnSuccessValue.lsp20VerifyCallResult.selector; + } +} diff --git a/contracts/Mocks/LSP20Owners/FallbackReturnMagicValue.sol b/contracts/Mocks/LSP20Owners/FallbackReturnSuccessValue.sol similarity index 100% rename from contracts/Mocks/LSP20Owners/FallbackReturnMagicValue.sol rename to contracts/Mocks/LSP20Owners/FallbackReturnSuccessValue.sol diff --git a/contracts/Mocks/LSP20Owners/FirstCallReturnExpandedInvalidValue.sol b/contracts/Mocks/LSP20Owners/FirstCallReturnExpandedInvalidValue.sol index 319f0dd2c..acc23e015 100644 --- a/contracts/Mocks/LSP20Owners/FirstCallReturnExpandedInvalidValue.sol +++ b/contracts/Mocks/LSP20Owners/FirstCallReturnExpandedInvalidValue.sol @@ -8,7 +8,7 @@ import { /** * @title sample contract used for testing */ -contract FirstCallReturnExpandedFailValue { +contract FirstCallReturnExpandedInvalidValue { event CallVerified(); address public target; diff --git a/contracts/Mocks/LSP20Owners/FirstCallReturnInvalidMagicValue.sol b/contracts/Mocks/LSP20Owners/FirstCallReturnInvalidValue.sol similarity index 77% rename from contracts/Mocks/LSP20Owners/FirstCallReturnInvalidMagicValue.sol rename to contracts/Mocks/LSP20Owners/FirstCallReturnInvalidValue.sol index fb7e1df14..a9cfa4d29 100644 --- a/contracts/Mocks/LSP20Owners/FirstCallReturnInvalidMagicValue.sol +++ b/contracts/Mocks/LSP20Owners/FirstCallReturnInvalidValue.sol @@ -7,17 +7,17 @@ import { /** * @title sample contract used for testing */ -contract FirstCallReturnFailValue { +contract FirstCallReturnInvalidValue { event CallVerified(); address public target; function lsp20VerifyCall( - address, - address, - address, - uint256, - bytes memory + address /* requestor */, + address /* targetContract */, + address /* caller */, + uint256 /* value */, + bytes memory /* data */ ) external returns (bytes4) { emit CallVerified(); diff --git a/contracts/Mocks/LSP20Owners/FirstCallReturnSuccessValue.sol b/contracts/Mocks/LSP20Owners/FirstCallReturnSuccessValue.sol new file mode 100644 index 000000000..b86849c24 --- /dev/null +++ b/contracts/Mocks/LSP20Owners/FirstCallReturnSuccessValue.sol @@ -0,0 +1,35 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +/** + * @title sample contract used for testing + */ +contract FirstCallReturnSuccessValue { + function lsp20VerifyCall( + address /* requestor */, + address /* targetContract */, + address /* caller */, + uint256 /* value */, + bytes memory /* data */ + ) external pure returns (bytes4 magicValue) { + return + bytes4( + abi.encodePacked( + bytes3( + FirstCallReturnSuccessValue.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"); + } +} diff --git a/contracts/Mocks/LSP20Owners/SecondCallReturnExpandedSuccessValue.sol b/contracts/Mocks/LSP20Owners/SecondCallReturnExpandedSuccessValue.sol new file mode 100644 index 000000000..59bb3bcac --- /dev/null +++ b/contracts/Mocks/LSP20Owners/SecondCallReturnExpandedSuccessValue.sol @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +/** + * @title sample contract used for testing + */ +contract SecondCallReturnExpandedSuccessValue { + function lsp20VerifyCall( + address /* requestor */, + address /* targetContract */, + address /* caller */, + uint256 /* value */, + bytes memory /* data */ + ) external pure returns (bytes4 magicValue) { + return + bytes4( + abi.encodePacked( + bytes3( + SecondCallReturnExpandedSuccessValue + .lsp20VerifyCall + .selector + ), + hex"01" + ) + ); + } + + function lsp20VerifyCallResult( + bytes32 /*callHash*/, + bytes memory /*result*/ + ) external pure returns (bytes32) { + return + bytes32( + bytes.concat( + bytes4( + SecondCallReturnExpandedSuccessValue + .lsp20VerifyCallResult + .selector + ) + ) + ); + } +} diff --git a/contracts/Mocks/LSP20Owners/SecondCallReturnFailureValue.sol b/contracts/Mocks/LSP20Owners/SecondCallReturnFailureValue.sol new file mode 100644 index 000000000..935a1e71b --- /dev/null +++ b/contracts/Mocks/LSP20Owners/SecondCallReturnFailureValue.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.4; + +/** + * @title sample contract used for testing + */ +contract SecondCallReturnFailureValue { + function lsp20VerifyCall( + address /* requestor */, + address /* targetContract */, + address /* caller */, + uint256 /* value */, + bytes memory /* data */ + ) external pure returns (bytes4 magicValue) { + return + bytes4( + abi.encodePacked( + bytes3( + SecondCallReturnFailureValue.lsp20VerifyCall.selector + ), + hex"01" + ) + ); + } + + function lsp20VerifyCallResult( + bytes32 /*callHash*/, + bytes memory /*result*/ + ) external pure returns (bytes4) { + return bytes4(0); + } +} diff --git a/package-lock.json b/package-lock.json index df11b0a98..43229fcff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,6 @@ }, "devDependencies": { "@b00ste/hardhat-dodoc": "^0.3.16", - "@defi-wonderland/smock": "^2.3.5", "@erc725/erc725.js": "0.17.2", "@lukso/eip191-signer.js": "^0.2.2", "@nomicfoundation/hardhat-toolbox": "^2.0.2", @@ -572,30 +571,6 @@ "node": ">=12" } }, - "node_modules/@defi-wonderland/smock": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@defi-wonderland/smock/-/smock-2.3.5.tgz", - "integrity": "sha512-klANj1hUpc3cd2ShXdVH/bEGwxJd+LxOngkF5gLcIbg6b37RCgMPMmR/94/hgL62F8bfWtuNKsQD7K+c6M5fWQ==", - "dev": true, - "dependencies": { - "@nomicfoundation/ethereumjs-evm": "^1.0.0-rc.3", - "@nomicfoundation/ethereumjs-util": "^8.0.0-rc.3", - "@nomicfoundation/ethereumjs-vm": "^6.0.0-rc.3", - "diff": "^5.0.0", - "lodash.isequal": "^4.5.0", - "lodash.isequalwith": "^4.4.0", - "rxjs": "^7.2.0", - "semver": "^7.3.5" - }, - "peerDependencies": { - "@ethersproject/abi": "^5", - "@ethersproject/abstract-provider": "^5", - "@ethersproject/abstract-signer": "^5", - "@nomiclabs/hardhat-ethers": "^2", - "ethers": "^5", - "hardhat": "^2" - } - }, "node_modules/@erc725/erc725.js": { "version": "0.17.2", "resolved": "https://registry.npmjs.org/@erc725/erc725.js/-/erc725.js-0.17.2.tgz", @@ -2135,162 +2110,6 @@ "node": ">= 8" } }, - "node_modules/@nomicfoundation/ethereumjs-block": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-block/-/ethereumjs-block-4.2.2.tgz", - "integrity": "sha512-atjpt4gc6ZGZUPHBAQaUJsm1l/VCo7FmyQ780tMGO8QStjLdhz09dXynmhwVTy5YbRr0FOh/uX3QaEM0yIB2Zg==", - "dev": true, - "dependencies": { - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-trie": "5.0.5", - "@nomicfoundation/ethereumjs-tx": "4.1.2", - "@nomicfoundation/ethereumjs-util": "8.0.6", - "ethereum-cryptography": "0.1.3" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-blockchain": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-blockchain/-/ethereumjs-blockchain-6.2.2.tgz", - "integrity": "sha512-6AIB2MoTEPZJLl6IRKcbd8mUmaBAQ/NMe3O7OsAOIiDjMNPPH5KaUQiLfbVlegT4wKIg/GOsFH7XlH2KDVoJNg==", - "dev": true, - "dependencies": { - "@nomicfoundation/ethereumjs-block": "4.2.2", - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-ethash": "2.0.5", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-trie": "5.0.5", - "@nomicfoundation/ethereumjs-util": "8.0.6", - "abstract-level": "^1.0.3", - "debug": "^4.3.3", - "ethereum-cryptography": "0.1.3", - "level": "^8.0.0", - "lru-cache": "^5.1.1", - "memory-level": "^1.0.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-common": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-3.1.2.tgz", - "integrity": "sha512-JAEBpIua62dyObHM9KI2b4wHZcRQYYge9gxiygTWa3lNCr2zo+K0TbypDpgiNij5MCGNWP1eboNfNfx1a3vkvA==", - "dev": true, - "dependencies": { - "@nomicfoundation/ethereumjs-util": "8.0.6", - "crc-32": "^1.2.0" - } - }, - "node_modules/@nomicfoundation/ethereumjs-ethash": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-ethash/-/ethereumjs-ethash-2.0.5.tgz", - "integrity": "sha512-xlLdcICGgAYyYmnI3r1t0R5fKGBJNDQSOQxXNjVO99JmxJIdXR5MgPo5CSJO1RpyzKOgzi3uIFn8agv564dZEQ==", - "dev": true, - "dependencies": { - "@nomicfoundation/ethereumjs-block": "4.2.2", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-util": "8.0.6", - "abstract-level": "^1.0.3", - "bigint-crypto-utils": "^3.0.23", - "ethereum-cryptography": "0.1.3" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-evm": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-evm/-/ethereumjs-evm-1.3.2.tgz", - "integrity": "sha512-I00d4MwXuobyoqdPe/12dxUQxTYzX8OckSaWsMcWAfQhgVDvBx6ffPyP/w1aL0NW7MjyerySPcSVfDJAMHjilw==", - "dev": true, - "dependencies": { - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-util": "8.0.6", - "@types/async-eventemitter": "^0.2.1", - "async-eventemitter": "^0.2.4", - "debug": "^4.3.3", - "ethereum-cryptography": "0.1.3", - "mcl-wasm": "^0.7.1", - "rustbn.js": "~0.2.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-rlp": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-4.0.3.tgz", - "integrity": "sha512-DZMzB/lqPK78T6MluyXqtlRmOMcsZbTTbbEyAjo0ncaff2mqu/k8a79PBcyvpgAhWD/R59Fjq/x3ro5Lof0AtA==", - "dev": true, - "bin": { - "rlp": "bin/rlp" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-statemanager": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-statemanager/-/ethereumjs-statemanager-1.0.5.tgz", - "integrity": "sha512-CAhzpzTR5toh/qOJIZUUOnWekUXuRqkkzaGAQrVcF457VhtCmr+ddZjjK50KNZ524c1XP8cISguEVNqJ6ij1sA==", - "dev": true, - "dependencies": { - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-trie": "5.0.5", - "@nomicfoundation/ethereumjs-util": "8.0.6", - "debug": "^4.3.3", - "ethereum-cryptography": "0.1.3", - "functional-red-black-tree": "^1.0.1" - } - }, - "node_modules/@nomicfoundation/ethereumjs-trie": { - "version": "5.0.5", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-trie/-/ethereumjs-trie-5.0.5.tgz", - "integrity": "sha512-+8sNZrXkzvA1NH5F4kz5RSYl1I6iaRz7mAZRsyxOm0IVY4UaP43Ofvfp/TwOalFunurQrYB5pRO40+8FBcxFMA==", - "dev": true, - "dependencies": { - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-util": "8.0.6", - "ethereum-cryptography": "0.1.3", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-tx": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-4.1.2.tgz", - "integrity": "sha512-emJBJZpmTdUa09cqxQqHaysbBI9Od353ZazeH7WgPb35miMgNY6mb7/3vBA98N5lUW/rgkiItjX0KZfIzihSoQ==", - "dev": true, - "dependencies": { - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-util": "8.0.6", - "ethereum-cryptography": "0.1.3" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@nomicfoundation/ethereumjs-util": { - "version": "8.0.6", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-8.0.6.tgz", - "integrity": "sha512-jOQfF44laa7xRfbfLXojdlcpkvxeHrE2Xu7tSeITsWFgoII163MzjOwFEzSNozHYieFysyoEMhCdP+NY5ikstw==", - "dev": true, - "dependencies": { - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "ethereum-cryptography": "0.1.3" - }, - "engines": { - "node": ">=14" - } - }, "node_modules/@nomicfoundation/ethereumjs-verkle": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-verkle/-/ethereumjs-verkle-0.0.2.tgz", @@ -2348,33 +2167,6 @@ "node": "14 || >=16.14" } }, - "node_modules/@nomicfoundation/ethereumjs-vm": { - "version": "6.4.2", - "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-vm/-/ethereumjs-vm-6.4.2.tgz", - "integrity": "sha512-PRTyxZMP6kx+OdAzBhuH1LD2Yw+hrSpaytftvaK//thDy2OI07S0nrTdbrdk7b8ZVPAc9H9oTwFBl3/wJ3w15g==", - "dev": true, - "dependencies": { - "@nomicfoundation/ethereumjs-block": "4.2.2", - "@nomicfoundation/ethereumjs-blockchain": "6.2.2", - "@nomicfoundation/ethereumjs-common": "3.1.2", - "@nomicfoundation/ethereumjs-evm": "1.3.2", - "@nomicfoundation/ethereumjs-rlp": "4.0.3", - "@nomicfoundation/ethereumjs-statemanager": "1.0.5", - "@nomicfoundation/ethereumjs-trie": "5.0.5", - "@nomicfoundation/ethereumjs-tx": "4.1.2", - "@nomicfoundation/ethereumjs-util": "8.0.6", - "@types/async-eventemitter": "^0.2.1", - "async-eventemitter": "^0.2.4", - "debug": "^4.3.3", - "ethereum-cryptography": "0.1.3", - "functional-red-black-tree": "^1.0.1", - "mcl-wasm": "^0.7.1", - "rustbn.js": "~0.2.0" - }, - "engines": { - "node": ">=14" - } - }, "node_modules/@nomicfoundation/hardhat-chai-matchers": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-1.0.6.tgz", @@ -4296,15 +4088,6 @@ "node": ">= 10.0.0" } }, - "node_modules/@types/async-eventemitter": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@types/async-eventemitter/-/async-eventemitter-0.2.4.tgz", - "integrity": "sha512-2Bq61VD01kgLf1XkK2xPtoBcu7fgn/km5JyEX9v0BlG5VQBzA+BlF9umFk+8gR8S4+eK7MgDY2oyVZCu6ar3Jw==", - "dev": true, - "dependencies": { - "@types/events": "*" - } - }, "node_modules/@types/bignumber.js": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/@types/bignumber.js/-/bignumber.js-5.0.0.tgz", @@ -4391,12 +4174,6 @@ "node": "*" } }, - "node_modules/@types/events": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.3.tgz", - "integrity": "sha512-trOc4AAUThEz9hapPtSd7wf5tiQKvTtu5b371UxXdTuqzIh0ArcRspRP0i0Viu+LXstIQ1z96t1nsPxT9ol01g==", - "dev": true - }, "node_modules/@types/form-data": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", @@ -4835,24 +4612,6 @@ "resolved": "https://registry.npmjs.org/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz", "integrity": "sha512-JMJ5soJWP18htbbxJjG7bG6yuI6pRhgJ0scHHTfkUjf6wjP912xZWvM+A4sJK3gqd9E8fcPbDnOefbA9Th/FIQ==" }, - "node_modules/abstract-level": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/abstract-level/-/abstract-level-1.0.4.tgz", - "integrity": "sha512-eUP/6pbXBkMbXFdx4IH2fVgvB7M0JvR7/lIL33zcs0IBcwjdzSSl31TOJsaCzmKSSDF9h8QYSOJux4Nd4YJqFg==", - "dev": true, - "dependencies": { - "buffer": "^6.0.3", - "catering": "^2.1.0", - "is-buffer": "^2.0.5", - "level-supports": "^4.0.0", - "level-transcoder": "^1.0.1", - "module-error": "^1.0.1", - "queue-microtask": "^1.2.3" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/abstract-leveldown": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", @@ -5948,18 +5707,6 @@ "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" }, - "node_modules/browser-level": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browser-level/-/browser-level-1.0.1.tgz", - "integrity": "sha512-XECYKJ+Dbzw0lbydyQuJzwNXtOpbMSq737qxJN11sIRTErOMShvDpbzTlgju7orJKvx4epULolZAuJGLzCmWRQ==", - "dev": true, - "dependencies": { - "abstract-level": "^1.0.2", - "catering": "^2.1.1", - "module-error": "^1.0.2", - "run-parallel-limit": "^1.1.0" - } - }, "node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -6317,15 +6064,6 @@ "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==" }, - "node_modules/catering": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/catering/-/catering-2.1.1.tgz", - "integrity": "sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/cbor": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/cbor/-/cbor-8.1.0.tgz", @@ -6593,23 +6331,6 @@ "node": ">= 0.4" } }, - "node_modules/classic-level": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/classic-level/-/classic-level-1.4.1.tgz", - "integrity": "sha512-qGx/KJl3bvtOHrGau2WklEZuXhS3zme+jf+fsu6Ej7W7IP/C49v7KNlWIsT1jZu0YnfzSIYDGcEWpCa1wKGWXQ==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "abstract-level": "^1.0.2", - "catering": "^2.1.0", - "module-error": "^1.0.1", - "napi-macros": "^2.2.2", - "node-gyp-build": "^4.3.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -7634,15 +7355,6 @@ "integrity": "sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==", "dev": true }, - "node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", - "dev": true, - "engines": { - "node": ">=0.3.1" - } - }, "node_modules/difflib": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/difflib/-/difflib-0.2.4.tgz", @@ -12471,29 +12183,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-buffer": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.5.tgz", - "integrity": "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "engines": { - "node": ">=4" - } - }, "node_modules/is-builtin-module": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", @@ -13281,24 +12970,6 @@ "node": ">=8" } }, - "node_modules/level": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/level/-/level-8.0.1.tgz", - "integrity": "sha512-oPBGkheysuw7DmzFQYyFe8NAia5jFLAgEnkgWnK3OXAuJr8qFT+xBQIwokAZPME2bhPFzS8hlYcL16m8UZrtwQ==", - "dev": true, - "dependencies": { - "abstract-level": "^1.0.4", - "browser-level": "^1.0.1", - "classic-level": "^1.2.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/level" - } - }, "node_modules/level-codec": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", @@ -13344,28 +13015,6 @@ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==" }, - "node_modules/level-supports": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-4.0.1.tgz", - "integrity": "sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/level-transcoder": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/level-transcoder/-/level-transcoder-1.0.1.tgz", - "integrity": "sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==", - "dev": true, - "dependencies": { - "buffer": "^6.0.3", - "module-error": "^1.0.1" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/level-ws": { "version": "0.0.0", "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", @@ -13523,18 +13172,6 @@ "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==", "dev": true }, - "node_modules/lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", - "dev": true - }, - "node_modules/lodash.isequalwith": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.isequalwith/-/lodash.isequalwith-4.4.0.tgz", - "integrity": "sha512-dcZON0IalGBpRmJBmMkaoV7d3I80R2O+FrzsZyHdNSFrANq/cgDqKQNmAHE8UEj4+QYWwwhkQOVdLHiAopzlsQ==", - "dev": true - }, "node_modules/lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -13759,15 +13396,6 @@ "integrity": "sha512-0EESkXiTkWzrQQntBu2uzKvLu6vVkUGz40nGPbSZuegcfE5UuSzNjLaIu76zJWuaT/2I3Z/8M06OlUOZLGwLlQ==", "dev": true }, - "node_modules/mcl-wasm": { - "version": "0.7.9", - "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.9.tgz", - "integrity": "sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ==", - "dev": true, - "engines": { - "node": ">=8.9.0" - } - }, "node_modules/md5.js": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", @@ -13818,20 +13446,6 @@ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, - "node_modules/memory-level": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/memory-level/-/memory-level-1.0.0.tgz", - "integrity": "sha512-UXzwewuWeHBz5krr7EvehKcmLFNoXxGcvuYhC41tRnkrTbJohtS7kVn9akmgirtRygg+f7Yjsfi8Uu5SGSQ4Og==", - "dev": true, - "dependencies": { - "abstract-level": "^1.0.0", - "functional-red-black-tree": "^1.0.1", - "module-error": "^1.0.1" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/memorystream": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", @@ -15088,15 +14702,6 @@ "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.14.0.tgz", "integrity": "sha512-qYvlv/exQ4+svI3UOvPUpLDF0OMX5euvUH0Ny4N5QyRyhNdgAgUrVH3iUINSzEPLvx0kbo/Bp28GJKIqvE7URw==" }, - "node_modules/module-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/module-error/-/module-error-1.0.2.tgz", - "integrity": "sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/mri": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", @@ -15299,12 +14904,6 @@ "node": ">=0.10.0" } }, - "node_modules/napi-macros": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.2.2.tgz", - "integrity": "sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==", - "dev": true - }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -17941,29 +17540,6 @@ "queue-microtask": "^1.2.2" } }, - "node_modules/run-parallel-limit": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/run-parallel-limit/-/run-parallel-limit-1.1.0.tgz", - "integrity": "sha512-jJA7irRNM91jaKc3Hcl1npHsFLOXOoTkPCUL1JEa1R82O2miplXXRaGdjW/KM/98YQWDhJLiSs793CnXfblJUw==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, "node_modules/rust-verkle-wasm": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/rust-verkle-wasm/-/rust-verkle-wasm-0.0.1.tgz", diff --git a/package.json b/package.json index d6e95e3c9..659a7b3df 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,6 @@ }, "devDependencies": { "@b00ste/hardhat-dodoc": "^0.3.16", - "@defi-wonderland/smock": "^2.3.5", "@erc725/erc725.js": "0.17.2", "@lukso/eip191-signer.js": "^0.2.2", "@nomicfoundation/hardhat-toolbox": "^2.0.2", diff --git a/tests/LSP17ContractExtension/LSP17Extendable.behaviour.ts b/tests/LSP17ContractExtension/LSP17Extendable.behaviour.ts index 184d9dfce..32e2249f2 100644 --- a/tests/LSP17ContractExtension/LSP17Extendable.behaviour.ts +++ b/tests/LSP17ContractExtension/LSP17Extendable.behaviour.ts @@ -1,7 +1,6 @@ import { expect } from 'chai'; import { ethers } from 'hardhat'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { FakeContract, smock } from '@defi-wonderland/smock'; import { LSP0ERC725Account, @@ -24,6 +23,9 @@ import { RequireCallbackToken__factory, RevertFallbackExtension, RevertFallbackExtension__factory, + NameExtension, + NameExtension__factory, + AgeExtension__factory, } from '../../types'; // helpers @@ -491,25 +493,10 @@ export const shouldBehaveLikeLSP17 = (buildContext: () => Promise { - let nameExtension: FakeContract; + let nameExtension: NameExtension; before(async () => { - nameExtension = await smock.fake([ - { - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - ]); - nameExtension.name.returns('LUKSO'); + nameExtension = await new NameExtension__factory(context.accounts[0]).deploy(); await context.contract .connect(context.deployParams.owner) @@ -528,25 +515,10 @@ export const shouldBehaveLikeLSP17 = (buildContext: () => Promise { - let ageExtension: FakeContract; + let ageExtension: AgeExtension; before(async () => { - ageExtension = await smock.fake([ - { - inputs: [], - name: 'age', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - ]); - ageExtension.age.returns(20); + ageExtension = await new AgeExtension__factory(context.accounts[0]).deploy(); await context.contract .connect(context.deployParams.owner) diff --git a/tests/LSP17ContractExtension/LSP17ExtendableTokens.behaviour.ts b/tests/LSP17ContractExtension/LSP17ExtendableTokens.behaviour.ts index e6e20a87d..fd8bea506 100644 --- a/tests/LSP17ContractExtension/LSP17ExtendableTokens.behaviour.ts +++ b/tests/LSP17ContractExtension/LSP17ExtendableTokens.behaviour.ts @@ -1,6 +1,5 @@ import { expect } from 'chai'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { FakeContract, smock } from '@defi-wonderland/smock'; import { LSP0ERC725Account, @@ -19,6 +18,10 @@ import { ReenterAccountExtension, BuyExtension, BuyExtension__factory, + NameExtension__factory, + NameExtension, + AgeExtension__factory, + AgeExtension, } from '../../types'; // helpers @@ -381,25 +384,10 @@ export const shouldBehaveLikeLSP17 = (buildContext: () => Promise { - let nameExtension: FakeContract; + let nameExtension: NameExtension; before(async () => { - nameExtension = await smock.fake([ - { - inputs: [], - name: 'name', - outputs: [ - { - internalType: 'string', - name: '', - type: 'string', - }, - ], - stateMutability: 'view', - type: 'function', - }, - ]); - nameExtension.name.returns('LUKSO'); + nameExtension = await new NameExtension__factory(context.accounts[0]).deploy(); await context.contract .connect(context.deployParams.owner) @@ -418,25 +406,10 @@ export const shouldBehaveLikeLSP17 = (buildContext: () => Promise { - let ageExtension: FakeContract; + let ageExtension: AgeExtension; before(async () => { - ageExtension = await smock.fake([ - { - inputs: [], - name: 'age', - outputs: [ - { - internalType: 'uint256', - name: '', - type: 'uint256', - }, - ], - stateMutability: 'view', - type: 'function', - }, - ]); - ageExtension.age.returns(20); + ageExtension = await new AgeExtension__factory(context.accounts[0]).deploy(); await context.contract .connect(context.deployParams.owner) diff --git a/tests/LSP20CallVerification/LSP20CallVerification.behaviour.ts b/tests/LSP20CallVerification/LSP20CallVerification.behaviour.ts index 172b442bb..3e1bb8a67 100644 --- a/tests/LSP20CallVerification/LSP20CallVerification.behaviour.ts +++ b/tests/LSP20CallVerification/LSP20CallVerification.behaviour.ts @@ -1,7 +1,6 @@ import { expect } from 'chai'; import { ethers, network } from 'hardhat'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; -import { FakeContract, smock } from '@defi-wonderland/smock'; // types import { @@ -11,23 +10,28 @@ import { ImplementingFallback__factory, FallbackReturnSuccessValue, FallbackReturnSuccessValue__factory, - FirstCallReturnExpandedFailValue, - FirstCallReturnExpandedFailValue__factory, - FirstCallReturnFailValue, - FirstCallReturnFailValue__factory, LSP0ERC725Account, - ILSP20CallVerifier, - ILSP20CallVerifier__factory, OwnerWithURD, OwnerWithURD__factory, UniversalProfile, UniversalProfile__factory, + FirstCallReturnExpandedInvalidValue, + FirstCallReturnExpandedInvalidValue__factory, + FirstCallReturnInvalidValue, + FirstCallReturnInvalidValue__factory, + SecondCallReturnFailureValue__factory, + SecondCallReturnFailureValue, + FirstCallReturnSuccessValue, + FirstCallReturnSuccessValue__factory, + BothCallReturnSuccessValue, + BothCallReturnSuccessValue__factory, + SecondCallReturnExpandedSuccessValue, + SecondCallReturnExpandedSuccessValue__factory, } from '../../types'; // constants import { LSP1_TYPE_IDS } from '../../constants'; import { OPERATION_TYPES } from '@lukso/lsp0-contracts'; -import { LSP20_SUCCESS_VALUES } from '@lukso/lsp20-contracts'; import { abiCoder } from './../utils/helpers'; export type LSP20TestContext = { @@ -355,10 +359,10 @@ export const shouldBehaveLikeLSP20 = (buildContext: () => Promise { - let ownerContract: FirstCallReturnExpandedFailValue; + let ownerContract: FirstCallReturnExpandedInvalidValue; before('deploying a new owner', async () => { - ownerContract = await new FirstCallReturnExpandedFailValue__factory( + ownerContract = await new FirstCallReturnExpandedInvalidValue__factory( context.deployParams.owner, ).deploy(); @@ -388,10 +392,10 @@ export const shouldBehaveLikeLSP20 = (buildContext: () => Promise { - let ownerContract: FirstCallReturnFailValue; + let ownerContract: FirstCallReturnInvalidValue; before('deploying a new owner', async () => { - ownerContract = await new FirstCallReturnFailValue__factory( + ownerContract = await new FirstCallReturnInvalidValue__factory( context.deployParams.owner, ).deploy(); @@ -421,14 +425,13 @@ export const shouldBehaveLikeLSP20 = (buildContext: () => Promise { - let firstCallReturnSuccessValueContract: FakeContract; + let firstCallReturnSuccessValueContract: FirstCallReturnSuccessValue; let newUniversalProfile: UniversalProfile; before(async () => { - firstCallReturnSuccessValueContract = await smock.fake(ILSP20CallVerifier__factory.abi); - firstCallReturnSuccessValueContract.lsp20VerifyCall.returns( - LSP20_SUCCESS_VALUES.VERIFY_CALL.NO_POST_VERIFICATION, - ); + firstCallReturnSuccessValueContract = await new FirstCallReturnSuccessValue__factory( + context.accounts[0], + ).deploy(); newUniversalProfile = await new UniversalProfile__factory(context.accounts[0]).deploy( firstCallReturnSuccessValueContract.address, @@ -449,17 +452,13 @@ export const shouldBehaveLikeLSP20 = (buildContext: () => Promise { - let firstCallReturnSuccessValueContract: FakeContract; + let firstCallReturnSuccessValueContract: FirstCallReturnSuccessValue; let newUniversalProfile: UniversalProfile; before(async () => { - firstCallReturnSuccessValueContract = await smock.fake(ILSP20CallVerifier__factory.abi); - firstCallReturnSuccessValueContract.lsp20VerifyCall.returns( - LSP20_SUCCESS_VALUES.VERIFY_CALL.NO_POST_VERIFICATION + - '0'.repeat(56) + - '0xcafecafecafecafecafecafecafecafecafecafe' + - '0'.repeat(24), - ); + firstCallReturnSuccessValueContract = await new FirstCallReturnSuccessValue__factory( + context.accounts[0], + ).deploy(); newUniversalProfile = await new UniversalProfile__factory(context.accounts[0]).deploy( firstCallReturnSuccessValueContract.address, @@ -482,17 +481,13 @@ export const shouldBehaveLikeLSP20 = (buildContext: () => Promise { - let bothCallReturnSuccessValueContract: FakeContract; + let bothCallReturnSuccessValueContract: BothCallReturnSuccessValue; let newUniversalProfile: UniversalProfile; before(async () => { - bothCallReturnSuccessValueContract = await smock.fake(ILSP20CallVerifier__factory.abi); - bothCallReturnSuccessValueContract.lsp20VerifyCall.returns( - LSP20_SUCCESS_VALUES.VERIFY_CALL.WITH_POST_VERIFICATION, - ); - bothCallReturnSuccessValueContract.lsp20VerifyCallResult.returns( - LSP20_SUCCESS_VALUES.VERIFY_CALL_RESULT, - ); + bothCallReturnSuccessValueContract = await new BothCallReturnSuccessValue__factory( + context.accounts[0], + ).deploy(); newUniversalProfile = await new UniversalProfile__factory(context.accounts[0]).deploy( bothCallReturnSuccessValueContract.address, @@ -513,23 +508,13 @@ export const shouldBehaveLikeLSP20 = (buildContext: () => Promise { - let bothCallReturnSuccessValueContract: FakeContract; + let bothCallReturnSuccessValueContract: BothCallReturnSuccessValue; let newUniversalProfile: UniversalProfile; before(async () => { - bothCallReturnSuccessValueContract = await smock.fake(ILSP20CallVerifier__factory.abi); - bothCallReturnSuccessValueContract.lsp20VerifyCall.returns( - LSP20_SUCCESS_VALUES.VERIFY_CALL.WITH_POST_VERIFICATION + - '0'.repeat(56) + - '0xcafecafecafecafecafecafecafecafecafecafe' + - '0'.repeat(24), - ); - bothCallReturnSuccessValueContract.lsp20VerifyCallResult.returns( - LSP20_SUCCESS_VALUES.VERIFY_CALL_RESULT + - '0'.repeat(56) + - '0xcafecafecafecafecafecafecafecafecafecafe' + - '0'.repeat(24), - ); + bothCallReturnSuccessValueContract = await new BothCallReturnSuccessValue__factory( + context.accounts[0], + ).deploy(); newUniversalProfile = await new UniversalProfile__factory(context.accounts[0]).deploy( bothCallReturnSuccessValueContract.address, @@ -552,15 +537,13 @@ export const shouldBehaveLikeLSP20 = (buildContext: () => Promise { - let secondCallReturnFailureContract: FakeContract; + let secondCallReturnFailureContract: SecondCallReturnFailureValue; let newUniversalProfile: UniversalProfile; before(async () => { - secondCallReturnFailureContract = await smock.fake(ILSP20CallVerifier__factory.abi); - secondCallReturnFailureContract.lsp20VerifyCall.returns( - LSP20_SUCCESS_VALUES.VERIFY_CALL.WITH_POST_VERIFICATION, - ); - secondCallReturnFailureContract.lsp20VerifyCallResult.returns('0x00000000'); + secondCallReturnFailureContract = await new SecondCallReturnFailureValue__factory( + context.accounts[0], + ).deploy(); newUniversalProfile = await new UniversalProfile__factory(context.accounts[0]).deploy( secondCallReturnFailureContract.address, @@ -578,20 +561,12 @@ export const shouldBehaveLikeLSP20 = (buildContext: () => Promise { - let secondCallReturnExpandedValueContract: FakeContract; + let secondCallReturnExpandedValueContract: SecondCallReturnExpandedSuccessValue; let newUniversalProfile: UniversalProfile; before(async () => { - secondCallReturnExpandedValueContract = await smock.fake(ILSP20CallVerifier__factory.abi); - secondCallReturnExpandedValueContract.lsp20VerifyCall.returns( - LSP20_SUCCESS_VALUES.VERIFY_CALL.WITH_POST_VERIFICATION, - ); - secondCallReturnExpandedValueContract.lsp20VerifyCallResult.returns( - ethers.utils.solidityPack( - ['bytes4', 'bytes28'], - [LSP20_SUCCESS_VALUES.VERIFY_CALL_RESULT, '0x' + '0'.repeat(56)], - ), - ); + secondCallReturnExpandedValueContract = + await new SecondCallReturnExpandedSuccessValue__factory(context.accounts[0]).deploy(); newUniversalProfile = await new UniversalProfile__factory(context.accounts[0]).deploy( secondCallReturnExpandedValueContract.address, diff --git a/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts b/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts index c1cda248b..c26ddbcb6 100644 --- a/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts +++ b/tests/LSP20CallVerification/LSP6/Interactions/PermissionTransferValue.test.ts @@ -2,7 +2,6 @@ import { expect } from 'chai'; import { ethers } from 'hardhat'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { BigNumber } from 'ethers'; -import { FakeContract, smock } from '@defi-wonderland/smock'; import { ExecutorLSP20, @@ -16,6 +15,8 @@ import { LSP7Mintable__factory, UniversalProfile__factory, UniversalProfile, + FallbackContract__factory, + FallbackContract, } from '../../../../types'; // constants @@ -575,7 +576,7 @@ export const shouldBehaveLikePermissionTransferValue = ( let targetContract: TargetPayableContract; let lyxRecipientEOA: string; - let lyxRecipientContract: FakeContract; + let lyxRecipientContract: FallbackContract; const recipientsEOA: string[] = [ ethers.Wallet.createRandom().address, @@ -605,13 +606,7 @@ export const shouldBehaveLikePermissionTransferValue = ( lyxRecipientEOA = ethers.Wallet.createRandom().address; // this contract has a payable fallback function and can receive native tokens - lyxRecipientContract = await smock.fake([ - { - stateMutability: 'payable', - type: 'fallback', - }, - ]); - lyxRecipientContract.fallback.returns(); + lyxRecipientContract = await new FallbackContract__factory(context.accounts[0]).deploy(); await lsp7Token .connect(context.accounts[0]) diff --git a/tests/LSP20CallVerification/LSP6/SetPermissions/SetAllowedCalls.test.ts b/tests/LSP20CallVerification/LSP6/SetPermissions/SetAllowedCalls.test.ts index 72040516e..00cf80b17 100644 --- a/tests/LSP20CallVerification/LSP6/SetPermissions/SetAllowedCalls.test.ts +++ b/tests/LSP20CallVerification/LSP6/SetPermissions/SetAllowedCalls.test.ts @@ -3,7 +3,7 @@ import { ethers } from 'hardhat'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; // constants -import { ERC725YDataKeys } from '../../../../constants'; +import { ERC725YDataKeys, INTERFACE_IDS } from '../../../../constants'; import { CALLTYPE, PERMISSIONS } from '@lukso/lsp6-contracts'; // setup diff --git a/tests/LSP6KeyManager/Interactions/PermissionTransferValue.test.ts b/tests/LSP6KeyManager/Interactions/PermissionTransferValue.test.ts index dc6b862f7..28491b47d 100644 --- a/tests/LSP6KeyManager/Interactions/PermissionTransferValue.test.ts +++ b/tests/LSP6KeyManager/Interactions/PermissionTransferValue.test.ts @@ -3,7 +3,6 @@ import { ethers } from 'hardhat'; import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'; import { EIP191Signer } from '@lukso/eip191-signer.js'; import { BigNumber } from 'ethers'; -import { FakeContract, smock } from '@defi-wonderland/smock'; import { Executor, @@ -17,6 +16,8 @@ import { UniversalProfile, LSP7Mintable, LSP7Mintable__factory, + FallbackContract, + FallbackContract__factory, } from '../../../types'; // constants @@ -858,7 +859,7 @@ export const shouldBehaveLikePermissionTransferValue = ( let targetContract: TargetPayableContract; let lyxRecipientEOA: string; - let lyxRecipientContract: FakeContract; + let lyxRecipientContract: FallbackContract; const recipientsEOA: string[] = [ ethers.Wallet.createRandom().address, @@ -888,13 +889,7 @@ export const shouldBehaveLikePermissionTransferValue = ( lyxRecipientEOA = ethers.Wallet.createRandom().address; // this contract has a payable fallback function and can receive native tokens - lyxRecipientContract = await smock.fake([ - { - stateMutability: 'payable', - type: 'fallback', - }, - ]); - lyxRecipientContract.fallback.returns(); + lyxRecipientContract = await new FallbackContract__factory(context.accounts[0]).deploy(); await lsp7Token .connect(context.accounts[0])