The use of
callcodeis discouraged and will be removed in the future.
But in what reason is using
CALLCODE EVM opcode also discouraged?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.Sign up to join this community
Delegatecall and Callcode are very low-level functions and should only be used as a last resort as they break the type-safety of Solidity.
All these functions are low-level functions and should be used with care. Specifically, any unknown contract might be malicious and if you call it, you hand over control to that contract which could in turn call back into your contract, so be prepared for changes to your state variables when the call returns.