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.

Answer from brianbhsu on Stack Exchange
🌐
GeeksforGeeks
geeksforgeeks.org › solidity › address-in-solidity
Address in Solidity - GeeksforGeeks
April 28, 2025 - In Solidity, there are two address types: address and address payable. The address type is used for both user addresses and contract addresses, while the address payable type is specifically used for addresses that can receive Ether.
🌐
Medium
medium.com › @nareshmmr › understanding-the-address-data-type-in-solidity-fd4cad81abaf
Understanding the “address” Data Type in Solidity | by Naresh Mohanraj | Medium
June 6, 2024 - In the world of blockchain and ... is the programming language for writing smart contracts on Ethereum, an address is like a digital mailbox....
🌐
Medium
jeancvllr.medium.com › solidity-tutorial-all-about-addresses-ffcdf7efc4e7
Solidity Tutorial : all about Addresses | by Jean Cvllr | Medium
April 10, 2026 - Basic of Addresses in Solidity & address literals · Address vs address payable · Methods available with addresses (including call(), delegatecall() and staticcall() ) Types conversions between addresses and address payable · Methods returning an address type ·
🌐
WhiteboardCrypto
whiteboardcrypto.com › home › solidity address
Solidity Address - WhiteboardCrypto
December 22, 2022 - Here is a smart contract that uses an address: //SPDX-License-Identifier: MIT pragma solidity 0.8.13; contract addressExample{ address public yourAddress = 0xd9145CCE52D386f254917e481eB44e9943F39138; address public zeroAddress = address(0); function whatIsMyAddress() public view returns(address){ return msg.sender; } }
🌐
GitHub
github.com › CJ42 › All-About-Solidity › blob › master › articles › Addresses.md
All-About-Solidity/articles/Addresses.md at master · CJ42/All-About-Solidity
Ethereum uses the keccak-256 hash ... p24, point 284). In Ethereum and Solidity, an address is of 20 byte value size (160 bits or 40 hex characters)....
Author   CJ42
🌐
Ethereum-blockchain-developer
ethereum-blockchain-developer.com › 010-solidity-basics › 04-address-types
Address Types
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.1; contract AddressExample { address public myAddress; function setAddress(address _address) public { myAddress = _address; } function getBalanceOfAccount() public view returns(uint) { return myAddress.balance; } }
🌐
Medium
medium.com › coinmonks › learn-solidity-lesson-12-addresses-and-only-owner-5022234848fe
Learn Solidity lesson 12. Addresses and only owner. | by João Paulo Morais | Coinmonks | Medium
August 1, 2022 - We have also seen that addresses are derived from the public key. More precisely, the address of an account is the last 20 bytes of the public key hash. Therefore, the address type in Solidity is a 20-byte hexadecimal number.
Find elsewhere
🌐
Solidity
docs.soliditylang.org › en › latest › types.html
Types — Solidity 0.8.36-develop documentation
Previous versions of Solidity allowed these functions to receive arbitrary arguments and would also handle a first argument of type bytes4 differently. These edge cases were removed in version 0.5.0. It is possible to adjust the supplied gas with the gas modifier: ... Lastly, these modifiers can be combined. Their order does not matter: ... address(nameReg).call{gas: 1000000, value: 1 ether}(abi.encodeWithSignature("register(string)", "MyName"));
🌐
GitHub
github.com › OpenZeppelin › openzeppelin-contracts › blob › master › contracts › utils › Address.sol
openzeppelin-contracts/contracts/utils/Address.sol at master · OpenZeppelin/openzeppelin-contracts
// OpenZeppelin Contracts (last updated v5.5.0) (utils/Address.sol) · pragma solidity ^0.8.20; · import {Errors} from "./Errors.sol"; import {LowLevelCall} from "./LowLevelCall.sol"; · /** * @dev Collection of functions related to the address type · */ library Address { /** * @dev There's no code at `target` (it is not a contract).
Author   OpenZeppelin
Top answer
1 of 3
2

address[] is a type, an array of addresses. You can think of it as a list of addresses.

The square brackets, [], are use to specify that this type is an array.

You can create an array of many things, like an array of uint256 numbers:

uint256[] numbers;

And many more with a similar syntax.

Many languages use the [] to create or declare an array. Like Javascript: const numbers = [];. We can usually initiate an array with values, like in js: const numbers = [1,2,3,4,5];. In Solidity it would look like this for an array of uint256 numbers in storage: uint256[] numbers = [1,2,3,4];

In your case, an array of addresses can be declared as a state variable as follows:

address[] admins;

And then, in another function you can add addresses to that array:

function addAdmin(address adminAddress) public onlyOwner {
   admins.push(adminAddress);
}

Of if you know the address before hand you can hard code them while you declare the array of addresses, like this:

address[] admins = [0x66B0b1d2930059407DcC30F1A2305435fc37315E, 0x6827b8f6cc60497d9bf5210d602C0EcaFDF7C405];

Arrays are really useful to hold a collection of things, objects, numbers, addresses, strings, etc.

We access arrays by index, starting at index 0 for the first element in most programming languages. If I want to access the first element of the array, then I do:

admins[0];

For the second:

admins[1];

And so on. Or in a loop:

for(uint256 i = 0; i < admins.length; i++) {
  address adminAddress = admins[i];
  // ...
  // do something with adminAddress
}

And so on.

Solidity has many rules for arrays. State and local arrays are usually declared differently and used a bit differently in some cases. To learn more about them you can check the documentation: https://docs.soliditylang.org/en/latest/types.html#arrays

I hope it has helped.

2 of 3
2

In Solidity, address[] is an array consisting of addresses.

See: How can I instantiate an array of addresses?

🌐
C# Corner
c-sharpcorner.com › article › address-and-function-in-solidity
Function And Address In Solidity
February 3, 2019 - Solidity allows the overloading concept. A contract can have multiple functions with the same name, but the number of parameters should be different. ... However, we cannot overload a function by its return type, just like other programming languages. The following code won't compile. ... On the Ethereum blockchain, every account and smart contract has an address and it's stored as 20-byte values.
🌐
GeeksforGeeks
geeksforgeeks.org › ethical hacking › difference-between-this-and-addressthis-in-solidity
Difference Between this and address(this) in Solidity - GeeksforGeeks
July 23, 2025 - this is the term used for the smart contract when the solidity version is below 0.5.0 . address(this) is the term used in the latest versions of the solidity to refer to the smart contract.
🌐
Base
docs.base.org › learn › address-and-payable › address-and-payable
Learning Resources - Base Documentation
Find educational content for learning Solidity, Ethereum, and blockchain development
🌐
Cyfrin
cyfrin.io › glossary › precompute-contract-address-with-create2-solidity-code-example
Cyfrin Code Glossary: Precompute Contract Address w/ Create2: Solidity
A contract address can be precomputed before the contract is deployed using create2. // SPDX-License-Identifier: MIT pragma solidity ^0.8.26; contract Factory { // Returns the address of the newly deployed contract function deploy(address _owner, uint256 _foo, bytes32 _salt) public payable returns (address) { // This syntax is a newer way to invoke create2 without assembly, you just need to pass salt // https://docs.soliditylang.org/en/latest/control-structures.html#salted-contract-creations-create2 return address(new TestContract{salt: _salt}(_owner, _foo)); } } // This is the older way of doing it using assembly contract FactoryAssembly { event Deployed(address addr, uint256 salt); // 1.