我正在使用 Remix (remix.run) 设置一个新项目,并尝试配置 Cypress/ESLint 进行组件测试。我有TestComponent.cy.ts一些样板代码:
describe('TestComponent.cy.ts', () => {
  it('playground', () => {
    // cy.mount()
  })
})
Run Code Online (Sandbox Code Playgroud)
但是,该describe函数会抛出此错误:
    Parsing error: ESLint was configured to run on `<tsconfigRootDir>/component/TestComponent.cy.ts` using `parserOptions.project`: <tsconfigRootDir>/../../../../../../users/tduke/desktop/dev/blog/cypress/tsconfig.json
    However, that TSConfig does not include this file. Either:
    - Change ESLint's list of included files to not include this file
    - Change that TSConfig to include this file
    - Create a new TSConfig that includes this file and include it in your parserOptions.project
Run Code Online (Sandbox Code Playgroud)
我尝试重新配置我的 …
我创建了一个新的 Solidity 合约。合同已启动并正在运行,但给了我这个警告。
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
Run Code Online (Sandbox Code Playgroud)
编译时没有错误。
我在https://remix.ethereum.org/ 中使用的编译器版本是 v0.7.5+commit.eb77ed08 语言:Solidity EVM 版本:编译器默认值
每当我按下编译时,它都会给我警告,但部署时没有问题。
我的代码片段:
pragma solidity ^0.7.5;
contract TestContract {
// Some logic
}
Run Code Online (Sandbox Code Playgroud) 如何在没有源代码的情况下使用 Remix 与以太坊上已部署的合约(不是我的合约)进行交互,但我有 ABI。
我想要这样做的原因是因为某些合同有超过 20 个 .sol 文件,我不想手动复制并粘贴到 Remix 中。
那么,到底是什么问题呢?我有两个 React 和 ReactDOM 实例为所提供的applicationB. 我在诊断问题空间时被误导了,因此下面提出的问题/呼吁有点全面。应该拿走什么,希望它可以帮助处于这个位置的其他人:
该错误Uncaught TypeError: Cannot read properties of null (reading 'useEffect')与将两个 React 副本加载到applicationB. 但为什么有两份呢?
applicationB是 Remix 应用程序。packageA是一个在其构建链中使用 esbuild 的 React 组件。Remix通过调查,我发现对以下方面的支持存在差异esbuild:
esbuild 添加了对 React 17 JSX Transform 的支持。Remix可能不知道此更新,并通过使用React 导入的垫片esbuild来解决对 JSX 自动运行时缺乏支持的问题。这导致了问题的提出:
Remix识别出垫片的故障并在 v1.7.0 版本中包含了解决方案。在applicationB …
我想将 Remix - Ethereum IDE ( https://remix.ethereum.org ) 连接到本地主机。
我按照说明进行操作https://remix-ide.readthedocs.io/en/latest/remixd.html#update-to-the-latest-remixd:
npm install -g @remix-project/remixd使用 npm 安装了 remix 守护进程。mkdir ~/shared_project.chmod u+rw shared_project我为本地用户授予了该文件夹的读/写权限。sudo remixd -s ~/shared_project --remix-ide https://remix.ethereum.org。问题是,当我想将浏览器中的 Remix IDE 连接到本地主机时,我可以看到带有错误消息的弹出窗口Cannot connect to the remixd daemon. Please make sure you have the remixd running in the background.。
我尝试重新启动守护进程:
ps -ef | grep remixdsudo kill 1007sudo remixd -s ~/shared_project --remix-ide https://remix.ethereum.org。我尝试重新安装守护进程:
sudo …这里是坚固的新手。当我尝试读取 people 数组的值时。我收到错误:
对 SimpleStorage.people 的调用出错:对参数进行编码时出错:错误:无效的 BigNumber 字符串(参数 =“值”值 =“”代码=INVALID_ARGUMENT 版本=bignumber/5.4.2)
我的编译器版本是0.6.6。不确定出了什么问题?有什么建议么?
// SPD-License_Identifier: MIT
pragma solidity ^0.6.0;
contract SimpleStorage {
    uint256 favNum;
    
    struct People {
        uint256 favNum;
        string name;
    }
    
    People[] public people;
    
    function store(uint256 _favNum) public {
        favNum = _favNum;
    }
    
    function retrieve() public view returns(uint256) {
        return favNum;
    }
    
    function addPerson(string memory _name, uint256 _favNum) public {
        people.push(People(_favNum, _name));
    }
}
Run Code Online (Sandbox Code Playgroud) 我是 Solidity 新手,正在 Remix 上运行代码。无论我指定什么版本的编译器,我都会不断收到相同的错误。有人可以帮我吗?“编译器版本 ^0.8.0 不满足 r semver 要求”到底是什么意思?
这是我的代码:
// SPDX-License-Identifier: UNLICENSED
Run Code Online (Sandbox Code Playgroud)
编译指示可靠性 ^ 0.8.0;
合约存储{
struct People {
    uint256 favoriteNumber;
    string name;
}
mapping(string => uint256) public nameToFavoriteNumber;
People[] public people;
function addPerson(uint _personFavoriteNumber, string memory _personName ) public {
    people.push(People({favoriteNumber: _personFavoriteNumber, name: _personName}));
    nameToFavoriteNumber[_personName] = _personFavoriteNumber;
}
Run Code Online (Sandbox Code Playgroud)
 我正在尝试控制台和调试代码或可靠性
我正在用remix-ide编写单元测试,我想在一个测试中从不同地址调用函数。
该混音检验Github上页说,你可以用import "remix_accounts.sol";,但我得到URL not parseable: remix_accounts.sol。如何解决?或者,也许还有另一种从各个地址拨打电话的方式?
remix ×10
solidity ×6
blockchain ×3
ethereum ×2
reactjs ×2
abi ×1
bash ×1
debugging ×1
esbuild ×1
npm-link ×1
react-hooks ×1
tsconfig ×1
typescript ×1
unit-testing ×1