payload: {"action":"created","issue":{"url":"https://api.github.com/repos/paritytech/substrate/issues/2214","repository_url":"https://api.github.com/repos/paritytech/substrate","labels_url":"https://api.github.com/repos/paritytech/substrate/issues/2214/labels{/name}","comments_url":"https://api.github.com/repos/paritytech/substrate/issues/2214/comments","events_url":"https://api.github.com/repos/paritytech/substrate/issues/2214/events","html_url":"https://github.com/paritytech/substrate/issues/2214","id":429519628,"node_id":"MDU6SXNzdWU0Mjk1MTk2Mjg=","number":2214,"title":"Contract read storage from other modules","user":{"login":"xlc","id":1201310,"node_id":"MDQ6VXNlcjEyMDEzMTA=","avatar_url":"https://avatars0.githubusercontent.com/u/1201310?v=4","gravatar_id":"","url":"https://api.github.com/users/xlc","html_url":"https://github.com/xlc","followers_url":"https://api.github.com/users/xlc/followers","following_url":"https://api.github.com/users/xlc/following{/other_user}","gists_url":"https://api.github.com/users/xlc/gists{/gist_id}","starred_url":"https://api.github.com/users/xlc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xlc/subscriptions","organizations_url":"https://api.github.com/users/xlc/orgs","repos_url":"https://api.github.com/users/xlc/repos","events_url":"https://api.github.com/users/xlc/events{/privacy}","received_events_url":"https://api.github.com/users/xlc/received_events","type":"User","site_admin":false},"labels":[{"id":746560698,"node_id":"MDU6TGFiZWw3NDY1NjA2OTg=","url":"https://api.github.com/repos/paritytech/substrate/labels/Z1-question","name":"Z1-question","color":"fff5fb","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2019-04-04T23:06:32Z","updated_at":"2019-06-04T16:11:37Z","closed_at":"2019-06-04T16:11:37Z","author_association":"CONTRIBUTOR","body":"Is it possible to read arbitrary chain storage from smart contract (not contract specific child storage).\r\nThis make it possible for smart contract to have read access to other runtime modules without couple the runtime module with contract.\r\n\r\nWithout this ability, to expose new information to contract runtime needs: \r\n\r\n1. Add new ext method run contract wasm runtime\r\nhttps://github.com/paritytech/substrate/blob/dd82e0e6bdbf34cec6aa502497a326c4db3182f0/srml/contract/src/wasm/runtime.rs#L519\r\n\r\n2. Add it to the `Ext` trait\r\nhttps://github.com/paritytech/substrate/blob/dd82e0e6bdbf34cec6aa502497a326c4db3182f0/srml/contract/src/exec.rs#L103\r\n\r\n3. Implement it\r\nhttps://github.com/paritytech/substrate/blob/dd82e0e6bdbf34cec6aa502497a326c4db3182f0/srml/contract/src/exec.rs#L621\r\n\r\n4. Make contract depends on the module stores the information\r\nhttps://github.com/paritytech/substrate/blob/dd82e0e6bdbf34cec6aa502497a326c4db3182f0/srml/contract/src/lib.rs#L169\r\n\r\nI think it is reasonable people may need to access staking, authorities, session storage data from smart contract and it is not good idea to make contract couple with all those modules.\r\nContract also needs a way to access information from custom modules. Fork contract module is not a good idea and hard to get it right just for read access.\r\n\r\nIf possible, write access will be useful but with `ext_dispatch_call` it is kind of possible so that's ok for now. \r\n"},"comment":{"url":"https://api.github.com/repos/paritytech/substrate/issues/comments/498739222","html_url":"https://github.com/paritytech/substrate/issues/2214#issuecomment-498739222","issue_url":"https://api.github.com/repos/paritytech/substrate/issues/2214","id":498739222,"node_id":"MDEyOklzc3VlQ29tbWVudDQ5ODczOTIyMg==","user":{"login":"folsen","id":8249,"node_id":"MDQ6VXNlcjgyNDk=","avatar_url":"https://avatars2.githubusercontent.com/u/8249?v=4","gravatar_id":"","url":"https://api.github.com/users/folsen","html_url":"https://github.com/folsen","followers_url":"https://api.github.com/users/folsen/followers","following_url":"https://api.github.com/users/folsen/following{/other_user}","gists_url":"https://api.github.com/users/folsen/gists{/gist_id}","starred_url":"https://api.github.com/users/folsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/folsen/subscriptions","organizations_url":"https://api.github.com/users/folsen/orgs","repos_url":"https://api.github.com/users/folsen/repos","events_url":"https://api.github.com/users/folsen/events{/privacy}","received_events_url":"https://api.github.com/users/folsen/received_events","type":"User","site_admin":false},"created_at":"2019-06-04T16:11:37Z","updated_at":"2019-06-04T16:11:37Z","author_association":"MEMBER","body":"Closing as answered, feel free to re-open if you still have outstanding questions."}}
other: {"actor":{"display_login":"folsen"}}