0

For Eg. I have developed and deployed a smart contract A , and as per nature smart contracts are interoperable , so is this possible that any smart contract let say B can access my smart contract storage / data and call functions ..

3 Answers3

1

If the storage variables are public you can, or if the other contract has set a getter for it, if not nobody will see them. You can see this question Solidity: accessing a library constant in a contract that imports the library where some examples of looking into another contract public variable are in the answers

Julissa DC
  • 1,888
  • 1
  • 8
  • 21
  • I just want to note that everyone can read data from your SC. They will not be able to use your function, but they can read data on specific storage slots. – Sky Oct 12 '23 at 08:05
  • Yeah! you can just access what's inside a specific storage slot even if it's marked as private – Julissa DC Oct 16 '23 at 13:31
0

its most important for smart contract so i describe in sortly

in creation of smart contract there are four different name for different view options like other programming language c,c++

  1. public
  2. internal
  3. external
  4. private

public ==> anyone can access.

internal ==> inside smart contract and only child contract can access

private ==> only access inside smart contract

external ==> only outside smart contract can access

so if your function and variable is public then anyone can access if its internal then your child contract is access you can do by inheritance concept

and if its private then no one can access outside the smart contract

0

In Short:

Yeah, everyone can read the data from your SmartContract storage. Some data might need more effort, but its possible. There is no such thing as "private-data" on a public blockchain.

The only "workaround" is if the data written into the contract's storage is encrypted. So they would be able to read it, but not understand it.

Sky
  • 2,282
  • 2
  • 7
  • 26