Sign in
Download Opera News App

homepage

Who is the msg.sender when calling function of ERC20 token contract inside a smart contract?

Who is the msg.sender when calling function of ERC20 token contract inside a smart contract?

Here is a function in a smart contract to call transferFrom in ERC20 token contract. pragma ^0.7.0 contract MyContract { ... function depositEscrow(uint256 _value) payable external returns (bool) { ... ERC20Token _fex = ERC20Token(contractFEX); //<<==create instance of the ERC20 token contract with its address _fex.transferFrom(msg.sender, address(this), value); //Who is msg.sender in transferFrom? is it the MyContract address? ... return true; } } When...

Read Full Story
ERC20 MyContract