Skip to content

Document limitations of information provided to secret contracts #201

Closed

Description

@reuvenpo

Ever invocation of init or handle in a secret contract receives an instance of the Env type, which is defined here: (in cosmwasm 0.8)

In JSON it'll look like this

{
  "env": {
    "block": {
      "height": 123,
      "time": 123,
      "chain_id": 123
    },
    "message": {
      "sender": "asdf",
      "sent_funds": [{"amount": 123, "denom": "SCRT"}, {...}, {...}]
    },
    "contract": {
      "address": "asdf"
    }
  }
}

At the moment we only know how to verify that env.message.sender. All the other fields in this structure can not be relied upon because they can be forged by a malicious host (of the enclave).
We should document that so that contract authors know not to depend on them, until we add support for that in the future.

Activity

  1. added
    dev
    on May 24, 2020
  2. added and removed
    dev
    on Jun 7, 2020
  3. assafmo commented on Jun 7, 2020

    @assafmo
    Contributor
  4. reuvenpo commented on Aug 26, 2020

    @reuvenpo
    ContributorAuthor

    This has been done by @assafmo as part of his documentation work. Thanks Assaf :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions