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
Pallet-Connectors-Gateway: Add Precompile for Axelar #1423
Pallet-Connectors-Gateway: Add Precompile for Axelar #1423
Conversation
@cdamian while doing that I noticed we need to nake the input of |
FYI @mikiquantum |
handle: &mut impl PrecompileHandle, | ||
command_id: U256, | ||
source_chain: U256, | ||
source_address: U256, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a H160
right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its a Solidity string
which is represented as an bytes32
also. IIRC. See IAxelarForecallable.sol
in the repo
fn forecall( | ||
handle: &mut impl PrecompileHandle, | ||
source_chain: U256, | ||
sourceAddress: U256, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here - H160
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its a Solidity string
which is represented as an bytes32
also. IIRC. See IAxelarForecallable.sol
in the repo
fn forecall_with_token( | ||
handle: &mut impl PrecompileHandle, | ||
source_chain: U256, | ||
source_address: U256, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here - H160
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its a Solidity string
which is represented as an bytes32
also. IIRC. See IAxelarForecallable.sol
in the repo
handle: &mut impl PrecompileHandle, | ||
command_id: U256, | ||
source_chain: U256, | ||
source_address: U256, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here - H160
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its a Solidity string
which is represented as an bytes32
also. IIRC. See IAxelarForecallable.sol
in the repo
core::marker::PhantomData<(Runtime, Gateway, MaxPayload)>, | ||
); | ||
|
||
#[precompile_utils::precompile] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need any other "EVM glue" for this to work or are these macro invocations enough to "register" this contract in the EVM?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are enough to impl Precompile
and some glue around generating selectors and so for the pallet. But we should expand it at least once ^^
|
||
use fp_evm::PrecompileHandle; | ||
use frame_support::dispatch::{Dispatchable, GetDispatchInfo, PostDispatchInfo}; | ||
use pallet_connectors_gatway::GatwayOrigin; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha. Always do that wrong. ^^
Description
Adding a precompile.
@cdamian this is my first approach for the precompile. LMKWYT.
cc @branan