0

I just have a question in my mind. can I use the contracts which are already deployed so that I can use them without even myself have to deploy it again.

For example, take SafeMath I think I would have been deployed already on the network.how can I use it.

AVATAR
  • 327
  • 3
  • 11

2 Answers2

1

Yes.

Any deployed contract is usable by invoking its public methods. Some contract method invocation maybe restricted using specific addresses (ex :onlyOwner modifiers).

To use a contract, you need to have their address :

address.call(bytes4(keccak256("MethodName(arguments)")),argumentsValue)

You should also check this answer for better understanding : Calling function from deployed contract

Kaki Master Of Time
  • 3,060
  • 4
  • 19
  • 44
1

Yes, if you know the address and the function is public, anyone can call it.