datahaven/operator/precompiles/datahaven-native-transfer/Cargo.toml
Gonza Montiel 82c581d495
feat: Add datahaven native transfer precompile (#309)
## DataHaven Native Transfer Precompile

Implements EVM precompile at address
`0x00000000000000000000000000000007F5` (2073) to expose
`pallet-datahaven-native-transfer` functionality to the EVM layer.

### Features
- **Transfer to Ethereum**: Locks native tokens and sends them via
Snowbridge to Ethereum addresses
- **Pause/Unpause**: Admin controls to halt/resume transfers
- **View Functions**: Query paused state, total locked balance, and
sovereign account address

### Implementation
- Precompile using `#[precompile_utils::precompile]` macro with proper
gas accounting
- 15+ test cases covering success/failure scenarios
- Solidity interface with NatSpec documentation for contract integration

Enables seamless cross-chain transfers of DataHaven native tokens to
Ethereum L1.

---------

Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
Co-authored-by: Ahmad Kaouk <56095276+ahmadkaouk@users.noreply.github.com>
2025-12-02 13:57:40 +01:00

53 lines
1.6 KiB
TOML

[package]
name = "pallet-evm-precompile-datahaven-native-transfer"
authors = { workspace = true }
description = "Precompile to expose DataHaven Native Transfer pallet to EVM"
edition = "2021"
version = { workspace = true }
[dependencies]
# Substrate
frame-support = { workspace = true }
frame-system = { workspace = true }
parity-scale-codec = { workspace = true, features = ["max-encoded-len"] }
sp-core = { workspace = true }
sp-io = { workspace = true }
sp-runtime = { workspace = true }
sp-std = { workspace = true }
# Frontier
evm = { workspace = true, features = ["with-codec"] }
fp-evm = { workspace = true }
pallet-evm = { workspace = true, features = ["forbid-evm-reentrancy"] }
precompile-utils = { workspace = true }
# Local
pallet-datahaven-native-transfer = { workspace = true }
[dev-dependencies]
hex-literal = { workspace = true }
pallet-balances = { workspace = true, features = ["insecure_zero_ed", "std"] }
pallet-timestamp = { workspace = true, features = ["std"] }
parity-scale-codec = { workspace = true, features = ["max-encoded-len", "std"] }
precompile-utils = { workspace = true, features = ["std", "testing"] }
scale-info = { workspace = true, features = ["derive", "std"] }
sp-runtime = { workspace = true, features = ["std"] }
snowbridge-core = { workspace = true, features = ["std"] }
snowbridge-outbound-queue-primitives = { workspace = true, features = ["std"] }
[features]
default = ["std"]
std = [
"fp-evm/std",
"frame-support/std",
"frame-system/std",
"pallet-datahaven-native-transfer/std",
"pallet-evm/std",
"parity-scale-codec/std",
"precompile-utils/std",
"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
]