Skip to content

"ExecutionError":"WebAssembly trap: An unreachable opcode was executed." #4

@Scofield-04-21-076

Description

@Scofield-04-21-076
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.16;

contract Calc {

    address public owner;
    uint256 public num;


    function multiply(address addr) public returns (address) {

        return addr;
    }
}

The contract can be deployed, but when I call the multiply method:
near call name_contract.testnet multiply '{"addr": "account1.testnet"}' --accountId name_contract.testnet

I get an error:
Error: {"index":0,"kind":{"ExecutionError":"WebAssembly trap: An unreachable opcode was executed."}}

After the call:
near call name_contract.testnet multiply '{"addr": "account1.testnet"}' --accountId name_contract.testnet
I expect to be returned the account passed in the function parameter:
account1.testnet

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions