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

Accessing call value and sender in precompiles #1684

Open
JamesHinshelwood opened this issue Aug 5, 2024 · 3 comments
Open

Accessing call value and sender in precompiles #1684

JamesHinshelwood opened this issue Aug 5, 2024 · 3 comments
Labels
feature New feature or lib ability

Comments

@JamesHinshelwood
Copy link

Currently only the call data is passed to precompiles:

We're working on some custom precompiles that need to know the msg.value and msg.sender too. Would there be any sympathy for adding these parameters to the precompile traits (Perhaps by passing &CallInputs instead)?

@rakita
Copy link
Member

rakita commented Aug 8, 2024

That makes sense. Do you want to add it?

@rakita rakita added the feature New feature or lib ability label Aug 8, 2024
@jsvisa
Copy link
Contributor

jsvisa commented Sep 10, 2024

just curious, the msg.sender and msg.value are already in the Env.tx? Don't hesitate to correct me if I'm misunderstood.

fn call(
&self,
bytes: &Bytes,
gas_limit: u64,
evmctx: &mut InnerEvmContext<DB>,
) -> PrecompileResult;
}

pub struct TxEnv {
/// Caller aka Author aka transaction signer.
pub caller: Address,
/// The gas limit of the transaction.
pub gas_limit: u64,
/// The gas price of the transaction.
pub gas_price: U256,
/// The destination of the transaction.
pub transact_to: TxKind,
/// The value sent to `transact_to`.
pub value: U256,
/// The data of the transaction.
pub data: Bytes,

@rakita
Copy link
Member

rakita commented Sep 10, 2024

just curious, the msg.sender and msg.value are already in the Env.tx? Don't hesitate to correct me if I'm misunderstood.

What I understood is caller and value of a subcall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or lib ability
Projects
None yet
Development

No branches or pull requests

3 participants