argotorg / argotorg/solidity

`msg.to` builtin for global access to `address(this)`

Open
#16,368 15 comments 7 reactions 0 assignees View on GitHub
feature low effort medium impact must have eventually
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
2d 19h
Merged PRs (30d)
29

Description

Please add the `msg.to` property. This property is simply the address of the currently executing contract. It is the value of `address(this)`.

Using `msg.to` makes sense in free functions. `address(this)` is not currently available in free functions.

Some people may argue that `address(this)` can be passed as an argument to free functions. My counter argument is that we don't have to pass `msg.sender` or `msg.data` or `msg.value` as arguments, why do we have to pass `address(this)` as an argument?

It is fine if people want to pass `address(this)` as an argument. However, I think people should have the option to just be able to use `msg.to`. I would certainly use that.

`address(this`) can coexist with `msg.to`.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing how the existing msg.sender, msg.data, and msg.value builtins are defined and how free functions resolve execution context. Confirm the intended semantics of msg.to as address(this), including its availability in free functions; done means the language accepts and evaluates the new property with coverage for the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, solidity
Domain
blockchain, compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.