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

Erc20 XCM bridge #2090

Merged
merged 46 commits into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
9456e7c
prepare evm runner for erc20 bridge
librelois Feb 2, 2023
42721be
upgrade frontier
librelois Feb 2, 2023
a057483
catch ethereum execution informations
librelois Feb 2, 2023
3e507c5
add pallet erc20-xcm-bridge
librelois Feb 3, 2023
d8dbce5
add bridge supply counter
librelois Feb 3, 2023
d61d177
impl internal_transfer_asset for Erc20XcmBridge
librelois Feb 4, 2023
cc9f340
add xcm holding extension "erc20s origins"
librelois Feb 6, 2023
e33de4b
inject precompile handle in substrate calls triggered by precompiles
librelois Feb 7, 2023
a57759d
rename rust module evm_runner
librelois Feb 7, 2023
9fa0723
fix: xtokens should be able to perform evm subcall
librelois Feb 7, 2023
209191d
fix: adress without know prefix should resolve into erc20 currency
librelois Feb 7, 2023
1de3c02
add ts test "transfer ERC20 token throught xcm with xtokens precompile"
librelois Feb 7, 2023
a27e306
Reserve pallet id 109 for future integration in moonriver/moonbeam
librelois Feb 8, 2023
9bc2817
fmt
librelois Feb 8, 2023
840b5e6
environmental/std
librelois Feb 9, 2023
8b662e5
editorconfig
librelois Feb 9, 2023
8fd99dc
rm unreachable!
librelois Feb 9, 2023
e78d870
toml-sort
librelois Feb 10, 2023
e0b3f56
clean some unused code
librelois Feb 10, 2023
315e4a1
forbid-evm-reentrancy
librelois Feb 10, 2023
752ce00
impl an AssetTrap that filter out erc20 assets
librelois Feb 10, 2023
32e2f3c
Update runtime/moonbase/src/xcm_config.rs
Feb 13, 2023
9c82392
ref: replace xcm holding ext by asset multilocation ext
librelois Feb 11, 2023
250ef2a
Merge branch 'master'
librelois Feb 13, 2023
e04abda
Merge branch 'master' into elois-erc20-xcm-bridge
librelois Feb 13, 2023
da1e60c
update frontier
librelois Feb 13, 2023
c1cab89
fix compilation warning
librelois Feb 13, 2023
b42dc1d
erc20_transfer: opt call data allocation
librelois Feb 13, 2023
ee6b35b
Revert "replace xcm holding ext by asset multilocation ext"
librelois Feb 14, 2023
a4528fc
remove duplicated code
librelois Feb 14, 2023
a55e3c4
add rust unit tests for Erc20Matcher
librelois Feb 14, 2023
63f0134
configurable erc20 transfer gas limit
librelois Feb 14, 2023
6135380
get evm config from pallet evm config
librelois Feb 14, 2023
650cc51
remove reserved pallet id for moonriver/moonbeam
librelois Feb 14, 2023
13d4e65
Merge branch 'master' into elois-erc20-xcm-bridge
librelois Feb 14, 2023
6b7a9d1
perform erc20 transfer in a db transaction in all cases
librelois Feb 15, 2023
8a00fb8
charge weigh for xcm erc20 transfers according to configured gas limit
librelois Feb 15, 2023
299be9a
filter some xcm instructions for arbitrary local execution
librelois Feb 15, 2023
aa804c1
apply suggestion
librelois Feb 16, 2023
7cfe01f
80000 gas limit is enough for almost all erc20 implementations
librelois Feb 16, 2023
423fadf
more doc
librelois Feb 16, 2023
94e7fa3
optimize is_erc20_asset and use it on trap
librelois Feb 16, 2023
e3eaeaa
each withdrawal of erc20 tokens must be deposited at once
librelois Feb 16, 2023
de63c70
improve XcmExecuteFilter impl and move it in pallet erc20 xcm
librelois Feb 16, 2023
83645bd
Merge branch 'master' into elois-erc20-xcm-bridge
librelois Feb 16, 2023
27bc728
call inner filter
librelois Feb 16, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
71 changes: 51 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ members = [
"node",
"node/cli",
"node/service",
"pallets/erc20-xcm-bridge",
"pallets/maintenance-mode",
"pallets/migrations",
"pallets/moonbeam-orbiters",
Expand Down
32 changes: 32 additions & 0 deletions pallets/erc20-xcm-bridge/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "pallet-erc20-xcm-bridge"
authors = [ "PureStake" ]
edition = "2021"
version = "1.0.0"

[dependencies]
environmental = { version = "1.1.3", default-features = false }
ethereum-types = { version = "0.14", default-features = false }
serde = { version = "1.0.101", optional = true, features = [ "derive" ] }

# Substrate
frame-support = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false }
frame-system = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false }
parity-scale-codec = { version = "3.0.0", default-features = false, features = [ "derive" ] }
scale-info = { version = "2.0", default-features = false, features = [ "derive" ] }
sp-core = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false }
sp-runtime = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false }
sp-std = { git = "https://github.com/purestake/substrate", branch = "moonbeam-polkadot-v0.9.37", default-features = false }

# Frontier
fp-evm = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37", default-features = false }
pallet-evm = { git = "https://github.com/purestake/frontier", branch = "moonbeam-polkadot-v0.9.37", default-features = false, features = [ "forbid-evm-reentrancy" ] }

#Polkadot / XCM
xcm = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37", default-features = false }
xcm-executor = { git = "https://github.com/purestake/polkadot", branch = "moonbeam-polkadot-v0.9.37", default-features = false }

[features]
default = [ "std" ]
std = [ "environmental/std", "fp-evm/std", "frame-support/std", "frame-system/std", "pallet-evm/std", "parity-scale-codec/std", "scale-info/std", "serde", "sp-core/std", "sp-runtime/std", "sp-std/std", "xcm-executor/std", "xcm/std" ]
try-runtime = [ "frame-support/try-runtime" ]