Skip to content

msg.sender provides wrong AccountId on substrate #679

@h4nsu

Description

@h4nsu

(seems to me like this could be related to #666)

I'm using solang 0.1.9 installed via cargo from crates.io and a custom substrate node (https://github.com/Cardinal-Cryptography/aleph-node/tree/smartnet) which is based on substrate 4.0.0-dev. It looks like msg.sender is providing an incorrect value. This is my minimal example:

contract mytoken {
    function test(address account, bool sender) public view returns (address) {
        if (sender) {
            return msg.sender;
        }
        return account;
    }
}

When I call that function from some address and provide the same address as the account parameter, I'm getting two different values when switching the bool parameter:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    polkadotConcerns the Polkadot target

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions