Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: convenient method to get address(this) #1465

Closed
Tracked by #843
LHerskind opened this issue Aug 8, 2023 · 5 comments
Closed
Tracked by #843

feat: convenient method to get address(this) #1465

LHerskind opened this issue Aug 8, 2023 · 5 comments
Assignees
Labels
A-internal-devex Area: Relates to the devex of internal teams building Aztec.

Comments

@LHerskind
Copy link
Contributor

LHerskind commented Aug 8, 2023

Add a convenient way to get the address of the current contract. The data should be available in the CallContext which is part of PrivateContextInputs which is in the Context.

Consider whether it is useful to have separate portal utility for this (get portal address) or if if it sufficient with current address together with #1464.

@github-project-automation github-project-automation bot moved this to Todo in A3 Aug 8, 2023
@LHerskind LHerskind added the A-internal-devex Area: Relates to the devex of internal teams building Aztec. label Aug 8, 2023
@iAmMichaelConnor
Copy link
Contributor

iAmMichaelConnor commented Aug 9, 2023

I'd recommend exposing this as a method of the Context struct. If the only low-level aztecy struct a dev ever needs to touch is the Context, that would be preferable.

E.g. inside impl Context { }

fn this_address(self) -> Field {
    self.inputs.call_context.storage_contract_address
}

@iAmMichaelConnor
Copy link
Contributor

Similar methods (on the Context) for msg_sender(), this_portal_address() would also be lovely 'quick wins'.

@Maddiaa0
Copy link
Member

Maddiaa0 commented Aug 9, 2023

Similar methods (on the Context) for msg_sender(), this_portal_address() would also be lovely 'quick wins'.

https://github.com/AztecProtocol/aztec-packages/blob/6688ca728c2103e4987168d505d18cb2eed7d95c/yarn-project/noir-libs/noir-aztec/src/context.nr#L103C1-L109C6

It appears that they already exist

@Maddiaa0
Copy link
Member

Maddiaa0 commented Aug 9, 2023

closing in this case

@Maddiaa0 Maddiaa0 closed this as completed Aug 9, 2023
@github-project-automation github-project-automation bot moved this from Todo to Done in A3 Aug 9, 2023
@iAmMichaelConnor
Copy link
Contributor

It appears that they already exist

Git blame says I added these yesterday. I do not remember doing this. Well... I remember thinking it... but then seeing this issue made me assume I hadn't actually done it.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-internal-devex Area: Relates to the devex of internal teams building Aztec.
Projects
Archived in project
Development

No branches or pull requests

3 participants