Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in Blockchain by (12.8k points)

Consider a Contract:

Contract Example{

    uint array[];

    address owner;

    function Example(){

        owner = msg.sender

    }

    function setArray(uint index, uint value) public {

        if (msg.sender == owner){

            array[index] = value;

        }

    }

}

Is there any possibility that hackers update array[] directly by generate a specific block. (steer clear of the condition that "only owner can update array")

1 Answer

0 votes
by (29.8k points)

No, nothing but the smart contract itself is allowed to modify its storage. This is assuming that the basic security of the blockchain is still intact

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...