jeremiah.kersey353
22 days ago  Karma: 134
What is the value of "address(this)" in Solidity?

What is the value of "address(this)" in Solidity?

en
#solidity
jeremiah.kersey353
22 days ago  Karma: 134
What is the value of "address(this)" in Solidity?

What is the value of "address(this)" in Solidity?

en
#solidity

6 ANSWERS
meetmeatblacksun
7 days ago Karma: 568

From the current top answer on StackExchange (link) :

this refers to the instance of the contract where the call is made (you can have multiple instances of the same contract).

address(this) refers to the address of the instance of the contract where the call is being made.

msg.sender refers to the address where the contract is being called from.

Therefore, address(this) and msg.sender are two unique addresses, the first referring to the address of the contract instance and the second referring to the address where the contract call originated from.

From the current top answer on StackExchange (link) :

this refers to the instance of the contract where the call is made (you can have multiple instances of the same contract).

address(this) refers to the address of the instance of the contract where the call is being made.

msg.sender refers to the address where the contract is being called from.

Therefore, address(this) and msg.sender are two unique addresses, the first referring to the address of the contract instance and the second referring to the address where the contract call originated from.

pqrbmoor
22 days ago Karma: 183

When the contract is deployed, it gets its own address. This is address can be accessed within the smart contract by calling address(this).

When the contract is deployed, it gets its own address. This is address can be accessed within the smart contract by calling address(this).

shaun_mcintyre

using address(this) in solidity returns the address at which the contract you're interacting with was deployed... more to the point... address(argument) is an explicit type conversion. "this" is a keyword that references the contract. address(this) creates an address variable that contains the current contract's address.

Oct 31 '18 at 7:44 am
Earn tokens by posting and answering questions about blockchain!
Karma to eth
YOUR ANSWER