小编TNJ*_*ing的帖子

Remix 中的显式类型转换

这个功能:

  function initializeDomainSeparator() public {
    // hash the name context with the contract address
    EIP712_DOMAIN_HASH = keccak256(abi.encodePacked(// solium-disable-line
            EIP712_DOMAIN_SEPARATOR_SCHEMA_HASH,
            keccak256(bytes(name)),
            bytes32(address(this))
            ^^^^^^^^^^^^^^^^^^^
        ));
}
Run Code Online (Sandbox Code Playgroud)

正在消除此错误:

TypeError: Explicit type conversion not allowed from "address" to "bytes32".
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?杂注可靠性^0.8.4;

type-conversion contract typeerror solidity remix

1
推荐指数
1
解决办法
3523
查看次数

标签 统计

contract ×1

remix ×1

solidity ×1

type-conversion ×1

typeerror ×1