From 2a6cd9da2dcf112046ef9321a2207cb8be18bb0d Mon Sep 17 00:00:00 2001 From: timbrinded <79199034+timbrinded@users.noreply.github.com> Date: Thu, 25 Apr 2024 10:25:24 +0100 Subject: [PATCH] feat: :test_tube: Initial skeleton New test for testing erc20 interactions, explicitly set evmVersion to Shanghai, incrementing solc --- test/contracts/src/ERC20Sample.sol | 22 ++ test/package.json | 3 +- test/pnpm-lock.yaml | 264 ++++++++++++------ test/scripts/compile-contracts.ts | 3 +- .../test-contract/test-erc20-interactions.ts | 44 +++ 5 files changed, 247 insertions(+), 89 deletions(-) create mode 100644 test/contracts/src/ERC20Sample.sol create mode 100644 test/suites/dev/moonbase/test-contract/test-erc20-interactions.ts diff --git a/test/contracts/src/ERC20Sample.sol b/test/contracts/src/ERC20Sample.sol new file mode 100644 index 0000000000..c59c93f5d8 --- /dev/null +++ b/test/contracts/src/ERC20Sample.sol @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.20; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol"; +import "@openzeppelin/contracts/access/Ownable.sol"; + +contract ERC20Sample is ERC20, ERC20Burnable, Ownable { + constructor() + ERC20("SampleToken", "SAM") + Ownable() + {} + + function greeter() public view returns (string memory) { + return "Hello, ERC20!"; + } + + function mint(address to, uint256 amount) public onlyOwner { + _mint(to, amount); + } + +} \ No newline at end of file diff --git a/test/package.json b/test/package.json index f612fa6fd6..9febfee368 100644 --- a/test/package.json +++ b/test/package.json @@ -21,6 +21,7 @@ "@moonwall/cli": "^5.1.4", "@moonwall/util": "^5.1.4", "@openzeppelin/contracts": "4.9.6", + "@openzeppelin/contracts-upgradeable": "4.9.6", "@polkadot/api": "10.12.6", "@polkadot/api-augment": "10.12.6", "@polkadot/api-derive": "10.12.6", @@ -46,7 +47,7 @@ "randomness": "1.6.8", "rlp": "3.0.0", "semver": "7.6.0", - "solc": "0.8.21", + "solc": "0.8.24", "tsx": "4.7.2", "viem": "2.9.9", "vitest": "1.4.0", diff --git a/test/pnpm-lock.yaml b/test/pnpm-lock.yaml index cdf3273330..85481a09e0 100644 --- a/test/pnpm-lock.yaml +++ b/test/pnpm-lock.yaml @@ -20,6 +20,9 @@ dependencies: '@openzeppelin/contracts': specifier: 4.9.6 version: 4.9.6 + '@openzeppelin/contracts-upgradeable': + specifier: 4.9.6 + version: 4.9.6 '@polkadot/api': specifier: 10.12.6 version: 10.12.6 @@ -96,8 +99,8 @@ dependencies: specifier: 7.6.0 version: 7.6.0 solc: - specifier: 0.8.21 - version: 0.8.21(debug@4.3.4) + specifier: 0.8.24 + version: 0.8.24(debug@4.3.4) tsx: specifier: 4.7.2 version: 4.7.2 @@ -1490,6 +1493,10 @@ packages: lodash.merge: 4.6.2 dev: false + /@openzeppelin/contracts-upgradeable@4.9.6: + resolution: {integrity: sha512-m4iHazOsOCv1DgM7eD7GupTJ+NFVujRZt1wzddDPSVGpWdKq1SKkla5htKG7+IS4d2XOCtzkUNwRZ7Vq5aEUMA==} + dev: false + /@openzeppelin/contracts@4.9.6: resolution: {integrity: sha512-xSmezSupL+y9VkHZJGDoCBpmnB2ogM13ccaYDWqJTfS3dbuHkgjuwDFUmaFauBCboQMGB/S5UqUl2y54X99BmA==} dev: false @@ -1563,18 +1570,39 @@ packages: dev: false optional: true + /@polkadot-api/json-rpc-provider-proxy@0.0.1: + resolution: {integrity: sha512-gmVDUP8LpCH0BXewbzqXF2sdHddq1H1q+XrAW2of+KZj4woQkIGBRGTJHeBEVHe30EB+UejR1N2dT4PO/RvDdg==} + requiresBuild: true + dev: false + optional: true + /@polkadot-api/json-rpc-provider-proxy@0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0: resolution: {integrity: sha512-0hZ8vtjcsyCX8AyqP2sqUHa1TFFfxGWmlXJkit0Nqp9b32MwZqn5eaUAiV2rNuEpoglKOdKnkGtUF8t5MoodKw==} requiresBuild: true dev: false optional: true + /@polkadot-api/json-rpc-provider@0.0.1: + resolution: {integrity: sha512-/SMC/l7foRjpykLTUTacIH05H3mr9ip8b5xxfwXlVezXrNVLp3Cv0GX6uItkKd+ZjzVPf3PFrDF2B2/HLSNESA==} + requiresBuild: true + dev: false + optional: true + /@polkadot-api/json-rpc-provider@0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0: resolution: {integrity: sha512-EaUS9Fc3wsiUr6ZS43PQqaRScW7kM6DYbuM/ou0aYjm8N9MBqgDbGm2oL6RE1vAVmOfEuHcXZuZkhzWtyvQUtA==} requiresBuild: true dev: false optional: true + /@polkadot-api/metadata-builders@0.0.1: + resolution: {integrity: sha512-GCI78BHDzXAF/L2pZD6Aod/yl82adqQ7ftNmKg51ixRL02JpWUA+SpUKTJE5MY1p8kiJJIo09P2um24SiJHxNA==} + requiresBuild: true + dependencies: + '@polkadot-api/substrate-bindings': 0.0.1 + '@polkadot-api/utils': 0.0.1 + dev: false + optional: true + /@polkadot-api/metadata-builders@0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0: resolution: {integrity: sha512-BD7rruxChL1VXt0icC2gD45OtT9ofJlql0qIllHSRYgama1CR2Owt+ApInQxB+lWqM+xNOznZRpj8CXNDvKIMg==} requiresBuild: true @@ -1584,6 +1612,31 @@ packages: dev: false optional: true + /@polkadot-api/observable-client@0.1.0(rxjs@7.8.1): + resolution: {integrity: sha512-GBCGDRztKorTLna/unjl/9SWZcRmvV58o9jwU2Y038VuPXZcr01jcw/1O3x+yeAuwyGzbucI/mLTDa1QoEml3A==} + requiresBuild: true + peerDependencies: + rxjs: '>=7.8.0' + dependencies: + '@polkadot-api/metadata-builders': 0.0.1 + '@polkadot-api/substrate-bindings': 0.0.1 + '@polkadot-api/substrate-client': 0.0.1 + '@polkadot-api/utils': 0.0.1 + rxjs: 7.8.1 + dev: false + optional: true + + /@polkadot-api/substrate-bindings@0.0.1: + resolution: {integrity: sha512-bAe7a5bOPnuFVmpv7y4BBMRpNTnMmE0jtTqRUw/+D8ZlEHNVEJQGr4wu3QQCl7k1GnSV1wfv3mzIbYjErEBocg==} + requiresBuild: true + dependencies: + '@noble/hashes': 1.4.0 + '@polkadot-api/utils': 0.0.1 + '@scure/base': 1.1.6 + scale-ts: 1.6.0 + dev: false + optional: true + /@polkadot-api/substrate-bindings@0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0: resolution: {integrity: sha512-N4vdrZopbsw8k57uG58ofO7nLXM4Ai7835XqakN27MkjXMp5H830A1KJE0L9sGQR7ukOCDEIHHcwXVrzmJ/PBg==} requiresBuild: true @@ -1595,12 +1648,24 @@ packages: dev: false optional: true + /@polkadot-api/substrate-client@0.0.1: + resolution: {integrity: sha512-9Bg9SGc3AwE+wXONQoW8GC00N3v6lCZLW74HQzqB6ROdcm5VAHM4CB/xRzWSUF9CXL78ugiwtHx3wBcpx4H4Wg==} + requiresBuild: true + dev: false + optional: true + /@polkadot-api/substrate-client@0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0: resolution: {integrity: sha512-lcdvd2ssUmB1CPzF8s2dnNOqbrDa+nxaaGbuts+Vo8yjgSKwds2Lo7Oq+imZN4VKW7t9+uaVcKFLMF7PdH0RWw==} requiresBuild: true dev: false optional: true + /@polkadot-api/utils@0.0.1: + resolution: {integrity: sha512-3j+pRmlF9SgiYDabSdZsBSsN5XHbpXOAce1lWj56IEEaFZVjsiCaxDOA7C9nCcgfVXuvnbxqqEGQvnY+QfBAUw==} + requiresBuild: true + dev: false + optional: true + /@polkadot-api/utils@0.0.1-492c132563ea6b40ae1fc5470dec4cd18768d182.1.0: resolution: {integrity: sha512-0CYaCjfLQJTCRCiYvZ81OncHXEKPzAexCMoVloR+v2nl/O2JRya/361MtPkeNLC6XBoaEgLAG9pWQpH3WePzsw==} requiresBuild: true @@ -1624,15 +1689,15 @@ packages: - utf-8-validate dev: false - /@polkadot/api-augment@10.13.1: - resolution: {integrity: sha512-IAKaCp19QxgOG4HKk9RAgUgC/VNVqymZ2GXfMNOZWImZhxRIbrK+raH5vN2MbWwtVHpjxyXvGsd1RRhnohI33A==} + /@polkadot/api-augment@11.0.2: + resolution: {integrity: sha512-Icrwk9DxcWlMxl0UFhIthYX+TzFGhxC2zwCaIgUbE5l1hoRFWl+K4BbLOtNdGTr6jkEkJizdnzbXvxWMYHZEOA==} engines: {node: '>=18'} dependencies: - '@polkadot/api-base': 10.13.1 - '@polkadot/rpc-augment': 10.13.1 - '@polkadot/types': 10.13.1 - '@polkadot/types-augment': 10.13.1 - '@polkadot/types-codec': 10.13.1 + '@polkadot/api-base': 11.0.2 + '@polkadot/rpc-augment': 11.0.2 + '@polkadot/types': 11.0.2 + '@polkadot/types-augment': 11.0.2 + '@polkadot/types-codec': 11.0.2 '@polkadot/util': 12.6.2 tslib: 2.6.2 transitivePeerDependencies: @@ -1689,12 +1754,12 @@ packages: - utf-8-validate dev: false - /@polkadot/api-base@10.13.1: - resolution: {integrity: sha512-Okrw5hjtEjqSMOG08J6qqEwlUQujTVClvY1/eZkzKwNzPelWrtV6vqfyJklB7zVhenlxfxqhZKKcY7zWSW/q5Q==} + /@polkadot/api-base@11.0.2: + resolution: {integrity: sha512-Sz1z6KHe+AyiQRxwSXU2KM0KSKZ97sc1WBEhqqkGuR3YdaV2Pt++ixSJe1FXt5/YyMI/KU0W8GSciK6Kydgxgw==} engines: {node: '>=18'} dependencies: - '@polkadot/rpc-core': 10.13.1 - '@polkadot/types': 10.13.1 + '@polkadot/rpc-core': 11.0.2 + '@polkadot/types': 11.0.2 '@polkadot/util': 12.6.2 rxjs: 7.8.1 tslib: 2.6.2 @@ -1753,16 +1818,16 @@ packages: - utf-8-validate dev: false - /@polkadot/api-derive@10.13.1: - resolution: {integrity: sha512-ef0H0GeCZ4q5Om+c61eLLLL29UxFC2/u/k8V1K2JOIU+2wD5LF7sjAoV09CBMKKHfkLenRckVk2ukm4rBqFRpg==} + /@polkadot/api-derive@11.0.2: + resolution: {integrity: sha512-1E3alBICLBbsNJ4HvJkyIuCznuOgksS6cQ+H57K0d9NCC4xZcCqreHm+VTlZh3HZjDgw4CPDRvhgCDvDOP8KpA==} engines: {node: '>=18'} dependencies: - '@polkadot/api': 10.13.1 - '@polkadot/api-augment': 10.13.1 - '@polkadot/api-base': 10.13.1 - '@polkadot/rpc-core': 10.13.1 - '@polkadot/types': 10.13.1 - '@polkadot/types-codec': 10.13.1 + '@polkadot/api': 11.0.2 + '@polkadot/api-augment': 11.0.2 + '@polkadot/api-base': 11.0.2 + '@polkadot/rpc-core': 11.0.2 + '@polkadot/types': 11.0.2 + '@polkadot/types-codec': 11.0.2 '@polkadot/util': 12.6.2 '@polkadot/util-crypto': 12.6.2(@polkadot/util@12.6.2) rxjs: 7.8.1 @@ -1839,22 +1904,22 @@ packages: - utf-8-validate dev: false - /@polkadot/api@10.13.1: - resolution: {integrity: sha512-YrKWR4TQR5CDyGkF0mloEUo7OsUA+bdtENpJGOtNavzOQUDEbxFE0PVzokzZfVfHhHX2CojPVmtzmmLxztyJkg==} + /@polkadot/api@11.0.2: + resolution: {integrity: sha512-LG4gwlev+SC2WolWMX0CaUZJyZWxXbsCe5h58zFxXucQuiPAvkn0QrnSTC3hB3qywsxK6aeuQ9E2vrQYcN7EMg==} engines: {node: '>=18'} dependencies: - '@polkadot/api-augment': 10.13.1 - '@polkadot/api-base': 10.13.1 - '@polkadot/api-derive': 10.13.1 + '@polkadot/api-augment': 11.0.2 + '@polkadot/api-base': 11.0.2 + '@polkadot/api-derive': 11.0.2 '@polkadot/keyring': 12.6.2(@polkadot/util-crypto@12.6.2)(@polkadot/util@12.6.2) - '@polkadot/rpc-augment': 10.13.1 - '@polkadot/rpc-core': 10.13.1 - '@polkadot/rpc-provider': 10.13.1 - '@polkadot/types': 10.13.1 - '@polkadot/types-augment': 10.13.1 - '@polkadot/types-codec': 10.13.1 - '@polkadot/types-create': 10.13.1 - '@polkadot/types-known': 10.13.1 + '@polkadot/rpc-augment': 11.0.2 + '@polkadot/rpc-core': 11.0.2 + '@polkadot/rpc-provider': 11.0.2 + '@polkadot/types': 11.0.2 + '@polkadot/types-augment': 11.0.2 + '@polkadot/types-codec': 11.0.2 + '@polkadot/types-create': 11.0.2 + '@polkadot/types-known': 11.0.2 '@polkadot/util': 12.6.2 '@polkadot/util-crypto': 12.6.2(@polkadot/util@12.6.2) eventemitter3: 5.0.1 @@ -2140,13 +2205,13 @@ packages: - utf-8-validate dev: false - /@polkadot/rpc-augment@10.13.1: - resolution: {integrity: sha512-iLsWUW4Jcx3DOdVrSHtN0biwxlHuTs4QN2hjJV0gd0jo7W08SXhWabZIf9mDmvUJIbR7Vk+9amzvegjRyIf5+A==} + /@polkadot/rpc-augment@11.0.2: + resolution: {integrity: sha512-QcT9U2hINcjynJhHC4AhoHNgZR5JymDkuhAIOVYsNb1BUcDzoud5lvfK+ISfw2kVPAyCdx3kHodFPhdNdPGHUg==} engines: {node: '>=18'} dependencies: - '@polkadot/rpc-core': 10.13.1 - '@polkadot/types': 10.13.1 - '@polkadot/types-codec': 10.13.1 + '@polkadot/rpc-core': 11.0.2 + '@polkadot/types': 11.0.2 + '@polkadot/types-codec': 11.0.2 '@polkadot/util': 12.6.2 tslib: 2.6.2 transitivePeerDependencies: @@ -2200,13 +2265,13 @@ packages: - utf-8-validate dev: false - /@polkadot/rpc-core@10.13.1: - resolution: {integrity: sha512-eoejSHa+/tzHm0vwic62/aptTGbph8vaBpbvLIK7gd00+rT813ROz5ckB1CqQBFB23nHRLuzzX/toY8ID3xrKw==} + /@polkadot/rpc-core@11.0.2: + resolution: {integrity: sha512-kC+85+WIc/uKColIGzrnRjM47N+AjbujRkTf0n9ldwtAIYJnq+B09R3Qjmk+kXrdW5fes85L/WigqwkohMfNkw==} engines: {node: '>=18'} dependencies: - '@polkadot/rpc-augment': 10.13.1 - '@polkadot/rpc-provider': 10.13.1 - '@polkadot/types': 10.13.1 + '@polkadot/rpc-augment': 11.0.2 + '@polkadot/rpc-provider': 11.0.2 + '@polkadot/types': 11.0.2 '@polkadot/util': 12.6.2 rxjs: 7.8.1 tslib: 2.6.2 @@ -2271,13 +2336,13 @@ packages: - utf-8-validate dev: false - /@polkadot/rpc-provider@10.13.1: - resolution: {integrity: sha512-oJ7tatVXYJ0L7NpNiGd69D558HG5y5ZDmH2Bp9Dd4kFTQIiV8A39SlWwWUPCjSsen9lqSvvprNLnG/VHTpenbw==} + /@polkadot/rpc-provider@11.0.2: + resolution: {integrity: sha512-EHoWs27r+V8NKexawcTkDzSJtYAXmkz8/zge+Ctm0PzdxtP740U9xvbK7uZ0INXeLIPdKKk7n9lGib3fhnXRvQ==} engines: {node: '>=18'} dependencies: '@polkadot/keyring': 12.6.2(@polkadot/util-crypto@12.6.2)(@polkadot/util@12.6.2) - '@polkadot/types': 10.13.1 - '@polkadot/types-support': 10.13.1 + '@polkadot/types': 11.0.2 + '@polkadot/types-support': 11.0.2 '@polkadot/util': 12.6.2 '@polkadot/util-crypto': 12.6.2(@polkadot/util@12.6.2) '@polkadot/x-fetch': 12.6.2 @@ -2288,7 +2353,7 @@ packages: nock: 13.5.4 tslib: 2.6.2 optionalDependencies: - '@substrate/connect': 0.8.8 + '@substrate/connect': 0.8.10 transitivePeerDependencies: - bufferutil - supports-color @@ -2351,12 +2416,12 @@ packages: tslib: 2.6.2 dev: false - /@polkadot/types-augment@10.13.1: - resolution: {integrity: sha512-TcrLhf95FNFin61qmVgOgayzQB/RqVsSg9thAso1Fh6pX4HSbvI35aGPBAn3SkA6R+9/TmtECirpSNLtIGFn0g==} + /@polkadot/types-augment@11.0.2: + resolution: {integrity: sha512-36C1LNWrd/IJu4y4xJFsklw7qmyBMnH16WLkIoma7W7tCkPyuvKpl9btTcNpY9UE0FLb3AEhO0shrz3KUANk/g==} engines: {node: '>=18'} dependencies: - '@polkadot/types': 10.13.1 - '@polkadot/types-codec': 10.13.1 + '@polkadot/types': 11.0.2 + '@polkadot/types-codec': 11.0.2 '@polkadot/util': 12.6.2 tslib: 2.6.2 dev: false @@ -2390,8 +2455,8 @@ packages: tslib: 2.6.2 dev: false - /@polkadot/types-codec@10.13.1: - resolution: {integrity: sha512-AiQ2Vv2lbZVxEdRCN8XSERiWlOWa2cTDLnpAId78EnCtx4HLKYQSd+Jk9Y4BgO35R79mchK4iG+w6gZ+ukG2bg==} + /@polkadot/types-codec@11.0.2: + resolution: {integrity: sha512-OL7jM9JNzmRo+gLNIWllvyv3I4k+2dywKchC9gw/D5OCkFD+B5T3oHUw99zzER0C/r7/vTH9RM3w79yeW0UYKA==} engines: {node: '>=18'} dependencies: '@polkadot/util': 12.6.2 @@ -2425,11 +2490,11 @@ packages: tslib: 2.6.2 dev: false - /@polkadot/types-create@10.13.1: - resolution: {integrity: sha512-Usn1jqrz35SXgCDAqSXy7mnD6j4RvB4wyzTAZipFA6DGmhwyxxIgOzlWQWDb+1PtPKo9vtMzen5IJ+7w5chIeA==} + /@polkadot/types-create@11.0.2: + resolution: {integrity: sha512-yx5Gef3QkbJjzbEGoyOxv74XslGEK1Uo0IC8qSmwHsqO2+QoAEU7uJ9QpSNxHAcRrjx1W3+MdJAsfXtnwOiOeQ==} engines: {node: '>=18'} dependencies: - '@polkadot/types-codec': 10.13.1 + '@polkadot/types-codec': 11.0.2 '@polkadot/util': 12.6.2 tslib: 2.6.2 dev: false @@ -2464,14 +2529,14 @@ packages: tslib: 2.6.2 dev: false - /@polkadot/types-known@10.13.1: - resolution: {integrity: sha512-uHjDW05EavOT5JeU8RbiFWTgPilZ+odsCcuEYIJGmK+es3lk/Qsdns9Zb7U7NJl7eJ6OWmRtyrWsLs+bU+jjIQ==} + /@polkadot/types-known@11.0.2: + resolution: {integrity: sha512-c89H2y2mMCjuf5X9tTadwHpJtnQvfVxlJLTlrGElfImzWNgRetIjH65Zgy/uh/I9LqTxRlk5y3ZhBMZgL/ybbg==} engines: {node: '>=18'} dependencies: '@polkadot/networks': 12.6.2 - '@polkadot/types': 10.13.1 - '@polkadot/types-codec': 10.13.1 - '@polkadot/types-create': 10.13.1 + '@polkadot/types': 11.0.2 + '@polkadot/types-codec': 11.0.2 + '@polkadot/types-create': 11.0.2 '@polkadot/util': 12.6.2 tslib: 2.6.2 dev: false @@ -2528,8 +2593,8 @@ packages: tslib: 2.6.2 dev: false - /@polkadot/types-support@10.13.1: - resolution: {integrity: sha512-4gEPfz36XRQIY7inKq0HXNVVhR6HvXtm7yrEmuBuhM86LE0lQQBkISUSgR358bdn2OFSLMxMoRNoh3kcDvdGDQ==} + /@polkadot/types-support@11.0.2: + resolution: {integrity: sha512-p26QwtEniCyqUX9WoMtEp5LRdrmvvUf8s8Dx6P3W8/lU+hYeKQjeGCudWoudSXIYpsfTliLEowoxmjx4Wn4GIw==} engines: {node: '>=18'} dependencies: '@polkadot/util': 12.6.2 @@ -2566,14 +2631,14 @@ packages: tslib: 2.6.2 dev: false - /@polkadot/types@10.13.1: - resolution: {integrity: sha512-Hfvg1ZgJlYyzGSAVrDIpp3vullgxrjOlh/CSThd/PI4TTN1qHoPSFm2hs77k3mKkOzg+LrWsLE0P/LP2XddYcw==} + /@polkadot/types@11.0.2: + resolution: {integrity: sha512-jYORxnbR9cOoLW2KI7OAbHlC8bQr+Anj34CqgtlEikRSZBlmmx1CLD08hZSnSHkVAQgqHB6SLfFIW5VTI2YaqA==} engines: {node: '>=18'} dependencies: '@polkadot/keyring': 12.6.2(@polkadot/util-crypto@12.6.2)(@polkadot/util@12.6.2) - '@polkadot/types-augment': 10.13.1 - '@polkadot/types-codec': 10.13.1 - '@polkadot/types-create': 10.13.1 + '@polkadot/types-augment': 11.0.2 + '@polkadot/types-codec': 11.0.2 + '@polkadot/types-create': 11.0.2 '@polkadot/util': 12.6.2 '@polkadot/util-crypto': 12.6.2(@polkadot/util@12.6.2) rxjs: 7.8.1 @@ -3470,7 +3535,7 @@ packages: /@subsocial/definitions@0.8.14: resolution: {integrity: sha512-K/8ZYGMyy15QI16bxgi0GfxP3JsnKeNAyPlwom1kDE89RGGs5O++PuWbXxVMMSVYfh9zn9qJYKiThBYIj/Vohg==} dependencies: - '@polkadot/api': 10.13.1 + '@polkadot/api': 11.0.2 lodash.camelcase: 4.3.0 transitivePeerDependencies: - bufferutil @@ -3494,6 +3559,12 @@ packages: dev: false optional: true + /@substrate/connect-known-chains@1.1.4: + resolution: {integrity: sha512-iT+BdKqvKl/uBLd8BAJysFM1BaMZXRkaXBP2B7V7ob/EyNs5h0EMhTVbO6MJxV/IEOg5OKsyl6FUqQK7pKnqyw==} + requiresBuild: true + dev: false + optional: true + /@substrate/connect@0.7.0-alpha.0: resolution: {integrity: sha512-fvO7w++M8R95R/pGJFW9+cWOt8OYnnTfgswxtlPqSgzqX4tta8xcNQ51crC72FcL5agwSGkA1gc2/+eyTj7O8A==} dependencies: @@ -3517,6 +3588,20 @@ packages: dev: false optional: true + /@substrate/connect@0.8.10: + resolution: {integrity: sha512-DIyQ13DDlXqVFnLV+S6/JDgiGowVRRrh18kahieJxhgvzcWicw5eLc6jpfQ0moVVLBYkO7rctB5Wreldwpva8w==} + requiresBuild: true + dependencies: + '@substrate/connect-extension-protocol': 2.0.0 + '@substrate/connect-known-chains': 1.1.4 + '@substrate/light-client-extension-helpers': 0.0.6(smoldot@2.0.22) + smoldot: 2.0.22 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + dev: false + optional: true + /@substrate/connect@0.8.8: resolution: {integrity: sha512-zwaxuNEVI9bGt0rT8PEJiXOyebLIo6QN1SyiAHRPBOl6g3Sy0KKdSN8Jmyn++oXhVRD8aIe75/V8ZkS81T+BPQ==} requiresBuild: true @@ -3548,6 +3633,23 @@ packages: dev: false optional: true + /@substrate/light-client-extension-helpers@0.0.6(smoldot@2.0.22): + resolution: {integrity: sha512-girltEuxQ1BvkJWmc8JJlk4ZxnlGXc/wkLcNguhY+UoDEMBK0LsdtfzQKIfrIehi4QdeSBlFEFBoI4RqPmsZzA==} + requiresBuild: true + peerDependencies: + smoldot: 2.x + dependencies: + '@polkadot-api/json-rpc-provider': 0.0.1 + '@polkadot-api/json-rpc-provider-proxy': 0.0.1 + '@polkadot-api/observable-client': 0.1.0(rxjs@7.8.1) + '@polkadot-api/substrate-client': 0.0.1 + '@substrate/connect-extension-protocol': 2.0.0 + '@substrate/connect-known-chains': 1.1.4 + rxjs: 7.8.1 + smoldot: 2.0.22 + dev: false + optional: true + /@substrate/smoldot-light@0.6.8: resolution: {integrity: sha512-9lVwbG6wrtss0sd6013BJGe4WN4taujsGG49pwyt1Lj36USeL2Sb164TTUxmZF/g2NQEqDPwPROBdekQ2gFmgg==} dependencies: @@ -6110,18 +6212,6 @@ packages: /flatted@3.3.1: resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} - /follow-redirects@1.15.4(debug@4.3.4): - resolution: {integrity: sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==} - engines: {node: '>=4.0'} - peerDependencies: - debug: '*' - peerDependenciesMeta: - debug: - optional: true - dependencies: - debug: 4.3.4(supports-color@8.1.1) - dev: false - /follow-redirects@1.15.6(debug@4.3.4): resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==} engines: {node: '>=4.0'} @@ -9145,7 +9235,7 @@ packages: engines: {node: '>=10.0.0'} requiresBuild: true dependencies: - elliptic: 6.5.4 + elliptic: 6.5.5 node-addon-api: 2.0.2 node-gyp-build: 4.7.0 dev: false @@ -9405,14 +9495,14 @@ packages: dev: false optional: true - /solc@0.8.21(debug@4.3.4): - resolution: {integrity: sha512-N55ogy2dkTRwiONbj4e6wMZqUNaLZkiRcjGyeafjLYzo/tf/IvhHY5P5wpe+H3Fubh9idu071i8eOGO31s1ylg==} + /solc@0.8.24(debug@4.3.4): + resolution: {integrity: sha512-G5yUqjTUPc8Np74sCFwfsevhBPlUifUOfhYrgyu6CmYlC6feSw0YS6eZW47XDT23k3JYdKx5nJ+Q7whCEmNcoA==} engines: {node: '>=10.0.0'} hasBin: true dependencies: command-exists: 1.2.9 commander: 8.3.0 - follow-redirects: 1.15.4(debug@4.3.4) + follow-redirects: 1.15.6(debug@4.3.4) js-sha3: 0.8.0 memorystream: 0.3.1 semver: 5.7.2 diff --git a/test/scripts/compile-contracts.ts b/test/scripts/compile-contracts.ts index b7d83e73d9..8df4d1b304 100644 --- a/test/scripts/compile-contracts.ts +++ b/test/scripts/compile-contracts.ts @@ -85,7 +85,7 @@ async function main(args: any) { const contracts = (await getFiles(contractPath.filepath)).filter((filename) => filename.endsWith(".sol") ); - for (let filepath of contracts) { + for (const filepath of contracts) { const ref = filepath .replace(contractPath.filepath, contractPath.importPath) .replace(/^\//, ""); @@ -185,6 +185,7 @@ function compileSolidity( }, }, settings: { + evmVersion: "shanghai", optimizer: { enabled: true, runs: 200 }, outputSelection: { "*": { diff --git a/test/suites/dev/moonbase/test-contract/test-erc20-interactions.ts b/test/suites/dev/moonbase/test-contract/test-erc20-interactions.ts new file mode 100644 index 0000000000..4cbe5e3c09 --- /dev/null +++ b/test/suites/dev/moonbase/test-contract/test-erc20-interactions.ts @@ -0,0 +1,44 @@ +import { beforeAll, describeSuite, expect } from "@moonwall/cli"; + +describeSuite({ + id: "D010611", + title: "ERC20 interactionss", + foundationMethods: "dev", + testCases: ({ context, it, log }) => { + let contract: `0x${string}`; + + beforeAll(async function () { + const { contractAddress } = await context.deployContract!("ERC20Sample"); + contract = contractAddress; + }); + + it({ + id: "T01", + title: "Should get the greeter message from the contract", + test: async function () { + const timbo = await context.readContract!({ + contractName: "ERC20Sample", + contractAddress: contract, + functionName: "greeter", + }); + console.log(timbo); + }, + }); + + // TODO add test for minting + + // TODO add test for burning + + // TODO add test for approval + + // TODO add test for transfer + + // TODO add test for transferFrom + + // TODO mint via XCM + + // TODO burn via XCM + + // TODO transferFrom via XCM + }, +});