Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty result #5

Closed
Scofield-04-21-076 opened this issue Sep 27, 2022 · 1 comment
Closed

Empty result #5

Scofield-04-21-076 opened this issue Sep 27, 2022 · 1 comment

Comments

@Scofield-04-21-076
Copy link

// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.16;


contract Calc {

    function multiply(int ui) public returns (int) {

        return ui;
    }
}

After deploying this contract, I call the multiply method:
near call name_contract.testnet multiply '{"ui": 16}' --accountId name_contract.testnet

I get result: '\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10'

Ideally, the expected result should be: 16

But if you change the code as follows:

// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.16;


contract Calc {

    address public owner;
    uint256 public num;


    function multiply(int ui) public returns (int) {

        return ui;
    }
}

I get result:
Empty result ''

Expected result: 16

@birchmd
Copy link
Member

birchmd commented Sep 27, 2022

@Scofield-04-21-076 Please pull the latest code and retry. The output is encoded nicely now, for example:

{ output: 16, status: 'SUCCESS' }

I also cannot reproduce your empty result issue.

Please include the commit you built the compiler from in future bug reports.

@birchmd birchmd closed this as completed Sep 27, 2022
birchmd pushed a commit to birchmd/evm2near that referenced this issue Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants